summaryrefslogtreecommitdiff
path: root/frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-11-16 19:08:29 +0800
committeraltaf-creator <dev@altafcreator.com>2025-11-16 19:08:29 +0800
commit434aa8343fdcbb4d5002f934979913c099489bee (patch)
tree55bab4ec5a6151be57797d34f61faf5ea744471b /frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js
parent893c388d4e99442a36005e5971a87730623f946e (diff)
sdk, del
Diffstat (limited to 'frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js')
-rw-r--r--frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js17
1 files changed, 0 insertions, 17 deletions
diff --git a/frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js b/frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js
deleted file mode 100644
index 8c6a40c..0000000
--- a/frontend-old/node_modules/yargs/build/lib/utils/maybe-async-result.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { isPromise } from './is-promise.js';
-export function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
- throw err;
-}) {
- try {
- const result = isFunction(getResult) ? getResult() : getResult;
- return isPromise(result)
- ? result.then((result) => resultHandler(result))
- : resultHandler(result);
- }
- catch (err) {
- return errorHandler(err);
- }
-}
-function isFunction(arg) {
- return typeof arg === 'function';
-}