@leyyo/type 1.3.3 → 1.3.4
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/README.md +3 -3
- package/dist/error/index.d.ts +17 -58
- package/dist/error/index.js +17 -75
- package/dist/error/invalid-array.error.js +4 -7
- package/dist/error/invalid-boolean.error.js +4 -7
- package/dist/error/invalid-date.error.js +4 -7
- package/dist/error/invalid-delimited.error.js +4 -7
- package/dist/error/invalid-enum-map.error.js +4 -7
- package/dist/error/invalid-enum-value.error.js +4 -7
- package/dist/error/invalid-integer.error.js +4 -7
- package/dist/error/invalid-list.error.js +4 -7
- package/dist/error/invalid-literal-items.error.js +4 -7
- package/dist/error/invalid-literal-value.error.js +4 -7
- package/dist/error/invalid-map.error.js +4 -7
- package/dist/error/invalid-number.error.js +4 -7
- package/dist/error/invalid-object.error.js +4 -7
- package/dist/error/invalid-real-value.error.js +4 -7
- package/dist/error/invalid-set.error.js +4 -7
- package/dist/error/invalid-string.error.js +4 -7
- package/dist/error/invalid-text.error.js +4 -7
- package/dist/index.d.ts +6 -10
- package/dist/index.foretell.js +30 -14
- package/dist/index.js +6 -27
- package/dist/index.loader.js +8 -14
- package/dist/internal.js +1 -5
- package/dist/is/index.d.ts +25 -25
- package/dist/is/index.js +25 -42
- package/dist/is/index.types.js +1 -3
- package/dist/is/is-another-object.js +3 -7
- package/dist/is/is-array-like.js +1 -5
- package/dist/is/is-bare-object.js +3 -7
- package/dist/is/is-boolean-like.js +3 -7
- package/dist/is/is-empty-object.js +3 -7
- package/dist/is/is-enum.js +4 -8
- package/dist/is/is-false-like.js +3 -7
- package/dist/is/is-instance-of.js +3 -7
- package/dist/is/is-key-value.js +3 -7
- package/dist/is/is-literal.js +4 -8
- package/dist/is/is-non-negative-integer.js +1 -5
- package/dist/is/is-non-negative-number.js +3 -7
- package/dist/is/is-not-empty.js +3 -7
- package/dist/is/is-positive-integer.js +1 -5
- package/dist/is/is-positive-number.js +3 -7
- package/dist/is/is-primitive.js +3 -7
- package/dist/is/is-real-value.js +3 -7
- package/dist/is/is-safe-integer.js +1 -5
- package/dist/is/is-sys-class.js +3 -7
- package/dist/is/is-sys-function.js +3 -7
- package/dist/is/is-true-like.js +3 -7
- package/dist/is/is-type-of.js +3 -7
- package/dist/is/is-valid-integer.js +3 -7
- package/dist/is/is-valid-number.js +1 -5
- package/dist/literal/basic-type.d.ts +1 -2
- package/dist/literal/basic-type.js +6 -8
- package/dist/literal/defined-type.d.ts +7 -0
- package/dist/literal/defined-type.js +5 -0
- package/dist/literal/extended-type.d.ts +5 -0
- package/dist/literal/extended-type.js +12 -0
- package/dist/literal/false-weak.js +4 -5
- package/dist/literal/index.d.ts +7 -5
- package/dist/literal/index.js +7 -22
- package/dist/literal/sys-class.js +4 -5
- package/dist/literal/sys-function.js +4 -5
- package/dist/literal/true-weak.js +4 -5
- package/dist/to/index.d.ts +15 -16
- package/dist/to/index.js +15 -33
- package/dist/to/index.types.js +1 -3
- package/dist/to/to-array-value.d.ts +1 -1
- package/dist/to/to-array-value.js +16 -20
- package/dist/to/to-boolean-value.d.ts +1 -1
- package/dist/to/to-boolean-value.js +14 -18
- package/dist/to/to-date-value.d.ts +1 -1
- package/dist/to/to-date-value.js +15 -19
- package/dist/to/to-delimited-value.d.ts +1 -1
- package/dist/to/to-delimited-value.js +14 -18
- package/dist/to/to-enum-value.d.ts +1 -1
- package/dist/to/to-enum-value.js +25 -29
- package/dist/to/to-integer-value.d.ts +1 -1
- package/dist/to/to-integer-value.js +13 -17
- package/dist/to/to-list-value.d.ts +1 -1
- package/dist/to/to-list-value.js +15 -19
- package/dist/to/to-literal-value.d.ts +1 -1
- package/dist/to/to-literal-value.js +23 -27
- package/dist/to/to-map-value.d.ts +1 -1
- package/dist/to/to-map-value.js +13 -17
- package/dist/to/to-number-value.d.ts +1 -1
- package/dist/to/to-number-value.js +12 -16
- package/dist/to/to-object-value.d.ts +5 -4
- package/dist/to/to-object-value.js +129 -8
- package/dist/to/to-set-value.d.ts +1 -1
- package/dist/to/to-set-value.js +13 -17
- package/dist/to/to-string-value.d.ts +1 -1
- package/dist/to/to-string-value.js +10 -14
- package/dist/to/to-text-value.d.ts +1 -1
- package/dist/to/to-text-value.js +11 -15
- package/dist/to/util.d.ts +1 -1
- package/dist/to/util.js +21 -32
- package/package.json +4 -4
- package/dist/assets/.gitkeep +0 -0
- package/dist/basic/assert-another-object.d.ts +0 -2
- package/dist/basic/assert-another-object.js +0 -19
- package/dist/basic/assert-another-object.js.map +0 -1
- package/dist/basic/assert-array-like.d.ts +0 -2
- package/dist/basic/assert-array-like.js +0 -19
- package/dist/basic/assert-array-like.js.map +0 -1
- package/dist/basic/assert-array.d.ts +0 -2
- package/dist/basic/assert-array.js +0 -19
- package/dist/basic/assert-array.js.map +0 -1
- package/dist/basic/assert-bare-object.d.ts +0 -2
- package/dist/basic/assert-bare-object.js +0 -19
- package/dist/basic/assert-bare-object.js.map +0 -1
- package/dist/basic/assert-bigint.d.ts +0 -2
- package/dist/basic/assert-bigint.js +0 -19
- package/dist/basic/assert-bigint.js.map +0 -1
- package/dist/basic/assert-boolean-like.d.ts +0 -2
- package/dist/basic/assert-boolean-like.js +0 -19
- package/dist/basic/assert-boolean-like.js.map +0 -1
- package/dist/basic/assert-boolean.d.ts +0 -2
- package/dist/basic/assert-boolean.js +0 -18
- package/dist/basic/assert-boolean.js.map +0 -1
- package/dist/basic/assert-class.d.ts +0 -2
- package/dist/basic/assert-class.js +0 -18
- package/dist/basic/assert-class.js.map +0 -1
- package/dist/basic/assert-empty.d.ts +0 -2
- package/dist/basic/assert-empty.js +0 -21
- package/dist/basic/assert-empty.js.map +0 -1
- package/dist/basic/assert-false-like.d.ts +0 -2
- package/dist/basic/assert-false-like.js +0 -19
- package/dist/basic/assert-false-like.js.map +0 -1
- package/dist/basic/assert-false.d.ts +0 -2
- package/dist/basic/assert-false.js +0 -18
- package/dist/basic/assert-false.js.map +0 -1
- package/dist/basic/assert-filled-array.d.ts +0 -2
- package/dist/basic/assert-filled-array.js +0 -18
- package/dist/basic/assert-filled-array.js.map +0 -1
- package/dist/basic/assert-filled-object.d.ts +0 -2
- package/dist/basic/assert-filled-object.js +0 -18
- package/dist/basic/assert-filled-object.js.map +0 -1
- package/dist/basic/assert-function.d.ts +0 -2
- package/dist/basic/assert-function.js +0 -18
- package/dist/basic/assert-function.js.map +0 -1
- package/dist/basic/assert-integer.d.ts +0 -2
- package/dist/basic/assert-integer.js +0 -19
- package/dist/basic/assert-integer.js.map +0 -1
- package/dist/basic/assert-key-value.d.ts +0 -2
- package/dist/basic/assert-key-value.js +0 -19
- package/dist/basic/assert-key-value.js.map +0 -1
- package/dist/basic/assert-list.d.ts +0 -2
- package/dist/basic/assert-list.js +0 -18
- package/dist/basic/assert-list.js.map +0 -1
- package/dist/basic/assert-map.d.ts +0 -2
- package/dist/basic/assert-map.js +0 -18
- package/dist/basic/assert-map.js.map +0 -1
- package/dist/basic/assert-message.d.ts +0 -2
- package/dist/basic/assert-message.js +0 -10
- package/dist/basic/assert-message.js.map +0 -1
- package/dist/basic/assert-non-negative-integer.d.ts +0 -2
- package/dist/basic/assert-non-negative-integer.js +0 -19
- package/dist/basic/assert-non-negative-integer.js.map +0 -1
- package/dist/basic/assert-non-negative-number.d.ts +0 -2
- package/dist/basic/assert-non-negative-number.js +0 -19
- package/dist/basic/assert-non-negative-number.js.map +0 -1
- package/dist/basic/assert-not-empty.d.ts +0 -2
- package/dist/basic/assert-not-empty.js +0 -19
- package/dist/basic/assert-not-empty.js.map +0 -1
- package/dist/basic/assert-not-null.d.ts +0 -2
- package/dist/basic/assert-not-null.js +0 -18
- package/dist/basic/assert-not-null.js.map +0 -1
- package/dist/basic/assert-not-system-class.d.ts +0 -2
- package/dist/basic/assert-not-system-class.js +0 -19
- package/dist/basic/assert-not-system-class.js.map +0 -1
- package/dist/basic/assert-not-system-function.d.ts +0 -2
- package/dist/basic/assert-not-system-function.js +0 -19
- package/dist/basic/assert-not-system-function.js.map +0 -1
- package/dist/basic/assert-not-undefined.d.ts +0 -2
- package/dist/basic/assert-not-undefined.js +0 -18
- package/dist/basic/assert-not-undefined.js.map +0 -1
- package/dist/basic/assert-null.d.ts +0 -2
- package/dist/basic/assert-null.js +0 -18
- package/dist/basic/assert-null.js.map +0 -1
- package/dist/basic/assert-number.d.ts +0 -2
- package/dist/basic/assert-number.js +0 -19
- package/dist/basic/assert-number.js.map +0 -1
- package/dist/basic/assert-object.d.ts +0 -2
- package/dist/basic/assert-object.js +0 -18
- package/dist/basic/assert-object.js.map +0 -1
- package/dist/basic/assert-positive-integer.d.ts +0 -2
- package/dist/basic/assert-positive-integer.js +0 -19
- package/dist/basic/assert-positive-integer.js.map +0 -1
- package/dist/basic/assert-positive-number.d.ts +0 -2
- package/dist/basic/assert-positive-number.js +0 -19
- package/dist/basic/assert-positive-number.js.map +0 -1
- package/dist/basic/assert-real-value.d.ts +0 -2
- package/dist/basic/assert-real-value.js +0 -19
- package/dist/basic/assert-real-value.js.map +0 -1
- package/dist/basic/assert-safe-integer.d.ts +0 -2
- package/dist/basic/assert-safe-integer.js +0 -19
- package/dist/basic/assert-safe-integer.js.map +0 -1
- package/dist/basic/assert-set.d.ts +0 -2
- package/dist/basic/assert-set.js +0 -18
- package/dist/basic/assert-set.js.map +0 -1
- package/dist/basic/assert-string.d.ts +0 -2
- package/dist/basic/assert-string.js +0 -18
- package/dist/basic/assert-string.js.map +0 -1
- package/dist/basic/assert-symbol.d.ts +0 -2
- package/dist/basic/assert-symbol.js +0 -18
- package/dist/basic/assert-symbol.js.map +0 -1
- package/dist/basic/assert-text.d.ts +0 -2
- package/dist/basic/assert-text.js +0 -18
- package/dist/basic/assert-text.js.map +0 -1
- package/dist/basic/assert-true-like.d.ts +0 -2
- package/dist/basic/assert-true-like.js +0 -19
- package/dist/basic/assert-true-like.js.map +0 -1
- package/dist/basic/assert-true.d.ts +0 -2
- package/dist/basic/assert-true.js +0 -18
- package/dist/basic/assert-true.js.map +0 -1
- package/dist/basic/assert-undefined.d.ts +0 -2
- package/dist/basic/assert-undefined.js +0 -18
- package/dist/basic/assert-undefined.js.map +0 -1
- package/dist/basic/fnc.d.ts +0 -14
- package/dist/basic/fnc.js +0 -35
- package/dist/basic/fnc.js.map +0 -1
- package/dist/basic/index.d.ts +0 -43
- package/dist/basic/index.foretell.d.ts +0 -1
- package/dist/basic/index.foretell.js +0 -48
- package/dist/basic/index.foretell.js.map +0 -1
- package/dist/basic/index.js +0 -60
- package/dist/basic/index.js.map +0 -1
- package/dist/basic/index.loader.d.ts +0 -1
- package/dist/basic/index.loader.js +0 -43
- package/dist/basic/index.loader.js.map +0 -1
- package/dist/basic/index.types.d.ts +0 -4
- package/dist/basic/index.types.js +0 -4
- package/dist/basic/index.types.js.map +0 -1
- package/dist/complex/assert-all-of.d.ts +0 -7
- package/dist/complex/assert-all-of.js +0 -39
- package/dist/complex/assert-all-of.js.map +0 -1
- package/dist/complex/assert-array-of.d.ts +0 -6
- package/dist/complex/assert-array-of.js +0 -40
- package/dist/complex/assert-array-of.js.map +0 -1
- package/dist/complex/assert-enum-of.d.ts +0 -6
- package/dist/complex/assert-enum-of.js +0 -74
- package/dist/complex/assert-enum-of.js.map +0 -1
- package/dist/complex/assert-i18n-of.d.ts +0 -6
- package/dist/complex/assert-i18n-of.js +0 -29
- package/dist/complex/assert-i18n-of.js.map +0 -1
- package/dist/complex/assert-instance-of.d.ts +0 -6
- package/dist/complex/assert-instance-of.js +0 -56
- package/dist/complex/assert-instance-of.js.map +0 -1
- package/dist/complex/assert-it.d.ts +0 -4
- package/dist/complex/assert-it.js +0 -68
- package/dist/complex/assert-it.js.map +0 -1
- package/dist/complex/assert-list-of.d.ts +0 -6
- package/dist/complex/assert-list-of.js +0 -40
- package/dist/complex/assert-list-of.js.map +0 -1
- package/dist/complex/assert-literal-of.d.ts +0 -6
- package/dist/complex/assert-literal-of.js +0 -71
- package/dist/complex/assert-literal-of.js.map +0 -1
- package/dist/complex/assert-map-of.d.ts +0 -6
- package/dist/complex/assert-map-of.js +0 -56
- package/dist/complex/assert-map-of.js.map +0 -1
- package/dist/complex/assert-number-of.d.ts +0 -6
- package/dist/complex/assert-number-of.js +0 -33
- package/dist/complex/assert-number-of.js.map +0 -1
- package/dist/complex/assert-one-of.d.ts +0 -6
- package/dist/complex/assert-one-of.js +0 -67
- package/dist/complex/assert-one-of.js.map +0 -1
- package/dist/complex/assert-optional.d.ts +0 -6
- package/dist/complex/assert-optional.js +0 -31
- package/dist/complex/assert-optional.js.map +0 -1
- package/dist/complex/assert-record-of.d.ts +0 -6
- package/dist/complex/assert-record-of.js +0 -53
- package/dist/complex/assert-record-of.js.map +0 -1
- package/dist/complex/assert-set-of.d.ts +0 -6
- package/dist/complex/assert-set-of.js +0 -40
- package/dist/complex/assert-set-of.js.map +0 -1
- package/dist/complex/assert-string-of.d.ts +0 -6
- package/dist/complex/assert-string-of.js +0 -25
- package/dist/complex/assert-string-of.js.map +0 -1
- package/dist/complex/assert-tuple-of.d.ts +0 -6
- package/dist/complex/assert-tuple-of.js +0 -43
- package/dist/complex/assert-tuple-of.js.map +0 -1
- package/dist/complex/assert-type-of.d.ts +0 -6
- package/dist/complex/assert-type-of.js +0 -58
- package/dist/complex/assert-type-of.js.map +0 -1
- package/dist/complex/fnc.d.ts +0 -14
- package/dist/complex/fnc.js +0 -35
- package/dist/complex/fnc.js.map +0 -1
- package/dist/complex/index.d.ts +0 -20
- package/dist/complex/index.foretell.d.ts +0 -1
- package/dist/complex/index.foretell.js +0 -48
- package/dist/complex/index.foretell.js.map +0 -1
- package/dist/complex/index.js +0 -37
- package/dist/complex/index.js.map +0 -1
- package/dist/complex/index.loader.d.ts +0 -1
- package/dist/complex/index.loader.js +0 -43
- package/dist/complex/index.loader.js.map +0 -1
- package/dist/complex/index.types.d.ts +0 -91
- package/dist/complex/index.types.js +0 -3
- package/dist/complex/index.types.js.map +0 -1
- package/dist/complex/util.d.ts +0 -9
- package/dist/complex/util.js +0 -60
- package/dist/complex/util.js.map +0 -1
- package/dist/error/assert-message.error.d.ts +0 -3
- package/dist/error/assert-message.error.js +0 -8
- package/dist/error/assert-message.error.js.map +0 -1
- package/dist/error/index.foretell.d.ts +0 -1
- package/dist/error/index.foretell.js +0 -49
- package/dist/error/index.foretell.js.map +0 -1
- package/dist/error/index.js.map +0 -1
- package/dist/error/index.loader.d.ts +0 -1
- package/dist/error/index.loader.js +0 -43
- package/dist/error/index.loader.js.map +0 -1
- package/dist/error/invalid-another-object.error.d.ts +0 -3
- package/dist/error/invalid-another-object.error.js +0 -8
- package/dist/error/invalid-another-object.error.js.map +0 -1
- package/dist/error/invalid-array-like.error.d.ts +0 -3
- package/dist/error/invalid-array-like.error.js +0 -8
- package/dist/error/invalid-array-like.error.js.map +0 -1
- package/dist/error/invalid-array.error.js.map +0 -1
- package/dist/error/invalid-assert-all-of.error.d.ts +0 -3
- package/dist/error/invalid-assert-all-of.error.js +0 -8
- package/dist/error/invalid-assert-all-of.error.js.map +0 -1
- package/dist/error/invalid-assert-one-of.error.d.ts +0 -3
- package/dist/error/invalid-assert-one-of.error.js +0 -8
- package/dist/error/invalid-assert-one-of.error.js.map +0 -1
- package/dist/error/invalid-assert-payload.error.d.ts +0 -3
- package/dist/error/invalid-assert-payload.error.js +0 -8
- package/dist/error/invalid-assert-payload.error.js.map +0 -1
- package/dist/error/invalid-bare-object.error.d.ts +0 -3
- package/dist/error/invalid-bare-object.error.js +0 -8
- package/dist/error/invalid-bare-object.error.js.map +0 -1
- package/dist/error/invalid-bigint.error.d.ts +0 -3
- package/dist/error/invalid-bigint.error.js +0 -8
- package/dist/error/invalid-bigint.error.js.map +0 -1
- package/dist/error/invalid-boolean-like.error.d.ts +0 -3
- package/dist/error/invalid-boolean-like.error.js +0 -8
- package/dist/error/invalid-boolean-like.error.js.map +0 -1
- package/dist/error/invalid-boolean.error.js.map +0 -1
- package/dist/error/invalid-class.error.d.ts +0 -3
- package/dist/error/invalid-class.error.js +0 -8
- package/dist/error/invalid-class.error.js.map +0 -1
- package/dist/error/invalid-date.error.js.map +0 -1
- package/dist/error/invalid-delimited.error.js.map +0 -1
- package/dist/error/invalid-enum-map.error.js.map +0 -1
- package/dist/error/invalid-enum-not-found.error.d.ts +0 -4
- package/dist/error/invalid-enum-not-found.error.js +0 -11
- package/dist/error/invalid-enum-not-found.error.js.map +0 -1
- package/dist/error/invalid-enum-value.error.js.map +0 -1
- package/dist/error/invalid-false-like.error.d.ts +0 -3
- package/dist/error/invalid-false-like.error.js +0 -8
- package/dist/error/invalid-false-like.error.js.map +0 -1
- package/dist/error/invalid-false.error.d.ts +0 -3
- package/dist/error/invalid-false.error.js +0 -8
- package/dist/error/invalid-false.error.js.map +0 -1
- package/dist/error/invalid-filled-array.error.d.ts +0 -3
- package/dist/error/invalid-filled-array.error.js +0 -8
- package/dist/error/invalid-filled-array.error.js.map +0 -1
- package/dist/error/invalid-filled-object.error.d.ts +0 -3
- package/dist/error/invalid-filled-object.error.js +0 -8
- package/dist/error/invalid-filled-object.error.js.map +0 -1
- package/dist/error/invalid-function.error.d.ts +0 -3
- package/dist/error/invalid-function.error.js +0 -8
- package/dist/error/invalid-function.error.js.map +0 -1
- package/dist/error/invalid-instance-of-class.error.d.ts +0 -3
- package/dist/error/invalid-instance-of-class.error.js +0 -8
- package/dist/error/invalid-instance-of-class.error.js.map +0 -1
- package/dist/error/invalid-instance-of.error.d.ts +0 -3
- package/dist/error/invalid-instance-of.error.js +0 -8
- package/dist/error/invalid-instance-of.error.js.map +0 -1
- package/dist/error/invalid-integer.error.js.map +0 -1
- package/dist/error/invalid-key-value.error.d.ts +0 -3
- package/dist/error/invalid-key-value.error.js +0 -8
- package/dist/error/invalid-key-value.error.js.map +0 -1
- package/dist/error/invalid-list.error.js.map +0 -1
- package/dist/error/invalid-literal-items.error.js.map +0 -1
- package/dist/error/invalid-literal-not-found.error.d.ts +0 -4
- package/dist/error/invalid-literal-not-found.error.js +0 -11
- package/dist/error/invalid-literal-not-found.error.js.map +0 -1
- package/dist/error/invalid-literal-value.error.js.map +0 -1
- package/dist/error/invalid-map.error.js.map +0 -1
- package/dist/error/invalid-non-negative-integer.error.d.ts +0 -3
- package/dist/error/invalid-non-negative-integer.error.js +0 -8
- package/dist/error/invalid-non-negative-integer.error.js.map +0 -1
- package/dist/error/invalid-non-negative-number.error.d.ts +0 -3
- package/dist/error/invalid-non-negative-number.error.js +0 -8
- package/dist/error/invalid-non-negative-number.error.js.map +0 -1
- package/dist/error/invalid-not-system-class.error.d.ts +0 -3
- package/dist/error/invalid-not-system-class.error.js +0 -8
- package/dist/error/invalid-not-system-class.error.js.map +0 -1
- package/dist/error/invalid-not-system-function.error.d.ts +0 -3
- package/dist/error/invalid-not-system-function.error.js +0 -8
- package/dist/error/invalid-not-system-function.error.js.map +0 -1
- package/dist/error/invalid-number.error.js.map +0 -1
- package/dist/error/invalid-object.error.js.map +0 -1
- package/dist/error/invalid-positive-integer.error.d.ts +0 -3
- package/dist/error/invalid-positive-integer.error.js +0 -8
- package/dist/error/invalid-positive-integer.error.js.map +0 -1
- package/dist/error/invalid-positive-number.error.d.ts +0 -3
- package/dist/error/invalid-positive-number.error.js +0 -8
- package/dist/error/invalid-positive-number.error.js.map +0 -1
- package/dist/error/invalid-real-value.error.js.map +0 -1
- package/dist/error/invalid-safe-integer.error.d.ts +0 -3
- package/dist/error/invalid-safe-integer.error.js +0 -8
- package/dist/error/invalid-safe-integer.error.js.map +0 -1
- package/dist/error/invalid-set.error.js.map +0 -1
- package/dist/error/invalid-string.error.js.map +0 -1
- package/dist/error/invalid-symbol.error.d.ts +0 -3
- package/dist/error/invalid-symbol.error.js +0 -8
- package/dist/error/invalid-symbol.error.js.map +0 -1
- package/dist/error/invalid-text.error.js.map +0 -1
- package/dist/error/invalid-true-like.error.d.ts +0 -3
- package/dist/error/invalid-true-like.error.js +0 -8
- package/dist/error/invalid-true-like.error.js.map +0 -1
- package/dist/error/invalid-true.error.d.ts +0 -3
- package/dist/error/invalid-true.error.js +0 -8
- package/dist/error/invalid-true.error.js.map +0 -1
- package/dist/error/invalid-tuple.error.d.ts +0 -3
- package/dist/error/invalid-tuple.error.js +0 -8
- package/dist/error/invalid-tuple.error.js.map +0 -1
- package/dist/error/invalid-type-of-type.error.d.ts +0 -3
- package/dist/error/invalid-type-of-type.error.js +0 -8
- package/dist/error/invalid-type-of-type.error.js.map +0 -1
- package/dist/error/invalid-type-of.error.d.ts +0 -3
- package/dist/error/invalid-type-of.error.js +0 -8
- package/dist/error/invalid-type-of.error.js.map +0 -1
- package/dist/error/value-empty.error.d.ts +0 -3
- package/dist/error/value-empty.error.js +0 -8
- package/dist/error/value-empty.error.js.map +0 -1
- package/dist/error/value-not-empty.error.d.ts +0 -3
- package/dist/error/value-not-empty.error.js +0 -8
- package/dist/error/value-not-empty.error.js.map +0 -1
- package/dist/error/value-not-null.error.d.ts +0 -3
- package/dist/error/value-not-null.error.js +0 -8
- package/dist/error/value-not-null.error.js.map +0 -1
- package/dist/error/value-not-undefined.error.d.ts +0 -3
- package/dist/error/value-not-undefined.error.js +0 -8
- package/dist/error/value-not-undefined.error.js.map +0 -1
- package/dist/error/value-null.error.d.ts +0 -3
- package/dist/error/value-null.error.js +0 -8
- package/dist/error/value-null.error.js.map +0 -1
- package/dist/error/value-undefined.error.d.ts +0 -3
- package/dist/error/value-undefined.error.js +0 -8
- package/dist/error/value-undefined.error.js.map +0 -1
- package/dist/handler/assert.handler.d.ts +0 -2
- package/dist/handler/assert.handler.js +0 -49
- package/dist/handler/assert.handler.js.map +0 -1
- package/dist/handler/index.d.ts +0 -2
- package/dist/handler/index.js +0 -19
- package/dist/handler/index.js.map +0 -1
- package/dist/handler/index.types.d.ts +0 -9
- package/dist/handler/index.types.js +0 -3
- package/dist/handler/index.types.js.map +0 -1
- package/dist/index.foretell.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.loader.js.map +0 -1
- package/dist/internal.js.map +0 -1
- package/dist/is/index.js.map +0 -1
- package/dist/is/index.types.js.map +0 -1
- package/dist/is/is-another-object.js.map +0 -1
- package/dist/is/is-array-like.js.map +0 -1
- package/dist/is/is-bare-object.js.map +0 -1
- package/dist/is/is-boolean-like.js.map +0 -1
- package/dist/is/is-empty-object.js.map +0 -1
- package/dist/is/is-enum.js.map +0 -1
- package/dist/is/is-false-like.js.map +0 -1
- package/dist/is/is-instance-of.js.map +0 -1
- package/dist/is/is-key-value.js.map +0 -1
- package/dist/is/is-literal.js.map +0 -1
- package/dist/is/is-non-negative-integer.js.map +0 -1
- package/dist/is/is-non-negative-number.js.map +0 -1
- package/dist/is/is-not-empty.js.map +0 -1
- package/dist/is/is-positive-integer.js.map +0 -1
- package/dist/is/is-positive-number.js.map +0 -1
- package/dist/is/is-primitive.js.map +0 -1
- package/dist/is/is-real-value.js.map +0 -1
- package/dist/is/is-safe-integer.js.map +0 -1
- package/dist/is/is-sys-class.js.map +0 -1
- package/dist/is/is-sys-function.js.map +0 -1
- package/dist/is/is-true-like.js.map +0 -1
- package/dist/is/is-type-of.js.map +0 -1
- package/dist/is/is-valid-integer.js.map +0 -1
- package/dist/is/is-valid-number.js.map +0 -1
- package/dist/literal/basic-type.js.map +0 -1
- package/dist/literal/false-weak.js.map +0 -1
- package/dist/literal/index.js.map +0 -1
- package/dist/literal/sys-class.js.map +0 -1
- package/dist/literal/sys-function.js.map +0 -1
- package/dist/literal/true-weak.js.map +0 -1
- package/dist/opt/index.d.ts +0 -9
- package/dist/opt/index.js +0 -3
- package/dist/opt/index.js.map +0 -1
- package/dist/to/index.js.map +0 -1
- package/dist/to/index.types.js.map +0 -1
- package/dist/to/to-array-value.js.map +0 -1
- package/dist/to/to-bare-object.d.ts +0 -10
- package/dist/to/to-bare-object.js +0 -140
- package/dist/to/to-bare-object.js.map +0 -1
- package/dist/to/to-boolean-value.js.map +0 -1
- package/dist/to/to-date-value.js.map +0 -1
- package/dist/to/to-delimited-value.js.map +0 -1
- package/dist/to/to-enum-value.js.map +0 -1
- package/dist/to/to-integer-value.js.map +0 -1
- package/dist/to/to-list-value.js.map +0 -1
- package/dist/to/to-literal-value.js.map +0 -1
- package/dist/to/to-map-value.js.map +0 -1
- package/dist/to/to-number-value.js.map +0 -1
- package/dist/to/to-object-value.js.map +0 -1
- package/dist/to/to-set-value.js.map +0 -1
- package/dist/to/to-string-value.js.map +0 -1
- package/dist/to/to-text-value.js.map +0 -1
- package/dist/to/util.js.map +0 -1
package/dist/is/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export * from './index.types';
|
|
2
|
-
export * from './is-another-object';
|
|
3
|
-
export * from './is-array-like';
|
|
4
|
-
export * from './is-bare-object';
|
|
5
|
-
export * from './is-boolean-like';
|
|
6
|
-
export * from './is-empty-object';
|
|
7
|
-
export * from './is-enum';
|
|
8
|
-
export * from './is-false-like';
|
|
9
|
-
export * from './is-instance-of';
|
|
10
|
-
export * from './is-key-value';
|
|
11
|
-
export * from './is-literal';
|
|
12
|
-
export * from './is-non-negative-integer';
|
|
13
|
-
export * from './is-non-negative-number';
|
|
14
|
-
export * from './is-not-empty';
|
|
15
|
-
export * from './is-positive-integer';
|
|
16
|
-
export * from './is-positive-number';
|
|
17
|
-
export * from './is-primitive';
|
|
18
|
-
export * from './is-real-value';
|
|
19
|
-
export * from './is-safe-integer';
|
|
20
|
-
export * from './is-sys-class';
|
|
21
|
-
export * from './is-sys-function';
|
|
22
|
-
export * from './is-true-like';
|
|
23
|
-
export * from './is-type-of';
|
|
24
|
-
export * from './is-valid-integer';
|
|
25
|
-
export * from './is-valid-number';
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './is-another-object.js';
|
|
3
|
+
export * from './is-array-like.js';
|
|
4
|
+
export * from './is-bare-object.js';
|
|
5
|
+
export * from './is-boolean-like.js';
|
|
6
|
+
export * from './is-empty-object.js';
|
|
7
|
+
export * from './is-enum.js';
|
|
8
|
+
export * from './is-false-like.js';
|
|
9
|
+
export * from './is-instance-of.js';
|
|
10
|
+
export * from './is-key-value.js';
|
|
11
|
+
export * from './is-literal.js';
|
|
12
|
+
export * from './is-non-negative-integer.js';
|
|
13
|
+
export * from './is-non-negative-number.js';
|
|
14
|
+
export * from './is-not-empty.js';
|
|
15
|
+
export * from './is-positive-integer.js';
|
|
16
|
+
export * from './is-positive-number.js';
|
|
17
|
+
export * from './is-primitive.js';
|
|
18
|
+
export * from './is-real-value.js';
|
|
19
|
+
export * from './is-safe-integer.js';
|
|
20
|
+
export * from './is-sys-class.js';
|
|
21
|
+
export * from './is-sys-function.js';
|
|
22
|
+
export * from './is-true-like.js';
|
|
23
|
+
export * from './is-type-of.js';
|
|
24
|
+
export * from './is-valid-integer.js';
|
|
25
|
+
export * from './is-valid-number.js';
|
package/dist/is/index.js
CHANGED
|
@@ -1,42 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
__exportStar(require("./is-key-value"), exports);
|
|
27
|
-
__exportStar(require("./is-literal"), exports);
|
|
28
|
-
__exportStar(require("./is-non-negative-integer"), exports);
|
|
29
|
-
__exportStar(require("./is-non-negative-number"), exports);
|
|
30
|
-
__exportStar(require("./is-not-empty"), exports);
|
|
31
|
-
__exportStar(require("./is-positive-integer"), exports);
|
|
32
|
-
__exportStar(require("./is-positive-number"), exports);
|
|
33
|
-
__exportStar(require("./is-primitive"), exports);
|
|
34
|
-
__exportStar(require("./is-real-value"), exports);
|
|
35
|
-
__exportStar(require("./is-safe-integer"), exports);
|
|
36
|
-
__exportStar(require("./is-sys-class"), exports);
|
|
37
|
-
__exportStar(require("./is-sys-function"), exports);
|
|
38
|
-
__exportStar(require("./is-true-like"), exports);
|
|
39
|
-
__exportStar(require("./is-type-of"), exports);
|
|
40
|
-
__exportStar(require("./is-valid-integer"), exports);
|
|
41
|
-
__exportStar(require("./is-valid-number"), exports);
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from './index.types.js';
|
|
2
|
+
export * from './is-another-object.js';
|
|
3
|
+
export * from './is-array-like.js';
|
|
4
|
+
export * from './is-bare-object.js';
|
|
5
|
+
export * from './is-boolean-like.js';
|
|
6
|
+
export * from './is-empty-object.js';
|
|
7
|
+
export * from './is-enum.js';
|
|
8
|
+
export * from './is-false-like.js';
|
|
9
|
+
export * from './is-instance-of.js';
|
|
10
|
+
export * from './is-key-value.js';
|
|
11
|
+
export * from './is-literal.js';
|
|
12
|
+
export * from './is-non-negative-integer.js';
|
|
13
|
+
export * from './is-non-negative-number.js';
|
|
14
|
+
export * from './is-not-empty.js';
|
|
15
|
+
export * from './is-positive-integer.js';
|
|
16
|
+
export * from './is-positive-number.js';
|
|
17
|
+
export * from './is-primitive.js';
|
|
18
|
+
export * from './is-real-value.js';
|
|
19
|
+
export * from './is-safe-integer.js';
|
|
20
|
+
export * from './is-sys-class.js';
|
|
21
|
+
export * from './is-sys-function.js';
|
|
22
|
+
export * from './is-true-like.js';
|
|
23
|
+
export * from './is-type-of.js';
|
|
24
|
+
export * from './is-valid-integer.js';
|
|
25
|
+
export * from './is-valid-number.js';
|
package/dist/is/index.types.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAnotherObject = isAnotherObject;
|
|
4
|
-
const common_1 = require("@leyyo/common");
|
|
1
|
+
import { isObj } from "@leyyo/common";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is another object?
|
|
7
4
|
* - `another` means, `[constructor !== Object]`
|
|
@@ -9,7 +6,6 @@ const common_1 = require("@leyyo/common");
|
|
|
9
6
|
* @param {any} value
|
|
10
7
|
* @returns {boolean}
|
|
11
8
|
* */
|
|
12
|
-
function isAnotherObject(value) {
|
|
13
|
-
return
|
|
9
|
+
export function isAnotherObject(value) {
|
|
10
|
+
return isObj(value) && value.constructor !== Object;
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=is-another-object.js.map
|
package/dist/is/is-array-like.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isArrayLike = isArrayLike;
|
|
4
1
|
/**
|
|
5
2
|
* Checks value is array like (array, Set or List) or not?
|
|
6
3
|
*
|
|
7
4
|
* @param {any} value
|
|
8
5
|
* @returns {boolean}
|
|
9
6
|
* */
|
|
10
|
-
function isArrayLike(value) {
|
|
7
|
+
export function isArrayLike(value) {
|
|
11
8
|
return Array.isArray(value) || value instanceof Set;
|
|
12
9
|
}
|
|
13
|
-
//# sourceMappingURL=is-array-like.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBareObject = isBareObject;
|
|
4
|
-
const common_1 = require("@leyyo/common");
|
|
1
|
+
import { isObj } from "@leyyo/common";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is bare object?
|
|
7
4
|
* - `bare` means, `[constructor === Object]`
|
|
@@ -9,7 +6,6 @@ const common_1 = require("@leyyo/common");
|
|
|
9
6
|
* @param {any} value
|
|
10
7
|
* @returns {boolean}
|
|
11
8
|
* */
|
|
12
|
-
function isBareObject(value) {
|
|
13
|
-
return
|
|
9
|
+
export function isBareObject(value) {
|
|
10
|
+
return isObj(value) && value.constructor === Object;
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=is-bare-object.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBooleanLike = isBooleanLike;
|
|
4
|
-
const literal_1 = require("../literal");
|
|
1
|
+
import { FalseWeakItems, TrueWeakItems } from "../literal/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is boolean like?
|
|
7
4
|
* - `boolean like` means:
|
|
@@ -16,15 +13,14 @@ const literal_1 = require("../literal");
|
|
|
16
13
|
* @param {any} value
|
|
17
14
|
* @returns {boolean}
|
|
18
15
|
* */
|
|
19
|
-
function isBooleanLike(value) {
|
|
16
|
+
export function isBooleanLike(value) {
|
|
20
17
|
switch (typeof value) {
|
|
21
18
|
case "boolean":
|
|
22
19
|
return true;
|
|
23
20
|
case "string":
|
|
24
|
-
return
|
|
21
|
+
return TrueWeakItems.includes(value) || FalseWeakItems.includes(value);
|
|
25
22
|
case 'number':
|
|
26
23
|
return [-1, 0, 1].includes(value);
|
|
27
24
|
}
|
|
28
25
|
return false;
|
|
29
26
|
}
|
|
30
|
-
//# sourceMappingURL=is-boolean-like.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEmptyObject = isEmptyObject;
|
|
4
|
-
const common_1 = require("@leyyo/common");
|
|
1
|
+
import { isObj } from "@leyyo/common";
|
|
5
2
|
// noinspection JSUnusedGlobalSymbols
|
|
6
3
|
/**
|
|
7
4
|
* Checks value is empty object?
|
|
@@ -10,7 +7,6 @@ const common_1 = require("@leyyo/common");
|
|
|
10
7
|
* @param {any} value
|
|
11
8
|
* @returns {boolean}
|
|
12
9
|
* */
|
|
13
|
-
function isEmptyObject(value) {
|
|
14
|
-
return
|
|
10
|
+
export function isEmptyObject(value) {
|
|
11
|
+
return isObj(value) && Object.keys(value).length < 1;
|
|
15
12
|
}
|
|
16
|
-
//# sourceMappingURL=is-empty-object.js.map
|
package/dist/is/is-enum.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isEnum = isEnum;
|
|
4
|
-
const common_1 = require("@leyyo/common");
|
|
5
|
-
const is_key_value_1 = require("./is-key-value");
|
|
1
|
+
import { isObj } from "@leyyo/common";
|
|
2
|
+
import { isKeyValue } from "./is-key-value.js";
|
|
6
3
|
/**
|
|
7
4
|
* Checks value is an enum value?
|
|
8
5
|
*
|
|
@@ -10,10 +7,9 @@ const is_key_value_1 = require("./is-key-value");
|
|
|
10
7
|
* @param {Enum} map
|
|
11
8
|
* @returns {boolean}
|
|
12
9
|
* */
|
|
13
|
-
function isEnum(value, map) {
|
|
14
|
-
if (!
|
|
10
|
+
export function isEnum(value, map) {
|
|
11
|
+
if (!isKeyValue(value) || !isObj(map)) {
|
|
15
12
|
return false;
|
|
16
13
|
}
|
|
17
14
|
return map[value] !== undefined;
|
|
18
15
|
}
|
|
19
|
-
//# sourceMappingURL=is-enum.js.map
|
package/dist/is/is-false-like.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFalseLike = isFalseLike;
|
|
4
|
-
const literal_1 = require("../literal");
|
|
1
|
+
import { FalseWeakItems } from "../literal/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is false like?
|
|
7
4
|
* - `false like` means:
|
|
@@ -14,15 +11,14 @@ const literal_1 = require("../literal");
|
|
|
14
11
|
* @param {any} value
|
|
15
12
|
* @returns {boolean}
|
|
16
13
|
* */
|
|
17
|
-
function isFalseLike(value) {
|
|
14
|
+
export function isFalseLike(value) {
|
|
18
15
|
switch (typeof value) {
|
|
19
16
|
case "boolean":
|
|
20
17
|
return !value;
|
|
21
18
|
case "string":
|
|
22
|
-
return
|
|
19
|
+
return FalseWeakItems.includes(value);
|
|
23
20
|
case 'number':
|
|
24
21
|
return [-1, 0].includes(value);
|
|
25
22
|
}
|
|
26
23
|
return false;
|
|
27
24
|
}
|
|
28
|
-
//# sourceMappingURL=is-false-like.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInstanceOf = isInstanceOf;
|
|
4
|
-
const is_another_object_1 = require("./is-another-object");
|
|
1
|
+
import { isAnotherObject } from "./is-another-object.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is any instance of given classes?
|
|
7
4
|
*
|
|
@@ -9,10 +6,9 @@ const is_another_object_1 = require("./is-another-object");
|
|
|
9
6
|
* @param {...ClassLike[]} classes
|
|
10
7
|
* @returns {boolean}
|
|
11
8
|
* */
|
|
12
|
-
function isInstanceOf(value, ...classes) {
|
|
13
|
-
if (classes.length < 1 || !
|
|
9
|
+
export function isInstanceOf(value, ...classes) {
|
|
10
|
+
if (classes.length < 1 || !isAnotherObject(value)) {
|
|
14
11
|
return false;
|
|
15
12
|
}
|
|
16
13
|
return classes.some(clazz => value instanceof clazz);
|
|
17
14
|
}
|
|
18
|
-
//# sourceMappingURL=is-instance-of.js.map
|
package/dist/is/is-key-value.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isKeyValue = isKeyValue;
|
|
4
|
-
const is_not_empty_1 = require("./is-not-empty");
|
|
1
|
+
import { isNotEmpty } from "./is-not-empty.js";
|
|
5
2
|
const _keyValueItems = ["string", "number"];
|
|
6
3
|
/**
|
|
7
4
|
* Checks value is key?
|
|
@@ -10,7 +7,6 @@ const _keyValueItems = ["string", "number"];
|
|
|
10
7
|
* @param {any} value
|
|
11
8
|
* @returns {boolean}
|
|
12
9
|
* */
|
|
13
|
-
function isKeyValue(value) {
|
|
14
|
-
return
|
|
10
|
+
export function isKeyValue(value) {
|
|
11
|
+
return isNotEmpty(value) && _keyValueItems.includes(typeof value);
|
|
15
12
|
}
|
|
16
|
-
//# sourceMappingURL=is-key-value.js.map
|
package/dist/is/is-literal.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isLiteral = isLiteral;
|
|
4
|
-
const common_1 = require("@leyyo/common");
|
|
5
|
-
const is_key_value_1 = require("./is-key-value");
|
|
1
|
+
import { isFilledArr } from "@leyyo/common";
|
|
2
|
+
import { isKeyValue } from "./is-key-value.js";
|
|
6
3
|
/**
|
|
7
4
|
* Checks value is an enum value?
|
|
8
5
|
*
|
|
@@ -10,10 +7,9 @@ const is_key_value_1 = require("./is-key-value");
|
|
|
10
7
|
* @param {Literal<string>} items
|
|
11
8
|
* @returns {boolean}
|
|
12
9
|
* */
|
|
13
|
-
function isLiteral(value, items) {
|
|
14
|
-
if (!
|
|
10
|
+
export function isLiteral(value, items) {
|
|
11
|
+
if (!isKeyValue(value) || !isFilledArr(items)) {
|
|
15
12
|
return false;
|
|
16
13
|
}
|
|
17
14
|
return items.includes(value);
|
|
18
15
|
}
|
|
19
|
-
//# sourceMappingURL=is-literal.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNonNegativeInteger = isNonNegativeInteger;
|
|
4
1
|
/**
|
|
5
2
|
* Checks value is non-negative integer or not?
|
|
6
3
|
*
|
|
@@ -9,7 +6,6 @@ exports.isNonNegativeInteger = isNonNegativeInteger;
|
|
|
9
6
|
*
|
|
10
7
|
* Note: NaN and infinite values are not evaluated as a number
|
|
11
8
|
* */
|
|
12
|
-
function isNonNegativeInteger(value) {
|
|
9
|
+
export function isNonNegativeInteger(value) {
|
|
13
10
|
return Number.isInteger(value) && value >= 0;
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=is-non-negative-integer.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNonNegativeNumber = isNonNegativeNumber;
|
|
4
|
-
const is_valid_number_1 = require("./is-valid-number");
|
|
1
|
+
import { isValidNumber } from "./is-valid-number.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is non-negative number or not?
|
|
7
4
|
*
|
|
@@ -10,7 +7,6 @@ const is_valid_number_1 = require("./is-valid-number");
|
|
|
10
7
|
*
|
|
11
8
|
* Note: NaN and infinite values are not evaluated as a number
|
|
12
9
|
* */
|
|
13
|
-
function isNonNegativeNumber(value) {
|
|
14
|
-
return
|
|
10
|
+
export function isNonNegativeNumber(value) {
|
|
11
|
+
return isValidNumber(value) && value >= 0;
|
|
15
12
|
}
|
|
16
|
-
//# sourceMappingURL=is-non-negative-number.js.map
|
package/dist/is/is-not-empty.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNotEmpty = isNotEmpty;
|
|
4
|
-
const common_1 = require("@leyyo/common");
|
|
1
|
+
import { EMPTY_VALUES_STR } from "@leyyo/common";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is not empty?
|
|
7
4
|
* - Empty means: `undefined`, `null` or `empty string` after trimming
|
|
@@ -10,10 +7,9 @@ const common_1 = require("@leyyo/common");
|
|
|
10
7
|
* @param {any} value
|
|
11
8
|
* @returns {boolean}
|
|
12
9
|
* */
|
|
13
|
-
function isNotEmpty(value) {
|
|
10
|
+
export function isNotEmpty(value) {
|
|
14
11
|
if (typeof value === 'string') {
|
|
15
12
|
value = value.trim();
|
|
16
13
|
}
|
|
17
|
-
return !
|
|
14
|
+
return !EMPTY_VALUES_STR.includes(value);
|
|
18
15
|
}
|
|
19
|
-
//# sourceMappingURL=is-not-empty.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPositiveInteger = isPositiveInteger;
|
|
4
1
|
/**
|
|
5
2
|
* Checks value is positive integer or not?
|
|
6
3
|
*
|
|
@@ -9,7 +6,6 @@ exports.isPositiveInteger = isPositiveInteger;
|
|
|
9
6
|
*
|
|
10
7
|
* Note: NaN and infinite values are not evaluated as a number
|
|
11
8
|
* */
|
|
12
|
-
function isPositiveInteger(value) {
|
|
9
|
+
export function isPositiveInteger(value) {
|
|
13
10
|
return Number.isInteger(value) && value > 0;
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=is-positive-integer.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPositiveNumber = isPositiveNumber;
|
|
4
|
-
const is_valid_number_1 = require("./is-valid-number");
|
|
1
|
+
import { isValidNumber } from "./is-valid-number.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is positive number or not?
|
|
7
4
|
*
|
|
@@ -10,7 +7,6 @@ const is_valid_number_1 = require("./is-valid-number");
|
|
|
10
7
|
*
|
|
11
8
|
* Note: NaN and infinite values are not evaluated as a number
|
|
12
9
|
* */
|
|
13
|
-
function isPositiveNumber(value) {
|
|
14
|
-
return
|
|
10
|
+
export function isPositiveNumber(value) {
|
|
11
|
+
return isValidNumber(value) && value > 0;
|
|
15
12
|
}
|
|
16
|
-
//# sourceMappingURL=is-positive-number.js.map
|
package/dist/is/is-primitive.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPrimitive = isPrimitive;
|
|
4
|
-
const is_not_empty_1 = require("./is-not-empty");
|
|
1
|
+
import { isNotEmpty } from "./is-not-empty.js";
|
|
5
2
|
const _primitiveValues = ["string", "number", "boolean"];
|
|
6
3
|
// noinspection JSUnusedGlobalSymbols
|
|
7
4
|
/**
|
|
@@ -11,7 +8,6 @@ const _primitiveValues = ["string", "number", "boolean"];
|
|
|
11
8
|
* @param {any} value
|
|
12
9
|
* @returns {boolean}
|
|
13
10
|
* */
|
|
14
|
-
function isPrimitive(value) {
|
|
15
|
-
return
|
|
11
|
+
export function isPrimitive(value) {
|
|
12
|
+
return isNotEmpty(value) && _primitiveValues.includes(typeof value);
|
|
16
13
|
}
|
|
17
|
-
//# sourceMappingURL=is-primitive.js.map
|
package/dist/is/is-real-value.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRealValue = isRealValue;
|
|
4
|
-
const is_not_empty_1 = require("./is-not-empty");
|
|
1
|
+
import { isNotEmpty } from "./is-not-empty.js";
|
|
5
2
|
const _realValueItems = ["string", "number", "bigint", "boolean", "object", "function"];
|
|
6
3
|
/**
|
|
7
4
|
* Checks value is real value?
|
|
@@ -11,7 +8,6 @@ const _realValueItems = ["string", "number", "bigint", "boolean", "object", "fun
|
|
|
11
8
|
* @param {any} value
|
|
12
9
|
* @returns {boolean}
|
|
13
10
|
* */
|
|
14
|
-
function isRealValue(value) {
|
|
15
|
-
return
|
|
11
|
+
export function isRealValue(value) {
|
|
12
|
+
return isNotEmpty(value) && _realValueItems.includes(typeof value);
|
|
16
13
|
}
|
|
17
|
-
//# sourceMappingURL=is-real-value.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSafeInteger = isSafeInteger;
|
|
4
1
|
/**
|
|
5
2
|
* Checks value is safe integer or not?
|
|
6
3
|
* Safe integer means: an integer can not be outside the bigint range
|
|
@@ -10,7 +7,6 @@ exports.isSafeInteger = isSafeInteger;
|
|
|
10
7
|
*
|
|
11
8
|
* Note: NaN and infinite values are not evaluated as a number
|
|
12
9
|
* */
|
|
13
|
-
function isSafeInteger(value) {
|
|
10
|
+
export function isSafeInteger(value) {
|
|
14
11
|
return Number.isInteger(value) && Number.isSafeInteger(value);
|
|
15
12
|
}
|
|
16
|
-
//# sourceMappingURL=is-safe-integer.js.map
|
package/dist/is/is-sys-class.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSysClass = isSysClass;
|
|
4
|
-
const literal_1 = require("../literal");
|
|
1
|
+
import { SysClassItems } from "../literal/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks function is system class?
|
|
7
4
|
*
|
|
8
5
|
* @param {any} value
|
|
9
6
|
* @returns {boolean}
|
|
10
7
|
* */
|
|
11
|
-
function isSysClass(value) {
|
|
12
|
-
return (typeof value === 'function') &&
|
|
8
|
+
export function isSysClass(value) {
|
|
9
|
+
return (typeof value === 'function') && SysClassItems.includes(typeof value);
|
|
13
10
|
}
|
|
14
|
-
//# sourceMappingURL=is-sys-class.js.map
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSysFunction = isSysFunction;
|
|
4
|
-
const literal_1 = require("../literal");
|
|
1
|
+
import { SysFunctionItems } from "../literal/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks function is system function?
|
|
7
4
|
*
|
|
8
5
|
* @param {any} value
|
|
9
6
|
* @returns {boolean}
|
|
10
7
|
* */
|
|
11
|
-
function isSysFunction(value) {
|
|
12
|
-
return (typeof value === 'function') &&
|
|
8
|
+
export function isSysFunction(value) {
|
|
9
|
+
return (typeof value === 'function') && SysFunctionItems.includes(typeof value);
|
|
13
10
|
}
|
|
14
|
-
//# sourceMappingURL=is-sys-function.js.map
|
package/dist/is/is-true-like.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTrueLike = isTrueLike;
|
|
4
|
-
const literal_1 = require("../literal");
|
|
1
|
+
import { TrueWeakItems } from "../literal/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is true like?
|
|
7
4
|
* - `true like` means:
|
|
@@ -14,15 +11,14 @@ const literal_1 = require("../literal");
|
|
|
14
11
|
* @param {any} value
|
|
15
12
|
* @returns {boolean}
|
|
16
13
|
* */
|
|
17
|
-
function isTrueLike(value) {
|
|
14
|
+
export function isTrueLike(value) {
|
|
18
15
|
switch (typeof value) {
|
|
19
16
|
case "boolean":
|
|
20
17
|
return value;
|
|
21
18
|
case "string":
|
|
22
|
-
return
|
|
19
|
+
return TrueWeakItems.includes(value);
|
|
23
20
|
case 'number':
|
|
24
21
|
return value === 1;
|
|
25
22
|
}
|
|
26
23
|
return false;
|
|
27
24
|
}
|
|
28
|
-
//# sourceMappingURL=is-true-like.js.map
|
package/dist/is/is-type-of.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTypeOf = isTypeOf;
|
|
4
|
-
const is_not_empty_1 = require("./is-not-empty");
|
|
1
|
+
import { isNotEmpty } from "./is-not-empty.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks type of value is in given types
|
|
7
4
|
*
|
|
@@ -9,7 +6,6 @@ const is_not_empty_1 = require("./is-not-empty");
|
|
|
9
6
|
* @param {...BasicType} types
|
|
10
7
|
* @returns {boolean}
|
|
11
8
|
* */
|
|
12
|
-
function isTypeOf(value, ...types) {
|
|
13
|
-
return
|
|
9
|
+
export function isTypeOf(value, ...types) {
|
|
10
|
+
return isNotEmpty(value) && types.includes(typeof value);
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=is-type-of.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidInteger = isValidInteger;
|
|
4
|
-
const is_valid_number_1 = require("./is-valid-number");
|
|
1
|
+
import { isValidNumber } from "./is-valid-number.js";
|
|
5
2
|
/**
|
|
6
3
|
* Checks value is integer or not?
|
|
7
4
|
*
|
|
@@ -10,7 +7,6 @@ const is_valid_number_1 = require("./is-valid-number");
|
|
|
10
7
|
*
|
|
11
8
|
* Note: NaN and infinite values are not evaluated as a number
|
|
12
9
|
* */
|
|
13
|
-
function isValidInteger(value) {
|
|
14
|
-
return
|
|
10
|
+
export function isValidInteger(value) {
|
|
11
|
+
return isValidNumber(value) && Number.isInteger(value);
|
|
15
12
|
}
|
|
16
|
-
//# sourceMappingURL=is-valid-integer.js.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidNumber = isValidNumber;
|
|
4
1
|
/**
|
|
5
2
|
* Checks value is number (float or integer) or not?
|
|
6
3
|
*
|
|
@@ -9,7 +6,6 @@ exports.isValidNumber = isValidNumber;
|
|
|
9
6
|
*
|
|
10
7
|
* Note: NaN and infinite values are not evaluated as a number
|
|
11
8
|
* */
|
|
12
|
-
function isValidNumber(value) {
|
|
9
|
+
export function isValidNumber(value) {
|
|
13
10
|
return (typeof value === 'number') && !isNaN(value) && isFinite(value);
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=is-valid-number.js.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.BasicTypeDefined = ['string', 'object', 'number', 'boolean', 'function', 'symbol', 'bigint'];
|
|
5
|
-
// noinspection JSUnusedGlobalSymbols
|
|
1
|
+
import { literalPool } from "@leyyo/common";
|
|
2
|
+
import { FQN } from "../internal.js";
|
|
3
|
+
const literals = ['string', 'object', 'number', 'boolean', 'function', 'symbol', 'bigint', 'undefined'];
|
|
6
4
|
/**
|
|
7
|
-
* JS
|
|
5
|
+
* JS Type without `undefined`
|
|
8
6
|
* */
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const BasicTypeItems = literals;
|
|
8
|
+
literalPool.define(FQN, 'BasicType', BasicTypeItems, { i18n: true, aliases: [] });
|