Initialisation
Added the packages and files for the backend server
This commit is contained in:
17
node_modules/@graphql-tools/utils/esm/valueMatchesCriteria.js
generated
vendored
Normal file
17
node_modules/@graphql-tools/utils/esm/valueMatchesCriteria.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export function valueMatchesCriteria(value, criteria) {
|
||||
if (value == null) {
|
||||
return value === criteria;
|
||||
}
|
||||
else if (Array.isArray(value)) {
|
||||
return Array.isArray(criteria) && value.every((val, index) => valueMatchesCriteria(val, criteria[index]));
|
||||
}
|
||||
else if (typeof value === 'object') {
|
||||
return (typeof criteria === 'object' &&
|
||||
criteria &&
|
||||
Object.keys(criteria).every(propertyName => valueMatchesCriteria(value[propertyName], criteria[propertyName])));
|
||||
}
|
||||
else if (criteria instanceof RegExp) {
|
||||
return criteria.test(value);
|
||||
}
|
||||
return value === criteria;
|
||||
}
|
||||
Reference in New Issue
Block a user