@asherng/utils
Advanced tools
| import { ArrayFromNumber } from './types.js'; | ||
| /** | ||
| * Generate array containing from 1...num. | ||
| * | ||
| * @param num length of the array. | ||
| * @returns array of numbers from 1...num. | ||
| */ | ||
| declare const arrayFromNumber: ArrayFromNumber; | ||
| export { arrayFromNumber as default }; |
| 'use strict'; | ||
| const o=r=>Array.from(Array(r),(a,m)=>m);var e=o; | ||
| module.exports = e; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=arrayFromNumber.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const o=r=>Array.from(Array(r),(a,m)=>m);var e=o; | ||
| export { e as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=arrayFromNumber.mjs.map |
| {"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"]} |
| export { default } from './arrayFromNumber.js'; | ||
| export { ArrayFromNumber } from './types.js'; |
| 'use strict'; | ||
| var arrayFromNumber = require('./arrayFromNumber'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var arrayFromNumber__default = /*#__PURE__*/_interopDefault(arrayFromNumber); | ||
| module.exports = arrayFromNumber__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './arrayFromNumber'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| type ArrayFromNumber = (num: number) => number[]; | ||
| export { ArrayFromNumber }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| /** | ||
| * @desc Check if the current environment is a browser | ||
| * @return {Boolean} | ||
| */ | ||
| declare const canUseDOM: () => boolean; | ||
| export { canUseDOM as default }; |
| 'use strict'; | ||
| const e=()=>!!(typeof window!="undefined"&&window.document&&window.document.createElement);var n=e; | ||
| module.exports = n; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const e=()=>!!(typeof window!="undefined"&&window.document&&window.document.createElement);var n=e; | ||
| export { n as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| /** | ||
| * @desc Check if the current environment supports IntersectionObserver | ||
| * @return {Boolean} | ||
| */ | ||
| declare const canUseIntersectionObserver: () => boolean; | ||
| export { canUseIntersectionObserver as default }; |
| 'use strict'; | ||
| const e=()=>typeof window!="undefined"&&"IntersectionObserver"in window;var n=e; | ||
| module.exports = n; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const e=()=>typeof window!="undefined"&&"IntersectionObserver"in window;var n=e; | ||
| export { n as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| var i=Object.defineProperty;var e=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(a,c,b)=>c in a?i(a,c,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[c]=b,j=(a,c)=>{for(var b in c||(c={}))g.call(c,b)&&f(a,b,c[b]);if(e)for(var b of e(c))h.call(c,b)&&f(a,b,c[b]);return a};var k=(a,c)=>{var b={};for(var d in a)g.call(a,d)&&c.indexOf(d)<0&&(b[d]=a[d]);if(a!=null&&e)for(var d of e(a))c.indexOf(d)<0&&h.call(a,d)&&(b[d]=a[d]);return b}; | ||
| export { j as a, k as b }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=chunk-KHSOYKNK.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]} |
| import { Cx, ClassValue, Config, Props } from './types.js'; | ||
| declare const cx: Cx; | ||
| declare const cv: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string; | ||
| export { cx, cv as default }; |
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| 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; | ||
| exports.cx = k; | ||
| exports.default = w; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=cv.js.map |
| {"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"]} |
| import { b, a } from '../chunk-KHSOYKNK.mjs'; | ||
| 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 }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=cv.mjs.map |
| {"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"]} |
| export { default } from './cv.js'; | ||
| export { ClassProp, ClassPropKey, ClassValue, Config, Cx, OmitUndefined, Props, StringToBoolean, VariantProps } from './types.js'; |
| 'use strict'; | ||
| var cv = require('./cv'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var cv__default = /*#__PURE__*/_interopDefault(cv); | ||
| module.exports = cv__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './cv'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| type ClassPropKey = 'class' | 'className'; | ||
| type ClassValue = string | null | undefined | ClassValue[]; | ||
| type ClassProp = { | ||
| class: ClassValue; | ||
| className?: never; | ||
| } | { | ||
| class?: never; | ||
| className: ClassValue; | ||
| } | { | ||
| class?: never; | ||
| className?: never; | ||
| }; | ||
| type OmitUndefined<T> = T extends undefined ? never : T; | ||
| type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T; | ||
| type VariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, 'class' | 'className'>; | ||
| type Cx = (...classes: ClassValue[]) => string; | ||
| type ConfigSchema = Record<string, Record<string, ClassValue>>; | ||
| type ConfigVariants<T extends ConfigSchema> = { | ||
| [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined; | ||
| }; | ||
| type ConfigVariantsMulti<T extends ConfigSchema> = { | ||
| [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined; | ||
| }; | ||
| type Config<T> = T extends ConfigSchema ? { | ||
| variants?: T; | ||
| defaultVariants?: ConfigVariants<T>; | ||
| compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[]; | ||
| } : never; | ||
| type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp; | ||
| export { ClassProp, ClassPropKey, ClassValue, Config, Cx, OmitUndefined, Props, StringToBoolean, VariantProps }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| import { MayBe } from '@asherng/common-types'; | ||
| /** | ||
| * Flatten nested object with max depth | ||
| * | ||
| * @param target Object | ||
| * @param maxDepth max depth | ||
| * | ||
| * @returns A flattened object. | ||
| */ | ||
| declare const flattenObject: <Value = any>(target: Record<string, Value> | undefined | null, maxDepth?: number) => MayBe<Partial<Record<string, any>>>; | ||
| export { flattenObject as default }; |
| 'use strict'; | ||
| var a = require('../isObject'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var a__default = /*#__PURE__*/_interopDefault(a); | ||
| 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; | ||
| module.exports = f; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| 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; | ||
| export { f as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| import { GetNestedObjectValue } from './types.js'; | ||
| /** | ||
| * Get nested object value by path | ||
| * | ||
| * @param {data} params.data - Object or array | ||
| * @param {path} params.path - String or number | ||
| * @param {fallback} params.fallback - A fallback value | ||
| * | ||
| * @returns Value or undefined | ||
| */ | ||
| declare const getNestedObjectValue: GetNestedObjectValue; | ||
| export { getNestedObjectValue as default }; |
| '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; | ||
| module.exports = m; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=getNestedObjectValue.js.map |
| {"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"]} |
| 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 m=f; | ||
| export { m as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=getNestedObjectValue.mjs.map |
| {"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"]} |
| export { default } from './getNestedObjectValue.js'; | ||
| export { GetNestedObjectValue, GetNestedObjectValueParams } from './types.js'; |
| 'use strict'; | ||
| var getNestedObjectValue = require('./getNestedObjectValue'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var getNestedObjectValue__default = /*#__PURE__*/_interopDefault(getNestedObjectValue); | ||
| module.exports = getNestedObjectValue__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './getNestedObjectValue'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| interface GetNestedObjectValueParams<T = any> { | ||
| data: any; | ||
| path?: string | number; | ||
| fallback?: T; | ||
| } | ||
| type GetNestedObjectValue = <T = any>(params: GetNestedObjectValueParams<T>) => T | undefined; | ||
| export { GetNestedObjectValue, GetNestedObjectValueParams }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| export { default } from './isEmpty.js'; | ||
| export { EmptyObject, EmptyObjectOf } from './types.js'; |
| 'use strict'; | ||
| var isEmpty = require('./isEmpty'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty); | ||
| module.exports = isEmpty__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './isEmpty'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| import { EmptyObjectOf } from './types.js'; | ||
| declare const isEmpty: <T extends object>(obj: T | null | undefined) => obj is EmptyObjectOf<T> | null | undefined; | ||
| export { isEmpty as default }; |
| 'use strict'; | ||
| const t=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;var n=t; | ||
| module.exports = n; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isEmpty.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const t=e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length;var n=t; | ||
| export { n as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isEmpty.mjs.map |
| {"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"]} |
| type EmptyObject<T> = { | ||
| [K in keyof T]?: never; | ||
| }; | ||
| type EmptyObjectOf<T> = EmptyObject<T> extends T ? EmptyObject<T> : never; | ||
| export { EmptyObject, EmptyObjectOf }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| /** | ||
| * @desc check if value is function | ||
| * @param value | ||
| * @returns {boolean} | ||
| */ | ||
| declare const isFunction: <T extends {}>(value: unknown) => value is T; | ||
| export { isFunction as default }; |
| 'use strict'; | ||
| const t=n=>typeof n=="function";var e=t; | ||
| module.exports = e; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const t=n=>typeof n=="function";var e=t; | ||
| export { e as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| export { default } from './isNil.js'; | ||
| export { IsNil } from './types.js'; |
| 'use strict'; | ||
| var isNil = require('./isNil'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var isNil__default = /*#__PURE__*/_interopDefault(isNil); | ||
| module.exports = isNil__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './isNil'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| import { IsNil } from './types.js'; | ||
| declare const isNil: IsNil; | ||
| export { isNil as default }; |
| 'use strict'; | ||
| const t=i=>i==null;var e=t; | ||
| module.exports = e; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isNil.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const t=i=>i==null;var e=t; | ||
| export { e as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=isNil.mjs.map |
| {"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"]} |
| type IsNil = (value: unknown) => boolean; | ||
| export { IsNil }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| /** | ||
| * @desc check if value is object | ||
| * @param value | ||
| * @returns {boolean} | ||
| * @example | ||
| * isObject({}); // true | ||
| * isObject(null); // false | ||
| * isObject(undefined); // false | ||
| * isObject(1); // false | ||
| */ | ||
| declare const isObject: (value: unknown) => value is Record<string, any>; | ||
| export { isObject as default }; |
| 'use strict'; | ||
| const r=n=>{const t=typeof n;return n!=null&&(t==="object"||t==="function")&&!Array.isArray(n)};var o=r; | ||
| module.exports = o; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const r=n=>{const t=typeof n;return n!=null&&(t==="object"||t==="function")&&!Array.isArray(n)};var o=r; | ||
| export { o as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| export { default } from './limitNumber.js'; | ||
| export { LimitNumber } from './types.js'; |
| 'use strict'; | ||
| var limitNumber = require('./limitNumber'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var limitNumber__default = /*#__PURE__*/_interopDefault(limitNumber); | ||
| module.exports = limitNumber__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './limitNumber'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| import { LimitNumber } from './types.js'; | ||
| declare const limitNumber: LimitNumber; | ||
| export { limitNumber as default }; |
| 'use strict'; | ||
| const e=({value:t,max:m,min:i})=>Math.max(i,Math.min(m,t));var r=e; | ||
| module.exports = r; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=limitNumber.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const e=({value:t,max:m,min:i})=>Math.max(i,Math.min(m,t));var r=e; | ||
| export { r as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=limitNumber.mjs.map |
| {"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"]} |
| interface LimitNumberParams { | ||
| value: number; | ||
| min: number; | ||
| max: number; | ||
| } | ||
| type LimitNumber = (params: LimitNumberParams) => number; | ||
| export { LimitNumber }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| /** | ||
| * pick | ||
| * @desc Returns a partial copy of an object containing only the keys specified. | ||
| * @param {Object} object | ||
| * @param {Array} keys | ||
| * @returns {Object} | ||
| */ | ||
| declare const pick: <T extends {}>(object: T, keys: (keyof T)[]) => T; | ||
| export { pick as default }; |
| 'use strict'; | ||
| const a=(e,T)=>T.reduce((t,r)=>(e&&Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{});var n=a; | ||
| module.exports = n; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| 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 }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| /** | ||
| * @desc Returns a partial copy of an object containing only the keys that satisfy the provided testing function. | ||
| * @param obj | ||
| * @param predicate | ||
| * @returns Partial<T> | ||
| */ | ||
| declare const pickBy: <T extends {}>(obj: T, predicate: (value: unknown, key: keyof T) => boolean) => Partial<T>; | ||
| export { pickBy as default }; |
| '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; | ||
| module.exports = T; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| 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 T=r; | ||
| export { T as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| /** | ||
| * Run if the passed parameter is a function or return it if not. | ||
| * | ||
| * @param {valueOrFn} - Input as function or other data type | ||
| * @param {arguments} - Arguments of the input function | ||
| * | ||
| * @returns The same input or returned value of input function | ||
| */ | ||
| declare const runIfFn: <T, U>(valueOrFn: T | ((...fnArgs: U[]) => T), ...args: U[]) => T; | ||
| export { runIfFn as default }; |
| 'use strict'; | ||
| var f = require('../isFunction'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var f__default = /*#__PURE__*/_interopDefault(f); | ||
| const n=(o,...t)=>f__default.default(o)?o(...t):o;var i=n; | ||
| module.exports = i; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| import f from '../isFunction'; | ||
| const n=(o,...t)=>f(o)?o(...t):o;var i=n; | ||
| export { i as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| export { default } from './setRef.js'; | ||
| export { SetRef } from './types.js'; | ||
| import '@asherng/common-types'; |
| 'use strict'; | ||
| var setRef = require('./setRef'); | ||
| function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
| var setRef__default = /*#__PURE__*/_interopDefault(setRef); | ||
| module.exports = setRef__default.default; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| export { default } from './setRef'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.mjs.map |
| {"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"]} |
| import { SetRef } from './types.js'; | ||
| import '@asherng/common-types'; | ||
| declare const setRef: SetRef; | ||
| export { setRef as default }; |
| 'use strict'; | ||
| const f=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e);};var o=f; | ||
| module.exports = o; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=setRef.js.map |
| {"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"]} |
| import '../chunk-KHSOYKNK.mjs'; | ||
| const f=(t,e)=>{typeof t=="function"?t(e):t&&(t.current=e);};var o=f; | ||
| export { o as default }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=setRef.mjs.map |
| {"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"]} |
| import { RefType } from '@asherng/common-types'; | ||
| type SetRef = <V>(ref: RefType<V>, value: V) => void; | ||
| export { SetRef }; |
| 'use strict'; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=types.mjs.map |
| {"version":3,"sources":[],"names":[],"mappings":""} |
+2
-2
| { | ||
| "name": "@asherng/utils", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "description": "UI Utils", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
| "typescript": "5.4.3", | ||
| "@asherng/common-types": "^1.0.6" | ||
| "@asherng/common-types": "^1.0.7" | ||
| }, | ||
@@ -38,0 +38,0 @@ "gitHead": "c4702ddc44863e127b8f57ceee1141daecad5d35", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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 3 instances in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
56030
2401.34%150
4900%405
Infinity%1
-50%4
300%