initial commit
This commit is contained in:
22
node_modules/unstorage/dist/shared/unstorage.10149939.mjs
generated
vendored
Normal file
22
node_modules/unstorage/dist/shared/unstorage.10149939.mjs
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
function wrapToPromise(value) {
|
||||
if (!value || typeof value.then !== "function") {
|
||||
return Promise.resolve(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function asyncCall(function_, ...arguments_) {
|
||||
try {
|
||||
return wrapToPromise(function_(...arguments_));
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
function isPrimitive(argument) {
|
||||
const type = typeof argument;
|
||||
return argument === null || type !== "object" && type !== "function";
|
||||
}
|
||||
function stringify(argument) {
|
||||
return isPrimitive(argument) ? argument + "" : JSON.stringify(argument);
|
||||
}
|
||||
|
||||
export { asyncCall as a, stringify as s };
|
||||
25
node_modules/unstorage/dist/shared/unstorage.e5f2cd8b.cjs
generated
vendored
Normal file
25
node_modules/unstorage/dist/shared/unstorage.e5f2cd8b.cjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
function wrapToPromise(value) {
|
||||
if (!value || typeof value.then !== "function") {
|
||||
return Promise.resolve(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function asyncCall(function_, ...arguments_) {
|
||||
try {
|
||||
return wrapToPromise(function_(...arguments_));
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
function isPrimitive(argument) {
|
||||
const type = typeof argument;
|
||||
return argument === null || type !== "object" && type !== "function";
|
||||
}
|
||||
function stringify(argument) {
|
||||
return isPrimitive(argument) ? argument + "" : JSON.stringify(argument);
|
||||
}
|
||||
|
||||
exports.asyncCall = asyncCall;
|
||||
exports.stringify = stringify;
|
||||
Reference in New Issue
Block a user