Initialisation
Added the packages and files for the backend server
This commit is contained in:
21
node_modules/@graphql-tools/utils/esm/jsutils.js
generated
vendored
Normal file
21
node_modules/@graphql-tools/utils/esm/jsutils.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
export function isIterableObject(value) {
|
||||
return value != null && typeof value === 'object' && Symbol.iterator in value;
|
||||
}
|
||||
export function isObjectLike(value) {
|
||||
return typeof value === 'object' && value !== null;
|
||||
}
|
||||
export function isPromise(value) {
|
||||
return isObjectLike(value) && typeof value['then'] === 'function';
|
||||
}
|
||||
export function promiseReduce(values, callbackFn, initialValue) {
|
||||
let accumulator = initialValue;
|
||||
for (const value of values) {
|
||||
accumulator = isPromise(accumulator)
|
||||
? accumulator.then(resolved => callbackFn(resolved, value))
|
||||
: callbackFn(accumulator, value);
|
||||
}
|
||||
return accumulator;
|
||||
}
|
||||
export function hasOwnProperty(obj, prop) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||||
}
|
||||
Reference in New Issue
Block a user