@theconcurrent/utility
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -1,2 +0,2 @@ | ||
(function(i,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("graphql")):typeof define=="function"&&define.amd?define(["exports","graphql"],u):(i=typeof globalThis!="undefined"?globalThis:i||self,u(i["@theconcurrent/utility"]={},i.graphql))})(this,function(i,u){"use strict";function l(e,n,r){return e.find(t=>t[n]===r)}function p(e,n){return e.filter(r=>n in r)}function T(e,n,r){return e.sort((t,o)=>{const f=n.indexOf(String(t[r])),y=n.indexOf(String(o[r]));return f===-1?1:y===-1?-1:f-y})}function s(e,n){return l(e,"typeName",n)}function d(e,n,r){var c;const t=s(e,n);if(!t||t.kind!=="Object"||!t.fields)return;if(r.length===0)return t;const[o,...f]=r,y=(c=t.fields.find(E=>E.name===o))==null?void 0:c.typeName;if(y)return d(e,y,f)}function a(e,n,r,t=[],o){if(o<0)return;const f=s(e,n);if(!(!f||t.includes(n))&&(t.push(n),!(f.kind!=="Object"||!f.fields)))for(const y of f.fields){if(y.typeName===r)return y.name;const c=a(e,y.typeName,r,t,o-1);if(c)return`${y.name}.${c}`}}function m(e,n,r,t){const o=a(e,n,r,[],0);if(o)return`${t}${o}`}function h(e,n){const r=n.split(".");if(r[0]!==e.name)return null;let t=e;for(const o of r.slice(1)){if(!t||!t.fields)return null;const f=t.fields.find(y=>y.name===o);if(!f)return null;t=f}return t}function N(e,n){const r=n.split(".");let t=e;return r.forEach(o=>{typeof t=="object"&&t!==null&&o in t?t=t[o]:t=null}),t}function P(e){return u.isEnumType(e.type)||u.isNonNullType(e.type)&&u.isEnumType(e.type.ofType)}function I(e){return u.isListType(e.type)||u.isNonNullType(e.type)&&u.isListType(e.type.ofType)}function S(e){return!!(u.isScalarType(e.type)||u.isNonNullType(e.type)&&(u.isScalarType(e.type.ofType)||u.isListType(e.type.ofType)&&(u.isScalarType(e.type.ofType.ofType)||u.isNonNullType(e.type.ofType.ofType)&&u.isScalarType(e.type.ofType.ofType.ofType))))}function B(e){return e.charAt(0).toLowerCase()+e.slice(1)}i.checkIsEnum=P,i.checkIsList=I,i.checkIsScalar=S,i.findEntityFromPath=d,i.findPathToEntity=a,i.findValue=N,i.generatePath=m,i.getEntityByName=s,i.getField=h,i.getItemByKeyAndValue=l,i.getItemsByHavingKey=p,i.lowercaseFirstLetter=B,i.sortDataByOrder=T,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); | ||
(function(r,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("graphql")):typeof define=="function"&&define.amd?define(["exports","graphql"],f):(r=typeof globalThis!="undefined"?globalThis:r||self,f(r["@theconcurrent/utility"]={},r.graphql))})(this,function(r,f){"use strict";function d(e,n,i){return e.find(t=>t[n]===i)}function p(e,n){return e.filter(i=>n in i)}function T(e,n,i){return e.sort((t,u)=>{const y=n.indexOf(String(t[i])),c=n.indexOf(String(u[i]));return y===-1?1:c===-1?-1:y-c})}function s(e,n){return d(e,"typeName",n)}function l(e,n,i){var o;const t=s(e,n);if(!t||t.kind!=="Object"||!t.fields)return;if(i.length===0)return t;const[u,...y]=i,c=(o=t.fields.find(L=>L.name===u))==null?void 0:o.typeName;if(c)return l(e,c,y)}function a(e,n,i,t=[],u){if(u<0)return;const y=s(e,n);if(!(!y||t.includes(n))&&(t.push(n),!(y.kind!=="Object"||!y.fields)))for(const c of y.fields){if(c.typeName===i)return c.name;const o=a(e,c.typeName,i,t,u-1);if(o)return`${c.name}.${o}`}}function m(e,n,i,t){const u=a(e,n,i,[],0);if(u)return`${t}${u}`}function N(e,n){return e.find(i=>{var t;return(t=i.directives)==null?void 0:t.find(u=>u.name===n)})}function h(e,n){return e.filter(i=>{var t;return(t=i.directives)==null?void 0:t.find(u=>u.name===n)})||[]}function v(e,n){const i=n.split(".");if(i[0]!==e.name)return null;let t=e;for(const u of i.slice(1)){if(!t||!t.fields)return null;const y=t.fields.find(c=>c.name===u);if(!y)return null;t=y}return t}function B(e,n){const i=n.split(".");let t=e;return i.forEach(u=>{typeof t=="object"&&t!==null&&u in t?t=t[u]:t=null}),t}function E(e){return f.isEnumType(e.type)||f.isNonNullType(e.type)&&f.isEnumType(e.type.ofType)}function P(e){return f.isListType(e.type)||f.isNonNullType(e.type)&&f.isListType(e.type.ofType)}function I(e){return!!(f.isScalarType(e.type)||f.isNonNullType(e.type)&&(f.isScalarType(e.type.ofType)||f.isListType(e.type.ofType)&&(f.isScalarType(e.type.ofType.ofType)||f.isNonNullType(e.type.ofType.ofType)&&f.isScalarType(e.type.ofType.ofType.ofType))))}function S(e){return e.charAt(0).toLowerCase()+e.slice(1)}r.checkIsEnum=E,r.checkIsList=P,r.checkIsScalar=I,r.filterEntitiesByDirectiveName=h,r.findEntityByDirectiveName=N,r.findEntityFromPath=l,r.findPathToEntity=a,r.findValue=B,r.generatePath=m,r.getEntityByName=s,r.getField=v,r.getItemByKeyAndValue=d,r.getItemsByHavingKey=p,r.lowercaseFirstLetter=S,r.sortDataByOrder=T,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -5,3 +5,5 @@ import findEntityFromPath from './findEntityFromPath'; | ||
import getEntityByName from './getEntityByName'; | ||
export { findEntityFromPath, findPathToEntity, generatePath, getEntityByName }; | ||
import findEntityByDirectiveName from './findEntityByDirectiveName'; | ||
import filterEntitiesByDirectiveName from './filterEntitiesByDirectiveName'; | ||
export { findEntityFromPath, findPathToEntity, generatePath, getEntityByName, findEntityByDirectiveName, filterEntitiesByDirectiveName, }; | ||
//# sourceMappingURL=index.d.ts.map |
import { getItemByKeyAndValue, getItemsByHavingKey, sortDataByOrder } from './dictionaryArray'; | ||
import { findEntityFromPath, findPathToEntity, generatePath, getEntityByName } from './entity'; | ||
import { findEntityFromPath, findPathToEntity, generatePath, getEntityByName, findEntityByDirectiveName, filterEntitiesByDirectiveName } from './entity'; | ||
import { getField } from './field'; | ||
@@ -8,4 +8,4 @@ import findValue from './findValue'; | ||
export { findValue }; | ||
export { findEntityFromPath, findPathToEntity, generatePath, getEntityByName, getField, getItemByKeyAndValue, getItemsByHavingKey, lowercaseFirstLetter, sortDataByOrder, }; | ||
export { findEntityFromPath, findPathToEntity, findEntityByDirectiveName, filterEntitiesByDirectiveName, generatePath, getEntityByName, getField, getItemByKeyAndValue, getItemsByHavingKey, lowercaseFirstLetter, sortDataByOrder, }; | ||
export { checkIsEnum, checkIsList, checkIsScalar }; | ||
//# sourceMappingURL=index.d.ts.map |
import { isEnumType as s, isNonNullType as y, isListType as p, isScalarType as c } from "graphql"; | ||
function T(t, e, r) { | ||
function m(t, e, r) { | ||
return t.find((n) => n[e] === r); | ||
} | ||
function g(t, e) { | ||
function v(t, e) { | ||
return t.filter((r) => e in r); | ||
} | ||
function P(t, e, r) { | ||
function g(t, e, r) { | ||
return t.sort((n, i) => { | ||
@@ -15,5 +15,5 @@ const u = e.indexOf(String(n[r])), o = e.indexOf(String(i[r])); | ||
function a(t, e) { | ||
return T(t, "typeName", e); | ||
return m(t, "typeName", e); | ||
} | ||
function m(t, e, r) { | ||
function T(t, e, r) { | ||
var f; | ||
@@ -29,3 +29,3 @@ const n = a(t, e); | ||
if (o) | ||
return m(t, o, u); | ||
return T(t, o, u); | ||
} | ||
@@ -51,3 +51,3 @@ function l(t, e, r, n = [], i) { | ||
} | ||
function v(t, e, r, n) { | ||
function P(t, e, r, n) { | ||
const i = l(t, e, r, [], 0); | ||
@@ -57,2 +57,14 @@ if (i) | ||
} | ||
function B(t, e) { | ||
return t.find((r) => { | ||
var n; | ||
return (n = r.directives) == null ? void 0 : n.find((i) => i.name === e); | ||
}); | ||
} | ||
function N(t, e) { | ||
return t.filter((r) => { | ||
var n; | ||
return (n = r.directives) == null ? void 0 : n.find((i) => i.name === e); | ||
}) || []; | ||
} | ||
function x(t, e) { | ||
@@ -73,3 +85,3 @@ const r = e.split("."); | ||
} | ||
function A(t, e) { | ||
function E(t, e) { | ||
const r = e.split("."); | ||
@@ -81,3 +93,3 @@ let n = t; | ||
} | ||
function B(t) { | ||
function A(t) { | ||
return s(t.type) || y(t.type) && s(t.type.ofType); | ||
@@ -88,23 +100,25 @@ } | ||
} | ||
function N(t) { | ||
function O(t) { | ||
return !!(c(t.type) || y(t.type) && (c(t.type.ofType) || p(t.type.ofType) && (c(t.type.ofType.ofType) || y(t.type.ofType.ofType) && c(t.type.ofType.ofType.ofType)))); | ||
} | ||
function O(t) { | ||
function F(t) { | ||
return t.charAt(0).toLowerCase() + t.slice(1); | ||
} | ||
export { | ||
B as checkIsEnum, | ||
A as checkIsEnum, | ||
I as checkIsList, | ||
N as checkIsScalar, | ||
m as findEntityFromPath, | ||
O as checkIsScalar, | ||
N as filterEntitiesByDirectiveName, | ||
B as findEntityByDirectiveName, | ||
T as findEntityFromPath, | ||
l as findPathToEntity, | ||
A as findValue, | ||
v as generatePath, | ||
E as findValue, | ||
P as generatePath, | ||
a as getEntityByName, | ||
x as getField, | ||
T as getItemByKeyAndValue, | ||
g as getItemsByHavingKey, | ||
O as lowercaseFirstLetter, | ||
P as sortDataByOrder | ||
m as getItemByKeyAndValue, | ||
v as getItemsByHavingKey, | ||
F as lowercaseFirstLetter, | ||
g as sortDataByOrder | ||
}; | ||
//# sourceMappingURL=index.es.js.map |
@@ -1,2 +0,2 @@ | ||
(function(i,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("graphql")):typeof define=="function"&&define.amd?define(["exports","graphql"],u):(i=typeof globalThis!="undefined"?globalThis:i||self,u(i["@theconcurrent/utility"]={},i.graphql))})(this,function(i,u){"use strict";function l(e,n,r){return e.find(t=>t[n]===r)}function p(e,n){return e.filter(r=>n in r)}function T(e,n,r){return e.sort((t,o)=>{const f=n.indexOf(String(t[r])),y=n.indexOf(String(o[r]));return f===-1?1:y===-1?-1:f-y})}function s(e,n){return l(e,"typeName",n)}function d(e,n,r){var c;const t=s(e,n);if(!t||t.kind!=="Object"||!t.fields)return;if(r.length===0)return t;const[o,...f]=r,y=(c=t.fields.find(E=>E.name===o))==null?void 0:c.typeName;if(y)return d(e,y,f)}function a(e,n,r,t=[],o){if(o<0)return;const f=s(e,n);if(!(!f||t.includes(n))&&(t.push(n),!(f.kind!=="Object"||!f.fields)))for(const y of f.fields){if(y.typeName===r)return y.name;const c=a(e,y.typeName,r,t,o-1);if(c)return`${y.name}.${c}`}}function m(e,n,r,t){const o=a(e,n,r,[],0);if(o)return`${t}${o}`}function h(e,n){const r=n.split(".");if(r[0]!==e.name)return null;let t=e;for(const o of r.slice(1)){if(!t||!t.fields)return null;const f=t.fields.find(y=>y.name===o);if(!f)return null;t=f}return t}function N(e,n){const r=n.split(".");let t=e;return r.forEach(o=>{typeof t=="object"&&t!==null&&o in t?t=t[o]:t=null}),t}function P(e){return u.isEnumType(e.type)||u.isNonNullType(e.type)&&u.isEnumType(e.type.ofType)}function I(e){return u.isListType(e.type)||u.isNonNullType(e.type)&&u.isListType(e.type.ofType)}function S(e){return!!(u.isScalarType(e.type)||u.isNonNullType(e.type)&&(u.isScalarType(e.type.ofType)||u.isListType(e.type.ofType)&&(u.isScalarType(e.type.ofType.ofType)||u.isNonNullType(e.type.ofType.ofType)&&u.isScalarType(e.type.ofType.ofType.ofType))))}function B(e){return e.charAt(0).toLowerCase()+e.slice(1)}i.checkIsEnum=P,i.checkIsList=I,i.checkIsScalar=S,i.findEntityFromPath=d,i.findPathToEntity=a,i.findValue=N,i.generatePath=m,i.getEntityByName=s,i.getField=h,i.getItemByKeyAndValue=l,i.getItemsByHavingKey=p,i.lowercaseFirstLetter=B,i.sortDataByOrder=T,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); | ||
(function(r,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("graphql")):typeof define=="function"&&define.amd?define(["exports","graphql"],f):(r=typeof globalThis!="undefined"?globalThis:r||self,f(r["@theconcurrent/utility"]={},r.graphql))})(this,function(r,f){"use strict";function d(e,n,i){return e.find(t=>t[n]===i)}function p(e,n){return e.filter(i=>n in i)}function T(e,n,i){return e.sort((t,u)=>{const y=n.indexOf(String(t[i])),c=n.indexOf(String(u[i]));return y===-1?1:c===-1?-1:y-c})}function s(e,n){return d(e,"typeName",n)}function l(e,n,i){var o;const t=s(e,n);if(!t||t.kind!=="Object"||!t.fields)return;if(i.length===0)return t;const[u,...y]=i,c=(o=t.fields.find(L=>L.name===u))==null?void 0:o.typeName;if(c)return l(e,c,y)}function a(e,n,i,t=[],u){if(u<0)return;const y=s(e,n);if(!(!y||t.includes(n))&&(t.push(n),!(y.kind!=="Object"||!y.fields)))for(const c of y.fields){if(c.typeName===i)return c.name;const o=a(e,c.typeName,i,t,u-1);if(o)return`${c.name}.${o}`}}function m(e,n,i,t){const u=a(e,n,i,[],0);if(u)return`${t}${u}`}function N(e,n){return e.find(i=>{var t;return(t=i.directives)==null?void 0:t.find(u=>u.name===n)})}function h(e,n){return e.filter(i=>{var t;return(t=i.directives)==null?void 0:t.find(u=>u.name===n)})||[]}function v(e,n){const i=n.split(".");if(i[0]!==e.name)return null;let t=e;for(const u of i.slice(1)){if(!t||!t.fields)return null;const y=t.fields.find(c=>c.name===u);if(!y)return null;t=y}return t}function B(e,n){const i=n.split(".");let t=e;return i.forEach(u=>{typeof t=="object"&&t!==null&&u in t?t=t[u]:t=null}),t}function E(e){return f.isEnumType(e.type)||f.isNonNullType(e.type)&&f.isEnumType(e.type.ofType)}function P(e){return f.isListType(e.type)||f.isNonNullType(e.type)&&f.isListType(e.type.ofType)}function I(e){return!!(f.isScalarType(e.type)||f.isNonNullType(e.type)&&(f.isScalarType(e.type.ofType)||f.isListType(e.type.ofType)&&(f.isScalarType(e.type.ofType.ofType)||f.isNonNullType(e.type.ofType.ofType)&&f.isScalarType(e.type.ofType.ofType.ofType))))}function S(e){return e.charAt(0).toLowerCase()+e.slice(1)}r.checkIsEnum=E,r.checkIsList=P,r.checkIsScalar=I,r.filterEntitiesByDirectiveName=h,r.findEntityByDirectiveName=N,r.findEntityFromPath=l,r.findPathToEntity=a,r.findValue=B,r.generatePath=m,r.getEntityByName=s,r.getField=v,r.getItemByKeyAndValue=d,r.getItemsByHavingKey=p,r.lowercaseFirstLetter=S,r.sortDataByOrder=T,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@theconcurrent/utility", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"main": "./dist/index.umd.js", | ||
@@ -29,3 +29,3 @@ "module": "./dist/index.es.js", | ||
}, | ||
"gitHead": "e9b5ea92e453f508265e1693e10b87c3039eec03" | ||
"gitHead": "d92250a7361b0103695a48cc29c8e610f698e487" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
52314
50
391