@vinicunca/perkakas 1.0.2 → 1.0.3
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/add-prop.spec-d.cjs +1 -0
- package/dist/add-prop.spec-d.d.cts +2 -0
- package/dist/add-prop.spec-d.d.ts +2 -0
- package/dist/add-prop.spec-d.js +1 -0
- package/dist/chunk-2ADWP73S.js +1 -0
- package/dist/chunk-2VLHCBHJ.js +1 -0
- package/dist/chunk-HU67VIVI.js +1 -0
- package/dist/chunk-J5PNUDDU.js +1 -0
- package/dist/chunk-MZWACWOX.js +1 -0
- package/dist/chunk-QHGCU3LJ.js +1 -0
- package/dist/chunk-T7S2RC5M.cjs +1 -0
- package/dist/chunk-TRIZIXDA.cjs +1 -0
- package/dist/chunk-ULMOKABQ.cjs +1 -0
- package/dist/chunk-UVAWCZB6.js +1 -0
- package/dist/chunk-VAUOPMAN.cjs +1 -0
- package/dist/chunk-XSYAC5NV.cjs +1 -0
- package/dist/chunk-ZJGZ2TEC.cjs +1 -0
- package/dist/chunk.spec-d.cjs +1 -0
- package/dist/chunk.spec-d.d.cts +2 -0
- package/dist/chunk.spec-d.d.ts +2 -0
- package/dist/chunk.spec-d.js +1 -0
- package/dist/conditional.spec-d.cjs +1 -0
- package/dist/conditional.spec-d.d.cts +2 -0
- package/dist/conditional.spec-d.d.ts +2 -0
- package/dist/conditional.spec-d.js +1 -0
- package/dist/constant.spec-d.cjs +1 -0
- package/dist/constant.spec-d.d.cts +2 -0
- package/dist/constant.spec-d.d.ts +2 -0
- package/dist/constant.spec-d.js +1 -0
- package/dist/{curry-order-rules-BOMf1JS7.d.cts → curry-order-rules-DETxSzle.d.cts} +1 -1
- package/dist/{curry-order-rules-BOMf1JS7.d.ts → curry-order-rules-DETxSzle.d.ts} +1 -1
- package/dist/debounce.spec-d.cjs +1 -0
- package/dist/debounce.spec-d.d.cts +2 -0
- package/dist/debounce.spec-d.d.ts +2 -0
- package/dist/debounce.spec-d.js +1 -0
- package/dist/do-nothing.spec-d.cjs +1 -0
- package/dist/do-nothing.spec-d.d.cts +2 -0
- package/dist/do-nothing.spec-d.d.ts +2 -0
- package/dist/do-nothing.spec-d.js +1 -0
- package/dist/drop-first-by.d.cts +1 -1
- package/dist/drop-first-by.d.ts +1 -1
- package/dist/entries.spec-d.cjs +1 -0
- package/dist/entries.spec-d.d.cts +2 -0
- package/dist/entries.spec-d.d.ts +2 -0
- package/dist/entries.spec-d.js +1 -0
- package/dist/evolve.spec-d.cjs +1 -0
- package/dist/evolve.spec-d.d.cts +2 -0
- package/dist/evolve.spec-d.d.ts +2 -0
- package/dist/evolve.spec-d.js +1 -0
- package/dist/filter.spec-d.cjs +1 -0
- package/dist/filter.spec-d.d.cts +2 -0
- package/dist/filter.spec-d.d.ts +2 -0
- package/dist/filter.spec-d.js +1 -0
- package/dist/find.spec-d.cjs +1 -0
- package/dist/find.spec-d.d.cts +2 -0
- package/dist/find.spec-d.d.ts +2 -0
- package/dist/find.spec-d.js +1 -0
- package/dist/first-by.cjs +1 -1
- package/dist/first-by.d.cts +1 -1
- package/dist/first-by.d.ts +1 -1
- package/dist/first-by.js +1 -1
- package/dist/first-by.spec-d.cjs +1 -0
- package/dist/first-by.spec-d.d.cts +2 -0
- package/dist/first-by.spec-d.d.ts +2 -0
- package/dist/first-by.spec-d.js +1 -0
- package/dist/first.spec-d.cjs +1 -0
- package/dist/first.spec-d.d.cts +2 -0
- package/dist/first.spec-d.d.ts +2 -0
- package/dist/first.spec-d.js +1 -0
- package/dist/flat.spec-d.cjs +1 -0
- package/dist/flat.spec-d.d.cts +2 -0
- package/dist/flat.spec-d.d.ts +2 -0
- package/dist/flat.spec-d.js +1 -0
- package/dist/for-each-obj.spec-d.cjs +1 -0
- package/dist/for-each-obj.spec-d.d.cts +2 -0
- package/dist/for-each-obj.spec-d.d.ts +2 -0
- package/dist/for-each-obj.spec-d.js +1 -0
- package/dist/for-each.spec-d.cjs +1 -0
- package/dist/for-each.spec-d.d.cts +2 -0
- package/dist/for-each.spec-d.d.ts +2 -0
- package/dist/for-each.spec-d.js +1 -0
- package/dist/from-entries.spec-d.cjs +1 -0
- package/dist/from-entries.spec-d.d.cts +2 -0
- package/dist/from-entries.spec-d.d.ts +2 -0
- package/dist/from-entries.spec-d.js +1 -0
- package/dist/from-keys.spec-d.cjs +1 -0
- package/dist/from-keys.spec-d.d.cts +2 -0
- package/dist/from-keys.spec-d.d.ts +2 -0
- package/dist/from-keys.spec-d.js +1 -0
- package/dist/group-by.spec-d.cjs +1 -0
- package/dist/group-by.spec-d.d.cts +2 -0
- package/dist/group-by.spec-d.d.ts +2 -0
- package/dist/group-by.spec-d.js +1 -0
- package/dist/has-at-least.spec-d.cjs +1 -0
- package/dist/has-at-least.spec-d.d.cts +2 -0
- package/dist/has-at-least.spec-d.d.ts +2 -0
- package/dist/has-at-least.spec-d.js +1 -0
- package/dist/has-sub-object.spec-d.cjs +1 -0
- package/dist/has-sub-object.spec-d.d.cts +2 -0
- package/dist/has-sub-object.spec-d.d.ts +2 -0
- package/dist/has-sub-object.spec-d.js +1 -0
- package/dist/identity.spec-d.cjs +1 -0
- package/dist/identity.spec-d.d.cts +2 -0
- package/dist/identity.spec-d.d.ts +2 -0
- package/dist/identity.spec-d.js +1 -0
- package/dist/index-by.spec-d.cjs +1 -0
- package/dist/index-by.spec-d.d.cts +2 -0
- package/dist/index-by.spec-d.d.ts +2 -0
- package/dist/index-by.spec-d.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/intersection.spec-d.cjs +1 -0
- package/dist/intersection.spec-d.d.cts +2 -0
- package/dist/intersection.spec-d.d.ts +2 -0
- package/dist/intersection.spec-d.js +1 -0
- package/dist/invert.spec-d.cjs +1 -0
- package/dist/invert.spec-d.d.cts +2 -0
- package/dist/invert.spec-d.d.ts +2 -0
- package/dist/invert.spec-d.js +1 -0
- package/dist/is-array.spec-d.cjs +1 -0
- package/dist/is-array.spec-d.d.cts +2 -0
- package/dist/is-array.spec-d.d.ts +2 -0
- package/dist/is-array.spec-d.js +1 -0
- package/dist/is-big-int.spec-d.cjs +1 -0
- package/dist/is-big-int.spec-d.d.cts +2 -0
- package/dist/is-big-int.spec-d.d.ts +2 -0
- package/dist/is-big-int.spec-d.js +1 -0
- package/dist/is-boolean.spec-d.cjs +1 -0
- package/dist/is-boolean.spec-d.d.cts +2 -0
- package/dist/is-boolean.spec-d.d.ts +2 -0
- package/dist/is-boolean.spec-d.js +1 -0
- package/dist/is-date.spec-d.cjs +1 -0
- package/dist/is-date.spec-d.d.cts +2 -0
- package/dist/is-date.spec-d.d.ts +2 -0
- package/dist/is-date.spec-d.js +1 -0
- package/dist/is-deep-equal.d.cts +26 -10
- package/dist/is-deep-equal.d.ts +26 -10
- package/dist/is-deep-equal.spec-d.cjs +1 -0
- package/dist/is-deep-equal.spec-d.d.cts +2 -0
- package/dist/is-deep-equal.spec-d.d.ts +2 -0
- package/dist/is-deep-equal.spec-d.js +1 -0
- package/dist/is-defined.spec-d.cjs +1 -0
- package/dist/is-defined.spec-d.d.cts +2 -0
- package/dist/is-defined.spec-d.d.ts +2 -0
- package/dist/is-defined.spec-d.js +1 -0
- package/dist/is-empty.cjs +1 -1
- package/dist/is-empty.js +1 -1
- package/dist/is-empty.spec-d.cjs +1 -0
- package/dist/is-empty.spec-d.d.cts +2 -0
- package/dist/is-empty.spec-d.d.ts +2 -0
- package/dist/is-empty.spec-d.js +1 -0
- package/dist/is-error.spec-d.cjs +1 -0
- package/dist/is-error.spec-d.d.cts +2 -0
- package/dist/is-error.spec-d.d.ts +2 -0
- package/dist/is-error.spec-d.js +1 -0
- package/dist/is-function.spec-d.cjs +1 -0
- package/dist/is-function.spec-d.d.cts +2 -0
- package/dist/is-function.spec-d.d.ts +2 -0
- package/dist/is-function.spec-d.js +1 -0
- package/dist/is-included-in.spec-d.cjs +1 -0
- package/dist/is-included-in.spec-d.d.cts +2 -0
- package/dist/is-included-in.spec-d.d.ts +2 -0
- package/dist/is-included-in.spec-d.js +1 -0
- package/dist/is-non-null.spec-d.cjs +1 -0
- package/dist/is-non-null.spec-d.d.cts +2 -0
- package/dist/is-non-null.spec-d.d.ts +2 -0
- package/dist/is-non-null.spec-d.js +1 -0
- package/dist/is-non-nullish.spec-d.cjs +1 -0
- package/dist/is-non-nullish.spec-d.d.cts +2 -0
- package/dist/is-non-nullish.spec-d.d.ts +2 -0
- package/dist/is-non-nullish.spec-d.js +1 -0
- package/dist/is-not.spec-d.cjs +1 -0
- package/dist/is-not.spec-d.d.cts +2 -0
- package/dist/is-not.spec-d.d.ts +2 -0
- package/dist/is-not.spec-d.js +1 -0
- package/dist/is-nullish.spec-d.cjs +1 -0
- package/dist/is-nullish.spec-d.d.cts +2 -0
- package/dist/is-nullish.spec-d.d.ts +2 -0
- package/dist/is-nullish.spec-d.js +1 -0
- package/dist/is-number.spec-d.cjs +1 -0
- package/dist/is-number.spec-d.d.cts +2 -0
- package/dist/is-number.spec-d.d.ts +2 -0
- package/dist/is-number.spec-d.js +1 -0
- package/dist/is-object-type.spec-d.cjs +1 -0
- package/dist/is-object-type.spec-d.d.cts +2 -0
- package/dist/is-object-type.spec-d.d.ts +2 -0
- package/dist/is-object-type.spec-d.js +1 -0
- package/dist/is-plain-object.spec-d.cjs +1 -0
- package/dist/is-plain-object.spec-d.d.cts +2 -0
- package/dist/is-plain-object.spec-d.d.ts +2 -0
- package/dist/is-plain-object.spec-d.js +1 -0
- package/dist/is-promise.spec-d.cjs +1 -0
- package/dist/is-promise.spec-d.d.cts +2 -0
- package/dist/is-promise.spec-d.d.ts +2 -0
- package/dist/is-promise.spec-d.js +1 -0
- package/dist/is-shallow-equal.cjs +1 -0
- package/dist/is-shallow-equal.d.cts +69 -0
- package/dist/is-shallow-equal.d.ts +69 -0
- package/dist/is-shallow-equal.js +1 -0
- package/dist/is-shallow-equal.spec-d.cjs +1 -0
- package/dist/is-shallow-equal.spec-d.d.cts +2 -0
- package/dist/is-shallow-equal.spec-d.d.ts +2 -0
- package/dist/is-shallow-equal.spec-d.js +1 -0
- package/dist/is-strict-equal.cjs +1 -0
- package/dist/is-strict-equal.d.cts +65 -0
- package/dist/is-strict-equal.d.ts +65 -0
- package/dist/is-strict-equal.js +1 -0
- package/dist/is-strict-equal.spec-d.cjs +1 -0
- package/dist/is-strict-equal.spec-d.d.cts +2 -0
- package/dist/is-strict-equal.spec-d.d.ts +2 -0
- package/dist/is-strict-equal.spec-d.js +1 -0
- package/dist/is-string.spec-d.cjs +1 -0
- package/dist/is-string.spec-d.d.cts +2 -0
- package/dist/is-string.spec-d.d.ts +2 -0
- package/dist/is-string.spec-d.js +1 -0
- package/dist/is-symbol.spec-d.cjs +1 -0
- package/dist/is-symbol.spec-d.d.cts +2 -0
- package/dist/is-symbol.spec-d.d.ts +2 -0
- package/dist/is-symbol.spec-d.js +1 -0
- package/dist/is-truthy.spec-d.cjs +1 -0
- package/dist/is-truthy.spec-d.d.cts +2 -0
- package/dist/is-truthy.spec-d.d.ts +2 -0
- package/dist/is-truthy.spec-d.js +1 -0
- package/dist/join.spec-d.cjs +1 -0
- package/dist/join.spec-d.d.cts +2 -0
- package/dist/join.spec-d.d.ts +2 -0
- package/dist/join.spec-d.js +1 -0
- package/dist/keys.spec-d.cjs +1 -0
- package/dist/keys.spec-d.d.cts +2 -0
- package/dist/keys.spec-d.d.ts +2 -0
- package/dist/keys.spec-d.js +1 -0
- package/dist/last.spec-d.cjs +1 -0
- package/dist/last.spec-d.d.cts +2 -0
- package/dist/last.spec-d.d.ts +2 -0
- package/dist/last.spec-d.js +1 -0
- package/dist/map-keys.spec-d.cjs +1 -0
- package/dist/map-keys.spec-d.d.cts +2 -0
- package/dist/map-keys.spec-d.d.ts +2 -0
- package/dist/map-keys.spec-d.js +1 -0
- package/dist/map-values.spec-d.cjs +1 -0
- package/dist/map-values.spec-d.d.cts +2 -0
- package/dist/map-values.spec-d.d.ts +2 -0
- package/dist/map-values.spec-d.js +1 -0
- package/dist/map-with-feedback.spec-d.cjs +1 -0
- package/dist/map-with-feedback.spec-d.d.cts +2 -0
- package/dist/map-with-feedback.spec-d.d.ts +2 -0
- package/dist/map-with-feedback.spec-d.js +1 -0
- package/dist/map.spec-d.cjs +1 -0
- package/dist/map.spec-d.d.cts +2 -0
- package/dist/map.spec-d.d.ts +2 -0
- package/dist/map.spec-d.js +1 -0
- package/dist/merge-deep.spec-d.cjs +1 -0
- package/dist/merge-deep.spec-d.d.cts +2 -0
- package/dist/merge-deep.spec-d.d.ts +2 -0
- package/dist/merge-deep.spec-d.js +1 -0
- package/dist/merge.spec-d.cjs +1 -0
- package/dist/merge.spec-d.d.cts +2 -0
- package/dist/merge.spec-d.d.ts +2 -0
- package/dist/merge.spec-d.js +1 -0
- package/dist/nth-by.d.cts +1 -1
- package/dist/nth-by.d.ts +1 -1
- package/dist/nth-by.spec-d.cjs +1 -0
- package/dist/nth-by.spec-d.d.cts +2 -0
- package/dist/nth-by.spec-d.d.ts +2 -0
- package/dist/nth-by.spec-d.js +1 -0
- package/dist/omit-by.spec-d.cjs +1 -0
- package/dist/omit-by.spec-d.d.cts +2 -0
- package/dist/omit-by.spec-d.d.ts +2 -0
- package/dist/omit-by.spec-d.js +1 -0
- package/dist/omit.spec-d.cjs +1 -0
- package/dist/omit.spec-d.d.cts +2 -0
- package/dist/omit.spec-d.d.ts +2 -0
- package/dist/omit.spec-d.js +1 -0
- package/dist/only.spec-d.cjs +1 -0
- package/dist/only.spec-d.d.cts +2 -0
- package/dist/only.spec-d.d.ts +2 -0
- package/dist/only.spec-d.js +1 -0
- package/dist/partition.spec-d.cjs +1 -0
- package/dist/partition.spec-d.d.cts +2 -0
- package/dist/partition.spec-d.d.ts +2 -0
- package/dist/partition.spec-d.js +1 -0
- package/dist/pick-by.spec-d.cjs +1 -0
- package/dist/pick-by.spec-d.d.cts +2 -0
- package/dist/pick-by.spec-d.d.ts +2 -0
- package/dist/pick-by.spec-d.js +1 -0
- package/dist/pick.spec-d.cjs +1 -0
- package/dist/pick.spec-d.d.cts +2 -0
- package/dist/pick.spec-d.d.ts +2 -0
- package/dist/pick.spec-d.js +1 -0
- package/dist/product.spec-d.cjs +1 -0
- package/dist/product.spec-d.d.cts +2 -0
- package/dist/product.spec-d.d.ts +2 -0
- package/dist/product.spec-d.js +1 -0
- package/dist/prop.spec-d.cjs +1 -0
- package/dist/prop.spec-d.d.cts +2 -0
- package/dist/prop.spec-d.d.ts +2 -0
- package/dist/prop.spec-d.js +1 -0
- package/dist/pull-object.spec-d.cjs +1 -0
- package/dist/pull-object.spec-d.d.cts +2 -0
- package/dist/pull-object.spec-d.d.ts +2 -0
- package/dist/pull-object.spec-d.js +1 -0
- package/dist/rank-by.d.cts +1 -1
- package/dist/rank-by.d.ts +1 -1
- package/dist/reverse.spec-d.cjs +1 -0
- package/dist/reverse.spec-d.d.cts +2 -0
- package/dist/reverse.spec-d.d.ts +2 -0
- package/dist/reverse.spec-d.js +1 -0
- package/dist/sample.spec-d.cjs +1 -0
- package/dist/sample.spec-d.d.cts +2 -0
- package/dist/sample.spec-d.d.ts +2 -0
- package/dist/sample.spec-d.js +1 -0
- package/dist/set-path.cjs +1 -1
- package/dist/set-path.d.cts +4 -4
- package/dist/set-path.d.ts +4 -4
- package/dist/set-path.js +1 -1
- package/dist/set-path.spec-d.cjs +1 -0
- package/dist/set-path.spec-d.d.cts +2 -0
- package/dist/set-path.spec-d.d.ts +2 -0
- package/dist/set-path.spec-d.js +1 -0
- package/dist/set.spec-d.cjs +1 -0
- package/dist/set.spec-d.d.cts +2 -0
- package/dist/set.spec-d.d.ts +2 -0
- package/dist/set.spec-d.js +1 -0
- package/dist/sort-by.d.cts +1 -1
- package/dist/sort-by.d.ts +1 -1
- package/dist/sort-by.spec-d.cjs +1 -0
- package/dist/sort-by.spec-d.d.cts +2 -0
- package/dist/sort-by.spec-d.d.ts +2 -0
- package/dist/sort-by.spec-d.js +1 -0
- package/dist/sort.spec-d.cjs +1 -0
- package/dist/sort.spec-d.d.cts +2 -0
- package/dist/sort.spec-d.d.ts +2 -0
- package/dist/sort.spec-d.js +1 -0
- package/dist/splice.spec-d.cjs +1 -0
- package/dist/splice.spec-d.d.cts +2 -0
- package/dist/splice.spec-d.d.ts +2 -0
- package/dist/splice.spec-d.js +1 -0
- package/dist/split.spec-d.cjs +1 -0
- package/dist/split.spec-d.d.cts +2 -0
- package/dist/split.spec-d.d.ts +2 -0
- package/dist/split.spec-d.js +1 -0
- package/dist/string-to-path.spec-d.cjs +1 -0
- package/dist/string-to-path.spec-d.d.cts +2 -0
- package/dist/string-to-path.spec-d.d.ts +2 -0
- package/dist/string-to-path.spec-d.js +1 -0
- package/dist/sum.spec-d.cjs +1 -0
- package/dist/sum.spec-d.d.cts +2 -0
- package/dist/sum.spec-d.d.ts +2 -0
- package/dist/sum.spec-d.js +1 -0
- package/dist/swap-props.spec-d.cjs +1 -0
- package/dist/swap-props.spec-d.d.cts +2 -0
- package/dist/swap-props.spec-d.d.ts +2 -0
- package/dist/swap-props.spec-d.js +1 -0
- package/dist/take-first-by.d.cts +1 -1
- package/dist/take-first-by.d.ts +1 -1
- package/dist/tap.spec-d.cjs +1 -0
- package/dist/tap.spec-d.d.cts +2 -0
- package/dist/tap.spec-d.d.ts +2 -0
- package/dist/tap.spec-d.js +1 -0
- package/dist/times.cjs +1 -1
- package/dist/times.d.cts +21 -5
- package/dist/times.d.ts +21 -5
- package/dist/times.js +1 -1
- package/dist/times.spec-d.cjs +1 -0
- package/dist/times.spec-d.d.cts +2 -0
- package/dist/times.spec-d.d.ts +2 -0
- package/dist/times.spec-d.js +1 -0
- package/dist/values.spec-d.cjs +1 -0
- package/dist/values.spec-d.d.cts +2 -0
- package/dist/values.spec-d.d.ts +2 -0
- package/dist/values.spec-d.js +1 -0
- package/dist/zip-with.spec-d.cjs +1 -0
- package/dist/zip-with.spec-d.d.cts +2 -0
- package/dist/zip-with.spec-d.d.ts +2 -0
- package/dist/zip-with.spec-d.js +1 -0
- package/dist/zip.spec-d.cjs +1 -0
- package/dist/zip.spec-d.d.cts +2 -0
- package/dist/zip.spec-d.d.ts +2 -0
- package/dist/zip.spec-d.js +1 -0
- package/package.json +15 -14
- package/dist/chunk-4XRKXTOK.js +0 -1
- package/dist/chunk-CXRG2GSY.js +0 -1
- package/dist/chunk-EDKMZBZ3.cjs +0 -1
- package/dist/chunk-NNU5DU4F.cjs +0 -1
- package/dist/chunk-NQR6HZYF.js +0 -1
- package/dist/chunk-UH3TDC4T.cjs +0 -1
- package/dist/chunk-ZW3IUWYO.js +0 -1
- /package/dist/{chunk-XJRGE7WL.cjs → chunk-DHNCWVVT.cjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as a}from"./chunk-2VLHCBHJ.js";import{a as e}from"./chunk-7EMQYM4A.js";it("should work as type guard",()=>{let r=o.error;e(r)&&expectTypeOf(r).toEqualTypeOf();let t;e(t)&&expectTypeOf(t).toEqualTypeOf()});it("should work as type guard in filter",()=>{let r=a.filter(e);expectTypeOf(r).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkZCCHYKDGcjs = require('./chunk-ZCCHYKDG.cjs');it("should work as type guard",()=>{let e=_chunkZJGZ2TECcjs.a.function;_chunkZCCHYKDGcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf();let i;_chunkZCCHYKDGcjs.a.call(void 0, i)&&(i(1),expectTypeOf(i).toEqualTypeOf())});it("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunkZCCHYKDGcjs.a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,b as a}from"./chunk-2VLHCBHJ.js";import{a as t}from"./chunk-VPHS3T3W.js";it("should work as type guard",()=>{let e=r.function;t(e)&&expectTypeOf(e).toEqualTypeOf();let i;t(i)&&(i(1),expectTypeOf(i).toEqualTypeOf())});it("should work as type guard in filter",()=>{let e=a.filter(t);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkWFR3HBYRcjs = require('./chunk-WFR3HBYR.cjs');it("throws on bad value types",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,["yes","no"])});it("throws on non-overlapping (e.g. typo-proof)",()=>{_chunkWFR3HBYRcjs.a.call(void 0, "cat",["doog"])});describe("narrowing",()=>{test("data is single literal, container is pure tuple === NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1])?expectTypeOf(1).toEqualTypeOf():expectTypeOf(1).toBeNever()}),test("data is literal union, container is pure tuple === NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is single literal, container is array === NOT NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is literal union, container is array === NOT NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is pure tuple of typeof data === NOT NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is array of typeof data === NOT NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is pure tuple of literals === NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is array of literals === NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive union, container is pure tuple of literals === NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive union, container is pure tuple of primitives === NOT NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive union, container is array of primitives === NOT NARROWED",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("pure tuples with literal unions",()=>{_chunkWFR3HBYRcjs.a.call(void 0, 1,[1]),expectTypeOf(1).toEqualTypeOf()})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-75K2QEB3.js";it("throws on bad value types",()=>{a(1,["yes","no"])});it("throws on non-overlapping (e.g. typo-proof)",()=>{a("cat",["doog"])});describe("narrowing",()=>{test("data is single literal, container is pure tuple === NARROWED",()=>{a(1,[1])?expectTypeOf(1).toEqualTypeOf():expectTypeOf(1).toBeNever()}),test("data is literal union, container is pure tuple === NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is single literal, container is array === NOT NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is literal union, container is array === NOT NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is pure tuple of typeof data === NOT NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is array of typeof data === NOT NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is pure tuple of literals === NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive, container is array of literals === NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive union, container is pure tuple of literals === NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive union, container is pure tuple of primitives === NOT NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("data is primitive union, container is array of primitives === NOT NARROWED",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()}),test("pure tuples with literal unions",()=>{a(1,[1]),expectTypeOf(1).toEqualTypeOf()})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunk7XMQFPW7cjs = require('./chunk-7XMQFPW7.cjs');test("should work as type guard",()=>{let e=_chunkZJGZ2TECcjs.a.date;_chunk7XMQFPW7cjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunk7XMQFPW7cjs.a);expectTypeOf(e).toEqualTypeOf(e)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,b as s}from"./chunk-2VLHCBHJ.js";import{a as r}from"./chunk-6BKLAQWR.js";test("should work as type guard",()=>{let e=t.date;r(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard in filter",()=>{let e=s.filter(r);expectTypeOf(e).toEqualTypeOf(e)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkDAFN5EJRcjs = require('./chunk-DAFN5EJR.cjs');it("should work as type guard",()=>{let r=_chunkZJGZ2TECcjs.a.date;_chunkDAFN5EJRcjs.a.call(void 0, r)&&expectTypeOf(r).toEqualTypeOf()});it("should work as type guard in filter",()=>{let r=_chunkZJGZ2TECcjs.b.filter(_chunkDAFN5EJRcjs.a);expectTypeOf(r).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,b as a}from"./chunk-2VLHCBHJ.js";import{a as e}from"./chunk-QPP664N4.js";it("should work as type guard",()=>{let r=t.date;e(r)&&expectTypeOf(r).toEqualTypeOf()});it("should work as type guard in filter",()=>{let r=a.filter(e);expectTypeOf(r).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkWM4KSO6Ccjs = require('./chunk-WM4KSO6C.cjs');var _chunkU3OEHN5Pcjs = require('./chunk-U3OEHN5P.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');it("should work as type guard",()=>{let r=_chunkZJGZ2TECcjs.a.promise;_chunkU3OEHN5Pcjs.a.call(void 0, (0, _chunkEHJK4JRFcjs.a))(r)&&expectTypeOf(r).toEqualTypeOf(r)});it("should work as type guard in filter",()=>{let r=_chunkZJGZ2TECcjs.b.filter(_chunkU3OEHN5Pcjs.a.call(void 0, _chunkWM4KSO6Ccjs.a));expectTypeOf(r).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,b as a}from"./chunk-2VLHCBHJ.js";import{a as s}from"./chunk-HFNVS6OX.js";import{a as e}from"./chunk-G73S4IVJ.js";import{a as t}from"./chunk-UYLVIAK4.js";it("should work as type guard",()=>{let r=n.promise;e(t)(r)&&expectTypeOf(r).toEqualTypeOf(r)});it("should work as type guard in filter",()=>{let r=a.filter(e(s));expectTypeOf(r).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkXUEOOIR6cjs = require('./chunk-XUEOOIR6.cjs');it("narrows nulls",()=>{_chunkXUEOOIR6cjs.a.call(void 0, 123)?expectTypeOf(123).toBeNull():expectTypeOf(123).toBeNumber()});it("narrows undefined",()=>{_chunkXUEOOIR6cjs.a.call(void 0, 123)?expectTypeOf(123).toBeUndefined():expectTypeOf(123).toBeNumber()});it("narrows on both",()=>{_chunkXUEOOIR6cjs.a.call(void 0, 123)?expectTypeOf(123).toEqualTypeOf():expectTypeOf(123).toBeNumber()});it("doesn't narrow non-nullables",()=>{_chunkXUEOOIR6cjs.a.call(void 0, 123)?expectTypeOf(123).toBeNever():expectTypeOf(123).toBeNumber()});it("narrows unknowns",()=>{_chunkXUEOOIR6cjs.a.call(void 0, 123)?expectTypeOf(123).toEqualTypeOf():expectTypeOf(123).toBeUnknown()});it("narrows any",()=>{_chunkXUEOOIR6cjs.a.call(void 0, 123)?expectTypeOf(123).toEqualTypeOf():expectTypeOf(123).toBeAny()});it("doesn't expand narrow types",()=>{let e="cat";_chunkXUEOOIR6cjs.a.call(void 0, e),expectTypeOf(e).toEqualTypeOf()});it("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunkXUEOOIR6cjs.a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a}from"./chunk-2VLHCBHJ.js";import{a as t}from"./chunk-TBXEXWSK.js";it("narrows nulls",()=>{t(123)?expectTypeOf(123).toBeNull():expectTypeOf(123).toBeNumber()});it("narrows undefined",()=>{t(123)?expectTypeOf(123).toBeUndefined():expectTypeOf(123).toBeNumber()});it("narrows on both",()=>{t(123)?expectTypeOf(123).toEqualTypeOf():expectTypeOf(123).toBeNumber()});it("doesn't narrow non-nullables",()=>{t(123)?expectTypeOf(123).toBeNever():expectTypeOf(123).toBeNumber()});it("narrows unknowns",()=>{t(123)?expectTypeOf(123).toEqualTypeOf():expectTypeOf(123).toBeUnknown()});it("narrows any",()=>{t(123)?expectTypeOf(123).toEqualTypeOf():expectTypeOf(123).toBeAny()});it("doesn't expand narrow types",()=>{let e="cat";t(e),expectTypeOf(e).toEqualTypeOf()});it("should work as type guard in filter",()=>{let e=a.filter(t);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkYWTY4X2Rcjs = require('./chunk-YWTY4X2R.cjs');var r=()=>1;it("should work as type guard",()=>{let e=_chunkZJGZ2TECcjs.a.number;_chunkYWTY4X2Rcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});it("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunkYWTY4X2Rcjs.a);expectTypeOf(e).toEqualTypeOf()});it("should work even if data type is unknown",()=>{let e=_chunkZJGZ2TECcjs.a.number;_chunkYWTY4X2Rcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});it("should work with literal types",()=>{let e=r();_chunkYWTY4X2Rcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf(e)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b as o}from"./chunk-2VLHCBHJ.js";import{a as t}from"./chunk-Q2HW4RVT.js";var r=()=>1;it("should work as type guard",()=>{let e=a.number;t(e)&&expectTypeOf(e).toEqualTypeOf()});it("should work as type guard in filter",()=>{let e=o.filter(t);expectTypeOf(e).toEqualTypeOf()});it("should work even if data type is unknown",()=>{let e=a.number;t(e)&&expectTypeOf(e).toEqualTypeOf()});it("should work with literal types",()=>{let e=r();t(e)&&expectTypeOf(e).toEqualTypeOf(e)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkR3TYGYBQcjs = require('./chunk-R3TYGYBQ.cjs');test("narrows nullable types",()=>{let e={a:"hello"};_chunkR3TYGYBQcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard",()=>{let e=_chunkZJGZ2TECcjs.a.object;_chunkR3TYGYBQcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work even if data type is unknown",()=>{let e=_chunkZJGZ2TECcjs.a.object;_chunkR3TYGYBQcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunkR3TYGYBQcjs.a);expectTypeOf(e).toEqualTypeOf()});test("Can narrow down `any`",()=>{let e={hello:"world"};_chunkR3TYGYBQcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,b as a}from"./chunk-2VLHCBHJ.js";import{a as t}from"./chunk-EBS4GCKX.js";test("narrows nullable types",()=>{let e={a:"hello"};t(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard",()=>{let e=r.object;t(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work even if data type is unknown",()=>{let e=r.object;t(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard in filter",()=>{let e=a.filter(t);expectTypeOf(e).toEqualTypeOf()});test("Can narrow down `any`",()=>{let e={hello:"world"};t(e)&&expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunk5AIMRZXJcjs = require('./chunk-5AIMRZXJ.cjs');test("narrows readonly records",()=>{let e={a:123};_chunk5AIMRZXJcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("narrows mixed records",()=>{let e={a:123,b:!1};_chunk5AIMRZXJcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard",()=>{let e=_chunkZJGZ2TECcjs.a.object;_chunk5AIMRZXJcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work even if data type is unknown",()=>{let e=_chunkZJGZ2TECcjs.a.object;_chunk5AIMRZXJcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunk5AIMRZXJcjs.a);expectTypeOf(e).toEqualTypeOf()});test("Can narrow down `any`",()=>{let e={hello:"world"};_chunk5AIMRZXJcjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as t}from"./chunk-2VLHCBHJ.js";import{a}from"./chunk-HLL46USD.js";test("narrows readonly records",()=>{let e={a:123};a(e)&&expectTypeOf(e).toEqualTypeOf()});test("narrows mixed records",()=>{let e={a:123,b:!1};a(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard",()=>{let e=o.object;a(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work even if data type is unknown",()=>{let e=o.object;a(e)&&expectTypeOf(e).toEqualTypeOf()});test("should work as type guard in filter",()=>{let e=t.filter(a);expectTypeOf(e).toEqualTypeOf()});test("Can narrow down `any`",()=>{let e={hello:"world"};a(e)&&expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkWM4KSO6Ccjs = require('./chunk-WM4KSO6C.cjs');it("should work as type guard",()=>{let e=_chunkZJGZ2TECcjs.a.promise;_chunkWM4KSO6Ccjs.a.call(void 0, e)&&expectTypeOf(e).toEqualTypeOf()});it("should work as type guard in filter",()=>{let e=_chunkZJGZ2TECcjs.b.filter(_chunkWM4KSO6Ccjs.a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,b as o}from"./chunk-2VLHCBHJ.js";import{a as r}from"./chunk-HFNVS6OX.js";it("should work as type guard",()=>{let e=t.promise;r(e)&&expectTypeOf(e).toEqualTypeOf()});it("should work as type guard in filter",()=>{let e=o.filter(r);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkT7S2RC5Mcjs = require('./chunk-T7S2RC5M.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.isShallowEqual = _chunkT7S2RC5Mcjs.a;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a *shallow structural* comparison between two values to determine if
|
|
3
|
+
* they are equivalent. For primitive values this is equivalent to `===`, for
|
|
4
|
+
* arrays a **strict equality** check would be performed on every item, in
|
|
5
|
+
* order, and for objects props will be matched and checked for **strict
|
|
6
|
+
* equality**; Unlike `isDeepEqual` where the function also *recurses* into each
|
|
7
|
+
* item and value.
|
|
8
|
+
*
|
|
9
|
+
* !IMPORTANT: Promise, Date, and RegExp, are shallowly equal, even when they
|
|
10
|
+
* are semantically different (e.g. resolved promises); but `isDeepEqual` does
|
|
11
|
+
* compare the latter 2 semantically by-value.
|
|
12
|
+
*
|
|
13
|
+
* The result would be narrowed to the second value so that the function can be
|
|
14
|
+
* used as a type guard.
|
|
15
|
+
*
|
|
16
|
+
* See:
|
|
17
|
+
* - `isStrictEqual` if you don't need a deep comparison and just want to check
|
|
18
|
+
* for simple (`===`, `Object.is`) equality.
|
|
19
|
+
* - `isDeepEqual` for a recursively deep check of arrays and objects.
|
|
20
|
+
*
|
|
21
|
+
* @param data - The first value to compare.
|
|
22
|
+
* @param other - The second value to compare.
|
|
23
|
+
* @signature
|
|
24
|
+
* P.isShallowEqual(data, other)
|
|
25
|
+
* @example
|
|
26
|
+
* P.isShallowEqual(1, 1) //=> true
|
|
27
|
+
* P.isShallowEqual(1, '1') //=> false
|
|
28
|
+
* P.isShallowEqual([1, 2, 3], [1, 2, 3]) //=> true
|
|
29
|
+
* P.isShallowEqual([[1], [2], [3]], [[1], [2], [3]]) //=> false
|
|
30
|
+
* @dataFirst
|
|
31
|
+
* @category Guard
|
|
32
|
+
*/
|
|
33
|
+
declare function isShallowEqual<T, S extends T>(data: T, other: T extends Exclude<T, S> ? S : never): data is S;
|
|
34
|
+
declare function isShallowEqual<T, S extends T = T>(data: T, other: S): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Performs a *shallow structural* comparison between two values to determine if
|
|
37
|
+
* they are equivalent. For primitive values this is equivalent to `===`, for
|
|
38
|
+
* arrays a **strict equality** check would be performed on every item, in
|
|
39
|
+
* order, and for objects props will be matched and checked for **strict
|
|
40
|
+
* equality**; Unlike `isDeepEqual` where the function also *recurses* into each
|
|
41
|
+
* item and value.
|
|
42
|
+
*
|
|
43
|
+
* !IMPORTANT: All built-in objects (Promise, Date, RegExp) are shallowly equal,
|
|
44
|
+
* even when they are semantically different (e.g. resolved promises). Use
|
|
45
|
+
* `isDeepEqual` instead.
|
|
46
|
+
*
|
|
47
|
+
* The result would be narrowed to the second value so that the function can be
|
|
48
|
+
* used as a type guard.
|
|
49
|
+
*
|
|
50
|
+
* See:
|
|
51
|
+
* - `isStrictEqual` if you don't need a deep comparison and just want to check
|
|
52
|
+
* for simple (`===`, `Object.is`) equality.
|
|
53
|
+
* - `isDeepEqual` for a recursively deep check of arrays and objects.
|
|
54
|
+
*
|
|
55
|
+
* @param other - The second value to compare.
|
|
56
|
+
* @signature
|
|
57
|
+
* P.isShallowEqual(other)(data)
|
|
58
|
+
* @example
|
|
59
|
+
* P.pipe(1, P.isShallowEqual(1)) //=> true
|
|
60
|
+
* P.pipe(1, P.isShallowEqual('1')) //=> false
|
|
61
|
+
* P.pipe([1, 2, 3], P.isShallowEqual([1, 2, 3])) //=> true
|
|
62
|
+
* P.pipe([[1], [2], [3]], P.isShallowEqual([[1], [2], [3]])) //=> false
|
|
63
|
+
* @dataFirst
|
|
64
|
+
* @category Guard
|
|
65
|
+
*/
|
|
66
|
+
declare function isShallowEqual<T, S extends T>(other: T extends Exclude<T, S> ? S : never): (data: T) => data is S;
|
|
67
|
+
declare function isShallowEqual<S>(other: S): <T extends S = S>(data: T) => boolean;
|
|
68
|
+
|
|
69
|
+
export { isShallowEqual };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a *shallow structural* comparison between two values to determine if
|
|
3
|
+
* they are equivalent. For primitive values this is equivalent to `===`, for
|
|
4
|
+
* arrays a **strict equality** check would be performed on every item, in
|
|
5
|
+
* order, and for objects props will be matched and checked for **strict
|
|
6
|
+
* equality**; Unlike `isDeepEqual` where the function also *recurses* into each
|
|
7
|
+
* item and value.
|
|
8
|
+
*
|
|
9
|
+
* !IMPORTANT: Promise, Date, and RegExp, are shallowly equal, even when they
|
|
10
|
+
* are semantically different (e.g. resolved promises); but `isDeepEqual` does
|
|
11
|
+
* compare the latter 2 semantically by-value.
|
|
12
|
+
*
|
|
13
|
+
* The result would be narrowed to the second value so that the function can be
|
|
14
|
+
* used as a type guard.
|
|
15
|
+
*
|
|
16
|
+
* See:
|
|
17
|
+
* - `isStrictEqual` if you don't need a deep comparison and just want to check
|
|
18
|
+
* for simple (`===`, `Object.is`) equality.
|
|
19
|
+
* - `isDeepEqual` for a recursively deep check of arrays and objects.
|
|
20
|
+
*
|
|
21
|
+
* @param data - The first value to compare.
|
|
22
|
+
* @param other - The second value to compare.
|
|
23
|
+
* @signature
|
|
24
|
+
* P.isShallowEqual(data, other)
|
|
25
|
+
* @example
|
|
26
|
+
* P.isShallowEqual(1, 1) //=> true
|
|
27
|
+
* P.isShallowEqual(1, '1') //=> false
|
|
28
|
+
* P.isShallowEqual([1, 2, 3], [1, 2, 3]) //=> true
|
|
29
|
+
* P.isShallowEqual([[1], [2], [3]], [[1], [2], [3]]) //=> false
|
|
30
|
+
* @dataFirst
|
|
31
|
+
* @category Guard
|
|
32
|
+
*/
|
|
33
|
+
declare function isShallowEqual<T, S extends T>(data: T, other: T extends Exclude<T, S> ? S : never): data is S;
|
|
34
|
+
declare function isShallowEqual<T, S extends T = T>(data: T, other: S): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Performs a *shallow structural* comparison between two values to determine if
|
|
37
|
+
* they are equivalent. For primitive values this is equivalent to `===`, for
|
|
38
|
+
* arrays a **strict equality** check would be performed on every item, in
|
|
39
|
+
* order, and for objects props will be matched and checked for **strict
|
|
40
|
+
* equality**; Unlike `isDeepEqual` where the function also *recurses* into each
|
|
41
|
+
* item and value.
|
|
42
|
+
*
|
|
43
|
+
* !IMPORTANT: All built-in objects (Promise, Date, RegExp) are shallowly equal,
|
|
44
|
+
* even when they are semantically different (e.g. resolved promises). Use
|
|
45
|
+
* `isDeepEqual` instead.
|
|
46
|
+
*
|
|
47
|
+
* The result would be narrowed to the second value so that the function can be
|
|
48
|
+
* used as a type guard.
|
|
49
|
+
*
|
|
50
|
+
* See:
|
|
51
|
+
* - `isStrictEqual` if you don't need a deep comparison and just want to check
|
|
52
|
+
* for simple (`===`, `Object.is`) equality.
|
|
53
|
+
* - `isDeepEqual` for a recursively deep check of arrays and objects.
|
|
54
|
+
*
|
|
55
|
+
* @param other - The second value to compare.
|
|
56
|
+
* @signature
|
|
57
|
+
* P.isShallowEqual(other)(data)
|
|
58
|
+
* @example
|
|
59
|
+
* P.pipe(1, P.isShallowEqual(1)) //=> true
|
|
60
|
+
* P.pipe(1, P.isShallowEqual('1')) //=> false
|
|
61
|
+
* P.pipe([1, 2, 3], P.isShallowEqual([1, 2, 3])) //=> true
|
|
62
|
+
* P.pipe([[1], [2], [3]], P.isShallowEqual([[1], [2], [3]])) //=> false
|
|
63
|
+
* @dataFirst
|
|
64
|
+
* @category Guard
|
|
65
|
+
*/
|
|
66
|
+
declare function isShallowEqual<T, S extends T>(other: T extends Exclude<T, S> ? S : never): (data: T) => data is S;
|
|
67
|
+
declare function isShallowEqual<S>(other: S): <T extends S = S>(data: T) => boolean;
|
|
68
|
+
|
|
69
|
+
export { isShallowEqual };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-2ADWP73S.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as isShallowEqual};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkT7S2RC5Mcjs = require('./chunk-T7S2RC5M.cjs');var _chunkKITVKWLPcjs = require('./chunk-KITVKWLP.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("narrows unions",()=>{_chunkT7S2RC5Mcjs.a.call(void 0, 1,1),expectTypeOf(1).toEqualTypeOf(),_chunkT7S2RC5Mcjs.a.call(void 0, 1,"hello"),expectTypeOf(1).toEqualTypeOf()});it("narrows to literal",()=>{_chunkT7S2RC5Mcjs.a.call(void 0, 1,1),expectTypeOf(1).toEqualTypeOf()});it("doesn't accept non-overlapping types",()=>{_chunkT7S2RC5Mcjs.a.call(void 0, 1,!0)});it("works deeply",()=>{let e=[];_chunkT7S2RC5Mcjs.a.call(void 0, e,[{a:[1]}]),expectTypeOf(e).toEqualTypeOf()});it("doesn't narrow when comparing objects of the same type",()=>{let e={a:1};_chunkT7S2RC5Mcjs.a.call(void 0, e,{a:2}),expectTypeOf(e).toEqualTypeOf()});it("headless usage can infer types",()=>{let e=_chunkKITVKWLPcjs.a.call(void 0, ["a","b","c"],["a","c","d"],_chunkT7S2RC5Mcjs.a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-2ADWP73S.js";import{a as t}from"./chunk-UNKQWZT6.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("narrows unions",()=>{a(1,1),expectTypeOf(1).toEqualTypeOf(),a(1,"hello"),expectTypeOf(1).toEqualTypeOf()});it("narrows to literal",()=>{a(1,1),expectTypeOf(1).toEqualTypeOf()});it("doesn't accept non-overlapping types",()=>{a(1,!0)});it("works deeply",()=>{let e=[];a(e,[{a:[1]}]),expectTypeOf(e).toEqualTypeOf()});it("doesn't narrow when comparing objects of the same type",()=>{let e={a:1};a(e,{a:2}),expectTypeOf(e).toEqualTypeOf()});it("headless usage can infer types",()=>{let e=t(["a","b","c"],["a","c","d"],a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVAUOPMANcjs = require('./chunk-VAUOPMAN.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.isStrictEqual = _chunkVAUOPMANcjs.a;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether two values are *functionally identical* in all contexts.
|
|
3
|
+
* For primitive values (string, number), this is done by-value, and for objects
|
|
4
|
+
* it is done by-reference (i.e., they point to the same object in memory).
|
|
5
|
+
*
|
|
6
|
+
* Under the hood we use **both** the [`===` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality)
|
|
7
|
+
* and [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). This means that `isStrictEqual(NaN, NaN) === true`
|
|
8
|
+
* (whereas `NaN !== NaN`), and `isStrictEqual(-0, 0) === true` (whereas
|
|
9
|
+
* `Object.is(-0, 0) === false`).
|
|
10
|
+
*
|
|
11
|
+
* The result would be narrowed to the second value so that the function can be
|
|
12
|
+
* used as a type guard.
|
|
13
|
+
*
|
|
14
|
+
* See:
|
|
15
|
+
* - `isDeepEqual` for a semantic comparison that allows comparing arrays and
|
|
16
|
+
* objects "by-value", and recurses for every item.
|
|
17
|
+
* - `isShallowEqual` if you need to compare arrays and objects "by-value" but
|
|
18
|
+
* don't want to recurse into their values.
|
|
19
|
+
*
|
|
20
|
+
* @param data - The first value to compare.
|
|
21
|
+
* @param other - The second value to compare.
|
|
22
|
+
* @signature
|
|
23
|
+
* P.isStrictEqual(data, other)
|
|
24
|
+
* @example
|
|
25
|
+
* P.isStrictEqual(1, 1) //=> true
|
|
26
|
+
* P.isStrictEqual(1, '1') //=> false
|
|
27
|
+
* P.isStrictEqual([1, 2, 3], [1, 2, 3]) //=> false
|
|
28
|
+
* @dataFirst
|
|
29
|
+
* @category Guard
|
|
30
|
+
*/
|
|
31
|
+
declare function isStrictEqual<T, S extends T>(data: T, other: T extends Exclude<T, S> ? S : never): data is S;
|
|
32
|
+
declare function isStrictEqual<T, S extends T = T>(data: T, other: S): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether two values are *functionally identical* in all contexts.
|
|
35
|
+
* For primitive values (string, number), this is done by-value, and for objects
|
|
36
|
+
* it is done by-reference (i.e., they point to the same object in memory).
|
|
37
|
+
*
|
|
38
|
+
* Under the hood we use **both** the [`===` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality)
|
|
39
|
+
* and [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). This means that `isStrictEqual(NaN, NaN) === true`
|
|
40
|
+
* (whereas `NaN !== NaN`), and `isStrictEqual(-0, 0) === true` (whereas
|
|
41
|
+
* `Object.is(-0, 0) === false`).
|
|
42
|
+
*
|
|
43
|
+
* The result would be narrowed to the second value so that the function can be
|
|
44
|
+
* used as a type guard.
|
|
45
|
+
*
|
|
46
|
+
* See:
|
|
47
|
+
* - `isDeepEqual` for a semantic comparison that allows comparing arrays and
|
|
48
|
+
* objects "by-value", and recurses for every item.
|
|
49
|
+
* - `isShallowEqual` if you need to compare arrays and objects "by-value" but
|
|
50
|
+
* don't want to recurse into their values.
|
|
51
|
+
*
|
|
52
|
+
* @param other - The second value to compare.
|
|
53
|
+
* @signature
|
|
54
|
+
* P.isStrictEqual(other)(data)
|
|
55
|
+
* @example
|
|
56
|
+
* P.pipe(1, P.isStrictEqual(1)); //=> true
|
|
57
|
+
* P.pipe(1, P.isStrictEqual('1')); //=> false
|
|
58
|
+
* P.pipe([1, 2, 3], P.isStrictEqual([1, 2, 3])); //=> false
|
|
59
|
+
* @dataLast
|
|
60
|
+
* @category Guard
|
|
61
|
+
*/
|
|
62
|
+
declare function isStrictEqual<T, S extends T>(other: T extends Exclude<T, S> ? S : never): (data: T) => data is S;
|
|
63
|
+
declare function isStrictEqual<S>(other: S): <T extends S = S>(data: T) => boolean;
|
|
64
|
+
|
|
65
|
+
export { isStrictEqual };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether two values are *functionally identical* in all contexts.
|
|
3
|
+
* For primitive values (string, number), this is done by-value, and for objects
|
|
4
|
+
* it is done by-reference (i.e., they point to the same object in memory).
|
|
5
|
+
*
|
|
6
|
+
* Under the hood we use **both** the [`===` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality)
|
|
7
|
+
* and [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). This means that `isStrictEqual(NaN, NaN) === true`
|
|
8
|
+
* (whereas `NaN !== NaN`), and `isStrictEqual(-0, 0) === true` (whereas
|
|
9
|
+
* `Object.is(-0, 0) === false`).
|
|
10
|
+
*
|
|
11
|
+
* The result would be narrowed to the second value so that the function can be
|
|
12
|
+
* used as a type guard.
|
|
13
|
+
*
|
|
14
|
+
* See:
|
|
15
|
+
* - `isDeepEqual` for a semantic comparison that allows comparing arrays and
|
|
16
|
+
* objects "by-value", and recurses for every item.
|
|
17
|
+
* - `isShallowEqual` if you need to compare arrays and objects "by-value" but
|
|
18
|
+
* don't want to recurse into their values.
|
|
19
|
+
*
|
|
20
|
+
* @param data - The first value to compare.
|
|
21
|
+
* @param other - The second value to compare.
|
|
22
|
+
* @signature
|
|
23
|
+
* P.isStrictEqual(data, other)
|
|
24
|
+
* @example
|
|
25
|
+
* P.isStrictEqual(1, 1) //=> true
|
|
26
|
+
* P.isStrictEqual(1, '1') //=> false
|
|
27
|
+
* P.isStrictEqual([1, 2, 3], [1, 2, 3]) //=> false
|
|
28
|
+
* @dataFirst
|
|
29
|
+
* @category Guard
|
|
30
|
+
*/
|
|
31
|
+
declare function isStrictEqual<T, S extends T>(data: T, other: T extends Exclude<T, S> ? S : never): data is S;
|
|
32
|
+
declare function isStrictEqual<T, S extends T = T>(data: T, other: S): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether two values are *functionally identical* in all contexts.
|
|
35
|
+
* For primitive values (string, number), this is done by-value, and for objects
|
|
36
|
+
* it is done by-reference (i.e., they point to the same object in memory).
|
|
37
|
+
*
|
|
38
|
+
* Under the hood we use **both** the [`===` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality)
|
|
39
|
+
* and [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). This means that `isStrictEqual(NaN, NaN) === true`
|
|
40
|
+
* (whereas `NaN !== NaN`), and `isStrictEqual(-0, 0) === true` (whereas
|
|
41
|
+
* `Object.is(-0, 0) === false`).
|
|
42
|
+
*
|
|
43
|
+
* The result would be narrowed to the second value so that the function can be
|
|
44
|
+
* used as a type guard.
|
|
45
|
+
*
|
|
46
|
+
* See:
|
|
47
|
+
* - `isDeepEqual` for a semantic comparison that allows comparing arrays and
|
|
48
|
+
* objects "by-value", and recurses for every item.
|
|
49
|
+
* - `isShallowEqual` if you need to compare arrays and objects "by-value" but
|
|
50
|
+
* don't want to recurse into their values.
|
|
51
|
+
*
|
|
52
|
+
* @param other - The second value to compare.
|
|
53
|
+
* @signature
|
|
54
|
+
* P.isStrictEqual(other)(data)
|
|
55
|
+
* @example
|
|
56
|
+
* P.pipe(1, P.isStrictEqual(1)); //=> true
|
|
57
|
+
* P.pipe(1, P.isStrictEqual('1')); //=> false
|
|
58
|
+
* P.pipe([1, 2, 3], P.isStrictEqual([1, 2, 3])); //=> false
|
|
59
|
+
* @dataLast
|
|
60
|
+
* @category Guard
|
|
61
|
+
*/
|
|
62
|
+
declare function isStrictEqual<T, S extends T>(other: T extends Exclude<T, S> ? S : never): (data: T) => data is S;
|
|
63
|
+
declare function isStrictEqual<S>(other: S): <T extends S = S>(data: T) => boolean;
|
|
64
|
+
|
|
65
|
+
export { isStrictEqual };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-HU67VIVI.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as isStrictEqual};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkVAUOPMANcjs = require('./chunk-VAUOPMAN.cjs');var _chunkKITVKWLPcjs = require('./chunk-KITVKWLP.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("narrows unions",()=>{_chunkVAUOPMANcjs.a.call(void 0, 1,1),expectTypeOf(1).toEqualTypeOf(),_chunkVAUOPMANcjs.a.call(void 0, 1,"hello"),expectTypeOf(1).toEqualTypeOf()});it("narrows to literal",()=>{_chunkVAUOPMANcjs.a.call(void 0, 1,1),expectTypeOf(1).toEqualTypeOf()});it("doesn't accept non-overlapping types",()=>{_chunkVAUOPMANcjs.a.call(void 0, 1,!0)});it("works deeply",()=>{let e=[];_chunkVAUOPMANcjs.a.call(void 0, e,[{a:[1]}]),expectTypeOf(e).toEqualTypeOf()});it("doesn't narrow when comparing objects of the same type",()=>{let e={a:1};_chunkVAUOPMANcjs.a.call(void 0, e,{a:2}),expectTypeOf(e).toEqualTypeOf()});it("headless usage can infer types",()=>{let e=_chunkKITVKWLPcjs.a.call(void 0, ["a","b","c"],["a","c","d"],_chunkVAUOPMANcjs.a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-HU67VIVI.js";import{a as t}from"./chunk-UNKQWZT6.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("narrows unions",()=>{a(1,1),expectTypeOf(1).toEqualTypeOf(),a(1,"hello"),expectTypeOf(1).toEqualTypeOf()});it("narrows to literal",()=>{a(1,1),expectTypeOf(1).toEqualTypeOf()});it("doesn't accept non-overlapping types",()=>{a(1,!0)});it("works deeply",()=>{let e=[];a(e,[{a:[1]}]),expectTypeOf(e).toEqualTypeOf()});it("doesn't narrow when comparing objects of the same type",()=>{let e={a:1};a(e,{a:2}),expectTypeOf(e).toEqualTypeOf()});it("headless usage can infer types",()=>{let e=t(["a","b","c"],["a","c","d"],a);expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkEHJK4JRFcjs = require('./chunk-EHJK4JRF.cjs');var o=()=>"a";it("should work as type guard",()=>{let t=_chunkZJGZ2TECcjs.a.string;_chunkEHJK4JRFcjs.a.call(void 0, t)&&expectTypeOf(t).toEqualTypeOf()});it("should work even if data type is unknown",()=>{let t=_chunkZJGZ2TECcjs.a.string;_chunkEHJK4JRFcjs.a.call(void 0, t)&&expectTypeOf(t).toEqualTypeOf()});it("should work with literal types",()=>{let t=o();_chunkEHJK4JRFcjs.a.call(void 0, t)&&expectTypeOf(t).toEqualTypeOf()});it("should work as type guard in array",()=>{let t=_chunkZJGZ2TECcjs.b.filter(_chunkEHJK4JRFcjs.a);expectTypeOf(t).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b as r}from"./chunk-2VLHCBHJ.js";import{a as e}from"./chunk-UYLVIAK4.js";var o=()=>"a";it("should work as type guard",()=>{let t=a.string;e(t)&&expectTypeOf(t).toEqualTypeOf()});it("should work even if data type is unknown",()=>{let t=a.string;e(t)&&expectTypeOf(t).toEqualTypeOf()});it("should work with literal types",()=>{let t=o();e(t)&&expectTypeOf(t).toEqualTypeOf()});it("should work as type guard in array",()=>{let t=r.filter(e);expectTypeOf(t).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZJGZ2TECcjs = require('./chunk-ZJGZ2TEC.cjs');var _chunkSW62SX4Ycjs = require('./chunk-SW62SX4Y.cjs');it("should work as type guard",()=>{let a=_chunkZJGZ2TECcjs.a.symbol;_chunkSW62SX4Ycjs.a.call(void 0, a)&&expectTypeOf(a).toEqualTypeOf()});it("should work even if data type is `unknown`",()=>{let a=_chunkZJGZ2TECcjs.a.symbol;_chunkSW62SX4Ycjs.a.call(void 0, a)&&expectTypeOf(a).toEqualTypeOf()});it("should work even if data type is `any`",()=>{let a=_chunkZJGZ2TECcjs.a.symbol;_chunkSW62SX4Ycjs.a.call(void 0, a)&&expectTypeOf(a).toEqualTypeOf()});it("should work as type guard in array",()=>{let a=_chunkZJGZ2TECcjs.b.filter(_chunkSW62SX4Ycjs.a);expectTypeOf(a).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as t}from"./chunk-2VLHCBHJ.js";import{a as e}from"./chunk-YBJMFRB6.js";it("should work as type guard",()=>{let a=o.symbol;e(a)&&expectTypeOf(a).toEqualTypeOf()});it("should work even if data type is `unknown`",()=>{let a=o.symbol;e(a)&&expectTypeOf(a).toEqualTypeOf()});it("should work even if data type is `any`",()=>{let a=o.symbol;e(a)&&expectTypeOf(a).toEqualTypeOf()});it("should work as type guard in array",()=>{let a=t.filter(e);expectTypeOf(a).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkOFLOVIU2cjs = require('./chunk-OFLOVIU2.cjs');test("isTruthy",()=>{let t={a:"asd"};_chunkOFLOVIU2cjs.a.call(void 0, t)&&expectTypeOf(t).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-RFHE6DOJ.js";test("isTruthy",()=>{let t={a:"asd"};a(t)&&expectTypeOf(t).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZBYQEJZVcjs = require('./chunk-ZBYQEJZV.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("empty tuple",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [],",");expectTypeOf(e).toEqualTypeOf()});it("empty readonly tuple",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [],",");expectTypeOf(e).toEqualTypeOf()});it("array",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [],",");expectTypeOf(e).toEqualTypeOf()});it("readonly array",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [],",");expectTypeOf(e).toEqualTypeOf()});it("tuple",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","c","e"],",");expectTypeOf(e).toEqualTypeOf()});it("readonly tuple",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","c","e"],",");expectTypeOf(e).toEqualTypeOf()});it("tuple with rest tail",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","c"],",");expectTypeOf(e).toEqualTypeOf()});it("readonly tuple with rest tail",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","c"],",");expectTypeOf(e).toEqualTypeOf()});it("tuple with rest head",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","c"],",");expectTypeOf(e).toEqualTypeOf()});it("readonly tuple with rest head",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","c"],",");expectTypeOf(e).toEqualTypeOf()});describe("tuple item types",()=>{it("number",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [1,2],",");expectTypeOf(e).toEqualTypeOf()}),it("string",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["a","b"],",");expectTypeOf(e).toEqualTypeOf()}),it("bigint",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [1n,2n],",");expectTypeOf(e).toEqualTypeOf()}),it("boolean",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [!0,!1],",");expectTypeOf(e).toEqualTypeOf()}),it("null",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [null,null],",");expectTypeOf(e).toEqualTypeOf()}),it("undefined",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [void 0,void 0],",");expectTypeOf(e).toEqualTypeOf()}),it("mixed",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, [1,void 0,"a"],",");expectTypeOf(e).toEqualTypeOf()}),it("nullish items",()=>{let e=_chunkZBYQEJZVcjs.a.call(void 0, ["prefix",void 0,"suffix"],",");expectTypeOf(e).toEqualTypeOf()})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-YTZNH65O.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("empty tuple",()=>{let e=t([],",");expectTypeOf(e).toEqualTypeOf()});it("empty readonly tuple",()=>{let e=t([],",");expectTypeOf(e).toEqualTypeOf()});it("array",()=>{let e=t([],",");expectTypeOf(e).toEqualTypeOf()});it("readonly array",()=>{let e=t([],",");expectTypeOf(e).toEqualTypeOf()});it("tuple",()=>{let e=t(["a","c","e"],",");expectTypeOf(e).toEqualTypeOf()});it("readonly tuple",()=>{let e=t(["a","c","e"],",");expectTypeOf(e).toEqualTypeOf()});it("tuple with rest tail",()=>{let e=t(["a","c"],",");expectTypeOf(e).toEqualTypeOf()});it("readonly tuple with rest tail",()=>{let e=t(["a","c"],",");expectTypeOf(e).toEqualTypeOf()});it("tuple with rest head",()=>{let e=t(["a","c"],",");expectTypeOf(e).toEqualTypeOf()});it("readonly tuple with rest head",()=>{let e=t(["a","c"],",");expectTypeOf(e).toEqualTypeOf()});describe("tuple item types",()=>{it("number",()=>{let e=t([1,2],",");expectTypeOf(e).toEqualTypeOf()}),it("string",()=>{let e=t(["a","b"],",");expectTypeOf(e).toEqualTypeOf()}),it("bigint",()=>{let e=t([1n,2n],",");expectTypeOf(e).toEqualTypeOf()}),it("boolean",()=>{let e=t([!0,!1],",");expectTypeOf(e).toEqualTypeOf()}),it("null",()=>{let e=t([null,null],",");expectTypeOf(e).toEqualTypeOf()}),it("undefined",()=>{let e=t([void 0,void 0],",");expectTypeOf(e).toEqualTypeOf()}),it("mixed",()=>{let e=t([1,void 0,"a"],",");expectTypeOf(e).toEqualTypeOf()}),it("nullish items",()=>{let e=t(["prefix",void 0,"suffix"],",");expectTypeOf(e).toEqualTypeOf()})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkSNQAZZSYcjs = require('./chunk-SNQAZZSY.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("arrays",()=>{test("empty tuple",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, []);expectTypeOf(e).toEqualTypeOf()}),test("empty readonly tuple",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, []);expectTypeOf(e).toEqualTypeOf()}),test("array",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, []);expectTypeOf(e).toEqualTypeOf()}),test("readonly array",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, []);expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["a",1,!0]);expectTypeOf(e).toEqualTypeOf()}),test("readonly tuple",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["a",1,!0]);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest tail",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["a"]);expectTypeOf(e).toEqualTypeOf()}),test("readonly tuple with rest tail",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["a"]);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest head",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["b"]);expectTypeOf(e).toEqualTypeOf()}),test("readonly tuple with rest head",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["b"]);expectTypeOf(e).toEqualTypeOf()}),test("tuple with rest middle",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["a","c"]);expectTypeOf(e).toEqualTypeOf()}),test("readonly tuple with rest middle",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, ["a","c"]);expectTypeOf(e).toEqualTypeOf()})});describe("object types",()=>{test("empty record (string)",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {});expectTypeOf(e).toEqualTypeOf()}),test("empty record (number)",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {});expectTypeOf(e).toEqualTypeOf()}),test("empty record (const)",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {});expectTypeOf(e).toEqualTypeOf()}),test("unions of records",()=>{let e={},a=_chunkSNQAZZSYcjs.a.call(void 0, e);expectTypeOf(a).toEqualTypeOf();let s=_chunkI6VXEY44cjs.a.call(void 0, e,_chunkSNQAZZSYcjs.a.call(void 0, ));expectTypeOf(s).toEqualTypeOf()}),test("simple (required) object",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {a:"a",b:1,c:!0});expectTypeOf(e).toEqualTypeOf()}),test("simple partial object",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {a:"a",b:1,c:!0});expectTypeOf(e).toEqualTypeOf()}),test("object with index signature",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {hello:"world",a:"goodbye"});expectTypeOf(e).toEqualTypeOf()}),test("Record with literal union",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {a:1,b:2});expectTypeOf(e).toEqualTypeOf()}),test("Record with template string literal",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {param_123:"hello",param_456:"world"});expectTypeOf(e).toEqualTypeOf()}),test("object with just symbol keys",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {[Symbol("a")]:1,[Symbol("b")]:"world"});expectTypeOf(e).toEqualTypeOf()}),test("object with number keys",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {123:"HELLO"});expectTypeOf(e).toEqualTypeOf()}),test("object with combined symbols and keys",()=>{let e=_chunkSNQAZZSYcjs.a.call(void 0, {a:1,[Symbol("b")]:"world",123:!0});expectTypeOf(e).toEqualTypeOf()})});
|