修改后台权限
This commit is contained in:
24
node_modules/until-async/lib/index.js
generated
vendored
Normal file
24
node_modules/until-async/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
//#region src/index.ts
|
||||
/**
|
||||
* Gracefully handles a callback that returns a promise.
|
||||
*
|
||||
* @example
|
||||
* await until(() => Promise.resolve(123))
|
||||
* // [null, 123]
|
||||
*
|
||||
* await until(() => Promise.reject(new Error('Oops!')))
|
||||
* // [new Error('Oops!'), null]
|
||||
*/
|
||||
async function until(callback) {
|
||||
try {
|
||||
return [null, await callback().catch((error) => {
|
||||
throw error;
|
||||
})];
|
||||
} catch (error) {
|
||||
return [error, null];
|
||||
}
|
||||
}
|
||||
|
||||
//#endregion
|
||||
export { until };
|
||||
//# sourceMappingURL=index.js.map
|
||||
Reference in New Issue
Block a user