Buckets:

immErfanrajabee/bd / node_modules /yargs /build /lib /utils /maybe-async-result.js
imerfanrajabee's picture
download
raw
496 Bytes
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';
}

Xet Storage Details

Size:
496 Bytes
·
Xet hash:
09c6b308b88e5092f88cdf3fd78038605808ae9eeff8fae561987fb5da0c4ce9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.