@kensio/smartass 1.16.0 → 1.18.0
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/assert/array-includes/array-includes.assert.d.ts +3 -8
- package/dist/assert/array-includes/array-includes.assert.d.ts.map +1 -1
- package/dist/assert/array-includes/array-includes.assert.js.map +1 -1
- package/dist/assert/array-includes/array-includes.match.d.ts +1 -6
- package/dist/assert/array-includes/array-includes.match.d.ts.map +1 -1
- package/dist/assert/array-includes/array-includes.match.js +7 -1
- package/dist/assert/array-includes/array-includes.match.js.map +1 -1
- package/dist/assert/array-includes/array-includes.type.d.ts +44 -0
- package/dist/assert/array-includes/array-includes.type.d.ts.map +1 -0
- package/dist/assert/array-includes/array-includes.type.js +8 -0
- package/dist/assert/array-includes/array-includes.type.js.map +1 -0
- package/dist/assert/array-includes-all/array-includes-all.assert.d.ts +3 -7
- package/dist/assert/array-includes-all/array-includes-all.assert.d.ts.map +1 -1
- package/dist/assert/array-includes-all/array-includes-all.assert.js +27 -5
- package/dist/assert/array-includes-all/array-includes-all.assert.js.map +1 -1
- package/dist/assert/array-includes-all/array-includes-all.match.d.ts +3 -8
- package/dist/assert/array-includes-all/array-includes-all.match.d.ts.map +1 -1
- package/dist/assert/array-includes-all/array-includes-all.match.js +16 -3
- package/dist/assert/array-includes-all/array-includes-all.match.js.map +1 -1
- package/dist/assert/array-includes-all/array-includes-all.type.d.ts +51 -0
- package/dist/assert/array-includes-all/array-includes-all.type.d.ts.map +1 -0
- package/dist/assert/array-includes-all/array-includes-all.type.js +2 -0
- package/dist/assert/array-includes-all/array-includes-all.type.js.map +1 -0
- package/dist/assert/array-length/array-length.assert.d.ts +4 -9
- package/dist/assert/array-length/array-length.assert.d.ts.map +1 -1
- package/dist/assert/array-length/array-length.assert.js +7 -4
- package/dist/assert/array-length/array-length.assert.js.map +1 -1
- package/dist/assert/array-length/array-length.match.d.ts +1 -9
- package/dist/assert/array-length/array-length.match.d.ts.map +1 -1
- package/dist/assert/array-length/array-length.match.js +8 -2
- package/dist/assert/array-length/array-length.match.js.map +1 -1
- package/dist/assert/array-length/array-length.type.d.ts +37 -0
- package/dist/assert/array-length/array-length.type.d.ts.map +1 -0
- package/dist/assert/array-length/array-length.type.js +8 -0
- package/dist/assert/array-length/array-length.type.js.map +1 -0
- package/dist/assert/array-min-length/array-min-length.assert.d.ts +3 -9
- package/dist/assert/array-min-length/array-min-length.assert.d.ts.map +1 -1
- package/dist/assert/array-min-length/array-min-length.assert.js +10 -6
- package/dist/assert/array-min-length/array-min-length.assert.js.map +1 -1
- package/dist/assert/array-min-length/array-min-length.match.d.ts +1 -3
- package/dist/assert/array-min-length/array-min-length.match.d.ts.map +1 -1
- package/dist/assert/array-min-length/array-min-length.match.js +7 -1
- package/dist/assert/array-min-length/array-min-length.match.js.map +1 -1
- package/dist/assert/array-min-length/array-min-length.type.d.ts +35 -0
- package/dist/assert/array-min-length/array-min-length.type.d.ts.map +1 -0
- package/dist/assert/array-min-length/array-min-length.type.js +8 -0
- package/dist/assert/array-min-length/array-min-length.type.js.map +1 -0
- package/dist/assert/array-not-empty/array-not-empty.assert.d.ts +3 -5
- package/dist/assert/array-not-empty/array-not-empty.assert.d.ts.map +1 -1
- package/dist/assert/array-not-empty/array-not-empty.assert.js +8 -3
- package/dist/assert/array-not-empty/array-not-empty.assert.js.map +1 -1
- package/dist/assert/array-not-empty/array-not-empty.match.d.ts +1 -3
- package/dist/assert/array-not-empty/array-not-empty.match.d.ts.map +1 -1
- package/dist/assert/array-not-empty/array-not-empty.match.js +7 -1
- package/dist/assert/array-not-empty/array-not-empty.match.js.map +1 -1
- package/dist/assert/array-not-empty/array-not-empty.type.d.ts +35 -0
- package/dist/assert/array-not-empty/array-not-empty.type.d.ts.map +1 -0
- package/dist/assert/array-not-empty/array-not-empty.type.js +8 -0
- package/dist/assert/array-not-empty/array-not-empty.type.js.map +1 -0
- package/dist/assert/buffer-equal/buffer-equal.assert.d.ts +1 -1
- package/dist/assert/buffer-equal/buffer-equal.assert.d.ts.map +1 -1
- package/dist/assert/buffer-equal/buffer-equal.assert.js.map +1 -1
- package/dist/assert/buffer-equal/buffer-equal.match.d.ts +3 -3
- package/dist/assert/buffer-equal/buffer-equal.match.d.ts.map +1 -1
- package/dist/assert/buffer-equal/buffer-equal.match.js +20 -11
- package/dist/assert/buffer-equal/buffer-equal.match.js.map +1 -1
- package/dist/assert/buffer-equal/buffer-equal.type.d.ts +32 -0
- package/dist/assert/buffer-equal/buffer-equal.type.d.ts.map +1 -0
- package/dist/assert/buffer-equal/buffer-equal.type.js +8 -0
- package/dist/assert/buffer-equal/buffer-equal.type.js.map +1 -0
- package/dist/assert/identical/identical.assert.d.ts +1 -1
- package/dist/assert/identical/identical.assert.d.ts.map +1 -1
- package/dist/assert/instance-of/instance-of.assert.d.ts +3 -5
- package/dist/assert/instance-of/instance-of.assert.d.ts.map +1 -1
- package/dist/assert/instance-of/instance-of.assert.js.map +1 -1
- package/dist/assert/instance-of/instance-of.match.d.ts +2 -3
- package/dist/assert/instance-of/instance-of.match.d.ts.map +1 -1
- package/dist/assert/instance-of/instance-of.match.js +7 -1
- package/dist/assert/instance-of/instance-of.match.js.map +1 -1
- package/dist/assert/instance-of/instance-of.type.d.ts +42 -0
- package/dist/assert/instance-of/instance-of.type.d.ts.map +1 -0
- package/dist/assert/instance-of/instance-of.type.js +8 -0
- package/dist/assert/instance-of/instance-of.type.js.map +1 -0
- package/dist/assert/map-size/map-size.assert.d.ts +4 -0
- package/dist/assert/map-size/map-size.assert.d.ts.map +1 -0
- package/dist/assert/map-size/map-size.assert.js +19 -0
- package/dist/assert/map-size/map-size.assert.js.map +1 -0
- package/dist/assert/map-size/map-size.match.d.ts +6 -0
- package/dist/assert/map-size/map-size.match.d.ts.map +1 -0
- package/dist/assert/map-size/map-size.match.js +15 -0
- package/dist/assert/map-size/map-size.match.js.map +1 -0
- package/dist/assert/map-size/map-size.type.d.ts +33 -0
- package/dist/assert/map-size/map-size.type.d.ts.map +1 -0
- package/dist/assert/map-size/map-size.type.js +8 -0
- package/dist/assert/map-size/map-size.type.js.map +1 -0
- package/dist/assert/non-nullable/non-nullable.match.d.ts +2 -2
- package/dist/assert/non-nullable/non-nullable.match.d.ts.map +1 -1
- package/dist/assert/non-nullable/non-nullable.match.js.map +1 -1
- package/dist/assert/non-nullable/non-nullable.type.d.ts +5 -0
- package/dist/assert/non-nullable/non-nullable.type.d.ts.map +1 -0
- package/dist/assert/non-nullable/non-nullable.type.js +2 -0
- package/dist/assert/non-nullable/non-nullable.type.js.map +1 -0
- package/dist/assert/number-to-nearest/number-to-nearest.assert.d.ts +1 -1
- package/dist/assert/number-to-nearest/number-to-nearest.assert.d.ts.map +1 -1
- package/dist/assert/number-to-nearest/number-to-nearest.assert.js +2 -2
- package/dist/assert/number-to-nearest/number-to-nearest.assert.js.map +1 -1
- package/dist/assert/number-to-nearest/number-to-nearest.match.d.ts +1 -1
- package/dist/assert/number-to-nearest/number-to-nearest.match.d.ts.map +1 -1
- package/dist/assert/number-to-nearest/number-to-nearest.match.js +1 -1
- package/dist/assert/number-to-nearest/number-to-nearest.match.js.map +1 -1
- package/dist/assert/object-has-property/object-has-property.assert.d.ts +3 -6
- package/dist/assert/object-has-property/object-has-property.assert.d.ts.map +1 -1
- package/dist/assert/object-has-property/object-has-property.assert.js +1 -1
- package/dist/assert/object-has-property/object-has-property.assert.js.map +1 -1
- package/dist/assert/object-has-property/object-has-property.match.d.ts +1 -7
- package/dist/assert/object-has-property/object-has-property.match.d.ts.map +1 -1
- package/dist/assert/object-has-property/object-has-property.match.js +1 -1
- package/dist/assert/object-has-property/object-has-property.match.js.map +1 -1
- package/dist/assert/object-has-property/object-has-property.type.d.ts +8 -0
- package/dist/assert/object-has-property/object-has-property.type.d.ts.map +1 -0
- package/dist/assert/object-has-property/object-has-property.type.js +2 -0
- package/dist/assert/object-has-property/object-has-property.type.js.map +1 -0
- package/dist/assert/object-matches/object-matches.assert.d.ts +1 -28
- package/dist/assert/object-matches/object-matches.assert.d.ts.map +1 -1
- package/dist/assert/object-matches/object-matches.assert.js.map +1 -1
- package/dist/assert/object-matches/object-matches.type.d.ts +155 -0
- package/dist/assert/object-matches/object-matches.type.d.ts.map +1 -0
- package/dist/assert/object-matches/object-matches.type.js +2 -0
- package/dist/assert/object-matches/object-matches.type.js.map +1 -0
- package/dist/assert/one-of/one-of.assert.d.ts +5 -3
- package/dist/assert/one-of/one-of.assert.d.ts.map +1 -1
- package/dist/assert/one-of/one-of.assert.js.map +1 -1
- package/dist/assert/one-of/one-of.match.d.ts +2 -2
- package/dist/assert/one-of/one-of.match.d.ts.map +1 -1
- package/dist/assert/one-of/one-of.match.js +7 -1
- package/dist/assert/one-of/one-of.match.js.map +1 -1
- package/dist/assert/one-of/one-of.type.d.ts +33 -0
- package/dist/assert/one-of/one-of.type.d.ts.map +1 -0
- package/dist/assert/one-of/one-of.type.js +8 -0
- package/dist/assert/one-of/one-of.type.js.map +1 -0
- package/dist/assert/string-ends-with/string-ends-with.assert.d.ts +3 -4
- package/dist/assert/string-ends-with/string-ends-with.assert.d.ts.map +1 -1
- package/dist/assert/string-ends-with/string-ends-with.assert.js.map +1 -1
- package/dist/assert/string-ends-with/string-ends-with.match.d.ts +2 -2
- package/dist/assert/string-ends-with/string-ends-with.match.d.ts.map +1 -1
- package/dist/assert/string-ends-with/string-ends-with.match.js +7 -1
- package/dist/assert/string-ends-with/string-ends-with.match.js.map +1 -1
- package/dist/assert/string-ends-with/string-ends-with.type.d.ts +39 -0
- package/dist/assert/string-ends-with/string-ends-with.type.d.ts.map +1 -0
- package/dist/assert/string-ends-with/string-ends-with.type.js +8 -0
- package/dist/assert/string-ends-with/string-ends-with.type.js.map +1 -0
- package/dist/assert/string-includes/string-includes.assert.d.ts +3 -4
- package/dist/assert/string-includes/string-includes.assert.d.ts.map +1 -1
- package/dist/assert/string-includes/string-includes.assert.js.map +1 -1
- package/dist/assert/string-includes/string-includes.match.d.ts +2 -2
- package/dist/assert/string-includes/string-includes.match.d.ts.map +1 -1
- package/dist/assert/string-includes/string-includes.match.js +7 -1
- package/dist/assert/string-includes/string-includes.match.js.map +1 -1
- package/dist/assert/string-includes/string-includes.type.d.ts +39 -0
- package/dist/assert/string-includes/string-includes.type.d.ts.map +1 -0
- package/dist/assert/string-includes/string-includes.type.js +8 -0
- package/dist/assert/string-includes/string-includes.type.js.map +1 -0
- package/dist/assert/string-length/string-length.assert.d.ts +3 -14
- package/dist/assert/string-length/string-length.assert.d.ts.map +1 -1
- package/dist/assert/string-length/string-length.assert.js +7 -2
- package/dist/assert/string-length/string-length.assert.js.map +1 -1
- package/dist/assert/string-length/string-length.match.d.ts +1 -93
- package/dist/assert/string-length/string-length.match.d.ts.map +1 -1
- package/dist/assert/string-length/string-length.match.js +8 -2
- package/dist/assert/string-length/string-length.match.js.map +1 -1
- package/dist/assert/string-length/string-length.type.d.ts +132 -0
- package/dist/assert/string-length/string-length.type.d.ts.map +1 -0
- package/dist/assert/string-length/string-length.type.js +8 -0
- package/dist/assert/string-length/string-length.type.js.map +1 -0
- package/dist/assert/string-not-includes/string-not-includes.assert.d.ts +4 -4
- package/dist/assert/string-not-includes/string-not-includes.assert.d.ts.map +1 -1
- package/dist/assert/string-not-includes/string-not-includes.assert.js +7 -2
- package/dist/assert/string-not-includes/string-not-includes.assert.js.map +1 -1
- package/dist/assert/string-not-includes/string-not-includes.match.d.ts +2 -2
- package/dist/assert/string-not-includes/string-not-includes.match.d.ts.map +1 -1
- package/dist/assert/string-not-includes/string-not-includes.match.js +8 -2
- package/dist/assert/string-not-includes/string-not-includes.match.js.map +1 -1
- package/dist/assert/string-not-includes/string-not-includes.type.d.ts +30 -0
- package/dist/assert/string-not-includes/string-not-includes.type.d.ts.map +1 -0
- package/dist/assert/string-not-includes/string-not-includes.type.js +8 -0
- package/dist/assert/string-not-includes/string-not-includes.type.js.map +1 -0
- package/dist/assert/string-starts-with/string-starts-with.assert.d.ts +4 -4
- package/dist/assert/string-starts-with/string-starts-with.assert.d.ts.map +1 -1
- package/dist/assert/string-starts-with/string-starts-with.assert.js +7 -2
- package/dist/assert/string-starts-with/string-starts-with.assert.js.map +1 -1
- package/dist/assert/string-starts-with/string-starts-with.match.d.ts +2 -2
- package/dist/assert/string-starts-with/string-starts-with.match.d.ts.map +1 -1
- package/dist/assert/string-starts-with/string-starts-with.match.js +7 -1
- package/dist/assert/string-starts-with/string-starts-with.match.js.map +1 -1
- package/dist/assert/string-starts-with/string-starts-with.type.d.ts +39 -0
- package/dist/assert/string-starts-with/string-starts-with.type.d.ts.map +1 -0
- package/dist/assert/string-starts-with/string-starts-with.type.js +8 -0
- package/dist/assert/string-starts-with/string-starts-with.type.js.map +1 -0
- package/dist/assert/throws-error-like/throws-error-like.assert.d.ts +1 -5
- package/dist/assert/throws-error-like/throws-error-like.assert.d.ts.map +1 -1
- package/dist/assert/throws-error-like/throws-error-like.assert.js.map +1 -1
- package/dist/assert/throws-error-like/throws-error-like.type.d.ts +6 -0
- package/dist/assert/throws-error-like/throws-error-like.type.d.ts.map +1 -0
- package/dist/assert/throws-error-like/throws-error-like.type.js +2 -0
- package/dist/assert/throws-error-like/throws-error-like.type.js.map +1 -0
- package/dist/assert/type-bigint/type-bigint.match.d.ts +2 -2
- package/dist/assert/type-bigint/type-bigint.match.d.ts.map +1 -1
- package/dist/assert/type-bigint/type-bigint.match.js.map +1 -1
- package/dist/assert/type-bigint/type-bigint.type.d.ts +21 -0
- package/dist/assert/type-bigint/type-bigint.type.d.ts.map +1 -0
- package/dist/assert/type-bigint/type-bigint.type.js +2 -0
- package/dist/assert/type-bigint/type-bigint.type.js.map +1 -0
- package/dist/assert/type-boolean/type-boolean.match.d.ts +2 -2
- package/dist/assert/type-boolean/type-boolean.match.d.ts.map +1 -1
- package/dist/assert/type-boolean/type-boolean.match.js +7 -1
- package/dist/assert/type-boolean/type-boolean.match.js.map +1 -1
- package/dist/assert/type-boolean/type-boolean.type.d.ts +30 -0
- package/dist/assert/type-boolean/type-boolean.type.d.ts.map +1 -0
- package/dist/assert/type-boolean/type-boolean.type.js +9 -0
- package/dist/assert/type-boolean/type-boolean.type.js.map +1 -0
- package/dist/assert/type-function/type-function.assert.d.ts.map +1 -1
- package/dist/assert/type-function/type-function.assert.js.map +1 -1
- package/dist/assert/type-function/type-function.match.d.ts +2 -2
- package/dist/assert/type-function/type-function.match.d.ts.map +1 -1
- package/dist/assert/type-function/type-function.match.js +7 -4
- package/dist/assert/type-function/type-function.match.js.map +1 -1
- package/dist/assert/type-function/type-function.type.d.ts +29 -0
- package/dist/assert/type-function/type-function.type.d.ts.map +1 -0
- package/dist/assert/type-function/type-function.type.js +8 -0
- package/dist/assert/type-function/type-function.type.js.map +1 -0
- package/dist/assert/type-number/type-number.match.d.ts +2 -2
- package/dist/assert/type-number/type-number.match.d.ts.map +1 -1
- package/dist/assert/type-number/type-number.match.js +7 -1
- package/dist/assert/type-number/type-number.match.js.map +1 -1
- package/dist/assert/type-number/type-number.type.d.ts +30 -0
- package/dist/assert/type-number/type-number.type.d.ts.map +1 -0
- package/dist/assert/type-number/type-number.type.js +9 -0
- package/dist/assert/type-number/type-number.type.js.map +1 -0
- package/dist/assert/type-numeric/type-numeric.match.d.ts +2 -2
- package/dist/assert/type-numeric/type-numeric.match.d.ts.map +1 -1
- package/dist/assert/type-numeric/type-numeric.match.js +7 -1
- package/dist/assert/type-numeric/type-numeric.match.js.map +1 -1
- package/dist/assert/type-numeric/type-numeric.type.d.ts +33 -0
- package/dist/assert/type-numeric/type-numeric.type.d.ts.map +1 -0
- package/dist/assert/type-numeric/type-numeric.type.js +9 -0
- package/dist/assert/type-numeric/type-numeric.type.js.map +1 -0
- package/dist/assert/type-object/type-object.match.d.ts +2 -2
- package/dist/assert/type-object/type-object.match.d.ts.map +1 -1
- package/dist/assert/type-object/type-object.match.js +7 -1
- package/dist/assert/type-object/type-object.match.js.map +1 -1
- package/dist/assert/type-object/type-object.type.d.ts +33 -0
- package/dist/assert/type-object/type-object.type.d.ts.map +1 -0
- package/dist/assert/type-object/type-object.type.js +8 -0
- package/dist/assert/type-object/type-object.type.js.map +1 -0
- package/dist/assert/type-string/type-string.match.d.ts +2 -2
- package/dist/assert/type-string/type-string.match.d.ts.map +1 -1
- package/dist/assert/type-string/type-string.match.js +7 -1
- package/dist/assert/type-string/type-string.match.js.map +1 -1
- package/dist/assert/type-string/type-string.type.d.ts +30 -0
- package/dist/assert/type-string/type-string.type.d.ts.map +1 -0
- package/dist/assert/type-string/type-string.type.js +9 -0
- package/dist/assert/type-string/type-string.type.js.map +1 -0
- package/dist/assert/type-symbol/type-symbol.assert.d.ts +5 -0
- package/dist/assert/type-symbol/type-symbol.assert.d.ts.map +1 -0
- package/dist/assert/type-symbol/type-symbol.assert.js +13 -0
- package/dist/assert/type-symbol/type-symbol.assert.js.map +1 -0
- package/dist/assert/type-symbol/type-symbol.match.d.ts +6 -0
- package/dist/assert/type-symbol/type-symbol.match.d.ts.map +1 -0
- package/dist/assert/type-symbol/type-symbol.match.js +14 -0
- package/dist/assert/type-symbol/type-symbol.match.js.map +1 -0
- package/dist/assert/type-symbol/type-symbol.type.d.ts +30 -0
- package/dist/assert/type-symbol/type-symbol.type.d.ts.map +1 -0
- package/dist/assert/type-symbol/type-symbol.type.js +9 -0
- package/dist/assert/type-symbol/type-symbol.type.js.map +1 -0
- package/dist/assert/type-typed-array/type-typed-array.assert.d.ts +1 -1
- package/dist/assert/type-typed-array/type-typed-array.assert.d.ts.map +1 -1
- package/dist/assert/type-typed-array/type-typed-array.assert.js.map +1 -1
- package/dist/assert/type-typed-array/type-typed-array.match.d.ts +2 -6
- package/dist/assert/type-typed-array/type-typed-array.match.d.ts.map +1 -1
- package/dist/assert/type-typed-array/type-typed-array.match.js +7 -1
- package/dist/assert/type-typed-array/type-typed-array.match.js.map +1 -1
- package/dist/assert/type-typed-array/type-typed-array.type.d.ts +33 -0
- package/dist/assert/type-typed-array/type-typed-array.type.d.ts.map +1 -0
- package/dist/assert/type-typed-array/type-typed-array.type.js +8 -0
- package/dist/assert/type-typed-array/type-typed-array.type.js.map +1 -0
- package/dist/assert/uuid/uuid-v4.assert.d.ts +2 -4
- package/dist/assert/uuid/uuid-v4.assert.d.ts.map +1 -1
- package/dist/assert/uuid/uuid-v4.assert.js +2 -2
- package/dist/assert/uuid/uuid-v4.assert.js.map +1 -1
- package/dist/assert/uuid/uuid-v4.match.d.ts +2 -4
- package/dist/assert/uuid/uuid-v4.match.d.ts.map +1 -1
- package/dist/assert/uuid/uuid-v4.match.js +7 -1
- package/dist/assert/uuid/uuid-v4.match.js.map +1 -1
- package/dist/assert/uuid/uuid-v4.type.d.ts +34 -0
- package/dist/assert/uuid/uuid-v4.type.d.ts.map +1 -0
- package/dist/assert/uuid/uuid-v4.type.js +8 -0
- package/dist/assert/uuid/uuid-v4.type.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/match/match.d.ts +37 -1
- package/dist/match/match.d.ts.map +1 -1
- package/dist/match/match.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unique symbol to reliably identify the StringOfLengthMatcher type.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript is structurally typed, so matcher types with similar predicates
|
|
5
|
+
* can otherwise accidentally satisfy each other's conditional branches.
|
|
6
|
+
*/
|
|
7
|
+
export const stringOfLengthMatcher = Symbol("smartass.stringOfLengthMatcher");
|
|
8
|
+
//# sourceMappingURL=string-length.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-length.type.js","sourceRoot":"","sources":["../../../src/assert/string-length/string-length.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
type StringNotIncluding<TActual extends string, TSubstring extends string> = TActual extends `${string}${TSubstring}${string}` ? never : TActual;
|
|
2
|
+
export declare function assertStringNotIncludes<TActual extends string, const TSubstring extends string>(value: TActual, substring: TSubstring, message?: string): asserts value is StringNotIncluding<TActual, TSubstring>;
|
|
3
|
+
export declare function assertStringNotIncludes<const TSubstring extends string>(value: unknown, substring: TSubstring, message?: string): asserts value is Exclude<string, `${string}${TSubstring}${string}`>;
|
|
4
|
+
export {};
|
|
5
5
|
//# sourceMappingURL=string-not-includes.assert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-not-includes.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.assert.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"string-not-includes.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.assert.ts"],"names":[],"mappings":"AAIA,KAAK,kBAAkB,CACrB,OAAO,SAAS,MAAM,EACtB,UAAU,SAAS,MAAM,IACvB,OAAO,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC;AAExE,wBAAgB,uBAAuB,CACrC,OAAO,SAAS,MAAM,EACtB,KAAK,CAAC,UAAU,SAAS,MAAM,EAE/B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAE5D,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,UAAU,SAAS,MAAM,EACrE,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC,CAAC"}
|
|
@@ -7,8 +7,13 @@ import { desc, repr } from "../../describe/describe.js";
|
|
|
7
7
|
export function assertStringNotIncludes(value, substring, message) {
|
|
8
8
|
const matcher = stringNotIncluding(substring);
|
|
9
9
|
if (!matcher.matches(value)) {
|
|
10
|
-
throw new AssertionError(message ??
|
|
11
|
-
`Expected ${desc(value)} not to include ${repr(substring)}, but it did.`, value, matcher.represent());
|
|
10
|
+
throw new AssertionError(message ?? buildStringNotIncludesMessage(value, substring), value, matcher.represent());
|
|
12
11
|
}
|
|
13
12
|
}
|
|
13
|
+
function buildStringNotIncludesMessage(value, substring) {
|
|
14
|
+
if (typeof value !== "string") {
|
|
15
|
+
return `Expected ${desc(value)} to be a string not including ${repr(substring)}.`;
|
|
16
|
+
}
|
|
17
|
+
return `Expected ${desc(value)} not to include ${repr(substring)}, but it did.`;
|
|
18
|
+
}
|
|
14
19
|
//# sourceMappingURL=string-not-includes.assert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-not-includes.assert.js","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"string-not-includes.assert.js","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAsBxD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAc,EACd,SAAiB,EACjB,OAAgB;IAEhB,MAAM,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAE9C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,6BAA6B,CAAC,KAAK,EAAE,SAAS,CAAC,EAC1D,KAAK,EACL,OAAO,CAAC,SAAS,EAAE,CACpB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CACpC,KAAc,EACd,SAAiB;IAEjB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,iCAAiC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;IACpF,CAAC;IAED,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;AAClF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type StringNotIncludingMatcher } from "./string-not-includes.type.js";
|
|
2
2
|
/**
|
|
3
3
|
* Matcher for a string that does not include a given substring.
|
|
4
4
|
*/
|
|
5
|
-
export declare function stringNotIncluding<const T extends string>(substring: T):
|
|
5
|
+
export declare function stringNotIncluding<const T extends string>(substring: T): StringNotIncludingMatcher<T>;
|
|
6
6
|
//# sourceMappingURL=string-not-includes.match.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-not-includes.match.d.ts","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.match.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"string-not-includes.match.d.ts","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.match.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EACvD,SAAS,EAAE,CAAC,GACX,yBAAyB,CAAC,CAAC,CAAC,CAY9B"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { createMatcher } from "../../match/match.js";
|
|
2
1
|
import { repr } from "../../describe/describe.js";
|
|
2
|
+
import { createMatcher } from "../../match/match.js";
|
|
3
|
+
import { stringNotIncludingMatcher, } from "./string-not-includes.type.js";
|
|
3
4
|
/**
|
|
4
5
|
* Matcher for a string that does not include a given substring.
|
|
5
6
|
*/
|
|
6
7
|
export function stringNotIncluding(substring) {
|
|
7
|
-
return
|
|
8
|
+
return {
|
|
9
|
+
...createMatcher((value) => typeof value === "string" && !value.includes(substring), () => `string not including ${repr(substring)}`, () => `"✗${substring}✗"`),
|
|
10
|
+
// Runtime marker used only to make the matcher type nominal for type-level
|
|
11
|
+
// refinement dispatch. It is not part of the user-facing matcher behaviour.
|
|
12
|
+
[stringNotIncludingMatcher]: substring,
|
|
13
|
+
};
|
|
8
14
|
}
|
|
9
15
|
//# sourceMappingURL=string-not-includes.match.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-not-includes.match.js","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.match.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"string-not-includes.match.js","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,yBAAyB,GAE1B,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAY;IAEZ,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAsD,EAAE,CAC5D,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EACzD,GAAG,EAAE,CAAC,wBAAwB,IAAI,CAAC,SAAS,CAAC,EAAE,EAC/C,GAAG,EAAE,CAAC,KAAK,SAAS,IAAI,CACzB;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,yBAAyB,CAAC,EAAE,SAAS;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AssertionMatcher, refinement } from "../../match/match.js";
|
|
2
|
+
/**
|
|
3
|
+
* Unique symbol to reliably identify the StringNotIncludingMatcher type.
|
|
4
|
+
*
|
|
5
|
+
* TypeScript is structurally typed, so matcher types with similar predicates
|
|
6
|
+
* can otherwise accidentally satisfy each other's conditional branches.
|
|
7
|
+
*/
|
|
8
|
+
export declare const stringNotIncludingMatcher: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* Type produced when an actual value is matched by stringNotIncluding().
|
|
11
|
+
*
|
|
12
|
+
* When the calling scope already has string literal information, we preserve the
|
|
13
|
+
* literals that do not include the forbidden substring. Otherwise, we fall back
|
|
14
|
+
* to the matcher's standalone string predicate type.
|
|
15
|
+
*/
|
|
16
|
+
export type StringNotIncludingMatch<TActual, TSubstring extends string> = [
|
|
17
|
+
Exclude<Extract<NonNullable<TActual>, string>, `${string}${TSubstring}${string}`>
|
|
18
|
+
] extends [never] ? Exclude<string, `${string}${TSubstring}${string}`> : Exclude<Extract<NonNullable<TActual>, string>, `${string}${TSubstring}${string}`>;
|
|
19
|
+
export type StringNotIncludingMatcher<TSubstring extends string> = AssertionMatcher<Exclude<string, `${string}${TSubstring}${string}`>> & {
|
|
20
|
+
readonly [stringNotIncludingMatcher]: TSubstring;
|
|
21
|
+
/**
|
|
22
|
+
* Optional type-level hook used by compositional assertions such as
|
|
23
|
+
* assertObjectMatches().
|
|
24
|
+
*
|
|
25
|
+
* This lets the matcher describe how it refines an existing actual type,
|
|
26
|
+
* rather than only exposing the standalone matches() predicate type.
|
|
27
|
+
*/
|
|
28
|
+
readonly [refinement]?: <TActual>(actual: TActual) => StringNotIncludingMatch<TActual, TSubstring>;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=string-not-includes.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-not-includes.type.d.ts","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eAErC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,CAAC,OAAO,EAAE,UAAU,SAAS,MAAM,IAAI;IACxE,OAAO,CACL,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EACrC,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EAAE,CAClC;CACF,SAAS,CAAC,KAAK,CAAC,GACb,OAAO,CAAC,MAAM,EAAE,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC,GAClD,OAAO,CACL,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EACrC,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EAAE,CAClC,CAAC;AAEN,MAAM,MAAM,yBAAyB,CAAC,UAAU,SAAS,MAAM,IAC7D,gBAAgB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC,CAAC,GAAG;IACrE,QAAQ,CAAC,CAAC,yBAAyB,CAAC,EAAE,UAAU,CAAC;IAEjD;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,uBAAuB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;CACnD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unique symbol to reliably identify the StringNotIncludingMatcher type.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript is structurally typed, so matcher types with similar predicates
|
|
5
|
+
* can otherwise accidentally satisfy each other's conditional branches.
|
|
6
|
+
*/
|
|
7
|
+
export const stringNotIncludingMatcher = Symbol("smartass.stringNotIncludingMatcher");
|
|
8
|
+
//# sourceMappingURL=string-not-includes.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-not-includes.type.js","sourceRoot":"","sources":["../../../src/assert/string-not-includes/string-not-includes.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAC7C,oCAAoC,CACrC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
type StringStartingWith<TActual extends string, TPrefix extends string> = TActual extends `${TPrefix}${string}` ? TActual : never;
|
|
2
|
+
export declare function assertStringStartsWith<TActual extends string, const TPrefix extends string>(value: TActual, prefix: TPrefix, message?: string): asserts value is StringStartingWith<TActual, TPrefix>;
|
|
3
|
+
export declare function assertStringStartsWith<const TPrefix extends string>(value: unknown, prefix: TPrefix, message?: string): asserts value is `${TPrefix}${string}`;
|
|
4
|
+
export {};
|
|
5
5
|
//# sourceMappingURL=string-starts-with.assert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-starts-with.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.assert.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"string-starts-with.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.assert.ts"],"names":[],"mappings":"AAIA,KAAK,kBAAkB,CACrB,OAAO,SAAS,MAAM,EACtB,OAAO,SAAS,MAAM,IACpB,OAAO,SAAS,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5D,wBAAgB,sBAAsB,CACpC,OAAO,SAAS,MAAM,EACtB,KAAK,CAAC,OAAO,SAAS,MAAM,EAE5B,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAEzD,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,OAAO,SAAS,MAAM,EACjE,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC"}
|
|
@@ -7,8 +7,13 @@ import { stringStartingWith } from "./string-starts-with.match.js";
|
|
|
7
7
|
export function assertStringStartsWith(value, prefix, message) {
|
|
8
8
|
const matcher = stringStartingWith(prefix);
|
|
9
9
|
if (!matcher.matches(value)) {
|
|
10
|
-
throw new AssertionError(message ??
|
|
11
|
-
`Expected ${desc(value)} to start with ${repr(prefix)}, but it did not.`, value, matcher.represent());
|
|
10
|
+
throw new AssertionError(message ?? buildStringStartsWithMessage(value, prefix), value, matcher.represent());
|
|
12
11
|
}
|
|
13
12
|
}
|
|
13
|
+
function buildStringStartsWithMessage(value, prefix) {
|
|
14
|
+
if (typeof value !== "string") {
|
|
15
|
+
return `Expected ${desc(value)} to be a string starting with ${repr(prefix)}.`;
|
|
16
|
+
}
|
|
17
|
+
return `Expected ${desc(value)} to start with ${repr(prefix)}, but it did not.`;
|
|
18
|
+
}
|
|
14
19
|
//# sourceMappingURL=string-starts-with.assert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-starts-with.assert.js","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"string-starts-with.assert.js","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAsBnE;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAc,EACd,MAAc,EACd,OAAgB;IAEhB,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,4BAA4B,CAAC,KAAK,EAAE,MAAM,CAAC,EACtD,KAAK,EACL,OAAO,CAAC,SAAS,EAAE,CACpB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,4BAA4B,CAAC,KAAc,EAAE,MAAc;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,iCAAiC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IACjF,CAAC;IAED,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;AAClF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type StringStartingWithMatcher } from "./string-starts-with.type.js";
|
|
2
2
|
/**
|
|
3
3
|
* Matcher for a string that starts with a given prefix.
|
|
4
4
|
*/
|
|
5
|
-
export declare function stringStartingWith<const T extends string>(prefix: T):
|
|
5
|
+
export declare function stringStartingWith<const T extends string>(prefix: T): StringStartingWithMatcher<T>;
|
|
6
6
|
//# sourceMappingURL=string-starts-with.match.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-starts-with.match.d.ts","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.match.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"string-starts-with.match.d.ts","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.match.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EACvD,MAAM,EAAE,CAAC,GACR,yBAAyB,CAAC,CAAC,CAAC,CAY9B"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { repr } from "../../describe/describe.js";
|
|
2
2
|
import { createMatcher } from "../../match/match.js";
|
|
3
|
+
import { stringStartingWithMatcher, } from "./string-starts-with.type.js";
|
|
3
4
|
/**
|
|
4
5
|
* Matcher for a string that starts with a given prefix.
|
|
5
6
|
*/
|
|
6
7
|
export function stringStartingWith(prefix) {
|
|
7
|
-
return
|
|
8
|
+
return {
|
|
9
|
+
...createMatcher((value) => typeof value === "string" && value.startsWith(prefix), () => `string starting with ${repr(prefix)}`, () => `"${prefix}…"`),
|
|
10
|
+
// Runtime marker used only to make the matcher type nominal for type-level
|
|
11
|
+
// refinement dispatch. It is not part of the user-facing matcher behaviour.
|
|
12
|
+
[stringStartingWithMatcher]: prefix,
|
|
13
|
+
};
|
|
8
14
|
}
|
|
9
15
|
//# sourceMappingURL=string-starts-with.match.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-starts-with.match.js","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"string-starts-with.match.js","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,yBAAyB,GAE1B,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAS;IAET,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAA4B,EAAE,CAClC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EACvD,GAAG,EAAE,CAAC,wBAAwB,IAAI,CAAC,MAAM,CAAC,EAAE,EAC5C,GAAG,EAAE,CAAC,IAAI,MAAM,IAAI,CACrB;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,yBAAyB,CAAC,EAAE,MAAM;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AssertionMatcher, refinement } from "../../match/match.js";
|
|
2
|
+
/**
|
|
3
|
+
* Unique symbol to reliably identify the StringStartingWithMatcher type.
|
|
4
|
+
*
|
|
5
|
+
* TypeScript is structurally typed, so matcher types with similar predicates can
|
|
6
|
+
* otherwise accidentally satisfy each other's conditional branches.
|
|
7
|
+
*/
|
|
8
|
+
export declare const stringStartingWithMatcher: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* Type produced when an actual value is matched by stringStartingWith().
|
|
11
|
+
*
|
|
12
|
+
* The primary goal is to expose clean, readable user-facing types in IDE
|
|
13
|
+
* tooltips and TypeScript errors. When the calling scope already has string
|
|
14
|
+
* literal overlap with the requested prefix, we preserve that overlap.
|
|
15
|
+
* Otherwise, we fall back to a readable template-literal string type.
|
|
16
|
+
*/
|
|
17
|
+
export type StringStartingWithMatch<TActual, TPrefix extends string> = [
|
|
18
|
+
Extract<NonNullable<TActual>, `${TPrefix}${string}`>
|
|
19
|
+
] extends [never] ? `${TPrefix}${string}` : Extract<NonNullable<TActual>, `${TPrefix}${string}`>;
|
|
20
|
+
/**
|
|
21
|
+
* Type produced when assertStringStartsWith() narrows a value.
|
|
22
|
+
*
|
|
23
|
+
* Assertion functions must assert a type assignable to the asserted parameter's
|
|
24
|
+
* original type. So unlike StringStartingWithMatch, the no-overlap fallback
|
|
25
|
+
* keeps the original actual string type in an intersection.
|
|
26
|
+
*/
|
|
27
|
+
export type StringStartingWithAssertion<TActual extends string, TPrefix extends string> = [Extract<TActual, `${TPrefix}${string}`>] extends [never] ? TActual & `${TPrefix}${string}` : Extract<TActual, `${TPrefix}${string}`>;
|
|
28
|
+
export type StringStartingWithMatcher<TPrefix extends string> = AssertionMatcher<`${TPrefix}${string}`> & {
|
|
29
|
+
readonly [stringStartingWithMatcher]: TPrefix;
|
|
30
|
+
/**
|
|
31
|
+
* Optional type-level hook used by compositional assertions such as
|
|
32
|
+
* assertObjectMatches().
|
|
33
|
+
*
|
|
34
|
+
* This lets the matcher describe how it refines an existing actual type,
|
|
35
|
+
* rather than only exposing the standalone matches() predicate type.
|
|
36
|
+
*/
|
|
37
|
+
readonly [refinement]?: <TActual>(actual: TActual) => StringStartingWithMatch<TActual, TPrefix>;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=string-starts-with.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-starts-with.type.d.ts","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,eAErC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,CAAC,OAAO,EAAE,OAAO,SAAS,MAAM,IAAI;IACrE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC;CACrD,SAAS,CAAC,KAAK,CAAC,GACb,GAAG,OAAO,GAAG,MAAM,EAAE,GACrB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,CACrC,OAAO,SAAS,MAAM,EACtB,OAAO,SAAS,MAAM,IACpB,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACzD,OAAO,GAAG,GAAG,OAAO,GAAG,MAAM,EAAE,GAC/B,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;AAE5C,MAAM,MAAM,yBAAyB,CAAC,OAAO,SAAS,MAAM,IAC1D,gBAAgB,CAAC,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,GAAG;IACxC,QAAQ,CAAC,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAE9C;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;CAChD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unique symbol to reliably identify the StringStartingWithMatcher type.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript is structurally typed, so matcher types with similar predicates can
|
|
5
|
+
* otherwise accidentally satisfy each other's conditional branches.
|
|
6
|
+
*/
|
|
7
|
+
export const stringStartingWithMatcher = Symbol("smartass.stringStartingWithMatcher");
|
|
8
|
+
//# sourceMappingURL=string-starts-with.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-starts-with.type.js","sourceRoot":"","sources":["../../../src/assert/string-starts-with/string-starts-with.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAC7C,oCAAoC,CACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throws-error-like.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/throws-error-like/throws-error-like.assert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"throws-error-like.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/throws-error-like/throws-error-like.assert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,OAAO,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,SAAS,CAqBX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throws-error-like.assert.js","sourceRoot":"","sources":["../../../src/assert/throws-error-like/throws-error-like.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"throws-error-like.assert.js","sourceRoot":"","sources":["../../../src/assert/throws-error-like/throws-error-like.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGlD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CACnC,EAAiB,EACjB,OAAgB;IAEhB,IAAI,CAAC;QACH,EAAE,EAAE,CAAC;IACP,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,YAAY,IAAI,CAAC,EAAE,CAAC,6CAA6C,IAAI,CAAC,KAAK,CAAC,GAAG,EACjF,KAAK,EACL,KAAK,CACN,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC,4BAA4B,EAC3D,SAAS,EACT,KAAK,CACN,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,SAAS,IAAI,KAAK;QAClB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws-error-like.type.d.ts","sourceRoot":"","sources":["../../../src/assert/throws-error-like/throws-error-like.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws-error-like.type.js","sourceRoot":"","sources":["../../../src/assert/throws-error-like/throws-error-like.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TypeBigIntMatcher } from "./type-bigint.type.js";
|
|
2
2
|
/**
|
|
3
3
|
* Matcher for a bigint value.
|
|
4
4
|
*/
|
|
5
|
-
export declare function typeBigInt():
|
|
5
|
+
export declare function typeBigInt(): TypeBigIntMatcher;
|
|
6
6
|
//# sourceMappingURL=type-bigint.match.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-bigint.match.d.ts","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.match.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-bigint.match.d.ts","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.match.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;GAEG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,CAM9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-bigint.match.js","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.match.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"type-bigint.match.js","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,aAAa,CAClB,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,EACrD,GAAG,EAAE,CAAC,QAAQ,EACd,GAAG,EAAE,CAAC,UAAU,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AssertionMatcher, refinement } from "../../match/match.js";
|
|
2
|
+
/**
|
|
3
|
+
* Type produced when an actual value is matched by typeBigInt().
|
|
4
|
+
*
|
|
5
|
+
* When the calling scope already has bigint literal information, we preserve
|
|
6
|
+
* that overlap. Otherwise, we fall back to bigint.
|
|
7
|
+
*/
|
|
8
|
+
export type TypeBigIntMatch<TActual> = [
|
|
9
|
+
Extract<NonNullable<TActual>, bigint>
|
|
10
|
+
] extends [never] ? bigint : Extract<NonNullable<TActual>, bigint>;
|
|
11
|
+
export type TypeBigIntMatcher = AssertionMatcher<bigint> & {
|
|
12
|
+
/**
|
|
13
|
+
* Optional type-level hook used by compositional assertions such as
|
|
14
|
+
* assertObjectMatches().
|
|
15
|
+
*
|
|
16
|
+
* This lets the matcher describe how it refines an existing actual type,
|
|
17
|
+
* rather than only exposing the standalone matches() predicate type.
|
|
18
|
+
*/
|
|
19
|
+
readonly [refinement]?: <TActual>(actual: TActual) => TypeBigIntMatch<TActual>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=type-bigint.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-bigint.type.d.ts","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI;IACrC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CACtC,SAAS,CAAC,KAAK,CAAC,GACb,MAAM,GACN,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,MAAM,CAAC,GAAG;IACzD;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,eAAe,CAAC,OAAO,CAAC,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-bigint.type.js","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type TypeBooleanMatcher } from "./type-boolean.type.js";
|
|
2
2
|
/**
|
|
3
3
|
* Matcher for a boolean value.
|
|
4
4
|
*/
|
|
5
|
-
export declare function typeBoolean():
|
|
5
|
+
export declare function typeBoolean(): TypeBooleanMatcher;
|
|
6
6
|
//# sourceMappingURL=type-boolean.match.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-boolean.match.d.ts","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.match.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-boolean.match.d.ts","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.match.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,wBAAgB,WAAW,IAAI,kBAAkB,CAWhD"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { createMatcher } from "../../match/match.js";
|
|
2
|
+
import { typeBooleanMatcher, } from "./type-boolean.type.js";
|
|
2
3
|
/**
|
|
3
4
|
* Matcher for a boolean value.
|
|
4
5
|
*/
|
|
5
6
|
export function typeBoolean() {
|
|
6
|
-
return
|
|
7
|
+
return {
|
|
8
|
+
...createMatcher((value) => typeof value === "boolean", () => "boolean", () => "Boolean()"),
|
|
9
|
+
// Runtime marker used only to make the matcher type nominal for type-level
|
|
10
|
+
// refinement dispatch. It is not part of the user-facing matcher behaviour.
|
|
11
|
+
[typeBooleanMatcher]: true,
|
|
12
|
+
};
|
|
7
13
|
}
|
|
8
14
|
//# sourceMappingURL=type-boolean.match.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-boolean.match.js","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.match.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"type-boolean.match.js","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,kBAAkB,GAEnB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAoB,EAAE,CAAC,OAAO,KAAK,KAAK,SAAS,EACvD,GAAG,EAAE,CAAC,SAAS,EACf,GAAG,EAAE,CAAC,WAAW,CAClB;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,kBAAkB,CAAC,EAAE,IAAI;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AssertionMatcher, refinement } from "../../match/match.js";
|
|
2
|
+
/**
|
|
3
|
+
* Unique symbol to reliably identify the TypeBooleanMatcher type.
|
|
4
|
+
*
|
|
5
|
+
* This keeps matcher dispatch nominal instead of relying only on structural
|
|
6
|
+
* compatibility. That matters because many type matchers have very similar
|
|
7
|
+
* shapes but different refinement semantics.
|
|
8
|
+
*/
|
|
9
|
+
export declare const typeBooleanMatcher: unique symbol;
|
|
10
|
+
/**
|
|
11
|
+
* Type produced when an actual value is matched by typeBoolean().
|
|
12
|
+
*
|
|
13
|
+
* If the calling scope already knows a narrower boolean literal type, preserve
|
|
14
|
+
* that overlap. Otherwise, fall back to the standalone matcher type: boolean.
|
|
15
|
+
*/
|
|
16
|
+
export type TypeBooleanMatch<TActual> = [
|
|
17
|
+
Extract<NonNullable<TActual>, boolean>
|
|
18
|
+
] extends [never] ? boolean : Extract<NonNullable<TActual>, boolean>;
|
|
19
|
+
export type TypeBooleanMatcher = AssertionMatcher<boolean> & {
|
|
20
|
+
readonly [typeBooleanMatcher]: true;
|
|
21
|
+
/**
|
|
22
|
+
* Optional type-level hook used by compositional assertions such as
|
|
23
|
+
* assertObjectMatches().
|
|
24
|
+
*
|
|
25
|
+
* This lets the matcher describe how it refines an existing actual type,
|
|
26
|
+
* rather than only exposing the standalone matches() predicate type.
|
|
27
|
+
*/
|
|
28
|
+
readonly [refinement]?: <TActual>(actual: TActual) => TypeBooleanMatch<TActual>;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=type-boolean.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-boolean.type.d.ts","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,eAAwC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,OAAO,IAAI;IACtC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CACvC,SAAS,CAAC,KAAK,CAAC,GACb,OAAO,GACP,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG;IAC3D,QAAQ,CAAC,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAEpC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unique symbol to reliably identify the TypeBooleanMatcher type.
|
|
3
|
+
*
|
|
4
|
+
* This keeps matcher dispatch nominal instead of relying only on structural
|
|
5
|
+
* compatibility. That matters because many type matchers have very similar
|
|
6
|
+
* shapes but different refinement semantics.
|
|
7
|
+
*/
|
|
8
|
+
export const typeBooleanMatcher = Symbol("smartass.typeBooleanMatcher");
|
|
9
|
+
//# sourceMappingURL=type-boolean.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-boolean.type.js","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.type.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-function.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.assert.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,SAAoD,
|
|
1
|
+
{"version":3,"file":"type-function.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.assert.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,SAAoD,GAC1D,OAAO,CAAC,KAAK,IAAI,QAAQ,CAK3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-function.assert.js","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"type-function.assert.js","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,0BAA0B;IAE3D,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type TypeFunctionMatcher } from "./type-function.type.js";
|
|
2
2
|
/**
|
|
3
3
|
* Matcher for a function value.
|
|
4
4
|
*/
|
|
5
|
-
export declare function typeFunction():
|
|
5
|
+
export declare function typeFunction(): TypeFunctionMatcher;
|
|
6
6
|
//# sourceMappingURL=type-function.match.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-function.match.d.ts","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.match.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-function.match.d.ts","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.match.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,wBAAgB,YAAY,IAAI,mBAAmB,CAWlD"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { createMatcher } from "../../match/match.js";
|
|
2
|
+
import { typeFunctionMatcher, } from "./type-function.type.js";
|
|
2
3
|
/**
|
|
3
4
|
* Matcher for a function value.
|
|
4
5
|
*/
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
6
6
|
export function typeFunction() {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return {
|
|
8
|
+
...createMatcher((value) => typeof value === "function", () => "function", () => "Function()"),
|
|
9
|
+
// Runtime marker used only to make the matcher type nominal for type-level
|
|
10
|
+
// refinement dispatch. It is not part of the user-facing matcher behaviour.
|
|
11
|
+
[typeFunctionMatcher]: true,
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=type-function.match.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-function.match.js","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.match.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"type-function.match.js","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,mBAAmB,GAEpB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAqB,EAAE,CAAC,OAAO,KAAK,KAAK,UAAU,EACzD,GAAG,EAAE,CAAC,UAAU,EAChB,GAAG,EAAE,CAAC,YAAY,CACnB;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,mBAAmB,CAAC,EAAE,IAAI;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AssertionMatcher, refinement } from "../../match/match.js";
|
|
2
|
+
/**
|
|
3
|
+
* Unique symbol to reliably identify the TypeFunctionMatcher type.
|
|
4
|
+
*
|
|
5
|
+
* This keeps refinement dispatch nominal. Without this marker, structurally
|
|
6
|
+
* similar matcher types could accidentally match the wrong conditional branch.
|
|
7
|
+
*/
|
|
8
|
+
export declare const typeFunctionMatcher: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* Type produced when an actual value is matched by typeFunction().
|
|
11
|
+
*
|
|
12
|
+
* If the calling scope already knows specific function signatures, preserve that
|
|
13
|
+
* overlap. Otherwise, fall back to the standalone matcher type: Function.
|
|
14
|
+
*/
|
|
15
|
+
export type TypeFunctionMatch<TActual> = [
|
|
16
|
+
Extract<NonNullable<TActual>, Function>
|
|
17
|
+
] extends [never] ? Function : Extract<NonNullable<TActual>, Function>;
|
|
18
|
+
export type TypeFunctionMatcher = AssertionMatcher<Function> & {
|
|
19
|
+
readonly [typeFunctionMatcher]: true;
|
|
20
|
+
/**
|
|
21
|
+
* Optional type-level hook used by compositional assertions such as
|
|
22
|
+
* assertObjectMatches().
|
|
23
|
+
*
|
|
24
|
+
* This lets the matcher describe how it refines an existing actual type,
|
|
25
|
+
* rather than only exposing the standalone matches() predicate type.
|
|
26
|
+
*/
|
|
27
|
+
readonly [refinement]?: <TActual>(actual: TActual) => TypeFunctionMatch<TActual>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=type-function.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-function.type.d.ts","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,eAAyC,CAAC;AAE1E;;;;;GAKG;AAEH,MAAM,MAAM,iBAAiB,CAAC,OAAO,IAAI;IACvC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;CACxC,SAAS,CAAC,KAAK,CAAC,GACb,QAAQ,GACR,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG;IAC7D,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,IAAI,CAAC;IAErC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unique symbol to reliably identify the TypeFunctionMatcher type.
|
|
3
|
+
*
|
|
4
|
+
* This keeps refinement dispatch nominal. Without this marker, structurally
|
|
5
|
+
* similar matcher types could accidentally match the wrong conditional branch.
|
|
6
|
+
*/
|
|
7
|
+
export const typeFunctionMatcher = Symbol("smartass.typeFunctionMatcher");
|
|
8
|
+
//# sourceMappingURL=type-function.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-function.type.js","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC"}
|