@vielzeug/toolkit 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/aggregate.cjs +2 -0
- package/dist/array/aggregate.cjs.map +1 -0
- package/dist/array/aggregate.js +16 -0
- package/dist/array/aggregate.js.map +1 -0
- package/dist/array/alternate.cjs +2 -0
- package/dist/array/alternate.cjs.map +1 -0
- package/dist/array/alternate.js +9 -0
- package/dist/array/alternate.js.map +1 -0
- package/dist/array/chunk.cjs +2 -0
- package/dist/array/chunk.cjs.map +1 -0
- package/dist/array/chunk.js +22 -0
- package/dist/array/chunk.js.map +1 -0
- package/dist/array/compact.cjs +2 -0
- package/dist/array/compact.cjs.map +1 -0
- package/dist/array/compact.js +9 -0
- package/dist/array/compact.js.map +1 -0
- package/dist/array/contains.cjs +2 -0
- package/dist/array/contains.cjs.map +1 -0
- package/dist/array/contains.js +11 -0
- package/dist/array/contains.js.map +1 -0
- package/dist/array/every.cjs +2 -0
- package/dist/array/every.cjs.map +1 -0
- package/dist/array/every.js +14 -0
- package/dist/array/every.js.map +1 -0
- package/dist/array/filter.cjs +2 -0
- package/dist/array/filter.cjs.map +1 -0
- package/dist/array/filter.js +14 -0
- package/dist/array/filter.js.map +1 -0
- package/dist/array/find.cjs +2 -0
- package/dist/array/find.cjs.map +1 -0
- package/dist/array/find.js +14 -0
- package/dist/array/find.js.map +1 -0
- package/dist/array/findIndex.cjs +2 -0
- package/dist/array/findIndex.cjs.map +1 -0
- package/dist/array/findIndex.js +14 -0
- package/dist/array/findIndex.js.map +1 -0
- package/dist/array/findLast.cjs +2 -0
- package/dist/array/findLast.cjs.map +1 -0
- package/dist/array/findLast.js +14 -0
- package/dist/array/findLast.js.map +1 -0
- package/dist/array/flatten.cjs +2 -0
- package/dist/array/flatten.cjs.map +1 -0
- package/dist/array/flatten.js +7 -0
- package/dist/array/flatten.js.map +1 -0
- package/dist/array/group.cjs +2 -0
- package/dist/array/group.cjs.map +1 -0
- package/dist/array/group.js +16 -0
- package/dist/array/group.js.map +1 -0
- package/dist/array/list.cjs +2 -0
- package/dist/array/list.cjs.map +1 -0
- package/dist/array/list.js +70 -0
- package/dist/array/list.js.map +1 -0
- package/dist/array/map.cjs +2 -0
- package/dist/array/map.cjs.map +1 -0
- package/dist/array/map.js +18 -0
- package/dist/array/map.js.map +1 -0
- package/dist/array/pick.cjs +2 -0
- package/dist/array/pick.cjs.map +1 -0
- package/dist/array/pick.js +15 -0
- package/dist/array/pick.js.map +1 -0
- package/dist/array/reduce.cjs +2 -0
- package/dist/array/reduce.cjs.map +1 -0
- package/dist/array/reduce.js +16 -0
- package/dist/array/reduce.js.map +1 -0
- package/dist/array/search.cjs +2 -0
- package/dist/array/search.cjs.map +1 -0
- package/dist/array/search.js +14 -0
- package/dist/array/search.js.map +1 -0
- package/dist/array/select.cjs +2 -0
- package/dist/array/select.cjs.map +1 -0
- package/dist/array/select.js +16 -0
- package/dist/array/select.js.map +1 -0
- package/dist/array/shift.cjs +2 -0
- package/dist/array/shift.cjs.map +1 -0
- package/dist/array/shift.js +13 -0
- package/dist/array/shift.js.map +1 -0
- package/dist/array/some.cjs +2 -0
- package/dist/array/some.cjs.map +1 -0
- package/dist/array/some.js +14 -0
- package/dist/array/some.js.map +1 -0
- package/dist/array/sort.cjs +2 -0
- package/dist/array/sort.cjs.map +1 -0
- package/dist/array/sort.js +13 -0
- package/dist/array/sort.js.map +1 -0
- package/dist/array/sortBy.cjs +2 -0
- package/dist/array/sortBy.cjs.map +1 -0
- package/dist/array/sortBy.js +6 -0
- package/dist/array/sortBy.js.map +1 -0
- package/dist/array/substitute.cjs +2 -0
- package/dist/array/substitute.cjs.map +1 -0
- package/dist/array/substitute.js +13 -0
- package/dist/array/substitute.js.map +1 -0
- package/dist/array/uniq.cjs +2 -0
- package/dist/array/uniq.cjs.map +1 -0
- package/dist/array/uniq.js +18 -0
- package/dist/array/uniq.js.map +1 -0
- package/dist/date/expires.cjs +2 -0
- package/dist/date/expires.cjs.map +1 -0
- package/dist/date/expires.js +11 -0
- package/dist/date/expires.js.map +1 -0
- package/dist/date/interval.cjs +2 -0
- package/dist/date/interval.cjs.map +1 -0
- package/dist/date/interval.js +39 -0
- package/dist/date/interval.js.map +1 -0
- package/dist/date/timeDiff.cjs +2 -0
- package/dist/date/timeDiff.cjs.map +1 -0
- package/dist/date/timeDiff.js +29 -0
- package/dist/date/timeDiff.js.map +1 -0
- package/dist/function/assert.cjs +3 -0
- package/dist/function/assert.cjs.map +1 -0
- package/dist/function/assert.js +12 -0
- package/dist/function/assert.js.map +1 -0
- package/dist/function/assertParams.cjs +2 -0
- package/dist/function/assertParams.cjs.map +1 -0
- package/dist/function/assertParams.js +13 -0
- package/dist/function/assertParams.js.map +1 -0
- package/dist/function/attempt.cjs +2 -0
- package/dist/function/attempt.cjs.map +1 -0
- package/dist/function/attempt.js +15 -0
- package/dist/function/attempt.js.map +1 -0
- package/dist/function/compare.cjs +2 -0
- package/dist/function/compare.cjs.map +1 -0
- package/dist/function/compare.js +22 -0
- package/dist/function/compare.js.map +1 -0
- package/dist/function/compareBy.cjs +2 -0
- package/dist/function/compareBy.cjs.map +1 -0
- package/dist/function/compareBy.js +15 -0
- package/dist/function/compareBy.js.map +1 -0
- package/dist/function/compose.cjs +2 -0
- package/dist/function/compose.cjs.map +1 -0
- package/dist/function/compose.js +14 -0
- package/dist/function/compose.js.map +1 -0
- package/dist/function/curry.cjs +2 -0
- package/dist/function/curry.cjs.map +1 -0
- package/dist/function/curry.js +8 -0
- package/dist/function/curry.js.map +1 -0
- package/dist/function/debounce.cjs +2 -0
- package/dist/function/debounce.cjs.map +1 -0
- package/dist/function/debounce.js +10 -0
- package/dist/function/debounce.js.map +1 -0
- package/dist/function/delay.cjs +2 -0
- package/dist/function/delay.cjs.map +1 -0
- package/dist/function/delay.js +8 -0
- package/dist/function/delay.js.map +1 -0
- package/dist/function/fp.cjs +2 -0
- package/dist/function/fp.cjs.map +1 -0
- package/dist/function/fp.js +10 -0
- package/dist/function/fp.js.map +1 -0
- package/dist/function/memo.cjs +2 -0
- package/dist/function/memo.cjs.map +1 -0
- package/dist/function/memo.js +24 -0
- package/dist/function/memo.js.map +1 -0
- package/dist/function/once.cjs +2 -0
- package/dist/function/once.cjs.map +1 -0
- package/dist/function/once.js +11 -0
- package/dist/function/once.js.map +1 -0
- package/dist/function/pipe.cjs +2 -0
- package/dist/function/pipe.cjs.map +1 -0
- package/dist/function/pipe.js +11 -0
- package/dist/function/pipe.js.map +1 -0
- package/dist/function/predict.cjs +2 -0
- package/dist/function/predict.cjs.map +1 -0
- package/dist/function/predict.js +13 -0
- package/dist/function/predict.js.map +1 -0
- package/dist/function/proxy.cjs +2 -0
- package/dist/function/proxy.cjs.map +1 -0
- package/dist/function/proxy.js +22 -0
- package/dist/function/proxy.js.map +1 -0
- package/dist/function/retry.cjs +2 -0
- package/dist/function/retry.cjs.map +1 -0
- package/dist/function/retry.js +25 -0
- package/dist/function/retry.js.map +1 -0
- package/dist/function/sleep.cjs +2 -0
- package/dist/function/sleep.cjs.map +1 -0
- package/dist/function/sleep.js +7 -0
- package/dist/function/sleep.js.map +1 -0
- package/dist/function/throttle.cjs +2 -0
- package/dist/function/throttle.cjs.map +1 -0
- package/dist/function/throttle.js +11 -0
- package/dist/function/throttle.js.map +1 -0
- package/dist/function/worker.cjs +14 -0
- package/dist/function/worker.cjs.map +1 -0
- package/dist/function/worker.js +29 -0
- package/dist/function/worker.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2278 -0
- package/dist/index.js +217 -0
- package/dist/index.js.map +1 -0
- package/dist/logit/dist/logit.cjs +2 -0
- package/dist/logit/dist/logit.cjs.map +1 -0
- package/dist/logit/dist/logit.js +178 -0
- package/dist/logit/dist/logit.js.map +1 -0
- package/dist/math/average.cjs +2 -0
- package/dist/math/average.cjs.map +1 -0
- package/dist/math/average.js +19 -0
- package/dist/math/average.js.map +1 -0
- package/dist/math/boil.cjs +2 -0
- package/dist/math/boil.cjs.map +1 -0
- package/dist/math/boil.js +17 -0
- package/dist/math/boil.js.map +1 -0
- package/dist/math/clamp.cjs +2 -0
- package/dist/math/clamp.cjs.map +1 -0
- package/dist/math/clamp.js +7 -0
- package/dist/math/clamp.js.map +1 -0
- package/dist/math/max.cjs +2 -0
- package/dist/math/max.cjs.map +1 -0
- package/dist/math/max.js +12 -0
- package/dist/math/max.js.map +1 -0
- package/dist/math/median.cjs +2 -0
- package/dist/math/median.cjs.map +1 -0
- package/dist/math/median.js +11 -0
- package/dist/math/median.js.map +1 -0
- package/dist/math/min.cjs +2 -0
- package/dist/math/min.cjs.map +1 -0
- package/dist/math/min.js +12 -0
- package/dist/math/min.js.map +1 -0
- package/dist/math/range.cjs +2 -0
- package/dist/math/range.cjs.map +1 -0
- package/dist/math/range.js +10 -0
- package/dist/math/range.js.map +1 -0
- package/dist/math/rate.cjs +2 -0
- package/dist/math/rate.cjs.map +1 -0
- package/dist/math/rate.js +9 -0
- package/dist/math/rate.js.map +1 -0
- package/dist/math/round.cjs +2 -0
- package/dist/math/round.cjs.map +1 -0
- package/dist/math/round.js +9 -0
- package/dist/math/round.js.map +1 -0
- package/dist/math/sum.cjs +2 -0
- package/dist/math/sum.cjs.map +1 -0
- package/dist/math/sum.js +22 -0
- package/dist/math/sum.js.map +1 -0
- package/dist/object/clone.cjs +2 -0
- package/dist/object/clone.cjs.map +1 -0
- package/dist/object/clone.js +7 -0
- package/dist/object/clone.js.map +1 -0
- package/dist/object/diff.cjs +2 -0
- package/dist/object/diff.cjs.map +1 -0
- package/dist/object/diff.js +18 -0
- package/dist/object/diff.js.map +1 -0
- package/dist/object/entries.cjs +2 -0
- package/dist/object/entries.cjs.map +1 -0
- package/dist/object/entries.js +9 -0
- package/dist/object/entries.js.map +1 -0
- package/dist/object/keys.cjs +2 -0
- package/dist/object/keys.cjs.map +1 -0
- package/dist/object/keys.js +9 -0
- package/dist/object/keys.js.map +1 -0
- package/dist/object/merge.cjs +2 -0
- package/dist/object/merge.cjs.map +1 -0
- package/dist/object/merge.js +29 -0
- package/dist/object/merge.js.map +1 -0
- package/dist/object/parseJSON.cjs +2 -0
- package/dist/object/parseJSON.cjs.map +1 -0
- package/dist/object/parseJSON.js +19 -0
- package/dist/object/parseJSON.js.map +1 -0
- package/dist/object/path.cjs +2 -0
- package/dist/object/path.cjs.map +1 -0
- package/dist/object/path.js +24 -0
- package/dist/object/path.js.map +1 -0
- package/dist/object/seek.cjs +2 -0
- package/dist/object/seek.cjs.map +1 -0
- package/dist/object/seek.js +11 -0
- package/dist/object/seek.js.map +1 -0
- package/dist/object/values.cjs +2 -0
- package/dist/object/values.cjs.map +1 -0
- package/dist/object/values.js +9 -0
- package/dist/object/values.js.map +1 -0
- package/dist/random/draw.cjs +2 -0
- package/dist/random/draw.cjs.map +1 -0
- package/dist/random/draw.js +11 -0
- package/dist/random/draw.js.map +1 -0
- package/dist/random/random.cjs +2 -0
- package/dist/random/random.cjs.map +1 -0
- package/dist/random/random.js +10 -0
- package/dist/random/random.js.map +1 -0
- package/dist/random/shuffle.cjs +2 -0
- package/dist/random/shuffle.cjs.map +1 -0
- package/dist/random/shuffle.js +15 -0
- package/dist/random/shuffle.js.map +1 -0
- package/dist/random/uuid.cjs +2 -0
- package/dist/random/uuid.cjs.map +1 -0
- package/dist/random/uuid.js +7 -0
- package/dist/random/uuid.js.map +1 -0
- package/dist/string/_caseUtils.cjs +2 -0
- package/dist/string/_caseUtils.cjs.map +1 -0
- package/dist/string/_caseUtils.js +9 -0
- package/dist/string/_caseUtils.js.map +1 -0
- package/dist/string/camelCase.cjs +2 -0
- package/dist/string/camelCase.cjs.map +1 -0
- package/dist/string/camelCase.js +8 -0
- package/dist/string/camelCase.js.map +1 -0
- package/dist/string/kebabCase.cjs +2 -0
- package/dist/string/kebabCase.cjs.map +1 -0
- package/dist/string/kebabCase.js +8 -0
- package/dist/string/kebabCase.js.map +1 -0
- package/dist/string/pascalCase.cjs +2 -0
- package/dist/string/pascalCase.cjs.map +1 -0
- package/dist/string/pascalCase.js +8 -0
- package/dist/string/pascalCase.js.map +1 -0
- package/dist/string/similarity.cjs +2 -0
- package/dist/string/similarity.cjs.map +1 -0
- package/dist/string/similarity.js +34 -0
- package/dist/string/similarity.js.map +1 -0
- package/dist/string/snakeCase.cjs +2 -0
- package/dist/string/snakeCase.cjs.map +1 -0
- package/dist/string/snakeCase.js +8 -0
- package/dist/string/snakeCase.js.map +1 -0
- package/dist/string/truncate.cjs +2 -0
- package/dist/string/truncate.cjs.map +1 -0
- package/dist/string/truncate.js +9 -0
- package/dist/string/truncate.js.map +1 -0
- package/dist/typed/ge.cjs +2 -0
- package/dist/typed/ge.cjs.map +1 -0
- package/dist/typed/ge.js +7 -0
- package/dist/typed/ge.js.map +1 -0
- package/dist/typed/gt.cjs +2 -0
- package/dist/typed/gt.cjs.map +1 -0
- package/dist/typed/gt.js +7 -0
- package/dist/typed/gt.js.map +1 -0
- package/dist/typed/is.cjs +2 -0
- package/dist/typed/is.cjs.map +1 -0
- package/dist/typed/is.js +44 -0
- package/dist/typed/is.js.map +1 -0
- package/dist/typed/isArray.cjs +2 -0
- package/dist/typed/isArray.cjs.map +1 -0
- package/dist/typed/isArray.js +9 -0
- package/dist/typed/isArray.js.map +1 -0
- package/dist/typed/isBoolean.cjs +2 -0
- package/dist/typed/isBoolean.cjs.map +1 -0
- package/dist/typed/isBoolean.js +7 -0
- package/dist/typed/isBoolean.js.map +1 -0
- package/dist/typed/isDate.cjs +2 -0
- package/dist/typed/isDate.cjs.map +1 -0
- package/dist/typed/isDate.js +9 -0
- package/dist/typed/isDate.js.map +1 -0
- package/dist/typed/isDefined.cjs +2 -0
- package/dist/typed/isDefined.cjs.map +1 -0
- package/dist/typed/isDefined.js +7 -0
- package/dist/typed/isDefined.js.map +1 -0
- package/dist/typed/isEmpty.cjs +2 -0
- package/dist/typed/isEmpty.cjs.map +1 -0
- package/dist/typed/isEmpty.js +12 -0
- package/dist/typed/isEmpty.js.map +1 -0
- package/dist/typed/isEqual.cjs +2 -0
- package/dist/typed/isEqual.cjs.map +1 -0
- package/dist/typed/isEqual.js +25 -0
- package/dist/typed/isEqual.js.map +1 -0
- package/dist/typed/isEven.cjs +2 -0
- package/dist/typed/isEven.cjs.map +1 -0
- package/dist/typed/isEven.js +7 -0
- package/dist/typed/isEven.js.map +1 -0
- package/dist/typed/isFunction.cjs +2 -0
- package/dist/typed/isFunction.cjs.map +1 -0
- package/dist/typed/isFunction.js +9 -0
- package/dist/typed/isFunction.js.map +1 -0
- package/dist/typed/isMatch.cjs +2 -0
- package/dist/typed/isMatch.cjs.map +1 -0
- package/dist/typed/isMatch.js +19 -0
- package/dist/typed/isMatch.js.map +1 -0
- package/dist/typed/isNegative.cjs +2 -0
- package/dist/typed/isNegative.cjs.map +1 -0
- package/dist/typed/isNegative.js +7 -0
- package/dist/typed/isNegative.js.map +1 -0
- package/dist/typed/isNil.cjs +2 -0
- package/dist/typed/isNil.cjs.map +1 -0
- package/dist/typed/isNil.js +9 -0
- package/dist/typed/isNil.js.map +1 -0
- package/dist/typed/isNumber.cjs +2 -0
- package/dist/typed/isNumber.cjs.map +1 -0
- package/dist/typed/isNumber.js +9 -0
- package/dist/typed/isNumber.js.map +1 -0
- package/dist/typed/isObject.cjs +2 -0
- package/dist/typed/isObject.cjs.map +1 -0
- package/dist/typed/isObject.js +9 -0
- package/dist/typed/isObject.js.map +1 -0
- package/dist/typed/isOdd.cjs +2 -0
- package/dist/typed/isOdd.cjs.map +1 -0
- package/dist/typed/isOdd.js +7 -0
- package/dist/typed/isOdd.js.map +1 -0
- package/dist/typed/isPositive.cjs +2 -0
- package/dist/typed/isPositive.cjs.map +1 -0
- package/dist/typed/isPositive.js +7 -0
- package/dist/typed/isPositive.js.map +1 -0
- package/dist/typed/isPrimitive.cjs +2 -0
- package/dist/typed/isPrimitive.cjs.map +1 -0
- package/dist/typed/isPrimitive.js +10 -0
- package/dist/typed/isPrimitive.js.map +1 -0
- package/dist/typed/isPromise.cjs +2 -0
- package/dist/typed/isPromise.cjs.map +1 -0
- package/dist/typed/isPromise.js +10 -0
- package/dist/typed/isPromise.js.map +1 -0
- package/dist/typed/isRegex.cjs +2 -0
- package/dist/typed/isRegex.cjs.map +1 -0
- package/dist/typed/isRegex.js +7 -0
- package/dist/typed/isRegex.js.map +1 -0
- package/dist/typed/isString.cjs +2 -0
- package/dist/typed/isString.cjs.map +1 -0
- package/dist/typed/isString.js +9 -0
- package/dist/typed/isString.js.map +1 -0
- package/dist/typed/isWithin.cjs +2 -0
- package/dist/typed/isWithin.cjs.map +1 -0
- package/dist/typed/isWithin.js +10 -0
- package/dist/typed/isWithin.js.map +1 -0
- package/dist/typed/isZero.cjs +2 -0
- package/dist/typed/isZero.cjs.map +1 -0
- package/dist/typed/isZero.js +7 -0
- package/dist/typed/isZero.js.map +1 -0
- package/dist/typed/le.cjs +2 -0
- package/dist/typed/le.cjs.map +1 -0
- package/dist/typed/le.js +7 -0
- package/dist/typed/le.js.map +1 -0
- package/dist/typed/lt.cjs +2 -0
- package/dist/typed/lt.cjs.map +1 -0
- package/dist/typed/lt.js +7 -0
- package/dist/typed/lt.js.map +1 -0
- package/dist/typed/typeOf.cjs +2 -0
- package/dist/typed/typeOf.cjs.map +1 -0
- package/dist/typed/typeOf.js +14 -0
- package/dist/typed/typeOf.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.cjs","sources":["../../src/random/uuid.ts"],"sourcesContent":["/**\n * Generates a unique identifier.\n *\n * @example\n * ```ts\n * uuid(); // a unique identifier, e.g., '22a746d0-08be-4aff-bbc2-4deddf0914e0'\n * ```\n *\n * @returns A unique identifier.\n */\nexport function uuid(): string {\n return (\n crypto?.randomUUID() ?? [12, 6, 6, 6, 18].map((val) => Math.floor(Math.random() * 10 ** val).toString(36)).join('-')\n );\n}\n"],"names":["uuid","val"],"mappings":"gFAUO,SAASA,GAAe,CAC7B,OACE,QAAQ,cAAgB,CAAC,GAAI,EAAG,EAAG,EAAG,EAAE,EAAE,IAAKC,GAAQ,KAAK,MAAM,KAAK,OAAA,EAAW,IAAMA,CAAG,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,GAAG,CAEvH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.js","sources":["../../src/random/uuid.ts"],"sourcesContent":["/**\n * Generates a unique identifier.\n *\n * @example\n * ```ts\n * uuid(); // a unique identifier, e.g., '22a746d0-08be-4aff-bbc2-4deddf0914e0'\n * ```\n *\n * @returns A unique identifier.\n */\nexport function uuid(): string {\n return (\n crypto?.randomUUID() ?? [12, 6, 6, 6, 18].map((val) => Math.floor(Math.random() * 10 ** val).toString(36)).join('-')\n );\n}\n"],"names":["uuid","val"],"mappings":"AAUO,SAASA,IAAe;AAC7B,SACE,QAAQ,gBAAgB,CAAC,IAAI,GAAG,GAAG,GAAG,EAAE,EAAE,IAAI,CAACC,MAAQ,KAAK,MAAM,KAAK,OAAA,IAAW,MAAMA,CAAG,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,GAAG;AAEvH;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=/([a-z])([A-Z\d])|([A-Z\d])([A-Z][a-z])|(\d)([a-zA-Z])/g;function i(n,e=" "){return n.trim().replace($,`$1$3$5${e}$2$4$6`).replace(/[^a-z\d]+/gi,e).replace(new RegExp(`^${e}+|${e}+$`,"g"),"")}exports.CASE_SPLIT_PATTERN=$;exports.normalizeCase=i;
|
|
2
|
+
//# sourceMappingURL=_caseUtils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_caseUtils.cjs","sources":["../../src/string/_caseUtils.ts"],"sourcesContent":["/**\n * Shared regex pattern for splitting words in case conversion utilities\n */\nexport const CASE_SPLIT_PATTERN = /([a-z])([A-Z\\d])|([A-Z\\d])([A-Z][a-z])|(\\d)([a-zA-Z])/g;\n\n/**\n * Normalizes a string by splitting on word boundaries and removing special characters\n *\n * @param str - The string to normalize\n * @param separator - The separator to use for splitting (default: space)\n * @returns The normalized string\n */\nexport function normalizeCase(str: string, separator = ' '): string {\n return str\n .trim()\n .replace(CASE_SPLIT_PATTERN, `$1$3$5${separator}$2$4$6`)\n .replace(/[^a-z\\d]+/gi, separator)\n .replace(new RegExp(`^${separator}+|${separator}+$`, 'g'), '');\n}\n"],"names":["CASE_SPLIT_PATTERN","normalizeCase","str","separator"],"mappings":"gFAGO,MAAMA,EAAqB,yDAS3B,SAASC,EAAcC,EAAaC,EAAY,IAAa,CAClE,OAAOD,EACJ,OACA,QAAQF,EAAoB,SAASG,CAAS,QAAQ,EACtD,QAAQ,cAAeA,CAAS,EAChC,QAAQ,IAAI,OAAO,IAAIA,CAAS,KAAKA,CAAS,KAAM,GAAG,EAAG,EAAE,CACjE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const n = /([a-z])([A-Z\d])|([A-Z\d])([A-Z][a-z])|(\d)([a-zA-Z])/g;
|
|
2
|
+
function A(e, $ = " ") {
|
|
3
|
+
return e.trim().replace(n, `$1$3$5${$}$2$4$6`).replace(/[^a-z\d]+/gi, $).replace(new RegExp(`^${$}+|${$}+$`, "g"), "");
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
n as CASE_SPLIT_PATTERN,
|
|
7
|
+
A as normalizeCase
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=_caseUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_caseUtils.js","sources":["../../src/string/_caseUtils.ts"],"sourcesContent":["/**\n * Shared regex pattern for splitting words in case conversion utilities\n */\nexport const CASE_SPLIT_PATTERN = /([a-z])([A-Z\\d])|([A-Z\\d])([A-Z][a-z])|(\\d)([a-zA-Z])/g;\n\n/**\n * Normalizes a string by splitting on word boundaries and removing special characters\n *\n * @param str - The string to normalize\n * @param separator - The separator to use for splitting (default: space)\n * @returns The normalized string\n */\nexport function normalizeCase(str: string, separator = ' '): string {\n return str\n .trim()\n .replace(CASE_SPLIT_PATTERN, `$1$3$5${separator}$2$4$6`)\n .replace(/[^a-z\\d]+/gi, separator)\n .replace(new RegExp(`^${separator}+|${separator}+$`, 'g'), '');\n}\n"],"names":["CASE_SPLIT_PATTERN","normalizeCase","str","separator"],"mappings":"AAGO,MAAMA,IAAqB;AAS3B,SAASC,EAAcC,GAAaC,IAAY,KAAa;AAClE,SAAOD,EACJ,OACA,QAAQF,GAAoB,SAASG,CAAS,QAAQ,EACtD,QAAQ,eAAeA,CAAS,EAChC,QAAQ,IAAI,OAAO,IAAIA,CAAS,KAAKA,CAAS,MAAM,GAAG,GAAG,EAAE;AACjE;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./_caseUtils.cjs");function t(a){return s.normalizeCase(a," ").replace(/(?:^|\s)(\w)/g,(e,r)=>r.toUpperCase()).replace(/\s+/g,"").replace(/^./,e=>e.toLowerCase())}exports.camelCase=t;
|
|
2
|
+
//# sourceMappingURL=camelCase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelCase.cjs","sources":["../../src/string/camelCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to camel case.\n *\n * @example\n * ```ts\n * const text = 'hello world';\n * camelCase(text); // 'helloWorld'\n * ```\n *\n * @param str - The string to convert.\n * @returns The converted string.\n */\nexport function camelCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/(?:^|\\s)(\\w)/g, (_, char) => char.toUpperCase())\n .replace(/\\s+/g, '')\n .replace(/^./, (char) => char.toLowerCase());\n}\n"],"names":["camelCase","str","normalizeCase","_","char"],"mappings":"oHAcO,SAASA,EAAUC,EAAqB,CAC7C,OAAOC,EAAAA,cAAcD,EAAK,GAAG,EAC1B,QAAQ,gBAAiB,CAACE,EAAGC,IAASA,EAAK,YAAA,CAAa,EACxD,QAAQ,OAAQ,EAAE,EAClB,QAAQ,KAAOA,GAASA,EAAK,aAAa,CAC/C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { normalizeCase as o } from "./_caseUtils.js";
|
|
2
|
+
function s(r) {
|
|
3
|
+
return o(r, " ").replace(/(?:^|\s)(\w)/g, (e, a) => a.toUpperCase()).replace(/\s+/g, "").replace(/^./, (e) => e.toLowerCase());
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
s as camelCase
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=camelCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelCase.js","sources":["../../src/string/camelCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to camel case.\n *\n * @example\n * ```ts\n * const text = 'hello world';\n * camelCase(text); // 'helloWorld'\n * ```\n *\n * @param str - The string to convert.\n * @returns The converted string.\n */\nexport function camelCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/(?:^|\\s)(\\w)/g, (_, char) => char.toUpperCase())\n .replace(/\\s+/g, '')\n .replace(/^./, (char) => char.toLowerCase());\n}\n"],"names":["camelCase","str","normalizeCase","_","char"],"mappings":";AAcO,SAASA,EAAUC,GAAqB;AAC7C,SAAOC,EAAcD,GAAK,GAAG,EAC1B,QAAQ,iBAAiB,CAACE,GAAGC,MAASA,EAAK,YAAA,CAAa,EACxD,QAAQ,QAAQ,EAAE,EAClB,QAAQ,MAAM,CAACA,MAASA,EAAK,aAAa;AAC/C;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebabCase.cjs","sources":["../../src/string/kebabCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to kebab case.\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * kebabCase(text); // 'hello-world'\n * ```\n *\n * @param str - The string to convert.\n *\n * @returns The converted string.\n */\nexport function kebabCase(str: string): string {\n return normalizeCase(str, '-').toLowerCase();\n}\n"],"names":["kebabCase","str","normalizeCase"],"mappings":"oHAeO,SAASA,EAAUC,EAAqB,CAC7C,OAAOC,gBAAcD,EAAK,GAAG,EAAE,YAAA,CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kebabCase.js","sources":["../../src/string/kebabCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to kebab case.\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * kebabCase(text); // 'hello-world'\n * ```\n *\n * @param str - The string to convert.\n *\n * @returns The converted string.\n */\nexport function kebabCase(str: string): string {\n return normalizeCase(str, '-').toLowerCase();\n}\n"],"names":["kebabCase","str","normalizeCase"],"mappings":";AAeO,SAASA,EAAUC,GAAqB;AAC7C,SAAOC,EAAcD,GAAK,GAAG,EAAE,YAAA;AACjC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./_caseUtils.cjs");function r(e){return s.normalizeCase(e," ").replace(/(?:^|\s)(\w)/g,(t,a)=>a.toUpperCase()).replace(/\s+/g,"")}exports.pascalCase=r;
|
|
2
|
+
//# sourceMappingURL=pascalCase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascalCase.cjs","sources":["../../src/string/pascalCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to Pascal case.\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * pascalCase(text) // 'HelloWorld';\n * ```\n *\n * @param str - The string to convert.\n *\n * @returns The converted string.\n */\nexport function pascalCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/(?:^|\\s)(\\w)/g, (_, char) => char.toUpperCase())\n .replace(/\\s+/g, '');\n}\n"],"names":["pascalCase","str","normalizeCase","_","char"],"mappings":"oHAeO,SAASA,EAAWC,EAAqB,CAC9C,OAAOC,EAAAA,cAAcD,EAAK,GAAG,EAC1B,QAAQ,gBAAiB,CAACE,EAAGC,IAASA,EAAK,YAAA,CAAa,EACxD,QAAQ,OAAQ,EAAE,CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pascalCase.js","sources":["../../src/string/pascalCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to Pascal case.\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * pascalCase(text) // 'HelloWorld';\n * ```\n *\n * @param str - The string to convert.\n *\n * @returns The converted string.\n */\nexport function pascalCase(str: string): string {\n return normalizeCase(str, ' ')\n .replace(/(?:^|\\s)(\\w)/g, (_, char) => char.toUpperCase())\n .replace(/\\s+/g, '');\n}\n"],"names":["pascalCase","str","normalizeCase","_","char"],"mappings":";AAeO,SAASA,EAAWC,GAAqB;AAC9C,SAAOC,EAAcD,GAAK,GAAG,EAC1B,QAAQ,iBAAiB,CAACE,GAAGC,MAASA,EAAK,YAAA,CAAa,EACxD,QAAQ,QAAQ,EAAE;AACvB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../function/assert.cjs");function u(a,c){g.assert(["string","number"].includes(typeof a)&&["string","number"].includes(typeof c),"Invalid arguments",{args:{str1:a,str2:c},type:TypeError});const r=String(a).toLowerCase(),i=String(c).toLowerCase();if(r===i)return 1;if(!r.length||!i.length)return 0;const o=r.length,s=i.length,n=Array.from({length:o+1},(t,e)=>[e]);for(let t=0;t<=s;t++)n[0][t]=t;for(let t=1;t<=o;t++)for(let e=1;e<=s;e++){const l=r[t-1]===i[e-1]?0:1;n[t][e]=Math.min(n[t-1][e]+1,n[t][e-1]+1,n[t-1][e-1]+l)}return 1-n[o][s]/Math.max(o,s)}exports.similarity=u;
|
|
2
|
+
//# sourceMappingURL=similarity.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"similarity.cjs","sources":["../../src/string/similarity.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Calculate the similarity between two strings using the Levenshtein distance algorithm.\n *\n * @example\n * ```ts\n * similarity('abc', 'abc') // 1\n * similarity('a', 'b') // 0\n * similarity('ab', 'ac') // 0.5\n * similarity('doe', 'John Doe') // 0.25\n * similarity('abc', 'axc') // 0.6666666666666667\n * similarity('kitten', 'sitting') // 0.5714285714285714\n * ```\n *\n * @param str1 - The first string.\n * @param str2 - The second string.\n *\n * @returns A number between 0 and 1 representing the similarity between the two strings.\n */\nexport function similarity(str1: unknown, str2: unknown): number {\n assert(\n ['string', 'number'].includes(typeof str1) && ['string', 'number'].includes(typeof str2),\n 'Invalid arguments',\n {\n args: { str1, str2 },\n type: TypeError,\n },\n );\n\n const a = String(str1).toLowerCase();\n const b = String(str2).toLowerCase();\n\n if (a === b) return 1;\n if (!a.length || !b.length) return 0;\n\n const aLength = a.length;\n const bLength = b.length;\n\n // Initialize matrix with first row and column\n const matrix: number[][] = Array.from({ length: aLength + 1 }, (_, i) => [i]);\n for (let j = 0; j <= bLength; j++) {\n matrix[0][j] = j;\n }\n\n // Calculate Levenshtein distance\n for (let i = 1; i <= aLength; i++) {\n for (let j = 1; j <= bLength; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n matrix[i][j] = Math.min(\n matrix[i - 1][j] + 1, // deletion\n matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j - 1] + cost, // substitution\n );\n }\n }\n\n const distance = matrix[aLength][bLength];\n\n return 1 - distance / Math.max(aLength, bLength);\n}\n"],"names":["similarity","str1","str2","assert","a","b","aLength","bLength","matrix","_","i","j","cost"],"mappings":"0HAoBO,SAASA,EAAWC,EAAeC,EAAuB,CAC/DC,EAAAA,OACE,CAAC,SAAU,QAAQ,EAAE,SAAS,OAAOF,CAAI,GAAK,CAAC,SAAU,QAAQ,EAAE,SAAS,OAAOC,CAAI,EACvF,oBACA,CACE,KAAM,CAAE,KAAAD,EAAM,KAAAC,CAAA,EACd,KAAM,SAAA,CACR,EAGF,MAAME,EAAI,OAAOH,CAAI,EAAE,YAAA,EACjBI,EAAI,OAAOH,CAAI,EAAE,YAAA,EAEvB,GAAIE,IAAMC,EAAG,MAAO,GACpB,GAAI,CAACD,EAAE,QAAU,CAACC,EAAE,OAAQ,MAAO,GAEnC,MAAMC,EAAUF,EAAE,OACZG,EAAUF,EAAE,OAGZG,EAAqB,MAAM,KAAK,CAAE,OAAQF,EAAU,CAAA,EAAK,CAACG,EAAGC,IAAM,CAACA,CAAC,CAAC,EAC5E,QAASC,EAAI,EAAGA,GAAKJ,EAASI,IAC5BH,EAAO,CAAC,EAAEG,CAAC,EAAIA,EAIjB,QAASD,EAAI,EAAGA,GAAKJ,EAASI,IAC5B,QAASC,EAAI,EAAGA,GAAKJ,EAASI,IAAK,CACjC,MAAMC,EAAOR,EAAEM,EAAI,CAAC,IAAML,EAAEM,EAAI,CAAC,EAAI,EAAI,EACzCH,EAAOE,CAAC,EAAEC,CAAC,EAAI,KAAK,IAClBH,EAAOE,EAAI,CAAC,EAAEC,CAAC,EAAI,EACnBH,EAAOE,CAAC,EAAEC,EAAI,CAAC,EAAI,EACnBH,EAAOE,EAAI,CAAC,EAAEC,EAAI,CAAC,EAAIC,CAAA,CAE3B,CAKF,MAAO,GAFUJ,EAAOF,CAAO,EAAEC,CAAO,EAElB,KAAK,IAAID,EAASC,CAAO,CACjD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { assert as l } from "../function/assert.js";
|
|
2
|
+
function h(a, c) {
|
|
3
|
+
l(
|
|
4
|
+
["string", "number"].includes(typeof a) && ["string", "number"].includes(typeof c),
|
|
5
|
+
"Invalid arguments",
|
|
6
|
+
{
|
|
7
|
+
args: { str1: a, str2: c },
|
|
8
|
+
type: TypeError
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
const r = String(a).toLowerCase(), o = String(c).toLowerCase();
|
|
12
|
+
if (r === o) return 1;
|
|
13
|
+
if (!r.length || !o.length) return 0;
|
|
14
|
+
const i = r.length, s = o.length, e = Array.from({ length: i + 1 }, (t, n) => [n]);
|
|
15
|
+
for (let t = 0; t <= s; t++)
|
|
16
|
+
e[0][t] = t;
|
|
17
|
+
for (let t = 1; t <= i; t++)
|
|
18
|
+
for (let n = 1; n <= s; n++) {
|
|
19
|
+
const g = r[t - 1] === o[n - 1] ? 0 : 1;
|
|
20
|
+
e[t][n] = Math.min(
|
|
21
|
+
e[t - 1][n] + 1,
|
|
22
|
+
// deletion
|
|
23
|
+
e[t][n - 1] + 1,
|
|
24
|
+
// insertion
|
|
25
|
+
e[t - 1][n - 1] + g
|
|
26
|
+
// substitution
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return 1 - e[i][s] / Math.max(i, s);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
h as similarity
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=similarity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"similarity.js","sources":["../../src/string/similarity.ts"],"sourcesContent":["import { assert } from '../function/assert';\n\n/**\n * Calculate the similarity between two strings using the Levenshtein distance algorithm.\n *\n * @example\n * ```ts\n * similarity('abc', 'abc') // 1\n * similarity('a', 'b') // 0\n * similarity('ab', 'ac') // 0.5\n * similarity('doe', 'John Doe') // 0.25\n * similarity('abc', 'axc') // 0.6666666666666667\n * similarity('kitten', 'sitting') // 0.5714285714285714\n * ```\n *\n * @param str1 - The first string.\n * @param str2 - The second string.\n *\n * @returns A number between 0 and 1 representing the similarity between the two strings.\n */\nexport function similarity(str1: unknown, str2: unknown): number {\n assert(\n ['string', 'number'].includes(typeof str1) && ['string', 'number'].includes(typeof str2),\n 'Invalid arguments',\n {\n args: { str1, str2 },\n type: TypeError,\n },\n );\n\n const a = String(str1).toLowerCase();\n const b = String(str2).toLowerCase();\n\n if (a === b) return 1;\n if (!a.length || !b.length) return 0;\n\n const aLength = a.length;\n const bLength = b.length;\n\n // Initialize matrix with first row and column\n const matrix: number[][] = Array.from({ length: aLength + 1 }, (_, i) => [i]);\n for (let j = 0; j <= bLength; j++) {\n matrix[0][j] = j;\n }\n\n // Calculate Levenshtein distance\n for (let i = 1; i <= aLength; i++) {\n for (let j = 1; j <= bLength; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n matrix[i][j] = Math.min(\n matrix[i - 1][j] + 1, // deletion\n matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j - 1] + cost, // substitution\n );\n }\n }\n\n const distance = matrix[aLength][bLength];\n\n return 1 - distance / Math.max(aLength, bLength);\n}\n"],"names":["similarity","str1","str2","assert","a","b","aLength","bLength","matrix","_","i","j","cost"],"mappings":";AAoBO,SAASA,EAAWC,GAAeC,GAAuB;AAC/D,EAAAC;AAAA,IACE,CAAC,UAAU,QAAQ,EAAE,SAAS,OAAOF,CAAI,KAAK,CAAC,UAAU,QAAQ,EAAE,SAAS,OAAOC,CAAI;AAAA,IACvF;AAAA,IACA;AAAA,MACE,MAAM,EAAE,MAAAD,GAAM,MAAAC,EAAA;AAAA,MACd,MAAM;AAAA,IAAA;AAAA,EACR;AAGF,QAAME,IAAI,OAAOH,CAAI,EAAE,YAAA,GACjBI,IAAI,OAAOH,CAAI,EAAE,YAAA;AAEvB,MAAIE,MAAMC,EAAG,QAAO;AACpB,MAAI,CAACD,EAAE,UAAU,CAACC,EAAE,OAAQ,QAAO;AAEnC,QAAMC,IAAUF,EAAE,QACZG,IAAUF,EAAE,QAGZG,IAAqB,MAAM,KAAK,EAAE,QAAQF,IAAU,EAAA,GAAK,CAACG,GAAGC,MAAM,CAACA,CAAC,CAAC;AAC5E,WAASC,IAAI,GAAGA,KAAKJ,GAASI;AAC5B,IAAAH,EAAO,CAAC,EAAEG,CAAC,IAAIA;AAIjB,WAASD,IAAI,GAAGA,KAAKJ,GAASI;AAC5B,aAASC,IAAI,GAAGA,KAAKJ,GAASI,KAAK;AACjC,YAAMC,IAAOR,EAAEM,IAAI,CAAC,MAAML,EAAEM,IAAI,CAAC,IAAI,IAAI;AACzC,MAAAH,EAAOE,CAAC,EAAEC,CAAC,IAAI,KAAK;AAAA,QAClBH,EAAOE,IAAI,CAAC,EAAEC,CAAC,IAAI;AAAA;AAAA,QACnBH,EAAOE,CAAC,EAAEC,IAAI,CAAC,IAAI;AAAA;AAAA,QACnBH,EAAOE,IAAI,CAAC,EAAEC,IAAI,CAAC,IAAIC;AAAA;AAAA,MAAA;AAAA,IAE3B;AAKF,SAAO,IAFUJ,EAAOF,CAAO,EAAEC,CAAO,IAElB,KAAK,IAAID,GAASC,CAAO;AACjD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snakeCase.cjs","sources":["../../src/string/snakeCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to snake case.\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * toSnakeCase(text) // 'hello_world';\n * ```\n *\n * @param str - The string to convert.\n *\n * @returns The converted string.\n */\nexport function snakeCase(str: string): string {\n return normalizeCase(str, '_').toLowerCase();\n}\n"],"names":["snakeCase","str","normalizeCase"],"mappings":"oHAeO,SAASA,EAAUC,EAAqB,CAC7C,OAAOC,gBAAcD,EAAK,GAAG,EAAE,YAAA,CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snakeCase.js","sources":["../../src/string/snakeCase.ts"],"sourcesContent":["import { normalizeCase } from './_caseUtils';\n\n/**\n * Converts a string to snake case.\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * toSnakeCase(text) // 'hello_world';\n * ```\n *\n * @param str - The string to convert.\n *\n * @returns The converted string.\n */\nexport function snakeCase(str: string): string {\n return normalizeCase(str, '_').toLowerCase();\n}\n"],"names":["snakeCase","str","normalizeCase"],"mappings":";AAeO,SAASA,EAAUC,GAAqB;AAC7C,SAAOC,EAAcD,GAAK,GAAG,EAAE,YAAA;AACjC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function f(e,t=25,r=!1,u="…"){if(e.length<=t)return e;const n=r?e.substring(0,t).lastIndexOf(" "):t,c=n>0?n:t;return`${e.substring(0,c).trim()}${u}`}exports.truncate=f;
|
|
2
|
+
//# sourceMappingURL=truncate.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncate.cjs","sources":["../../src/string/truncate.ts"],"sourcesContent":["/**\n * Truncates a string if it is longer than the given maximum string length. The last characters of the truncated string are replaced with the ellipsis sign \"…\".\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * truncate(text, 5); // 'Hello…'\n * truncate(text, 3, true); // 'Hello…'\n * truncate(text, 5, true, '...'); // 'Hello...'\n * ```\n *\n * @param str - The string to truncate.\n * @param limit - The maximum string length.\n * @param completeWords - If true, the string is truncated to the nearest word, instead of character.\n * @param ellipsis - The characters to end the truncated string with.\n *\n * @returns The truncated string.\n */\nexport function truncate(str: string, limit = 25, completeWords = false, ellipsis = '…'): string {\n if (str.length <= limit) return str;\n\n const _limit = completeWords ? str.substring(0, limit).lastIndexOf(' ') : limit;\n const effectiveLimit = _limit > 0 ? _limit : limit;\n\n return `${str.substring(0, effectiveLimit).trim()}${ellipsis}`;\n}\n"],"names":["truncate","str","limit","completeWords","ellipsis","_limit","effectiveLimit"],"mappings":"gFAkBO,SAASA,EAASC,EAAaC,EAAQ,GAAIC,EAAgB,GAAOC,EAAW,IAAa,CAC/F,GAAIH,EAAI,QAAUC,EAAO,OAAOD,EAEhC,MAAMI,EAASF,EAAgBF,EAAI,UAAU,EAAGC,CAAK,EAAE,YAAY,GAAG,EAAIA,EACpEI,EAAiBD,EAAS,EAAIA,EAASH,EAE7C,MAAO,GAAGD,EAAI,UAAU,EAAGK,CAAc,EAAE,KAAA,CAAM,GAAGF,CAAQ,EAC9D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function c(n, e = 25, f = !1, r = "…") {
|
|
2
|
+
if (n.length <= e) return n;
|
|
3
|
+
const t = f ? n.substring(0, e).lastIndexOf(" ") : e, u = t > 0 ? t : e;
|
|
4
|
+
return `${n.substring(0, u).trim()}${r}`;
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
c as truncate
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=truncate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncate.js","sources":["../../src/string/truncate.ts"],"sourcesContent":["/**\n * Truncates a string if it is longer than the given maximum string length. The last characters of the truncated string are replaced with the ellipsis sign \"…\".\n *\n * @example\n * ```ts\n * const text = 'Hello World';\n * truncate(text, 5); // 'Hello…'\n * truncate(text, 3, true); // 'Hello…'\n * truncate(text, 5, true, '...'); // 'Hello...'\n * ```\n *\n * @param str - The string to truncate.\n * @param limit - The maximum string length.\n * @param completeWords - If true, the string is truncated to the nearest word, instead of character.\n * @param ellipsis - The characters to end the truncated string with.\n *\n * @returns The truncated string.\n */\nexport function truncate(str: string, limit = 25, completeWords = false, ellipsis = '…'): string {\n if (str.length <= limit) return str;\n\n const _limit = completeWords ? str.substring(0, limit).lastIndexOf(' ') : limit;\n const effectiveLimit = _limit > 0 ? _limit : limit;\n\n return `${str.substring(0, effectiveLimit).trim()}${ellipsis}`;\n}\n"],"names":["truncate","str","limit","completeWords","ellipsis","_limit","effectiveLimit"],"mappings":"AAkBO,SAASA,EAASC,GAAaC,IAAQ,IAAIC,IAAgB,IAAOC,IAAW,KAAa;AAC/F,MAAIH,EAAI,UAAUC,EAAO,QAAOD;AAEhC,QAAMI,IAASF,IAAgBF,EAAI,UAAU,GAAGC,CAAK,EAAE,YAAY,GAAG,IAAIA,GACpEI,IAAiBD,IAAS,IAAIA,IAASH;AAE7C,SAAO,GAAGD,EAAI,UAAU,GAAGK,CAAc,EAAE,KAAA,CAAM,GAAGF,CAAQ;AAC9D;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ge.cjs","sources":["../../src/typed/ge.ts"],"sourcesContent":["/**\n * Checks if the first argument is greater than or equal to the second argument.\n *\n * @example\n * ```ts\n * gte(5, 3); // true\n * gte(3, 5); // false\n * gte(5, 5); // true\n * gte(5, '3'); // false\n * gte('5', 3); // false\n * gte('5', '3'); // false\n * ```\n * @param a - The first argument to compare.\n * @param b - The second argument to compare.\n *\n * @returns `true` if `a` is greater than or equal to `b`, otherwise `false`.\n */\nexport function ge(a: unknown, b: unknown): boolean {\n return typeof a === 'number' && typeof b === 'number' && a >= b;\n}\n"],"names":["ge","a","b"],"mappings":"gFAiBO,SAASA,EAAGC,EAAYC,EAAqB,CAClD,OAAO,OAAOD,GAAM,UAAY,OAAOC,GAAM,UAAYD,GAAKC,CAChE"}
|
package/dist/typed/ge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ge.js","sources":["../../src/typed/ge.ts"],"sourcesContent":["/**\n * Checks if the first argument is greater than or equal to the second argument.\n *\n * @example\n * ```ts\n * gte(5, 3); // true\n * gte(3, 5); // false\n * gte(5, 5); // true\n * gte(5, '3'); // false\n * gte('5', 3); // false\n * gte('5', '3'); // false\n * ```\n * @param a - The first argument to compare.\n * @param b - The second argument to compare.\n *\n * @returns `true` if `a` is greater than or equal to `b`, otherwise `false`.\n */\nexport function ge(a: unknown, b: unknown): boolean {\n return typeof a === 'number' && typeof b === 'number' && a >= b;\n}\n"],"names":["ge","a","b"],"mappings":"AAiBO,SAASA,EAAGC,GAAYC,GAAqB;AAClD,SAAO,OAAOD,KAAM,YAAY,OAAOC,KAAM,YAAYD,KAAKC;AAChE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gt.cjs","sources":["../../src/typed/gt.ts"],"sourcesContent":["/**\n * Checks if the first argument is greater than the second argument.\n *\n * @example\n * ```ts\n * gt(5, 3); // true\n * gt(3, 5); // false\n * gt(5, 5); // false\n * ```\n *\n * @param a - The first argument to compare.\n * @param b - The second argument to compare.\n *\n * @returns `true` if `a` is greater than `b`, otherwise `false`.\n */\nexport function gt(a: unknown, b: unknown): boolean {\n return typeof a === 'number' && typeof b === 'number' && a > b;\n}\n"],"names":["gt","a","b"],"mappings":"gFAeO,SAASA,EAAGC,EAAYC,EAAqB,CAClD,OAAO,OAAOD,GAAM,UAAY,OAAOC,GAAM,UAAYD,EAAIC,CAC/D"}
|
package/dist/typed/gt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gt.js","sources":["../../src/typed/gt.ts"],"sourcesContent":["/**\n * Checks if the first argument is greater than the second argument.\n *\n * @example\n * ```ts\n * gt(5, 3); // true\n * gt(3, 5); // false\n * gt(5, 5); // false\n * ```\n *\n * @param a - The first argument to compare.\n * @param b - The second argument to compare.\n *\n * @returns `true` if `a` is greater than `b`, otherwise `false`.\n */\nexport function gt(a: unknown, b: unknown): boolean {\n return typeof a === 'number' && typeof b === 'number' && a > b;\n}\n"],"names":["gt","a","b"],"mappings":"AAeO,SAASA,EAAGC,GAAYC,GAAqB;AAClD,SAAO,OAAOD,KAAM,YAAY,OAAOC,KAAM,YAAYD,IAAIC;AAC/D;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ge.cjs"),n=require("./gt.cjs"),o=require("./isDefined.cjs"),c=require("./isEmpty.cjs"),r=require("./isEqual.cjs"),u=require("./isEven.cjs"),q=require("./isMatch.cjs"),l=require("./isNegative.cjs"),d=require("./isNil.cjs"),g=require("./isOdd.cjs"),a=require("./isPositive.cjs"),v=require("./isRegex.cjs"),p=require("./isWithin.cjs"),f=require("./isZero.cjs"),m=require("./le.cjs"),E=require("./lt.cjs"),h=require("./typeOf.cjs");function y(i,s){if(!i)throw new Error("Type must be provided");return{defined:o.isDefined,empty:c.isEmpty,eq:e=>r.isEqual(...e),even:u.isEven,ge:e=>t.ge(...e),gt:e=>n.gt(...e),le:e=>m.le(...e),lt:e=>E.lt(...e),match:e=>q.isMatch(...e),ne:e=>!r.isEqual(...e),negative:l.isNegative,nil:d.isNil,odd:g.isOdd,positive:a.isPositive,regex:v.isRegex,within:e=>p.isWithin(...e),zero:f.isZero}[i]?.(s)??h.typeOf(s)===i}exports.is=y;
|
|
2
|
+
//# sourceMappingURL=is.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.cjs","sources":["../../src/typed/is.ts"],"sourcesContent":["import { ge } from './ge';\nimport { gt } from './gt';\nimport { isDefined } from './isDefined';\nimport { isEmpty } from './isEmpty';\nimport { isEqual } from './isEqual';\nimport { isEven } from './isEven';\nimport { isMatch } from './isMatch';\nimport { isNegative } from './isNegative';\nimport { isNil } from './isNil';\nimport { isOdd } from './isOdd';\nimport { isPositive } from './isPositive';\nimport { isRegex } from './isRegex';\nimport { isWithin } from './isWithin';\nimport { isZero } from './isZero';\nimport { le } from './le';\nimport { lt } from './lt';\nimport { type ArgType, typeOf } from './typeOf';\n\ntype isType =\n | ArgType\n | 'defined'\n | 'empty'\n | 'eq'\n | 'even'\n | 'ge'\n | 'gt'\n | 'le'\n | 'lt'\n | 'match'\n | 'ne'\n | 'negative'\n | 'nil'\n | 'odd'\n | 'positive'\n | 'regex'\n | 'within'\n | 'zero';\n\n/**\n * @description\n * Checks if the value type of argument.\n *\n * @example\n * ```ts\n * is('array', []);\n * is('boolean', true);\n * is('date', new Date());\n * is('defined', 123);\n * is('empty', []);\n * is('even', 2);\n * is('function', () => {});\n * is('match', { a: 1, b: 2 }, { a: 1 });\n * is('nan', Number.NaN);\n * is('negative', -123);\n * is('nil', null);\n * is('null', null);\n * is('number', 123);\n * is('object', {});\n * is('odd', 3);\n * is('positive', 123);\n * is('string', 'hello');\n * is('symbol', Symbol('test'));\n * is('regex', /abc/);\n * is('string', 'hello world');\n * is('undefined', undefined);\n * is('within', 1, 2, 3);\n * is('zero', 0);\n * is('eq', [1, 2, 3], [1, 2, 3]);\n * is('ne', [1, 2, 3], [1, 2]);\n * is('ge', 5, 5);\n * is('gt', 5, 3);\n * is('le', 5, 5);\n * is('lt', 3, 5);\n * ```\n *\n * @param type - The type to check against.\n * @param args - The argument to be checked.\n *\n * @returns `true` if the value is of the specified type, else `false`.\n */\nexport function is(type: 'within', ...args: Parameters<typeof isWithin>): boolean;\nexport function is(type: 'eq', ...args: Parameters<typeof isEqual>): boolean;\nexport function is(type: 'ne', ...args: Parameters<typeof isEqual>): boolean;\nexport function is(type: 'gt', ...args: Parameters<typeof gt>): boolean;\nexport function is(type: 'ge', ...args: Parameters<typeof ge>): boolean;\nexport function is(type: 'lt', ...args: Parameters<typeof lt>): boolean;\nexport function is(type: 'le', ...args: Parameters<typeof le>): boolean;\nexport function is(type: 'match', ...args: Parameters<typeof isMatch>): boolean;\nexport function is(type: 'empty', ...args: Parameters<typeof isEmpty>): boolean;\nexport function is(type: 'array', arg: unknown): arg is Array<unknown>;\nexport function is(type: 'string', arg: unknown): arg is string;\nexport function is(type: 'number', arg: unknown): arg is number;\nexport function is(type: 'object', arg: unknown): arg is object;\nexport function is(type: 'nil', arg: unknown): arg is null | undefined;\nexport function is(type: 'primitive', arg: unknown): arg is string | number | boolean;\nexport function is(type: isType, arg: unknown): boolean;\nexport function is(type: string, arg: unknown): boolean {\n if (!type) {\n throw new Error('Type must be provided');\n }\n\n const compare = {\n defined: isDefined,\n empty: isEmpty,\n eq: (args: Parameters<typeof isEqual>) => isEqual(...args),\n even: isEven,\n ge: (args: Parameters<typeof ge>) => ge(...args),\n gt: (args: Parameters<typeof gt>) => gt(...args),\n le: (args: Parameters<typeof le>) => le(...args),\n lt: (args: Parameters<typeof lt>) => lt(...args),\n match: (args: Parameters<typeof isMatch>) => isMatch(...args),\n ne: (args: Parameters<typeof isEqual>) => !isEqual(...args),\n negative: isNegative,\n nil: isNil,\n odd: isOdd,\n positive: isPositive,\n regex: isRegex,\n within: (args: Parameters<typeof isWithin>) => isWithin(...args),\n zero: isZero,\n };\n\n return compare[type as keyof typeof compare]?.(arg) ?? typeOf(arg) === type;\n}\n"],"names":["is","type","arg","isDefined","isEmpty","args","isEqual","isEven","ge","gt","le","lt","isMatch","isNegative","isNil","isOdd","isPositive","isRegex","isWithin","isZero","typeOf"],"mappings":"+gBAgGO,SAASA,EAAGC,EAAcC,EAAuB,CACtD,GAAI,CAACD,EACH,MAAM,IAAI,MAAM,uBAAuB,EAuBzC,MApBgB,CACd,QAASE,EAAAA,UACT,MAAOC,EAAAA,QACP,GAAKC,GAAqCC,EAAAA,QAAQ,GAAGD,CAAI,EACzD,KAAME,EAAAA,OACN,GAAKF,GAAgCG,EAAAA,GAAG,GAAGH,CAAI,EAC/C,GAAKA,GAAgCI,EAAAA,GAAG,GAAGJ,CAAI,EAC/C,GAAKA,GAAgCK,EAAAA,GAAG,GAAGL,CAAI,EAC/C,GAAKA,GAAgCM,EAAAA,GAAG,GAAGN,CAAI,EAC/C,MAAQA,GAAqCO,EAAAA,QAAQ,GAAGP,CAAI,EAC5D,GAAKA,GAAqC,CAACC,EAAAA,QAAQ,GAAGD,CAAI,EAC1D,SAAUQ,EAAAA,WACV,IAAKC,EAAAA,MACL,IAAKC,EAAAA,MACL,SAAUC,EAAAA,WACV,MAAOC,EAAAA,QACP,OAASZ,GAAsCa,EAAAA,SAAS,GAAGb,CAAI,EAC/D,KAAMc,EAAAA,MAAA,EAGOlB,CAA4B,IAAIC,CAAG,GAAKkB,EAAAA,OAAOlB,CAAG,IAAMD,CACzE"}
|
package/dist/typed/is.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ge as t } from "./ge.js";
|
|
2
|
+
import { gt as e } from "./gt.js";
|
|
3
|
+
import { isDefined as p } from "./isDefined.js";
|
|
4
|
+
import { isEmpty as f } from "./isEmpty.js";
|
|
5
|
+
import { isEqual as m } from "./isEqual.js";
|
|
6
|
+
import { isEven as s } from "./isEven.js";
|
|
7
|
+
import { isMatch as n } from "./isMatch.js";
|
|
8
|
+
import { isNegative as d } from "./isNegative.js";
|
|
9
|
+
import { isNil as g } from "./isNil.js";
|
|
10
|
+
import { isOdd as l } from "./isOdd.js";
|
|
11
|
+
import { isPositive as v } from "./isPositive.js";
|
|
12
|
+
import { isRegex as a } from "./isRegex.js";
|
|
13
|
+
import { isWithin as c } from "./isWithin.js";
|
|
14
|
+
import { isZero as h } from "./isZero.js";
|
|
15
|
+
import { le as u } from "./le.js";
|
|
16
|
+
import { lt as E } from "./lt.js";
|
|
17
|
+
import { typeOf as w } from "./typeOf.js";
|
|
18
|
+
function C(o, r) {
|
|
19
|
+
if (!o)
|
|
20
|
+
throw new Error("Type must be provided");
|
|
21
|
+
return {
|
|
22
|
+
defined: p,
|
|
23
|
+
empty: f,
|
|
24
|
+
eq: (i) => m(...i),
|
|
25
|
+
even: s,
|
|
26
|
+
ge: (i) => t(...i),
|
|
27
|
+
gt: (i) => e(...i),
|
|
28
|
+
le: (i) => u(...i),
|
|
29
|
+
lt: (i) => E(...i),
|
|
30
|
+
match: (i) => n(...i),
|
|
31
|
+
ne: (i) => !m(...i),
|
|
32
|
+
negative: d,
|
|
33
|
+
nil: g,
|
|
34
|
+
odd: l,
|
|
35
|
+
positive: v,
|
|
36
|
+
regex: a,
|
|
37
|
+
within: (i) => c(...i),
|
|
38
|
+
zero: h
|
|
39
|
+
}[o]?.(r) ?? w(r) === o;
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
C as is
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=is.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.js","sources":["../../src/typed/is.ts"],"sourcesContent":["import { ge } from './ge';\nimport { gt } from './gt';\nimport { isDefined } from './isDefined';\nimport { isEmpty } from './isEmpty';\nimport { isEqual } from './isEqual';\nimport { isEven } from './isEven';\nimport { isMatch } from './isMatch';\nimport { isNegative } from './isNegative';\nimport { isNil } from './isNil';\nimport { isOdd } from './isOdd';\nimport { isPositive } from './isPositive';\nimport { isRegex } from './isRegex';\nimport { isWithin } from './isWithin';\nimport { isZero } from './isZero';\nimport { le } from './le';\nimport { lt } from './lt';\nimport { type ArgType, typeOf } from './typeOf';\n\ntype isType =\n | ArgType\n | 'defined'\n | 'empty'\n | 'eq'\n | 'even'\n | 'ge'\n | 'gt'\n | 'le'\n | 'lt'\n | 'match'\n | 'ne'\n | 'negative'\n | 'nil'\n | 'odd'\n | 'positive'\n | 'regex'\n | 'within'\n | 'zero';\n\n/**\n * @description\n * Checks if the value type of argument.\n *\n * @example\n * ```ts\n * is('array', []);\n * is('boolean', true);\n * is('date', new Date());\n * is('defined', 123);\n * is('empty', []);\n * is('even', 2);\n * is('function', () => {});\n * is('match', { a: 1, b: 2 }, { a: 1 });\n * is('nan', Number.NaN);\n * is('negative', -123);\n * is('nil', null);\n * is('null', null);\n * is('number', 123);\n * is('object', {});\n * is('odd', 3);\n * is('positive', 123);\n * is('string', 'hello');\n * is('symbol', Symbol('test'));\n * is('regex', /abc/);\n * is('string', 'hello world');\n * is('undefined', undefined);\n * is('within', 1, 2, 3);\n * is('zero', 0);\n * is('eq', [1, 2, 3], [1, 2, 3]);\n * is('ne', [1, 2, 3], [1, 2]);\n * is('ge', 5, 5);\n * is('gt', 5, 3);\n * is('le', 5, 5);\n * is('lt', 3, 5);\n * ```\n *\n * @param type - The type to check against.\n * @param args - The argument to be checked.\n *\n * @returns `true` if the value is of the specified type, else `false`.\n */\nexport function is(type: 'within', ...args: Parameters<typeof isWithin>): boolean;\nexport function is(type: 'eq', ...args: Parameters<typeof isEqual>): boolean;\nexport function is(type: 'ne', ...args: Parameters<typeof isEqual>): boolean;\nexport function is(type: 'gt', ...args: Parameters<typeof gt>): boolean;\nexport function is(type: 'ge', ...args: Parameters<typeof ge>): boolean;\nexport function is(type: 'lt', ...args: Parameters<typeof lt>): boolean;\nexport function is(type: 'le', ...args: Parameters<typeof le>): boolean;\nexport function is(type: 'match', ...args: Parameters<typeof isMatch>): boolean;\nexport function is(type: 'empty', ...args: Parameters<typeof isEmpty>): boolean;\nexport function is(type: 'array', arg: unknown): arg is Array<unknown>;\nexport function is(type: 'string', arg: unknown): arg is string;\nexport function is(type: 'number', arg: unknown): arg is number;\nexport function is(type: 'object', arg: unknown): arg is object;\nexport function is(type: 'nil', arg: unknown): arg is null | undefined;\nexport function is(type: 'primitive', arg: unknown): arg is string | number | boolean;\nexport function is(type: isType, arg: unknown): boolean;\nexport function is(type: string, arg: unknown): boolean {\n if (!type) {\n throw new Error('Type must be provided');\n }\n\n const compare = {\n defined: isDefined,\n empty: isEmpty,\n eq: (args: Parameters<typeof isEqual>) => isEqual(...args),\n even: isEven,\n ge: (args: Parameters<typeof ge>) => ge(...args),\n gt: (args: Parameters<typeof gt>) => gt(...args),\n le: (args: Parameters<typeof le>) => le(...args),\n lt: (args: Parameters<typeof lt>) => lt(...args),\n match: (args: Parameters<typeof isMatch>) => isMatch(...args),\n ne: (args: Parameters<typeof isEqual>) => !isEqual(...args),\n negative: isNegative,\n nil: isNil,\n odd: isOdd,\n positive: isPositive,\n regex: isRegex,\n within: (args: Parameters<typeof isWithin>) => isWithin(...args),\n zero: isZero,\n };\n\n return compare[type as keyof typeof compare]?.(arg) ?? typeOf(arg) === type;\n}\n"],"names":["is","type","arg","isDefined","isEmpty","args","isEqual","isEven","ge","gt","le","lt","isMatch","isNegative","isNil","isOdd","isPositive","isRegex","isWithin","isZero","typeOf"],"mappings":";;;;;;;;;;;;;;;;;AAgGO,SAASA,EAAGC,GAAcC,GAAuB;AACtD,MAAI,CAACD;AACH,UAAM,IAAI,MAAM,uBAAuB;AAuBzC,SApBgB;AAAA,IACd,SAASE;AAAA,IACT,OAAOC;AAAA,IACP,IAAI,CAACC,MAAqCC,EAAQ,GAAGD,CAAI;AAAA,IACzD,MAAME;AAAA,IACN,IAAI,CAACF,MAAgCG,EAAG,GAAGH,CAAI;AAAA,IAC/C,IAAI,CAACA,MAAgCI,EAAG,GAAGJ,CAAI;AAAA,IAC/C,IAAI,CAACA,MAAgCK,EAAG,GAAGL,CAAI;AAAA,IAC/C,IAAI,CAACA,MAAgCM,EAAG,GAAGN,CAAI;AAAA,IAC/C,OAAO,CAACA,MAAqCO,EAAQ,GAAGP,CAAI;AAAA,IAC5D,IAAI,CAACA,MAAqC,CAACC,EAAQ,GAAGD,CAAI;AAAA,IAC1D,UAAUQ;AAAA,IACV,KAAKC;AAAA,IACL,KAAKC;AAAA,IACL,UAAUC;AAAA,IACV,OAAOC;AAAA,IACP,QAAQ,CAACZ,MAAsCa,EAAS,GAAGb,CAAI;AAAA,IAC/D,MAAMc;AAAA,EAAA,EAGOlB,CAA4B,IAAIC,CAAG,KAAKkB,EAAOlB,CAAG,MAAMD;AACzE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isArray.cjs","sources":["../../src/typed/isArray.ts"],"sourcesContent":["/**\n * Determines if the passed value is an array.\n *\n * @example\n * ```ts\n * isArray([1, 2, 3]) // true\n * isArray(1, 2, 3) // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is an array, else `false`.\n */\nexport function isArray(arg: unknown): arg is Array<unknown> {\n return Array.isArray(arg);\n}\n\nexport const IS_ARRAY_ERROR_MSG = 'Expected an array';\n"],"names":["isArray","arg","IS_ARRAY_ERROR_MSG"],"mappings":"gFAaO,SAASA,EAAQC,EAAqC,CAC3D,OAAO,MAAM,QAAQA,CAAG,CAC1B,CAEO,MAAMC,EAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isArray.js","sources":["../../src/typed/isArray.ts"],"sourcesContent":["/**\n * Determines if the passed value is an array.\n *\n * @example\n * ```ts\n * isArray([1, 2, 3]) // true\n * isArray(1, 2, 3) // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is an array, else `false`.\n */\nexport function isArray(arg: unknown): arg is Array<unknown> {\n return Array.isArray(arg);\n}\n\nexport const IS_ARRAY_ERROR_MSG = 'Expected an array';\n"],"names":["isArray","arg","IS_ARRAY_ERROR_MSG"],"mappings":"AAaO,SAASA,EAAQC,GAAqC;AAC3D,SAAO,MAAM,QAAQA,CAAG;AAC1B;AAEO,MAAMC,IAAqB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBoolean.cjs","sources":["../../src/typed/isBoolean.ts"],"sourcesContent":["/**\n * Checks if the value is a boolean.\n *\n * @example\n * ```ts\n * isBoolean(true); // true\n * isBoolean(false); // true\n * isBoolean(123); // false\n * isBoolean('hello world'); // false\n * isBoolean({}); // false\n * isBoolean([]); // false\n * isBoolean(new Date()); // false\n * isBoolean(null); // false\n * isBoolean(undefined); // false\n * isBoolean(NaN); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a boolean, else `false`.\n */\nexport function isBoolean(arg: unknown): arg is boolean {\n return typeof arg === 'boolean';\n}\n"],"names":["isBoolean","arg"],"mappings":"gFAqBO,SAASA,EAAUC,EAA8B,CACtD,OAAO,OAAOA,GAAQ,SACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBoolean.js","sources":["../../src/typed/isBoolean.ts"],"sourcesContent":["/**\n * Checks if the value is a boolean.\n *\n * @example\n * ```ts\n * isBoolean(true); // true\n * isBoolean(false); // true\n * isBoolean(123); // false\n * isBoolean('hello world'); // false\n * isBoolean({}); // false\n * isBoolean([]); // false\n * isBoolean(new Date()); // false\n * isBoolean(null); // false\n * isBoolean(undefined); // false\n * isBoolean(NaN); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a boolean, else `false`.\n */\nexport function isBoolean(arg: unknown): arg is boolean {\n return typeof arg === 'boolean';\n}\n"],"names":["isBoolean","arg"],"mappings":"AAqBO,SAASA,EAAUC,GAA8B;AACtD,SAAO,OAAOA,KAAQ;AACxB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDate.cjs","sources":["../../src/typed/isDate.ts"],"sourcesContent":["/**\n * Determines if the passed value is a valid Date Object.\n *\n * @example\n * ```ts\n * isDate(new Date()); // true\n * isDate(123); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a valid Date object, else `false`.\n */\nexport function isDate(arg: unknown): arg is Date {\n return arg instanceof Date && !Number.isNaN(arg.getTime());\n}\n\nexport const IS_DATE_ERROR_MSG = 'Expected a Date object';\n"],"names":["isDate","arg","IS_DATE_ERROR_MSG"],"mappings":"gFAaO,SAASA,EAAOC,EAA2B,CAChD,OAAOA,aAAe,MAAQ,CAAC,OAAO,MAAMA,EAAI,SAAS,CAC3D,CAEO,MAAMC,EAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDate.js","sources":["../../src/typed/isDate.ts"],"sourcesContent":["/**\n * Determines if the passed value is a valid Date Object.\n *\n * @example\n * ```ts\n * isDate(new Date()); // true\n * isDate(123); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a valid Date object, else `false`.\n */\nexport function isDate(arg: unknown): arg is Date {\n return arg instanceof Date && !Number.isNaN(arg.getTime());\n}\n\nexport const IS_DATE_ERROR_MSG = 'Expected a Date object';\n"],"names":["isDate","arg","IS_DATE_ERROR_MSG"],"mappings":"AAaO,SAASA,EAAOC,GAA2B;AAChD,SAAOA,aAAe,QAAQ,CAAC,OAAO,MAAMA,EAAI,SAAS;AAC3D;AAEO,MAAMC,IAAoB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDefined.cjs","sources":["../../src/typed/isDefined.ts"],"sourcesContent":["/**\n * Checks if a value is defined (not `undefined`).\n *\n * @example\n * ```ts\n * isDefined(123); // true\n * isDefined(undefined); // false\n * isDefined('hello world'); // true\n * isDefined({}); // true\n * isDefined([]); // true\n * isDefined(null); // true\n * ```\n *\n * @param arg - The value to check.\n *\n * @returns `true` if the value is defined, else `false`.\n */\nexport function isDefined<T>(arg: T | undefined): arg is T {\n return arg !== undefined;\n}\n"],"names":["isDefined","arg"],"mappings":"gFAiBO,SAASA,EAAaC,EAA8B,CACzD,OAAOA,IAAQ,MACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDefined.js","sources":["../../src/typed/isDefined.ts"],"sourcesContent":["/**\n * Checks if a value is defined (not `undefined`).\n *\n * @example\n * ```ts\n * isDefined(123); // true\n * isDefined(undefined); // false\n * isDefined('hello world'); // true\n * isDefined({}); // true\n * isDefined([]); // true\n * isDefined(null); // true\n * ```\n *\n * @param arg - The value to check.\n *\n * @returns `true` if the value is defined, else `false`.\n */\nexport function isDefined<T>(arg: T | undefined): arg is T {\n return arg !== undefined;\n}\n"],"names":["isDefined","arg"],"mappings":"AAiBO,SAASA,EAAaC,GAA8B;AACzD,SAAOA,MAAQ;AACjB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./isArray.cjs"),i=require("./isNil.cjs"),s=require("./isObject.cjs");function n(e){return i.isNil(e)||e===""||t.isArray(e)&&e.length===0||s.isObject(e)&&Object.keys(e).length===0}const c="Expected an empty value";exports.IS_EMPTY_ERROR_MSG=c;exports.isEmpty=n;
|
|
2
|
+
//# sourceMappingURL=isEmpty.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEmpty.cjs","sources":["../../src/typed/isEmpty.ts"],"sourcesContent":["import { isArray } from './isArray';\nimport { isNil } from './isNil';\nimport { isObject } from './isObject';\n\n/**\n * Checks if the given argument is empty.\n *\n * @example\n * ```ts\n * isEmpty(null); // true\n * isEmpty(undefined); // true\n * isEmpty([]); // true\n * isEmpty({}); // true\n * isEmpty(''); // true\n * isEmpty(0); // false\n * isEmpty(123); // false\n * isEmpty('abc'); // false\n * isEmpty([1, 2, 3]); // false\n * isEmpty({ a: 1, b: 2 }); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if all arguments are `null`, `undefined`, `{}`, `[]`, or empty strings. Otherwise, it returns `false`.\n */\n// biome-ignore lint/suspicious/noExplicitAny: -\nexport function isEmpty(arg: any): boolean {\n return (\n isNil(arg) || arg === '' || (isArray(arg) && arg.length === 0) || (isObject(arg) && Object.keys(arg).length === 0)\n );\n}\n\nexport const IS_EMPTY_ERROR_MSG = 'Expected an empty value';\n"],"names":["isEmpty","arg","isNil","isArray","isObject","IS_EMPTY_ERROR_MSG"],"mappings":"sKA0BO,SAASA,EAAQC,EAAmB,CACzC,OACEC,EAAAA,MAAMD,CAAG,GAAKA,IAAQ,IAAOE,EAAAA,QAAQF,CAAG,GAAKA,EAAI,SAAW,GAAOG,EAAAA,SAASH,CAAG,GAAK,OAAO,KAAKA,CAAG,EAAE,SAAW,CAEpH,CAEO,MAAMI,EAAqB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isArray as e } from "./isArray.js";
|
|
2
|
+
import { isNil as i } from "./isNil.js";
|
|
3
|
+
import { isObject as o } from "./isObject.js";
|
|
4
|
+
function r(t) {
|
|
5
|
+
return i(t) || t === "" || e(t) && t.length === 0 || o(t) && Object.keys(t).length === 0;
|
|
6
|
+
}
|
|
7
|
+
const s = "Expected an empty value";
|
|
8
|
+
export {
|
|
9
|
+
s as IS_EMPTY_ERROR_MSG,
|
|
10
|
+
r as isEmpty
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=isEmpty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEmpty.js","sources":["../../src/typed/isEmpty.ts"],"sourcesContent":["import { isArray } from './isArray';\nimport { isNil } from './isNil';\nimport { isObject } from './isObject';\n\n/**\n * Checks if the given argument is empty.\n *\n * @example\n * ```ts\n * isEmpty(null); // true\n * isEmpty(undefined); // true\n * isEmpty([]); // true\n * isEmpty({}); // true\n * isEmpty(''); // true\n * isEmpty(0); // false\n * isEmpty(123); // false\n * isEmpty('abc'); // false\n * isEmpty([1, 2, 3]); // false\n * isEmpty({ a: 1, b: 2 }); // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if all arguments are `null`, `undefined`, `{}`, `[]`, or empty strings. Otherwise, it returns `false`.\n */\n// biome-ignore lint/suspicious/noExplicitAny: -\nexport function isEmpty(arg: any): boolean {\n return (\n isNil(arg) || arg === '' || (isArray(arg) && arg.length === 0) || (isObject(arg) && Object.keys(arg).length === 0)\n );\n}\n\nexport const IS_EMPTY_ERROR_MSG = 'Expected an empty value';\n"],"names":["isEmpty","arg","isNil","isArray","isObject","IS_EMPTY_ERROR_MSG"],"mappings":";;;AA0BO,SAASA,EAAQC,GAAmB;AACzC,SACEC,EAAMD,CAAG,KAAKA,MAAQ,MAAOE,EAAQF,CAAG,KAAKA,EAAI,WAAW,KAAOG,EAASH,CAAG,KAAK,OAAO,KAAKA,CAAG,EAAE,WAAW;AAEpH;AAEO,MAAMI,IAAqB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object"||typeof t!="object")return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}if(Array.isArray(e)!==Array.isArray(t))return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const f=Object.keys(e),s=Object.keys(t);if(f.length!==s.length)return!1;for(const r of f)if(!Object.hasOwn(t,r)||!n(e[r],t[r]))return!1;return!0}const i="Expected two values to be equal";exports.IS_EQUAL_ERROR_MSG=i;exports.isEqual=n;
|
|
2
|
+
//# sourceMappingURL=isEqual.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEqual.cjs","sources":["../../src/typed/isEqual.ts"],"sourcesContent":["/**\n * Deeply compares two values for equality, including objects, arrays, and primitives.\n * Detects circular references and optimizes performance.\n *\n * @example\n * ```ts\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n * isEqual([1, 2], [1, 2, 3]); // false\n * isEqual({ a: 1, b: 2 }, { a: 1, b: 2 }); // true\n * isEqual({ a: { b: 2 } }, { a: { b: 2 } }); // true\n * isEqual({ a: 1 }, { a: 2 }); // false\n * isEqual({ a: 1 }, { b: 1 }); // false\n * isEqual(new Date('2023-01-01'), new Date('2023-01-01')); // true\n * isEqual(new Date('2023-01-01'), new Date('2023-01-02')); // false\n * isEqual(new Date('2023-01-01'), 1); // false\n * ```\n *\n * @param a - First value to compare.\n * @param b - Second value to compare.\n * @returns Whether the values are deeply equal.\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: -\nexport function isEqual(a: unknown, b: unknown): boolean {\n // Check for strict equality (handles primitives and references)\n if (a === b) return true;\n\n // If either is null or not an object, they're not equal\n if (a == null || b == null || typeof a !== typeof b || typeof a !== 'object' || typeof b !== 'object') return false;\n\n // Array comparison\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n for (let idx = 0; idx < a.length; idx++) {\n if (!isEqual(a[idx], b[idx])) return false;\n }\n return true;\n }\n\n // Ensure both are arrays or neither is\n if (Array.isArray(a) !== Array.isArray(b)) return false;\n\n // Date comparison\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n // Object comparison\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!Object.hasOwn(b, key) || !isEqual((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key]))\n return false;\n }\n\n return true;\n}\n\nexport const IS_EQUAL_ERROR_MSG = 'Expected two values to be equal';\n"],"names":["isEqual","a","b","idx","keysA","keysB","key","IS_EQUAL_ERROR_MSG"],"mappings":"gFAsBO,SAASA,EAAQC,EAAYC,EAAqB,CAEvD,GAAID,IAAMC,EAAG,MAAO,GAGpB,GAAID,GAAK,MAAQC,GAAK,MAAQ,OAAOD,GAAM,OAAOC,GAAK,OAAOD,GAAM,UAAY,OAAOC,GAAM,SAAU,MAAO,GAG9G,GAAI,MAAM,QAAQD,CAAC,GAAK,MAAM,QAAQC,CAAC,EAAG,CACxC,GAAID,EAAE,SAAWC,EAAE,OAAQ,MAAO,GAClC,QAASC,EAAM,EAAGA,EAAMF,EAAE,OAAQE,IAChC,GAAI,CAACH,EAAQC,EAAEE,CAAG,EAAGD,EAAEC,CAAG,CAAC,EAAG,MAAO,GAEvC,MAAO,EACT,CAGA,GAAI,MAAM,QAAQF,CAAC,IAAM,MAAM,QAAQC,CAAC,EAAG,MAAO,GAGlD,GAAID,aAAa,MAAQC,aAAa,KACpC,OAAOD,EAAE,YAAcC,EAAE,QAAA,EAI3B,MAAME,EAAQ,OAAO,KAAKH,CAAC,EACrBI,EAAQ,OAAO,KAAKH,CAAC,EAE3B,GAAIE,EAAM,SAAWC,EAAM,OAAQ,MAAO,GAE1C,UAAWC,KAAOF,EAChB,GAAI,CAAC,OAAO,OAAOF,EAAGI,CAAG,GAAK,CAACN,EAASC,EAA8BK,CAAG,EAAIJ,EAA8BI,CAAG,CAAC,EAC7G,MAAO,GAGX,MAAO,EACT,CAEO,MAAMC,EAAqB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function f(e, t) {
|
|
2
|
+
if (e === t) return !0;
|
|
3
|
+
if (e == null || t == null || typeof e != typeof t || typeof e != "object" || typeof t != "object") return !1;
|
|
4
|
+
if (Array.isArray(e) && Array.isArray(t)) {
|
|
5
|
+
if (e.length !== t.length) return !1;
|
|
6
|
+
for (let r = 0; r < e.length; r++)
|
|
7
|
+
if (!f(e[r], t[r])) return !1;
|
|
8
|
+
return !0;
|
|
9
|
+
}
|
|
10
|
+
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
11
|
+
if (e instanceof Date && t instanceof Date)
|
|
12
|
+
return e.getTime() === t.getTime();
|
|
13
|
+
const n = Object.keys(e), s = Object.keys(t);
|
|
14
|
+
if (n.length !== s.length) return !1;
|
|
15
|
+
for (const r of n)
|
|
16
|
+
if (!Object.hasOwn(t, r) || !f(e[r], t[r]))
|
|
17
|
+
return !1;
|
|
18
|
+
return !0;
|
|
19
|
+
}
|
|
20
|
+
const i = "Expected two values to be equal";
|
|
21
|
+
export {
|
|
22
|
+
i as IS_EQUAL_ERROR_MSG,
|
|
23
|
+
f as isEqual
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=isEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEqual.js","sources":["../../src/typed/isEqual.ts"],"sourcesContent":["/**\n * Deeply compares two values for equality, including objects, arrays, and primitives.\n * Detects circular references and optimizes performance.\n *\n * @example\n * ```ts\n * isEqual([1, 2, 3], [1, 2, 3]); // true\n * isEqual([1, 2], [1, 2, 3]); // false\n * isEqual({ a: 1, b: 2 }, { a: 1, b: 2 }); // true\n * isEqual({ a: { b: 2 } }, { a: { b: 2 } }); // true\n * isEqual({ a: 1 }, { a: 2 }); // false\n * isEqual({ a: 1 }, { b: 1 }); // false\n * isEqual(new Date('2023-01-01'), new Date('2023-01-01')); // true\n * isEqual(new Date('2023-01-01'), new Date('2023-01-02')); // false\n * isEqual(new Date('2023-01-01'), 1); // false\n * ```\n *\n * @param a - First value to compare.\n * @param b - Second value to compare.\n * @returns Whether the values are deeply equal.\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: -\nexport function isEqual(a: unknown, b: unknown): boolean {\n // Check for strict equality (handles primitives and references)\n if (a === b) return true;\n\n // If either is null or not an object, they're not equal\n if (a == null || b == null || typeof a !== typeof b || typeof a !== 'object' || typeof b !== 'object') return false;\n\n // Array comparison\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n for (let idx = 0; idx < a.length; idx++) {\n if (!isEqual(a[idx], b[idx])) return false;\n }\n return true;\n }\n\n // Ensure both are arrays or neither is\n if (Array.isArray(a) !== Array.isArray(b)) return false;\n\n // Date comparison\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n // Object comparison\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!Object.hasOwn(b, key) || !isEqual((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key]))\n return false;\n }\n\n return true;\n}\n\nexport const IS_EQUAL_ERROR_MSG = 'Expected two values to be equal';\n"],"names":["isEqual","a","b","idx","keysA","keysB","key","IS_EQUAL_ERROR_MSG"],"mappings":"AAsBO,SAASA,EAAQC,GAAYC,GAAqB;AAEvD,MAAID,MAAMC,EAAG,QAAO;AAGpB,MAAID,KAAK,QAAQC,KAAK,QAAQ,OAAOD,KAAM,OAAOC,KAAK,OAAOD,KAAM,YAAY,OAAOC,KAAM,SAAU,QAAO;AAG9G,MAAI,MAAM,QAAQD,CAAC,KAAK,MAAM,QAAQC,CAAC,GAAG;AACxC,QAAID,EAAE,WAAWC,EAAE,OAAQ,QAAO;AAClC,aAASC,IAAM,GAAGA,IAAMF,EAAE,QAAQE;AAChC,UAAI,CAACH,EAAQC,EAAEE,CAAG,GAAGD,EAAEC,CAAG,CAAC,EAAG,QAAO;AAEvC,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,QAAQF,CAAC,MAAM,MAAM,QAAQC,CAAC,EAAG,QAAO;AAGlD,MAAID,aAAa,QAAQC,aAAa;AACpC,WAAOD,EAAE,cAAcC,EAAE,QAAA;AAI3B,QAAME,IAAQ,OAAO,KAAKH,CAAC,GACrBI,IAAQ,OAAO,KAAKH,CAAC;AAE3B,MAAIE,EAAM,WAAWC,EAAM,OAAQ,QAAO;AAE1C,aAAWC,KAAOF;AAChB,QAAI,CAAC,OAAO,OAAOF,GAAGI,CAAG,KAAK,CAACN,EAASC,EAA8BK,CAAG,GAAIJ,EAA8BI,CAAG,CAAC;AAC7G,aAAO;AAGX,SAAO;AACT;AAEO,MAAMC,IAAqB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEven.cjs","sources":["../../src/typed/isEven.ts"],"sourcesContent":["/**\n * Checks if a number is even.\n *\n * @param {number} arg - The number to check.\n *\n * @returns {boolean} - Returns true if the number is even, otherwise false.\n */\nexport function isEven(arg: unknown): arg is number {\n return typeof arg === 'number' && Number.isFinite(arg) && Number.isInteger(arg) && arg % 2 === 0;\n}\n"],"names":["isEven","arg"],"mappings":"gFAOO,SAASA,EAAOC,EAA6B,CAClD,OAAO,OAAOA,GAAQ,UAAY,OAAO,SAASA,CAAG,GAAK,OAAO,UAAUA,CAAG,GAAKA,EAAM,IAAM,CACjG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEven.js","sources":["../../src/typed/isEven.ts"],"sourcesContent":["/**\n * Checks if a number is even.\n *\n * @param {number} arg - The number to check.\n *\n * @returns {boolean} - Returns true if the number is even, otherwise false.\n */\nexport function isEven(arg: unknown): arg is number {\n return typeof arg === 'number' && Number.isFinite(arg) && Number.isInteger(arg) && arg % 2 === 0;\n}\n"],"names":["isEven","arg"],"mappings":"AAOO,SAASA,EAAOC,GAA6B;AAClD,SAAO,OAAOA,KAAQ,YAAY,OAAO,SAASA,CAAG,KAAK,OAAO,UAAUA,CAAG,KAAKA,IAAM,MAAM;AACjG;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isFunction.cjs","sources":["../../src/typed/isFunction.ts"],"sourcesContent":["/**\n * Determines if the passed value is a function.\n *\n * @example\n * ```ts\n * isFunction(function() {}) // true\n * isFunction(() => {}) // true\n * isFunction('hello world') // false\n * ```\n *\n * @param arg - The argument to be checked.\n *\n * @returns `true` if the value is a function, else `false`.\n */\n// biome-ignore lint/suspicious/noExplicitAny: -\nexport function isFunction(arg: unknown): arg is (...args: any[]) => any {\n return typeof arg === 'function';\n}\n\nexport const IS_FUNCTION_ERROR_MSG = 'Expected a function';\n"],"names":["isFunction","arg","IS_FUNCTION_ERROR_MSG"],"mappings":"gFAeO,SAASA,EAAWC,EAA8C,CACvE,OAAO,OAAOA,GAAQ,UACxB,CAEO,MAAMC,EAAwB"}
|