@asherng/utils
Advanced tools
| 'use strict'; | ||
| const o=r=>Array.from(Array(r),(a,m)=>m);var e=o; | ||
| const o=r=>Array.from(Array(r),(a,m)=>m);var y=o; | ||
| module.exports = e; | ||
| module.exports = y; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=arrayFromNumber.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const o=r=>Array.from(Array(r),(a,m)=>m);var t=o; | ||
| const o=r=>Array.from(Array(r),(a,m)=>m);var e=o; | ||
| export { e as default }; | ||
| export { t as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=arrayFromNumber.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/arrayFromNumber/arrayFromNumber.ts"],"names":["arrayFromNumber","num","_","x","arrayFromNumber_default"],"mappings":"8BASA,MAAMA,EAAmCC,GAAO,MAAM,KAAK,MAAMA,CAAG,EAAG,CAACC,EAAGC,IAAMA,CAAC,EAElF,IAAOC,EAAQJ","sourcesContent":["import type { ArrayFromNumber } from './types';\n\n/**\n * Generate array containing from 1...num.\n *\n * @param num length of the array.\n * @returns array of numbers from 1...num.\n */\n\nconst arrayFromNumber: ArrayFromNumber = num => Array.from(Array(num), (_, x) => x);\n\nexport default arrayFromNumber;\n"]} | ||
| {"version":3,"sources":["../../src/arrayFromNumber/arrayFromNumber.ts"],"names":["arrayFromNumber","num","_","x","arrayFromNumber_default"],"mappings":"AASA,MAAMA,EAAmCC,GAAO,MAAM,KAAK,MAAMA,CAAG,EAAG,CAACC,EAAGC,IAAMA,CAAC,EAElF,IAAOC,EAAQJ","sourcesContent":["import type { ArrayFromNumber } from './types';\n\n/**\n * Generate array containing from 1...num.\n *\n * @param num length of the array.\n * @returns array of numbers from 1...num.\n */\n\nconst arrayFromNumber: ArrayFromNumber = num => Array.from(Array(num), (_, x) => x);\n\nexport default arrayFromNumber;\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './arrayFromNumber'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/arrayFromNumber/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './arrayFromNumber';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/arrayFromNumber/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './arrayFromNumber';\n\nexport type * from './types';\n"]} |
| 'use strict'; | ||
| const e=()=>!!(typeof window!="undefined"&&window.document&&window.document.createElement);var n=e; | ||
| const e=()=>!!(typeof window!="undefined"&&window.document&&window.document.createElement);var o=e; | ||
| module.exports = n; | ||
| module.exports = o; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const e=()=>!!(typeof window!="undefined"&&window.document&&window.document.createElement);var d=e; | ||
| const e=()=>!!(typeof window!="undefined"&&window.document&&window.document.createElement);var n=e; | ||
| export { n as default }; | ||
| export { d as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/canUseDOM/index.ts"],"names":["canUseDOM","canUseDOM_default"],"mappings":"8BAKA,MAAMA,EAAY,IAChB,CAAC,EAAE,OAAO,QAAW,aAAe,OAAO,UAAY,OAAO,SAAS,eAEzE,IAAOC,EAAQD","sourcesContent":["/**\n * @desc Check if the current environment is a browser\n * @return {Boolean}\n */\n\nconst canUseDOM = (): boolean =>\n !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nexport default canUseDOM;\n"]} | ||
| {"version":3,"sources":["../../src/canUseDOM/index.ts"],"names":["canUseDOM","canUseDOM_default"],"mappings":"AAKA,MAAMA,EAAY,IAChB,CAAC,EAAE,OAAO,QAAW,aAAe,OAAO,UAAY,OAAO,SAAS,eAEzE,IAAOC,EAAQD","sourcesContent":["/**\n * @desc Check if the current environment is a browser\n * @return {Boolean}\n */\n\nconst canUseDOM = (): boolean =>\n !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nexport default canUseDOM;\n"]} |
| 'use strict'; | ||
| const e=()=>typeof window!="undefined"&&"IntersectionObserver"in window;var n=e; | ||
| const e=()=>typeof window!="undefined"&&"IntersectionObserver"in window;var o=e; | ||
| module.exports = n; | ||
| module.exports = o; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const e=()=>typeof window!="undefined"&&"IntersectionObserver"in window;var t=e; | ||
| const e=()=>typeof window!="undefined"&&"IntersectionObserver"in window;var n=e; | ||
| export { n as default }; | ||
| export { t as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/canUseIntersectionObserver/index.ts"],"names":["canUseIntersectionObserver","canUseIntersectionObserver_default"],"mappings":"8BAKA,MAAMA,EAA6B,IACjC,OAAO,QAAW,aAAe,yBAA0B,OAE7D,IAAOC,EAAQD","sourcesContent":["/**\n * @desc Check if the current environment supports IntersectionObserver\n * @return {Boolean}\n */\n\nconst canUseIntersectionObserver = (): boolean =>\n typeof window !== 'undefined' && 'IntersectionObserver' in window;\n\nexport default canUseIntersectionObserver;\n"]} | ||
| {"version":3,"sources":["../../src/canUseIntersectionObserver/index.ts"],"names":["canUseIntersectionObserver","canUseIntersectionObserver_default"],"mappings":"AAKA,MAAMA,EAA6B,IACjC,OAAO,QAAW,aAAe,yBAA0B,OAE7D,IAAOC,EAAQD","sourcesContent":["/**\n * @desc Check if the current environment supports IntersectionObserver\n * @return {Boolean}\n */\n\nconst canUseIntersectionObserver = (): boolean =>\n typeof window !== 'undefined' && 'IntersectionObserver' in window;\n\nexport default canUseIntersectionObserver;\n"]} |
+2
-2
@@ -5,7 +5,7 @@ 'use strict'; | ||
| var O=Object.defineProperty;var u=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var T=(e,n,t)=>n in e?O(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,y=(e,n)=>{for(var t in n||(n={}))V.call(n,t)&&T(e,t,n[t]);if(u)for(var t of u(n))x.call(n,t)&&T(e,t,n[t]);return e};var N=(e,n)=>{var t={};for(var a in e)V.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&u)for(var a of u(e))n.indexOf(a)<0&&x.call(e,a)&&(t[a]=e[a]);return t};const j=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,k=(...e)=>e.flat(1/0).filter(Boolean).join(" "),A=(e,n)=>t=>{var m;if((n==null?void 0:n.variants)==null)return k(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:a,defaultVariants:r}=n,P=Object.keys(a).map(s=>{const l=t==null?void 0:t[s],i=r==null?void 0:r[s];if(l===null)return null;const d=j(l)||j(i);return a[s][d]}),c=t&&Object.entries(t).reduce((s,[l,i])=>(i===void 0||(s[l]=i),s),{}),b=(m=n==null?void 0:n.compoundVariants)==null?void 0:m.reduce((s,h)=>{var C=h,{class:l,className:i}=C,d=N(C,["class","className"]);return Object.entries(d).every(([o,f])=>Array.isArray(f)?f.includes(y(y({},r),c)[o]):y(y({},r),c)[o]===f)?[...s,l,i]:s},[]);return k(e,P,b,t==null?void 0:t.class,t==null?void 0:t.className)};var w=A; | ||
| var O=Object.defineProperty;var u=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var T=(e,n,t)=>n in e?O(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,y=(e,n)=>{for(var t in n||(n={}))V.call(n,t)&&T(e,t,n[t]);if(u)for(var t of u(n))x.call(n,t)&&T(e,t,n[t]);return e};var N=(e,n)=>{var t={};for(var a in e)V.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&u)for(var a of u(e))n.indexOf(a)<0&&x.call(e,a)&&(t[a]=e[a]);return t};const j=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,k=(...e)=>e.flat(1/0).filter(Boolean).join(" "),A=(e,n)=>t=>{var m;if((n==null?void 0:n.variants)==null)return k(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:a,defaultVariants:r}=n,P=Object.keys(a).map(s=>{const l=t==null?void 0:t[s],i=r==null?void 0:r[s];if(l===null)return null;const d=j(l)||j(i);return a[s][d]}),c=t&&Object.entries(t).reduce((s,[l,i])=>(i===void 0||(s[l]=i),s),{}),b=(m=n==null?void 0:n.compoundVariants)==null?void 0:m.reduce((s,h)=>{var C=h,{class:l,className:i}=C,d=N(C,["class","className"]);return Object.entries(d).every(([o,f])=>Array.isArray(f)?f.includes(y(y({},r),c)[o]):y(y({},r),c)[o]===f)?[...s,l,i]:s},[]);return k(e,P,b,t==null?void 0:t.class,t==null?void 0:t.className)};var B=A; | ||
| exports.cx = k; | ||
| exports.default = w; | ||
| exports.default = B; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=cv.js.map |
+2
-4
@@ -1,7 +0,5 @@ | ||
| import { b, a } from '../chunk-KHSOYKNK.mjs'; | ||
| var O=Object.defineProperty;var u=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var T=(e,n,t)=>n in e?O(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,y=(e,n)=>{for(var t in n||(n={}))V.call(n,t)&&T(e,t,n[t]);if(u)for(var t of u(n))x.call(n,t)&&T(e,t,n[t]);return e};var N=(e,n)=>{var t={};for(var a in e)V.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(e!=null&&u)for(var a of u(e))n.indexOf(a)<0&&x.call(e,a)&&(t[a]=e[a]);return t};const j=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,k=(...e)=>e.flat(1/0).filter(Boolean).join(" "),A=(e,n)=>t=>{var m;if((n==null?void 0:n.variants)==null)return k(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:a,defaultVariants:r}=n,P=Object.keys(a).map(s=>{const l=t==null?void 0:t[s],i=r==null?void 0:r[s];if(l===null)return null;const d=j(l)||j(i);return a[s][d]}),c=t&&Object.entries(t).reduce((s,[l,i])=>(i===void 0||(s[l]=i),s),{}),b=(m=n==null?void 0:n.compoundVariants)==null?void 0:m.reduce((s,h)=>{var C=h,{class:l,className:i}=C,d=N(C,["class","className"]);return Object.entries(d).every(([o,f])=>Array.isArray(f)?f.includes(y(y({},r),c)[o]):y(y({},r),c)[o]===f)?[...s,l,i]:s},[]);return k(e,P,b,t==null?void 0:t.class,t==null?void 0:t.className)};var I=A; | ||
| const T=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,V=(...n)=>n.flat(1/0).filter(Boolean).join(" "),j=(n,a$1)=>t=>{var c;if((a$1==null?void 0:a$1.variants)==null)return V(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:d,defaultVariants:i}=a$1,x=Object.keys(d).map(e=>{const s=t==null?void 0:t[e],l=i==null?void 0:i[e];if(s===null)return null;const y=T(s)||T(l);return d[e][y]}),f=t&&Object.entries(t).reduce((e,[s,l])=>(l===void 0||(e[s]=l),e),{}),N=(c=a$1==null?void 0:a$1.compoundVariants)==null?void 0:c.reduce((e,k)=>{var m=k,{class:s,className:l}=m,y=b(m,["class","className"]);return Object.entries(y).every(([C,u])=>Array.isArray(u)?u.includes(a(a({},i),f)[C]):a(a({},i),f)[C]===u)?[...e,s,l]:e},[]);return V(n,x,N,t==null?void 0:t.class,t==null?void 0:t.className)};var P=j; | ||
| export { V as cx, P as default }; | ||
| export { k as cx, I as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=cv.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/cv/cv.ts"],"names":["falsyToString","value","cx","classes","cv","base","config","props","_c","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","key","getCompoundVariantClassNames","_a","_b","cvClass","cvClassName","compoundVariantOptions","__objRest","__spreadValues","cv_default"],"mappings":"iDAEA,MAAMA,EAAoBC,GACxB,OAAOA,GAAU,UAAY,GAAGA,IAAUA,IAAU,EAAI,IAAMA,EAEnDC,EAAS,IAAIC,IACxBA,EAAQ,KAAK,GAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAE3CC,EACJ,CAAIC,EAAmBC,IACtBC,GAA6B,CAVhC,IAAAC,EAWI,IAAIF,GAAA,YAAAA,EAAQ,WAAY,KACtB,OAAOJ,EAAGG,EAAME,GAAA,YAAAA,EAAO,MAAOA,GAAA,YAAAA,EAAO,SAAS,EAGhD,KAAM,CAAE,SAAAE,EAAU,gBAAAC,CAAgB,EAAIJ,EAEhCK,EAAuB,OAAO,KAAKF,CAAQ,EAAE,IAAKG,GAAmC,CACzF,MAAMC,EAAcN,GAAA,YAAAA,EAAQK,GAEtBE,EAAqBJ,GAAA,YAAAA,EAAkBE,GAE7C,GAAIC,IAAgB,KAClB,OAAO,KAGT,MAAME,EAAcf,EAAca,CAAW,GAC3Cb,EAAcc,CAAkB,EAElC,OAAOL,EAASG,CAAO,EAAEG,CAAU,CACrC,CAAC,EAEKC,EACJT,GACA,OAAO,QAAQA,CAAK,EAAE,OACpB,CAACU,EAAK,CAACC,EAAKjB,CAAK,KACXA,IAAU,SAIdgB,EAAIC,CAAG,EAAIjB,GAEJgB,GAET,CAAC,CACH,EAEIE,GAA+BX,EAAAF,GAAA,YAAAA,EAAQ,mBAAR,YAAAE,EAA0B,OAC7D,CAACS,EAAKG,IAAuE,CAAvE,IAAAC,EAAAD,EAAE,OAAOE,EAAS,UAAWC,CAhDzC,EAgDYF,EAA6CG,EAAAC,EAA7CJ,EAA6C,CAA3C,QAAgB,cACtB,cAAO,QAAQG,CAAsB,EAAE,MAAM,CAAC,CAACN,EAAKjB,CAAK,IACvD,MAAM,QAAQA,CAAK,EACfA,EAAM,SACJyB,IAAA,GACKhB,GACAM,GACHE,CAAG,CACP,EACAQ,IAAA,GACKhB,GACAM,GACHE,CAAG,IAAMjB,CACjB,EACI,CAAC,GAAGgB,EAAKK,EAASC,CAAW,EAC7BN,GACN,CAAC,GAGH,OAAOf,EACLG,EACAM,EACAQ,EACAZ,GAAA,YAAAA,EAAO,MACPA,GAAA,YAAAA,EAAO,SACT,CACF,EAEF,IAAOoB,EAAQvB","sourcesContent":["import type { ClassValue, Config, Props, Cx } from './types';\n\nconst falsyToString = <T>(value: T) =>\n typeof value === 'boolean' ? `${value}` : value === 0 ? '0' : value;\n\nexport const cx: Cx = (...classes: any[]): string =>\n classes.flat(Infinity).filter(Boolean).join(' ');\n\nconst cv =\n <T>(base?: ClassValue, config?: Config<T>) =>\n (props?: Props<T>): string => {\n if (config?.variants == null) {\n return cx(base, props?.class, props?.className);\n }\n\n const { variants, defaultVariants } = config;\n\n const getVariantClassNames = Object.keys(variants).map((variant: keyof typeof variants) => {\n const variantProp = props?.[variant as keyof typeof props];\n\n const defaultVariantProp = defaultVariants?.[variant];\n\n if (variantProp === null) {\n return null;\n }\n\n const variantKey = (falsyToString(variantProp) ||\n falsyToString(defaultVariantProp)) as keyof (typeof variants)[typeof variant];\n\n return variants[variant][variantKey];\n });\n\n const propsWithoutUndefined =\n props &&\n Object.entries(props).reduce(\n (acc, [key, value]) => {\n if (value === undefined) {\n return acc;\n }\n\n acc[key] = value;\n\n return acc;\n },\n {} as Record<string, unknown>\n );\n\n const getCompoundVariantClassNames = config?.compoundVariants?.reduce(\n (acc, { class: cvClass, className: cvClassName, ...compoundVariantOptions }) =>\n Object.entries(compoundVariantOptions).every(([key, value]) =>\n Array.isArray(value)\n ? value.includes(\n {\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]\n )\n : {\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key] === value\n )\n ? [...acc, cvClass, cvClassName]\n : acc,\n [] as ClassValue[]\n );\n\n return cx(\n base,\n getVariantClassNames,\n getCompoundVariantClassNames,\n props?.class,\n props?.className\n );\n };\n\nexport default cv;\n"]} | ||
| {"version":3,"sources":["../../src/cv/cv.ts"],"names":["falsyToString","value","cx","classes","cv","base","config","props","_c","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","key","getCompoundVariantClassNames","_a","_b","cvClass","cvClassName","compoundVariantOptions","__objRest","__spreadValues","cv_default"],"mappings":"2fAEA,MAAMA,EAAoBC,GACxB,OAAOA,GAAU,UAAY,GAAGA,IAAUA,IAAU,EAAI,IAAMA,EAEnDC,EAAS,IAAIC,IACxBA,EAAQ,KAAK,GAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAE3CC,EACJ,CAAIC,EAAmBC,IACtBC,GAA6B,CAVhC,IAAAC,EAWI,IAAIF,GAAA,YAAAA,EAAQ,WAAY,KACtB,OAAOJ,EAAGG,EAAME,GAAA,YAAAA,EAAO,MAAOA,GAAA,YAAAA,EAAO,SAAS,EAGhD,KAAM,CAAE,SAAAE,EAAU,gBAAAC,CAAgB,EAAIJ,EAEhCK,EAAuB,OAAO,KAAKF,CAAQ,EAAE,IAAKG,GAAmC,CACzF,MAAMC,EAAcN,GAAA,YAAAA,EAAQK,GAEtBE,EAAqBJ,GAAA,YAAAA,EAAkBE,GAE7C,GAAIC,IAAgB,KAClB,OAAO,KAGT,MAAME,EAAcf,EAAca,CAAW,GAC3Cb,EAAcc,CAAkB,EAElC,OAAOL,EAASG,CAAO,EAAEG,CAAU,CACrC,CAAC,EAEKC,EACJT,GACA,OAAO,QAAQA,CAAK,EAAE,OACpB,CAACU,EAAK,CAACC,EAAKjB,CAAK,KACXA,IAAU,SAIdgB,EAAIC,CAAG,EAAIjB,GAEJgB,GAET,CAAC,CACH,EAEIE,GAA+BX,EAAAF,GAAA,YAAAA,EAAQ,mBAAR,YAAAE,EAA0B,OAC7D,CAACS,EAAKG,IAAuE,CAAvE,IAAAC,EAAAD,EAAE,OAAOE,EAAS,UAAWC,CAhDzC,EAgDYF,EAA6CG,EAAAC,EAA7CJ,EAA6C,CAA3C,QAAgB,cACtB,cAAO,QAAQG,CAAsB,EAAE,MAAM,CAAC,CAACN,EAAKjB,CAAK,IACvD,MAAM,QAAQA,CAAK,EACfA,EAAM,SACJyB,IAAA,GACKhB,GACAM,GACHE,CAAG,CACP,EACAQ,IAAA,GACKhB,GACAM,GACHE,CAAG,IAAMjB,CACjB,EACI,CAAC,GAAGgB,EAAKK,EAASC,CAAW,EAC7BN,GACN,CAAC,GAGH,OAAOf,EACLG,EACAM,EACAQ,EACAZ,GAAA,YAAAA,EAAO,MACPA,GAAA,YAAAA,EAAO,SACT,CACF,EAEF,IAAOoB,EAAQvB","sourcesContent":["import type { ClassValue, Config, Props, Cx } from './types';\n\nconst falsyToString = <T>(value: T) =>\n typeof value === 'boolean' ? `${value}` : value === 0 ? '0' : value;\n\nexport const cx: Cx = (...classes: any[]): string =>\n classes.flat(Infinity).filter(Boolean).join(' ');\n\nconst cv =\n <T>(base?: ClassValue, config?: Config<T>) =>\n (props?: Props<T>): string => {\n if (config?.variants == null) {\n return cx(base, props?.class, props?.className);\n }\n\n const { variants, defaultVariants } = config;\n\n const getVariantClassNames = Object.keys(variants).map((variant: keyof typeof variants) => {\n const variantProp = props?.[variant as keyof typeof props];\n\n const defaultVariantProp = defaultVariants?.[variant];\n\n if (variantProp === null) {\n return null;\n }\n\n const variantKey = (falsyToString(variantProp) ||\n falsyToString(defaultVariantProp)) as keyof (typeof variants)[typeof variant];\n\n return variants[variant][variantKey];\n });\n\n const propsWithoutUndefined =\n props &&\n Object.entries(props).reduce(\n (acc, [key, value]) => {\n if (value === undefined) {\n return acc;\n }\n\n acc[key] = value;\n\n return acc;\n },\n {} as Record<string, unknown>\n );\n\n const getCompoundVariantClassNames = config?.compoundVariants?.reduce(\n (acc, { class: cvClass, className: cvClassName, ...compoundVariantOptions }) =>\n Object.entries(compoundVariantOptions).every(([key, value]) =>\n Array.isArray(value)\n ? value.includes(\n {\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]\n )\n : {\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key] === value\n )\n ? [...acc, cvClass, cvClassName]\n : acc,\n [] as ClassValue[]\n );\n\n return cx(\n base,\n getVariantClassNames,\n getCompoundVariantClassNames,\n props?.class,\n props?.className\n );\n };\n\nexport default cv;\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './cv'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/cv/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './cv';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/cv/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './cv';\n\nexport type * from './types';\n"]} |
@@ -9,6 +9,6 @@ 'use strict'; | ||
| const o=(r,i=1/0)=>!a__default.default(r)&&!Array.isArray(r)||!i?r:Object.entries(r).reduce((e,[t,n])=>(a__default.default(n)||Array.isArray(n)?Object.entries(o(n,i-1)).forEach(([c,s])=>{e[`${t}.${c}`]=s;}):e[t]=n,e),{});var f=o; | ||
| const o=(r,i=1/0)=>!a__default.default(r)&&!Array.isArray(r)||!i?r:Object.entries(r).reduce((e,[t,n])=>(a__default.default(n)||Array.isArray(n)?Object.entries(o(n,i-1)).forEach(([c,s])=>{e[`${t}.${c}`]=s;}):e[t]=n,e),{});var d=o; | ||
| module.exports = f; | ||
| module.exports = d; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,8 +0,7 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| import a from '../isObject'; | ||
| const o=(r,i=1/0)=>!a(r)&&!Array.isArray(r)||!i?r:Object.entries(r).reduce((e,[t,n])=>(a(n)||Array.isArray(n)?Object.entries(o(n,i-1)).forEach(([c,s])=>{e[`${t}.${c}`]=s;}):e[t]=n,e),{});var f=o; | ||
| const o=(r,i=1/0)=>!a(r)&&!Array.isArray(r)||!i?r:Object.entries(r).reduce((e,[t,n])=>(a(n)||Array.isArray(n)?Object.entries(o(n,i-1)).forEach(([c,s])=>{e[`${t}.${c}`]=s;}):e[t]=n,e),{});var l=o; | ||
| export { f as default }; | ||
| export { l as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/flattenObject/index.ts"],"names":["isObject","flattenObject","target","maxDepth","result","key","value","childKey","childValue","flattenObject_default"],"mappings":"8BACA,OAAOA,MAAc,cAWrB,MAAMC,EAAgB,CACpBC,EACAC,EAAW,MAEN,CAACH,EAASE,CAAM,GAAK,CAAC,MAAM,QAAQA,CAAM,GAAM,CAACC,EAC7CD,EAGF,OAAO,QAAQA,CAAM,EAAE,OAAqC,CAACE,EAAQ,CAACC,EAAKC,CAAK,KACjFN,EAASM,CAAK,GAAK,MAAM,QAAQA,CAAK,EACxC,OAAO,QAAQL,EAAcK,EAAOH,EAAW,CAAC,CAAiC,EAAE,QACjF,CAAC,CAACI,EAAUC,CAAU,IAAM,CAC1BJ,EAAO,GAAGC,KAAOE,GAAU,EAAIC,CACjC,CACF,EAEAJ,EAAOC,CAAG,EAAIC,EAGTF,GACN,CAAC,CAAC,EAGP,IAAOK,EAAQR","sourcesContent":["import type { MayBe } from '@asherng/common-types';\nimport isObject from '../isObject';\n\n/**\n * Flatten nested object with max depth\n *\n * @param target Object\n * @param maxDepth max depth\n *\n * @returns A flattened object.\n */\n\nconst flattenObject = <Value = any>(\n target: Record<string, Value> | undefined | null,\n maxDepth = Infinity\n): MayBe<Partial<Record<string, any>>> => {\n if ((!isObject(target) && !Array.isArray(target)) || !maxDepth) {\n return target;\n }\n\n return Object.entries(target).reduce<Partial<Record<string, any>>>((result, [key, value]) => {\n if (isObject(value) || Array.isArray(value)) {\n Object.entries(flattenObject(value, maxDepth - 1) as Partial<Record<string, any>>).forEach(\n ([childKey, childValue]) => {\n result[`${key}.${childKey}`] = childValue;\n }\n );\n } else {\n result[key] = value;\n }\n\n return result;\n }, {});\n};\n\nexport default flattenObject;\n"]} | ||
| {"version":3,"sources":["../../src/flattenObject/index.ts"],"names":["isObject","flattenObject","target","maxDepth","result","key","value","childKey","childValue","flattenObject_default"],"mappings":"AACA,OAAOA,MAAc,cAWrB,MAAMC,EAAgB,CACpBC,EACAC,EAAW,MAEN,CAACH,EAASE,CAAM,GAAK,CAAC,MAAM,QAAQA,CAAM,GAAM,CAACC,EAC7CD,EAGF,OAAO,QAAQA,CAAM,EAAE,OAAqC,CAACE,EAAQ,CAACC,EAAKC,CAAK,KACjFN,EAASM,CAAK,GAAK,MAAM,QAAQA,CAAK,EACxC,OAAO,QAAQL,EAAcK,EAAOH,EAAW,CAAC,CAAiC,EAAE,QACjF,CAAC,CAACI,EAAUC,CAAU,IAAM,CAC1BJ,EAAO,GAAGC,KAAOE,GAAU,EAAIC,CACjC,CACF,EAEAJ,EAAOC,CAAG,EAAIC,EAGTF,GACN,CAAC,CAAC,EAGP,IAAOK,EAAQR","sourcesContent":["import type { MayBe } from '@asherng/common-types';\nimport isObject from '../isObject';\n\n/**\n * Flatten nested object with max depth\n *\n * @param target Object\n * @param maxDepth max depth\n *\n * @returns A flattened object.\n */\n\nconst flattenObject = <Value = any>(\n target: Record<string, Value> | undefined | null,\n maxDepth = Infinity\n): MayBe<Partial<Record<string, any>>> => {\n if ((!isObject(target) && !Array.isArray(target)) || !maxDepth) {\n return target;\n }\n\n return Object.entries(target).reduce<Partial<Record<string, any>>>((result, [key, value]) => {\n if (isObject(value) || Array.isArray(value)) {\n Object.entries(flattenObject(value, maxDepth - 1) as Partial<Record<string, any>>).forEach(\n ([childKey, childValue]) => {\n result[`${key}.${childKey}`] = childValue;\n }\n );\n } else {\n result[key] = value;\n }\n\n return result;\n }, {});\n};\n\nexport default flattenObject;\n"]} |
| 'use strict'; | ||
| const c=()=>{const r=new WeakMap,i=({data:n,path:e,fallback:o})=>{if(e===void 0)return o;const s=typeof e=="string"?e.split("."):[e];let t=n;for(let u=0;u<s.length&&t;u+=1)t=t[s[u]];return t!=null?t:o};return ({data:n,path:e,fallback:o})=>{if(typeof n=="undefined")return i({data:n,path:e,fallback:o});r.has(n)||r.set(n,new Map);const s=r.get(n);if(s.has(e))return s.get(e);const t=i({data:n,path:e,fallback:o});return s.set(e,t),t}},f=c();var m=f; | ||
| const c=()=>{const r=new WeakMap,i=({data:n,path:e,fallback:o})=>{if(e===void 0)return o;const s=typeof e=="string"?e.split("."):[e];let t=n;for(let u=0;u<s.length&&t;u+=1)t=t[s[u]];return t!=null?t:o};return ({data:n,path:e,fallback:o})=>{if(typeof n=="undefined")return i({data:n,path:e,fallback:o});r.has(n)||r.set(n,new Map);const s=r.get(n);if(s.has(e))return s.get(e);const t=i({data:n,path:e,fallback:o});return s.set(e,t),t}},f=c();var V=f; | ||
| module.exports = m; | ||
| module.exports = V; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=getNestedObjectValue.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const c=()=>{const r=new WeakMap,i=({data:n,path:e,fallback:o})=>{if(e===void 0)return o;const s=typeof e=="string"?e.split("."):[e];let t=n;for(let u=0;u<s.length&&t;u+=1)t=t[s[u]];return t!=null?t:o};return ({data:n,path:e,fallback:o})=>{if(typeof n=="undefined")return i({data:n,path:e,fallback:o});r.has(n)||r.set(n,new Map);const s=r.get(n);if(s.has(e))return s.get(e);const t=i({data:n,path:e,fallback:o});return s.set(e,t),t}},f=c();var d=f; | ||
| const c=()=>{const r=new WeakMap,i=({data:n,path:e,fallback:o})=>{if(e===void 0)return o;const s=typeof e=="string"?e.split("."):[e];let t=n;for(let u=0;u<s.length&&t;u+=1)t=t[s[u]];return t!=null?t:o};return ({data:n,path:e,fallback:o})=>{if(typeof n=="undefined")return i({data:n,path:e,fallback:o});r.has(n)||r.set(n,new Map);const s=r.get(n);if(s.has(e))return s.get(e);const t=i({data:n,path:e,fallback:o});return s.set(e,t),t}},f=c();var m=f; | ||
| export { m as default }; | ||
| export { d as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=getNestedObjectValue.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/getNestedObjectValue/getNestedObjectValue.ts"],"names":["memoizeGetValue","cache","fn","data","path","fallback","key","current","i","map","value","getNestedObjectValue","getNestedObjectValue_default"],"mappings":"8BAEA,MAAMA,EAAkB,IAAM,CAC5B,MAAMC,EAAQ,IAAI,QAEZC,EAA2B,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,CAAS,IAAM,CAC7D,GAAID,IAAS,OACX,OAAOC,EAGT,MAAMC,EAAM,OAAOF,GAAS,SAAWA,EAAK,MAAM,GAAG,EAAI,CAACA,CAAI,EAE9D,IAAIG,EAAUJ,EAEd,QAASK,EAAI,EAAGA,EAAIF,EAAI,QACjBC,EADyBC,GAAK,EAKnCD,EAAUA,EAAQD,EAAIE,CAAC,CAAC,EAG1B,OAAOD,GAAA,KAAAA,EAAWF,CACpB,EAwBA,MAtBgD,CAAC,CAAE,KAAAF,EAAM,KAAAC,EAAM,SAAAC,CAAS,IAAM,CAC5E,GAAI,OAAOF,GAAS,YAClB,OAAOD,EAAG,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,CAAS,CAAC,EAG/BJ,EAAM,IAAIE,CAAI,GACjBF,EAAM,IAAIE,EAAM,IAAI,GAAK,EAG3B,MAAMM,EAAMR,EAAM,IAAIE,CAAI,EAE1B,GAAIM,EAAI,IAAIL,CAAI,EACd,OAAOK,EAAI,IAAIL,CAAI,EAGrB,MAAMM,EAAQR,EAAG,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,CAAS,CAAC,EAEzC,OAAAI,EAAI,IAAIL,EAAMM,CAAK,EAEZA,CACT,CAGF,EAYMC,EAAuBX,EAAgB,EAE7C,IAAOY,EAAQD","sourcesContent":["import type { GetNestedObjectValue } from './types';\n\nconst memoizeGetValue = () => {\n const cache = new WeakMap();\n\n const fn: GetNestedObjectValue = ({ data, path, fallback }) => {\n if (path === undefined) {\n return fallback;\n }\n\n const key = typeof path === 'string' ? path.split('.') : [path];\n\n let current = data;\n\n for (let i = 0; i < key.length; i += 1) {\n if (!current) {\n break;\n }\n\n current = current[key[i]];\n }\n\n return current ?? fallback;\n };\n\n const _memoizedGetValue: GetNestedObjectValue = ({ data, path, fallback }) => {\n if (typeof data === 'undefined') {\n return fn({ data, path, fallback });\n }\n\n if (!cache.has(data)) {\n cache.set(data, new Map());\n }\n\n const map = cache.get(data);\n\n if (map.has(path)) {\n return map.get(path);\n }\n\n const value = fn({ data, path, fallback });\n\n map.set(path, value);\n\n return value;\n };\n\n return _memoizedGetValue;\n};\n\n/**\n * Get nested object value by path\n *\n * @param {data} params.data - Object or array\n * @param {path} params.path - String or number\n * @param {fallback} params.fallback - A fallback value\n *\n * @returns Value or undefined\n */\n\nconst getNestedObjectValue = memoizeGetValue();\n\nexport default getNestedObjectValue;\n"]} | ||
| {"version":3,"sources":["../../src/getNestedObjectValue/getNestedObjectValue.ts"],"names":["memoizeGetValue","cache","fn","data","path","fallback","key","current","i","map","value","getNestedObjectValue","getNestedObjectValue_default"],"mappings":"AAEA,MAAMA,EAAkB,IAAM,CAC5B,MAAMC,EAAQ,IAAI,QAEZC,EAA2B,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,CAAS,IAAM,CAC7D,GAAID,IAAS,OACX,OAAOC,EAGT,MAAMC,EAAM,OAAOF,GAAS,SAAWA,EAAK,MAAM,GAAG,EAAI,CAACA,CAAI,EAE9D,IAAIG,EAAUJ,EAEd,QAASK,EAAI,EAAGA,EAAIF,EAAI,QACjBC,EADyBC,GAAK,EAKnCD,EAAUA,EAAQD,EAAIE,CAAC,CAAC,EAG1B,OAAOD,GAAA,KAAAA,EAAWF,CACpB,EAwBA,MAtBgD,CAAC,CAAE,KAAAF,EAAM,KAAAC,EAAM,SAAAC,CAAS,IAAM,CAC5E,GAAI,OAAOF,GAAS,YAClB,OAAOD,EAAG,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,CAAS,CAAC,EAG/BJ,EAAM,IAAIE,CAAI,GACjBF,EAAM,IAAIE,EAAM,IAAI,GAAK,EAG3B,MAAMM,EAAMR,EAAM,IAAIE,CAAI,EAE1B,GAAIM,EAAI,IAAIL,CAAI,EACd,OAAOK,EAAI,IAAIL,CAAI,EAGrB,MAAMM,EAAQR,EAAG,CAAE,KAAAC,EAAM,KAAAC,EAAM,SAAAC,CAAS,CAAC,EAEzC,OAAAI,EAAI,IAAIL,EAAMM,CAAK,EAEZA,CACT,CAGF,EAYMC,EAAuBX,EAAgB,EAE7C,IAAOY,EAAQD","sourcesContent":["import type { GetNestedObjectValue } from './types';\n\nconst memoizeGetValue = () => {\n const cache = new WeakMap();\n\n const fn: GetNestedObjectValue = ({ data, path, fallback }) => {\n if (path === undefined) {\n return fallback;\n }\n\n const key = typeof path === 'string' ? path.split('.') : [path];\n\n let current = data;\n\n for (let i = 0; i < key.length; i += 1) {\n if (!current) {\n break;\n }\n\n current = current[key[i]];\n }\n\n return current ?? fallback;\n };\n\n const _memoizedGetValue: GetNestedObjectValue = ({ data, path, fallback }) => {\n if (typeof data === 'undefined') {\n return fn({ data, path, fallback });\n }\n\n if (!cache.has(data)) {\n cache.set(data, new Map());\n }\n\n const map = cache.get(data);\n\n if (map.has(path)) {\n return map.get(path);\n }\n\n const value = fn({ data, path, fallback });\n\n map.set(path, value);\n\n return value;\n };\n\n return _memoizedGetValue;\n};\n\n/**\n * Get nested object value by path\n *\n * @param {data} params.data - Object or array\n * @param {path} params.path - String or number\n * @param {fallback} params.fallback - A fallback value\n *\n * @returns Value or undefined\n */\n\nconst getNestedObjectValue = memoizeGetValue();\n\nexport default getNestedObjectValue;\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './getNestedObjectValue'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/getNestedObjectValue/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './getNestedObjectValue';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/getNestedObjectValue/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './getNestedObjectValue';\n\nexport type * from './types';\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './isEmpty'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/isEmpty/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './isEmpty';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/isEmpty/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './isEmpty';\n\nexport type * from './types';\n"]} |
| 'use strict'; | ||
| const t=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;var n=t; | ||
| const t=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;var c=t; | ||
| module.exports = n; | ||
| module.exports = c; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isEmpty.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const t=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;var s=t; | ||
| const t=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;var n=t; | ||
| export { n as default }; | ||
| export { s as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isEmpty.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/isEmpty/isEmpty.ts"],"names":["isEmpty","obj","isEmpty_default"],"mappings":"8BAEA,MAAMA,EACJC,GAEA,CAAC,OAAQ,KAAK,EAAE,UAAWA,GAAe,CAAC,GAAG,WAAW,GAAK,CAAC,OAAO,QAAQA,GAAO,CAAC,CAAC,EAAE,OAE3F,IAAOC,EAAQF","sourcesContent":["import type { EmptyObjectOf } from './types';\n\nconst isEmpty = <T extends object>(\n obj: T | null | undefined\n): obj is EmptyObjectOf<T> | null | undefined =>\n [Object, Array].includes(((obj as any) || {}).constructor) && !Object.entries(obj || {}).length;\n\nexport default isEmpty;\n"]} | ||
| {"version":3,"sources":["../../src/isEmpty/isEmpty.ts"],"names":["isEmpty","obj","isEmpty_default"],"mappings":"AAEA,MAAMA,EACJC,GAEA,CAAC,OAAQ,KAAK,EAAE,UAAWA,GAAe,CAAC,GAAG,WAAW,GAAK,CAAC,OAAO,QAAQA,GAAO,CAAC,CAAC,EAAE,OAE3F,IAAOC,EAAQF","sourcesContent":["import type { EmptyObjectOf } from './types';\n\nconst isEmpty = <T extends object>(\n obj: T | null | undefined\n): obj is EmptyObjectOf<T> | null | undefined =>\n [Object, Array].includes(((obj as any) || {}).constructor) && !Object.entries(obj || {}).length;\n\nexport default isEmpty;\n"]} |
| 'use strict'; | ||
| const t=n=>typeof n=="function";var e=t; | ||
| const t=n=>typeof n=="function";var o=t; | ||
| module.exports = e; | ||
| module.exports = o; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const t=n=>typeof n=="function";var u=t; | ||
| const t=n=>typeof n=="function";var e=t; | ||
| export { e as default }; | ||
| export { u as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/isFunction/index.ts"],"names":["isFunction","value","isFunction_default"],"mappings":"8BAMA,MAAMA,EAA4BC,GAA+B,OAAOA,GAAU,WAElF,IAAOC,EAAQF","sourcesContent":["/**\n * @desc check if value is function\n * @param value\n * @returns {boolean}\n */\n\nconst isFunction = <T extends {}>(value: unknown): value is T => typeof value === 'function';\n\nexport default isFunction;\n"]} | ||
| {"version":3,"sources":["../../src/isFunction/index.ts"],"names":["isFunction","value","isFunction_default"],"mappings":"AAMA,MAAMA,EAA4BC,GAA+B,OAAOA,GAAU,WAElF,IAAOC,EAAQF","sourcesContent":["/**\n * @desc check if value is function\n * @param value\n * @returns {boolean}\n */\n\nconst isFunction = <T extends {}>(value: unknown): value is T => typeof value === 'function';\n\nexport default isFunction;\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './isNil'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/isNil/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './isNil';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/isNil/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './isNil';\n\nexport type * from './types';\n"]} |
| 'use strict'; | ||
| const t=i=>i==null;var e=t; | ||
| const t=i=>i==null;var l=t; | ||
| module.exports = e; | ||
| module.exports = l; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isNil.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const t=i=>i==null;var s=t; | ||
| const t=i=>i==null;var e=t; | ||
| export { e as default }; | ||
| export { s as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isNil.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/isNil/isNil.ts"],"names":["isNil","value","isNil_default"],"mappings":"8BAEA,MAAMA,EAAeC,GAASA,GAAU,KAExC,IAAOC,EAAQF","sourcesContent":["import type { IsNil } from './types';\n\nconst isNil: IsNil = value => value === null || value === undefined;\n\nexport default isNil;\n"]} | ||
| {"version":3,"sources":["../../src/isNil/isNil.ts"],"names":["isNil","value","isNil_default"],"mappings":"AAEA,MAAMA,EAAeC,GAASA,GAAU,KAExC,IAAOC,EAAQF","sourcesContent":["import type { IsNil } from './types';\n\nconst isNil: IsNil = value => value === null || value === undefined;\n\nexport default isNil;\n"]} |
| 'use strict'; | ||
| const r=n=>{const t=typeof n;return n!=null&&(t==="object"||t==="function")&&!Array.isArray(n)};var o=r; | ||
| const r=n=>{const t=typeof n;return n!=null&&(t==="object"||t==="function")&&!Array.isArray(n)};var e=r; | ||
| module.exports = o; | ||
| module.exports = e; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const r=n=>{const t=typeof n;return n!=null&&(t==="object"||t==="function")&&!Array.isArray(n)};var c=r; | ||
| const r=n=>{const t=typeof n;return n!=null&&(t==="object"||t==="function")&&!Array.isArray(n)};var o=r; | ||
| export { o as default }; | ||
| export { c as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/isObject/index.ts"],"names":["isObject","value","type","isObject_default"],"mappings":"8BAWA,MAAMA,EAAYC,GAAiD,CACjE,MAAMC,EAAO,OAAOD,EAEpB,OAAOA,GAAS,OAASC,IAAS,UAAYA,IAAS,aAAe,CAAC,MAAM,QAAQD,CAAK,CAC5F,EAEA,IAAOE,EAAQH","sourcesContent":["/**\n * @desc check if value is object\n * @param value\n * @returns {boolean}\n * @example\n * isObject({}); // true\n * isObject(null); // false\n * isObject(undefined); // false\n * isObject(1); // false\n */\n\nconst isObject = (value: unknown): value is Record<string, any> => {\n const type = typeof value;\n\n return value != null && (type === 'object' || type === 'function') && !Array.isArray(value);\n};\n\nexport default isObject;\n"]} | ||
| {"version":3,"sources":["../../src/isObject/index.ts"],"names":["isObject","value","type","isObject_default"],"mappings":"AAWA,MAAMA,EAAYC,GAAiD,CACjE,MAAMC,EAAO,OAAOD,EAEpB,OAAOA,GAAS,OAASC,IAAS,UAAYA,IAAS,aAAe,CAAC,MAAM,QAAQD,CAAK,CAC5F,EAEA,IAAOE,EAAQH","sourcesContent":["/**\n * @desc check if value is object\n * @param value\n * @returns {boolean}\n * @example\n * isObject({}); // true\n * isObject(null); // false\n * isObject(undefined); // false\n * isObject(1); // false\n */\n\nconst isObject = (value: unknown): value is Record<string, any> => {\n const type = typeof value;\n\n return value != null && (type === 'object' || type === 'function') && !Array.isArray(value);\n};\n\nexport default isObject;\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './limitNumber'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/limitNumber/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './limitNumber';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/limitNumber/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './limitNumber';\n\nexport type * from './types';\n"]} |
| 'use strict'; | ||
| const e=({value:t,max:m,min:i})=>Math.max(i,Math.min(m,t));var r=e; | ||
| const e=({value:t,max:m,min:i})=>Math.max(i,Math.min(m,t));var a=e; | ||
| module.exports = r; | ||
| module.exports = a; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=limitNumber.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const e=({value:t,max:m,min:i})=>Math.max(i,Math.min(m,t));var o=e; | ||
| const e=({value:t,max:m,min:i})=>Math.max(i,Math.min(m,t));var r=e; | ||
| export { r as default }; | ||
| export { o as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=limitNumber.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/limitNumber/limitNumber.ts"],"names":["limitNumber","value","max","min","limitNumber_default"],"mappings":"8BAEA,MAAMA,EAA2B,CAAC,CAAE,MAAAC,EAAO,IAAAC,EAAK,IAAAC,CAAI,IAAM,KAAK,IAAIA,EAAK,KAAK,IAAID,EAAKD,CAAK,CAAC,EAE5F,IAAOG,EAAQJ","sourcesContent":["import type { LimitNumber } from './types';\n\nconst limitNumber: LimitNumber = ({ value, max, min }) => Math.max(min, Math.min(max, value));\n\nexport default limitNumber;\n"]} | ||
| {"version":3,"sources":["../../src/limitNumber/limitNumber.ts"],"names":["limitNumber","value","max","min","limitNumber_default"],"mappings":"AAEA,MAAMA,EAA2B,CAAC,CAAE,MAAAC,EAAO,IAAAC,EAAK,IAAAC,CAAI,IAAM,KAAK,IAAIA,EAAK,KAAK,IAAID,EAAKD,CAAK,CAAC,EAE5F,IAAOG,EAAQJ","sourcesContent":["import type { LimitNumber } from './types';\n\nconst limitNumber: LimitNumber = ({ value, max, min }) => Math.max(min, Math.min(max, value));\n\nexport default limitNumber;\n"]} |
| 'use strict'; | ||
| const a=(e,T)=>T.reduce((t,r)=>(e&&Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{});var n=a; | ||
| const a=(e,T)=>T.reduce((t,r)=>(e&&Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{});var s=a; | ||
| module.exports = n; | ||
| module.exports = s; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const a=(e,T)=>T.reduce((t,r)=>(e&&Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{});var c=a; | ||
| const a=(e,T)=>T.reduce((t,r)=>(e&&Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{});var n=a; | ||
| export { n as default }; | ||
| export { c as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/pick/index.ts"],"names":["pick","object","keys","obj","key","pick_default"],"mappings":"8BAQA,MAAMA,EAAO,CAAeC,EAAWC,IACrCA,EAAK,OAAO,CAACC,EAAKC,KACZH,GAAU,OAAO,eAAe,KAAKA,EAAQG,CAAG,IAClDD,EAAIC,CAAG,EAAIH,EAAOG,CAAG,GAGhBD,GACN,CAAC,CAAM,EAEZ,IAAOE,EAAQL","sourcesContent":["/**\n * pick\n * @desc Returns a partial copy of an object containing only the keys specified.\n * @param {Object} object\n * @param {Array} keys\n * @returns {Object}\n */\n\nconst pick = <T extends {}>(object: T, keys: (keyof T)[]): T =>\n keys.reduce((obj, key) => {\n if (object && Object.hasOwnProperty.call(object, key)) {\n obj[key] = object[key];\n }\n\n return obj;\n }, {} as T);\n\nexport default pick;\n"]} | ||
| {"version":3,"sources":["../../src/pick/index.ts"],"names":["pick","object","keys","obj","key","pick_default"],"mappings":"AAQA,MAAMA,EAAO,CAAeC,EAAWC,IACrCA,EAAK,OAAO,CAACC,EAAKC,KACZH,GAAU,OAAO,eAAe,KAAKA,EAAQG,CAAG,IAClDD,EAAIC,CAAG,EAAIH,EAAOG,CAAG,GAGhBD,GACN,CAAC,CAAM,EAEZ,IAAOE,EAAQL","sourcesContent":["/**\n * pick\n * @desc Returns a partial copy of an object containing only the keys specified.\n * @param {Object} object\n * @param {Array} keys\n * @returns {Object}\n */\n\nconst pick = <T extends {}>(object: T, keys: (keyof T)[]): T =>\n keys.reduce((obj, key) => {\n if (object && Object.hasOwnProperty.call(object, key)) {\n obj[key] = object[key];\n }\n\n return obj;\n }, {} as T);\n\nexport default pick;\n"]} |
| 'use strict'; | ||
| const r=(n,a)=>{const e={};for(const[o,t]of Object.entries(n))a(t,o)&&(e[o]=t);return e};var T=r; | ||
| const r=(n,a)=>{const e={};for(const[o,t]of Object.entries(n))a(t,o)&&(e[o]=t);return e};var f=r; | ||
| module.exports = T; | ||
| module.exports = f; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const r=(n,a)=>{const e={};for(const[o,t]of Object.entries(n))a(t,o)&&(e[o]=t);return e};var k=r; | ||
| const r=(n,a)=>{const e={};for(const[o,t]of Object.entries(n))a(t,o)&&(e[o]=t);return e};var T=r; | ||
| export { T as default }; | ||
| export { k as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/pickBy/index.ts"],"names":["pickBy","obj","predicate","result","key","value","pickBy_default"],"mappings":"8BAOA,MAAMA,EAAS,CACbC,EACAC,IACe,CACf,MAAMC,EAAqB,CAAC,EAE5B,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAAQJ,CAAG,EACvCC,EAAUG,EAAOD,CAAG,IACtBD,EAAOC,CAAG,EAAIC,GAIlB,OAAOF,CACT,EAEA,IAAOG,EAAQN","sourcesContent":["/**\n * @desc Returns a partial copy of an object containing only the keys that satisfy the provided testing function.\n * @param obj\n * @param predicate\n * @returns Partial<T>\n */\n\nconst pickBy = <T extends {}>(\n obj: T,\n predicate: (value: unknown, key: keyof T) => boolean\n): Partial<T> => {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj) as [keyof T, T[keyof T]][]) {\n if (predicate(value, key)) {\n result[key] = value;\n }\n }\n\n return result;\n};\n\nexport default pickBy;\n"]} | ||
| {"version":3,"sources":["../../src/pickBy/index.ts"],"names":["pickBy","obj","predicate","result","key","value","pickBy_default"],"mappings":"AAOA,MAAMA,EAAS,CACbC,EACAC,IACe,CACf,MAAMC,EAAqB,CAAC,EAE5B,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAAQJ,CAAG,EACvCC,EAAUG,EAAOD,CAAG,IACtBD,EAAOC,CAAG,EAAIC,GAIlB,OAAOF,CACT,EAEA,IAAOG,EAAQN","sourcesContent":["/**\n * @desc Returns a partial copy of an object containing only the keys that satisfy the provided testing function.\n * @param obj\n * @param predicate\n * @returns Partial<T>\n */\n\nconst pickBy = <T extends {}>(\n obj: T,\n predicate: (value: unknown, key: keyof T) => boolean\n): Partial<T> => {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj) as [keyof T, T[keyof T]][]) {\n if (predicate(value, key)) {\n result[key] = value;\n }\n }\n\n return result;\n};\n\nexport default pickBy;\n"]} |
@@ -9,6 +9,6 @@ 'use strict'; | ||
| const n=(o,...t)=>f__default.default(o)?o(...t):o;var i=n; | ||
| const n=(o,...t)=>f__default.default(o)?o(...t):o;var r=n; | ||
| module.exports = i; | ||
| module.exports = r; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,8 +0,7 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| import f from '../isFunction'; | ||
| const n=(o,...t)=>f(o)?o(...t):o;var i=n; | ||
| const n=(o,...t)=>f(o)?o(...t):o;var s=n; | ||
| export { i as default }; | ||
| export { s as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/runIfFn/index.ts"],"names":["isFunction","runIfFn","valueOrFn","args","runIfFn_default"],"mappings":"8BAAA,OAAOA,MAAgB,gBAWvB,MAAMC,EAAU,CAAOC,KAA2CC,IAChEH,EAAWE,CAAS,EAAIA,EAAU,GAAGC,CAAI,EAAID,EAE/C,IAAOE,EAAQH","sourcesContent":["import isFunction from '../isFunction';\n\n/**\n * Run if the passed parameter is a function or return it if not.\n *\n * @param {valueOrFn} - Input as function or other data type\n * @param {arguments} - Arguments of the input function\n *\n * @returns The same input or returned value of input function\n */\n\nconst runIfFn = <T, U>(valueOrFn: T | ((...fnArgs: U[]) => T), ...args: U[]): T =>\n isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;\n\nexport default runIfFn;\n"]} | ||
| {"version":3,"sources":["../../src/runIfFn/index.ts"],"names":["isFunction","runIfFn","valueOrFn","args","runIfFn_default"],"mappings":"AAAA,OAAOA,MAAgB,gBAWvB,MAAMC,EAAU,CAAOC,KAA2CC,IAChEH,EAAWE,CAAS,EAAIA,EAAU,GAAGC,CAAI,EAAID,EAE/C,IAAOE,EAAQH","sourcesContent":["import isFunction from '../isFunction';\n\n/**\n * Run if the passed parameter is a function or return it if not.\n *\n * @param {valueOrFn} - Input as function or other data type\n * @param {arguments} - Arguments of the input function\n *\n * @returns The same input or returned value of input function\n */\n\nconst runIfFn = <T, U>(valueOrFn: T | ((...fnArgs: U[]) => T), ...args: U[]): T =>\n isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;\n\nexport default runIfFn;\n"]} |
@@ -1,4 +0,3 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './setRef'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/setRef/index.ts"],"names":["default"],"mappings":"8BAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './setRef';\n\nexport type * from './types';\n"]} | ||
| {"version":3,"sources":["../../src/setRef/index.ts"],"names":["default"],"mappings":"AAAA,OAAS,WAAAA,MAAe","sourcesContent":["export { default } from './setRef';\n\nexport type * from './types';\n"]} |
| 'use strict'; | ||
| const f=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e);};var o=f; | ||
| const f=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e);};var p=f; | ||
| module.exports = o; | ||
| module.exports = p; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=setRef.js.map |
@@ -1,7 +0,5 @@ | ||
| import '../chunk-KHSOYKNK.mjs'; | ||
| const f=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e);};var i=f; | ||
| const f=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e);};var o=f; | ||
| export { o as default }; | ||
| export { i as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=setRef.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../../src/setRef/setRef.ts"],"names":["setRef","ref","value","setRef_default"],"mappings":"8BAEA,MAAMA,EAAiB,CAACC,EAAKC,IAAU,CACjC,OAAOD,GAAQ,WACjBA,EAAIC,CAAK,EACAD,IACTA,EAAI,QAAUC,EAElB,EAEA,IAAOC,EAAQH","sourcesContent":["import type { SetRef } from './types';\n\nconst setRef: SetRef = (ref, value) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n};\n\nexport default setRef;\n"]} | ||
| {"version":3,"sources":["../../src/setRef/setRef.ts"],"names":["setRef","ref","value","setRef_default"],"mappings":"AAEA,MAAMA,EAAiB,CAACC,EAAKC,IAAU,CACjC,OAAOD,GAAQ,WACjBA,EAAIC,CAAK,EACAD,IACTA,EAAI,QAAUC,EAElB,EAEA,IAAOC,EAAQH","sourcesContent":["import type { SetRef } from './types';\n\nconst setRef: SetRef = (ref, value) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n};\n\nexport default setRef;\n"]} |
+2
-2
| { | ||
| "name": "@asherng/utils", | ||
| "version": "1.0.9", | ||
| "version": "1.0.10", | ||
| "description": "UI Utils", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
| "typescript": "5.4.3", | ||
| "@asherng/common-types": "^1.0.9" | ||
| "@asherng/common-types": "^1.0.10" | ||
| }, | ||
@@ -38,0 +38,0 @@ "gitHead": "c4702ddc44863e127b8f57ceee1141daecad5d35", |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
55775
-0.46%384
-5.19%