File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed
Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1212# published
1313index.js
1414lambda-wrapper.js
15- handler.cjs
16- handler.mjs
1715loader.js
1816# misc
1917.DS_Store
Original file line number Diff line number Diff line change 1+ const { loadSync } = require ( './load-sync' ) ;
2+ const { wrap } = require ( './index' ) ;
3+
4+ const actualHandler = process . env . BASELIME_ACTUAL_HANDLER ;
5+ const taskRoot = process . env . LAMBDA_TASK_ROOT ;
6+
7+ if ( ! taskRoot ) {
8+ throw Error ( 'LAMBDA_TASK_ROOT is not defined' ) ;
9+ }
10+
11+ if ( ! actualHandler ) {
12+ throw Error ( 'BASELIME_ACTUAL_HANDLER is not defined' ) ;
13+ }
14+
15+ const handler = loadSync ( taskRoot , actualHandler ) ;
16+
17+ exports . handler = wrap ( handler ) ;
Original file line number Diff line number Diff line change 1+ import { wrap } from './index' ;
2+ import { load } from './load-async'
3+
4+
5+ const actualHandler = process . env . BASELIME_ACTUAL_HANDLER ;
6+ const taskRoot = process . env . LAMBDA_TASK_ROOT ;
7+
8+ if ( typeof taskRoot !== 'string' ) {
9+ throw Error ( 'LAMBDA_TASK_ROOT is not defined' ) ;
10+ }
11+
12+ if ( typeof actualHandler !== 'string' ) {
13+ throw Error ( 'BASELIME_ACTUAL_HANDLER is not defined' ) ;
14+ }
15+
16+ export const handler = wrap ( await load ( taskRoot , actualHandler ) ) ;
You can’t perform that action at this time.
0 commit comments