-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement
dozer run lambda
(#2202)
* feat: Implement `dozer run lambda` * feat: Use module's default export as lambda function * refactor: Stop using `deno_runtime::MainWorker`
- Loading branch information
Showing
33 changed files
with
1,578 additions
and
69 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | ||
|
||
const primordials = globalThis.__bootstrap.primordials; | ||
const { | ||
Promise, | ||
SafeArrayIterator, | ||
} = primordials; | ||
|
||
// WARNING: Keep this in sync with Rust (search for LogLevel) | ||
const LogLevel = { | ||
Error: 1, | ||
Warn: 2, | ||
Info: 3, | ||
Debug: 4, | ||
}; | ||
|
||
let logLevel = 3; | ||
let logSource = "JS"; | ||
|
||
function setLogLevel(level, source) { | ||
logLevel = level; | ||
if (source) { | ||
logSource = source; | ||
} | ||
} | ||
|
||
function log(...args) { | ||
if (logLevel >= LogLevel.Debug) { | ||
// if we destructure `console` off `globalThis` too early, we don't bind to | ||
// the right console, therefore we don't log anything out. | ||
globalThis.console.error( | ||
`DEBUG ${logSource} -`, | ||
...new SafeArrayIterator(args), | ||
); | ||
} | ||
} | ||
|
||
function createResolvable() { | ||
let resolve; | ||
let reject; | ||
const promise = new Promise((res, rej) => { | ||
resolve = res; | ||
reject = rej; | ||
}); | ||
promise.resolve = resolve; | ||
promise.reject = reject; | ||
return promise; | ||
} | ||
|
||
function writable(value) { | ||
return { | ||
value, | ||
writable: true, | ||
enumerable: true, | ||
configurable: true, | ||
}; | ||
} | ||
|
||
function nonEnumerable(value) { | ||
return { | ||
value, | ||
writable: true, | ||
enumerable: false, | ||
configurable: true, | ||
}; | ||
} | ||
|
||
function readOnly(value) { | ||
return { | ||
value, | ||
enumerable: true, | ||
writable: false, | ||
configurable: true, | ||
}; | ||
} | ||
|
||
function getterOnly(getter) { | ||
return { | ||
get: getter, | ||
set() { }, | ||
enumerable: true, | ||
configurable: true, | ||
}; | ||
} | ||
|
||
export { | ||
createResolvable, | ||
getterOnly, | ||
log, | ||
nonEnumerable, | ||
readOnly, | ||
setLogLevel, | ||
writable, | ||
}; |
Oops, something went wrong.