hein 2.0.0-alpha.1 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +34 -0
- package/dist/assert/deep-equal.cjs +40 -0
- package/dist/assert/deep-equal.cjs.map +1 -0
- package/dist/assert/deep-equal.d.cts +5 -0
- package/dist/assert/deep-equal.d.cts.map +1 -0
- package/dist/assert/deep-equal.d.ts +5 -0
- package/dist/assert/deep-equal.d.ts.map +1 -0
- package/dist/assert/deep-equal.js +36 -0
- package/dist/assert/deep-equal.js.map +1 -0
- package/dist/assert/deep-has-property.cjs +68 -0
- package/dist/assert/deep-has-property.cjs.map +1 -0
- package/dist/assert/deep-has-property.d.cts +22 -0
- package/dist/assert/deep-has-property.d.cts.map +1 -0
- package/dist/assert/deep-has-property.d.ts +22 -0
- package/dist/assert/deep-has-property.d.ts.map +1 -0
- package/dist/assert/deep-has-property.js +63 -0
- package/dist/assert/deep-has-property.js.map +1 -0
- package/dist/assert/ends-with.cjs +30 -0
- package/dist/assert/ends-with.cjs.map +1 -0
- package/dist/assert/ends-with.d.cts +13 -0
- package/dist/assert/ends-with.d.cts.map +1 -0
- package/dist/assert/ends-with.d.ts +13 -0
- package/dist/assert/ends-with.d.ts.map +1 -0
- package/dist/assert/ends-with.js +27 -0
- package/dist/assert/ends-with.js.map +1 -0
- package/dist/assert/equal.cjs +37 -0
- package/dist/assert/equal.cjs.map +1 -0
- package/dist/assert/equal.d.cts +11 -0
- package/dist/assert/equal.d.cts.map +1 -0
- package/dist/assert/equal.d.ts +11 -0
- package/dist/assert/equal.d.ts.map +1 -0
- package/dist/assert/equal.js +34 -0
- package/dist/assert/equal.js.map +1 -0
- package/dist/assert/greater-than-equal.cjs +32 -0
- package/dist/assert/greater-than-equal.cjs.map +1 -0
- package/dist/assert/greater-than-equal.d.cts +11 -0
- package/dist/assert/greater-than-equal.d.cts.map +1 -0
- package/dist/assert/greater-than-equal.d.ts +11 -0
- package/dist/assert/greater-than-equal.d.ts.map +1 -0
- package/dist/assert/greater-than-equal.js +29 -0
- package/dist/assert/greater-than-equal.js.map +1 -0
- package/dist/assert/greater-than.cjs +33 -0
- package/dist/assert/greater-than.cjs.map +1 -0
- package/dist/assert/greater-than.d.cts +11 -0
- package/dist/assert/greater-than.d.cts.map +1 -0
- package/dist/assert/greater-than.d.ts +11 -0
- package/dist/assert/greater-than.d.ts.map +1 -0
- package/dist/assert/greater-than.js +30 -0
- package/dist/assert/greater-than.js.map +1 -0
- package/dist/assert/has-keys.cjs +58 -0
- package/dist/assert/has-keys.cjs.map +1 -0
- package/dist/assert/has-keys.d.cts +16 -0
- package/dist/assert/has-keys.d.cts.map +1 -0
- package/dist/assert/has-keys.d.ts +16 -0
- package/dist/assert/has-keys.d.ts.map +1 -0
- package/dist/assert/has-keys.js +54 -0
- package/dist/assert/has-keys.js.map +1 -0
- package/dist/assert/has-members.cjs +67 -0
- package/dist/assert/has-members.cjs.map +1 -0
- package/dist/assert/has-members.d.cts +48 -0
- package/dist/assert/has-members.d.cts.map +1 -0
- package/dist/assert/has-members.d.ts +48 -0
- package/dist/assert/has-members.d.ts.map +1 -0
- package/dist/assert/has-members.js +64 -0
- package/dist/assert/has-members.js.map +1 -0
- package/dist/assert/has-property.cjs +61 -0
- package/dist/assert/has-property.cjs.map +1 -0
- package/dist/assert/has-property.d.cts +22 -0
- package/dist/assert/has-property.d.cts.map +1 -0
- package/dist/assert/has-property.d.ts +22 -0
- package/dist/assert/has-property.d.ts.map +1 -0
- package/dist/assert/has-property.js +58 -0
- package/dist/assert/has-property.js.map +1 -0
- package/dist/assert/has-size.cjs +122 -0
- package/dist/assert/has-size.cjs.map +1 -0
- package/dist/assert/has-size.d.cts +42 -0
- package/dist/assert/has-size.d.cts.map +1 -0
- package/dist/assert/has-size.d.ts +42 -0
- package/dist/assert/has-size.d.ts.map +1 -0
- package/dist/assert/has-size.js +118 -0
- package/dist/assert/has-size.js.map +1 -0
- package/dist/assert/in-ballpark.cjs +44 -0
- package/dist/assert/in-ballpark.cjs.map +1 -0
- package/dist/assert/in-ballpark.d.cts +16 -0
- package/dist/assert/in-ballpark.d.cts.map +1 -0
- package/dist/assert/in-ballpark.d.ts +16 -0
- package/dist/assert/in-ballpark.d.ts.map +1 -0
- package/dist/assert/in-ballpark.js +41 -0
- package/dist/assert/in-ballpark.js.map +1 -0
- package/dist/assert/includes.cjs +30 -0
- package/dist/assert/includes.cjs.map +1 -0
- package/dist/assert/includes.d.cts +24 -0
- package/dist/assert/includes.d.cts.map +1 -0
- package/dist/assert/includes.d.ts +24 -0
- package/dist/assert/includes.d.ts.map +1 -0
- package/dist/assert/includes.js +27 -0
- package/dist/assert/includes.js.map +1 -0
- package/dist/assert/instance-of.cjs +36 -0
- package/dist/assert/instance-of.cjs.map +1 -0
- package/dist/assert/instance-of.d.cts +16 -0
- package/dist/assert/instance-of.d.cts.map +1 -0
- package/dist/assert/instance-of.d.ts +16 -0
- package/dist/assert/instance-of.d.ts.map +1 -0
- package/dist/assert/instance-of.js +32 -0
- package/dist/assert/instance-of.js.map +1 -0
- package/dist/assert/is-after.cjs +29 -0
- package/dist/assert/is-after.cjs.map +1 -0
- package/dist/assert/is-after.d.cts +11 -0
- package/dist/assert/is-after.d.cts.map +1 -0
- package/dist/assert/is-after.d.ts +11 -0
- package/dist/assert/is-after.d.ts.map +1 -0
- package/dist/assert/is-after.js +26 -0
- package/dist/assert/is-after.js.map +1 -0
- package/dist/assert/is-before.cjs +29 -0
- package/dist/assert/is-before.cjs.map +1 -0
- package/dist/assert/is-before.d.cts +11 -0
- package/dist/assert/is-before.d.cts.map +1 -0
- package/dist/assert/is-before.d.ts +11 -0
- package/dist/assert/is-before.d.ts.map +1 -0
- package/dist/assert/is-before.js +26 -0
- package/dist/assert/is-before.js.map +1 -0
- package/dist/assert/is-between.cjs +47 -0
- package/dist/assert/is-between.cjs.map +1 -0
- package/dist/assert/is-between.d.cts +15 -0
- package/dist/assert/is-between.d.cts.map +1 -0
- package/dist/assert/is-between.d.ts +15 -0
- package/dist/assert/is-between.d.ts.map +1 -0
- package/dist/assert/is-between.js +44 -0
- package/dist/assert/is-between.js.map +1 -0
- package/dist/assert/is-empty.cjs +98 -0
- package/dist/assert/is-empty.cjs.map +1 -0
- package/dist/assert/is-empty.d.cts +31 -0
- package/dist/assert/is-empty.d.cts.map +1 -0
- package/dist/assert/is-empty.d.ts +31 -0
- package/dist/assert/is-empty.d.ts.map +1 -0
- package/dist/assert/is-empty.js +94 -0
- package/dist/assert/is-empty.js.map +1 -0
- package/dist/assert/is-type.cjs +34 -0
- package/dist/assert/is-type.cjs.map +1 -0
- package/dist/assert/is-type.d.cts +97 -0
- package/dist/assert/is-type.d.cts.map +1 -0
- package/dist/assert/is-type.d.ts +97 -0
- package/dist/assert/is-type.d.ts.map +1 -0
- package/dist/assert/is-type.js +31 -0
- package/dist/assert/is-type.js.map +1 -0
- package/dist/assert/less-than-equal.cjs +36 -0
- package/dist/assert/less-than-equal.cjs.map +1 -0
- package/dist/assert/less-than-equal.d.cts +11 -0
- package/dist/assert/less-than-equal.d.cts.map +1 -0
- package/dist/assert/less-than-equal.d.ts +11 -0
- package/dist/assert/less-than-equal.d.ts.map +1 -0
- package/dist/assert/less-than-equal.js +33 -0
- package/dist/assert/less-than-equal.js.map +1 -0
- package/dist/assert/less-than.cjs +34 -0
- package/dist/assert/less-than.cjs.map +1 -0
- package/dist/assert/less-than.d.cts +11 -0
- package/dist/assert/less-than.d.cts.map +1 -0
- package/dist/assert/less-than.d.ts +11 -0
- package/dist/assert/less-than.d.ts.map +1 -0
- package/dist/assert/less-than.js +31 -0
- package/dist/assert/less-than.js.map +1 -0
- package/dist/assert/match.cjs +31 -0
- package/dist/assert/match.cjs.map +1 -0
- package/dist/assert/match.d.cts +15 -0
- package/dist/assert/match.d.cts.map +1 -0
- package/dist/assert/match.d.ts +15 -0
- package/dist/assert/match.d.ts.map +1 -0
- package/dist/assert/match.js +28 -0
- package/dist/assert/match.js.map +1 -0
- package/dist/assert/rejects.cjs +49 -0
- package/dist/assert/rejects.cjs.map +1 -0
- package/dist/assert/rejects.d.cts +36 -0
- package/dist/assert/rejects.d.cts.map +1 -0
- package/dist/assert/rejects.d.ts +36 -0
- package/dist/assert/rejects.d.ts.map +1 -0
- package/dist/assert/rejects.js +46 -0
- package/dist/assert/rejects.js.map +1 -0
- package/dist/assert/round-to.cjs +54 -0
- package/dist/assert/round-to.cjs.map +1 -0
- package/dist/assert/round-to.d.cts +15 -0
- package/dist/assert/round-to.d.cts.map +1 -0
- package/dist/assert/round-to.d.ts +15 -0
- package/dist/assert/round-to.d.ts.map +1 -0
- package/dist/assert/round-to.js +51 -0
- package/dist/assert/round-to.js.map +1 -0
- package/dist/assert/starts-with.cjs +30 -0
- package/dist/assert/starts-with.cjs.map +1 -0
- package/dist/assert/starts-with.d.cts +14 -0
- package/dist/assert/starts-with.d.cts.map +1 -0
- package/dist/assert/starts-with.d.ts +14 -0
- package/dist/assert/starts-with.d.ts.map +1 -0
- package/dist/assert/starts-with.js +27 -0
- package/dist/assert/starts-with.js.map +1 -0
- package/dist/assert/throws.cjs +41 -0
- package/dist/assert/throws.cjs.map +1 -0
- package/dist/{throws-CYLYG7gu.d.cts → assert/throws.d.cts} +4 -11
- package/dist/assert/throws.d.cts.map +1 -0
- package/dist/{throws-BlzO4xvg.d.ts → assert/throws.d.ts} +3 -12
- package/dist/assert/throws.d.ts.map +1 -0
- package/dist/assert/throws.js +38 -0
- package/dist/assert/throws.js.map +1 -0
- package/dist/assert.cjs +143 -52
- package/dist/assert.cjs.map +1 -0
- package/dist/assert.d.cts +34 -3
- package/dist/assert.d.cts.map +1 -0
- package/dist/assert.d.ts +34 -3
- package/dist/assert.d.ts.map +1 -0
- package/dist/assert.js +87 -2
- package/dist/assert.js.map +1 -0
- package/dist/expect/after.cjs +15 -0
- package/dist/expect/after.cjs.map +1 -0
- package/dist/expect/after.js +16 -0
- package/dist/expect/after.js.map +1 -0
- package/dist/expect/ballpark.cjs +15 -0
- package/dist/expect/ballpark.cjs.map +1 -0
- package/dist/expect/ballpark.js +16 -0
- package/dist/expect/ballpark.js.map +1 -0
- package/dist/expect/before.cjs +15 -0
- package/dist/expect/before.cjs.map +1 -0
- package/dist/expect/before.js +16 -0
- package/dist/expect/before.js.map +1 -0
- package/dist/expect/between.cjs +15 -0
- package/dist/expect/between.cjs.map +1 -0
- package/dist/expect/between.js +16 -0
- package/dist/expect/between.js.map +1 -0
- package/dist/expect/empty.cjs +15 -0
- package/dist/expect/empty.cjs.map +1 -0
- package/dist/expect/empty.js +16 -0
- package/dist/expect/empty.js.map +1 -0
- package/dist/expect/end-with.cjs +15 -0
- package/dist/expect/end-with.cjs.map +1 -0
- package/dist/expect/end-with.js +16 -0
- package/dist/expect/end-with.js.map +1 -0
- package/dist/expect/eql.cjs +21 -0
- package/dist/expect/eql.cjs.map +1 -0
- package/dist/expect/eql.js +22 -0
- package/dist/expect/eql.js.map +1 -0
- package/dist/expect/equal-shorthand.cjs +34 -0
- package/dist/expect/equal-shorthand.cjs.map +1 -0
- package/dist/expect/equal-shorthand.js +33 -0
- package/dist/expect/equal-shorthand.js.map +1 -0
- package/dist/expect/equal.cjs +27 -0
- package/dist/expect/equal.cjs.map +1 -0
- package/dist/expect/equal.js +28 -0
- package/dist/expect/equal.js.map +1 -0
- package/dist/expect/excluding.cjs +19 -0
- package/dist/expect/excluding.cjs.map +1 -0
- package/dist/expect/excluding.js +18 -0
- package/dist/expect/excluding.js.map +1 -0
- package/dist/expect/greater-than-equal.cjs +25 -0
- package/dist/expect/greater-than-equal.cjs.map +1 -0
- package/dist/expect/greater-than-equal.js +26 -0
- package/dist/expect/greater-than-equal.js.map +1 -0
- package/dist/expect/greater-than.cjs +25 -0
- package/dist/expect/greater-than.cjs.map +1 -0
- package/dist/expect/greater-than.js +26 -0
- package/dist/expect/greater-than.js.map +1 -0
- package/dist/expect/has-property.cjs +20 -0
- package/dist/expect/has-property.cjs.map +1 -0
- package/dist/expect/has-property.js +21 -0
- package/dist/expect/has-property.js.map +1 -0
- package/dist/expect/include.cjs +21 -0
- package/dist/expect/include.cjs.map +1 -0
- package/dist/expect/include.js +22 -0
- package/dist/expect/include.js.map +1 -0
- package/dist/expect/instance-of-shorthand.cjs +24 -0
- package/dist/expect/instance-of-shorthand.cjs.map +1 -0
- package/dist/expect/instance-of-shorthand.js +25 -0
- package/dist/expect/instance-of-shorthand.js.map +1 -0
- package/dist/expect/instance-of.cjs +15 -0
- package/dist/expect/instance-of.cjs.map +1 -0
- package/dist/expect/instance-of.js +16 -0
- package/dist/expect/instance-of.js.map +1 -0
- package/dist/expect/keys.cjs +15 -0
- package/dist/expect/keys.cjs.map +1 -0
- package/dist/expect/keys.js +16 -0
- package/dist/expect/keys.js.map +1 -0
- package/dist/expect/length.cjs +21 -0
- package/dist/expect/length.cjs.map +1 -0
- package/dist/expect/length.js +22 -0
- package/dist/expect/length.js.map +1 -0
- package/dist/expect/less-than-equal.cjs +25 -0
- package/dist/expect/less-than-equal.cjs.map +1 -0
- package/dist/expect/less-than-equal.js +26 -0
- package/dist/expect/less-than-equal.js.map +1 -0
- package/dist/expect/less-than.cjs +25 -0
- package/dist/expect/less-than.cjs.map +1 -0
- package/dist/expect/less-than.js +26 -0
- package/dist/expect/less-than.js.map +1 -0
- package/dist/expect/match.cjs +15 -0
- package/dist/expect/match.cjs.map +1 -0
- package/dist/expect/match.js +16 -0
- package/dist/expect/match.js.map +1 -0
- package/dist/expect/members.cjs +41 -0
- package/dist/expect/members.cjs.map +1 -0
- package/dist/expect/members.js +42 -0
- package/dist/expect/members.js.map +1 -0
- package/dist/expect/reject.cjs +14 -0
- package/dist/expect/reject.cjs.map +1 -0
- package/dist/expect/reject.js +15 -0
- package/dist/expect/reject.js.map +1 -0
- package/dist/expect/round-to.cjs +15 -0
- package/dist/expect/round-to.cjs.map +1 -0
- package/dist/expect/round-to.js +16 -0
- package/dist/expect/round-to.js.map +1 -0
- package/dist/expect/start-with.cjs +15 -0
- package/dist/expect/start-with.cjs.map +1 -0
- package/dist/expect/start-with.js +16 -0
- package/dist/expect/start-with.js.map +1 -0
- package/dist/expect/throw.cjs +14 -0
- package/dist/expect/throw.cjs.map +1 -0
- package/dist/expect/throw.js +15 -0
- package/dist/expect/throw.js.map +1 -0
- package/dist/expect/type-shorthand.cjs +29 -0
- package/dist/expect/type-shorthand.cjs.map +1 -0
- package/dist/expect/type-shorthand.js +30 -0
- package/dist/expect/type-shorthand.js.map +1 -0
- package/dist/expect/type.cjs +15 -0
- package/dist/expect/type.cjs.map +1 -0
- package/dist/expect/type.js +16 -0
- package/dist/expect/type.js.map +1 -0
- package/dist/expect.cjs +144 -0
- package/dist/expect.cjs.map +1 -0
- package/dist/expect.d.cts +10 -0
- package/dist/expect.d.cts.map +1 -0
- package/dist/expect.d.ts +10 -0
- package/dist/expect.d.ts.map +1 -0
- package/dist/expect.js +141 -0
- package/dist/expect.js.map +1 -0
- package/dist/expect.types.d.cts +67 -3
- package/dist/expect.types.d.cts.map +1 -0
- package/dist/expect.types.d.ts +67 -3
- package/dist/expect.types.d.ts.map +1 -0
- package/dist/index.cjs +13 -582
- package/dist/index.d.cts +8 -15
- package/dist/index.d.ts +8 -15
- package/dist/index.js +8 -575
- package/dist/mixins.cjs +11 -0
- package/dist/mixins.cjs.map +1 -0
- package/dist/mixins.d.cts +28 -0
- package/dist/mixins.d.cts.map +1 -0
- package/dist/mixins.d.ts +28 -0
- package/dist/mixins.d.ts.map +1 -0
- package/dist/mixins.js +9 -0
- package/dist/mixins.js.map +1 -0
- package/dist/utils/chain.cjs +20 -0
- package/dist/utils/chain.cjs.map +1 -0
- package/dist/utils/chain.js +18 -0
- package/dist/utils/chain.js.map +1 -0
- package/dist/utils/fail.cjs +16 -0
- package/dist/utils/fail.cjs.map +1 -0
- package/dist/utils/fail.d.cts +9 -0
- package/dist/utils/fail.d.cts.map +1 -0
- package/dist/utils/fail.d.ts +9 -0
- package/dist/utils/fail.d.ts.map +1 -0
- package/dist/utils/fail.js +14 -0
- package/dist/utils/fail.js.map +1 -0
- package/dist/utils/get-size.cjs +17 -0
- package/dist/utils/get-size.cjs.map +1 -0
- package/dist/utils/get-size.js +15 -0
- package/dist/utils/get-size.js.map +1 -0
- package/dist/utils/get-type.cjs +12 -0
- package/dist/utils/get-type.cjs.map +1 -0
- package/dist/utils/get-type.d.cts +5 -0
- package/dist/utils/get-type.d.cts.map +1 -0
- package/dist/utils/get-type.d.ts +5 -0
- package/dist/utils/get-type.d.ts.map +1 -0
- package/dist/utils/get-type.js +11 -0
- package/dist/utils/get-type.js.map +1 -0
- package/dist/utils/match.cjs +118 -0
- package/dist/utils/match.cjs.map +1 -0
- package/dist/utils/match.d.cts +7 -0
- package/dist/utils/match.d.cts.map +1 -0
- package/dist/utils/match.d.ts +7 -0
- package/dist/utils/match.d.ts.map +1 -0
- package/dist/utils/match.js +114 -0
- package/dist/utils/match.js.map +1 -0
- package/dist/utils/process-error.cjs +86 -0
- package/dist/utils/process-error.cjs.map +1 -0
- package/dist/utils/process-error.d.cts +8 -0
- package/dist/utils/process-error.d.cts.map +1 -0
- package/dist/utils/process-error.d.ts +10 -0
- package/dist/utils/process-error.d.ts.map +1 -0
- package/dist/utils/process-error.js +85 -0
- package/dist/utils/process-error.js.map +1 -0
- package/dist/utils/validate-numeric-and-dates.cjs +20 -0
- package/dist/utils/validate-numeric-and-dates.cjs.map +1 -0
- package/dist/utils/validate-numeric-and-dates.js +18 -0
- package/dist/utils/validate-numeric-and-dates.js.map +1 -0
- package/dist/utils/xor.cjs +9 -0
- package/dist/utils/xor.cjs.map +1 -0
- package/dist/utils/xor.js +8 -0
- package/dist/utils/xor.js.map +1 -0
- package/package.json +1 -1
- package/dist/assert-ChQPKP5C.d.cts +0 -480
- package/dist/assert-ChQPKP5C.d.cts.map +0 -1
- package/dist/assert-CsN7srt-.d.ts +0 -478
- package/dist/assert-CsN7srt-.d.ts.map +0 -1
- package/dist/assert-DZjgWjOw.cjs +0 -1626
- package/dist/assert-DZjgWjOw.cjs.map +0 -1
- package/dist/assert-kFXp7i_B.js +0 -1260
- package/dist/assert-kFXp7i_B.js.map +0 -1
- package/dist/expect.types-CHYPdbCW.d.cts +0 -454
- package/dist/expect.types-CHYPdbCW.d.cts.map +0 -1
- package/dist/expect.types-nBq4Rg8e.d.ts +0 -454
- package/dist/expect.types-nBq4Rg8e.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/throws-BlzO4xvg.d.ts.map +0 -1
- package/dist/throws-CYLYG7gu.d.cts.map +0 -1
- /package/dist/{chunk-CTAAG5j7.js → _virtual/rolldown_runtime.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createAssertion } from "hein-assertion-utils";
|
|
2
|
+
|
|
3
|
+
//#region src/assert/round-to.ts
|
|
4
|
+
const [roundTo, notRoundTo] = createAssertion({
|
|
5
|
+
messages: {
|
|
6
|
+
miss: "Expected {{= it.actual }} to round to {{= it.expected }}",
|
|
7
|
+
tooManyDecimals: "Invalid argument for target, decimals for target ({{= it.expected }}) cannot be less than rounding decimals ({{= it.decimals }})",
|
|
8
|
+
not: "Expected {{= it.actual }} to not round to {{= it.expected }}"
|
|
9
|
+
},
|
|
10
|
+
test: (report) => (actual, expected, decimals = 0) => {
|
|
11
|
+
var _expected$toString$sp;
|
|
12
|
+
if (((_expected$toString$sp = expected.toString().split(".")[1]) === null || _expected$toString$sp === void 0 ? void 0 : _expected$toString$sp.length) > decimals) {
|
|
13
|
+
report({
|
|
14
|
+
status: "notok",
|
|
15
|
+
messageId: "tooManyDecimals",
|
|
16
|
+
expected,
|
|
17
|
+
actual,
|
|
18
|
+
data: { decimals },
|
|
19
|
+
noStringify: true
|
|
20
|
+
});
|
|
21
|
+
report({
|
|
22
|
+
status: "ok",
|
|
23
|
+
messageId: "tooManyDecimals",
|
|
24
|
+
expected,
|
|
25
|
+
actual,
|
|
26
|
+
data: { decimals },
|
|
27
|
+
noStringify: true
|
|
28
|
+
});
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (round(actual, decimals) === expected) return report({
|
|
32
|
+
status: "ok",
|
|
33
|
+
expected,
|
|
34
|
+
actual
|
|
35
|
+
});
|
|
36
|
+
return report({
|
|
37
|
+
status: "notok",
|
|
38
|
+
messageId: "miss",
|
|
39
|
+
expected,
|
|
40
|
+
actual
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const round = (value, decimals) => {
|
|
45
|
+
const factor = 10 ** decimals;
|
|
46
|
+
return Math.round(value * factor) / factor;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { notRoundTo, roundTo };
|
|
51
|
+
//# sourceMappingURL=round-to.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round-to.js","names":[],"sources":["../../src/assert/round-to.ts"],"sourcesContent":["import { createAssertion } from 'hein-assertion-utils';\n\ninterface RoundTo {\n /**\n * check if value rounds to target\n * @param actual\n * @param expected\n * @param [decimals=0] - number of decimals to round to, defaults to 0\n * @example roundTo(1.234, 1.23, 2);\n */\n (actual: number, expected: number, decimals?: number): void;\n}\n\nexport const [roundTo, notRoundTo] = createAssertion({\n messages: {\n miss: 'Expected {{= it.actual }} to round to {{= it.expected }}',\n tooManyDecimals:\n 'Invalid argument for target, decimals for target ({{= it.expected }}) cannot be less than rounding decimals ({{= it.decimals }})',\n not: 'Expected {{= it.actual }} to not round to {{= it.expected }}'\n },\n test:\n (report): RoundTo =>\n (actual: number, expected: number, decimals = 0) => {\n if (expected.toString().split('.')[1]?.length > decimals) {\n report({\n status: 'notok',\n messageId: 'tooManyDecimals',\n expected,\n actual,\n data: { decimals },\n noStringify: true\n });\n report({\n status: 'ok',\n messageId: 'tooManyDecimals',\n expected,\n actual,\n data: { decimals },\n noStringify: true\n });\n return true;\n }\n if (round(actual, decimals) === expected) {\n return report({ status: 'ok', expected, actual });\n }\n return report({ status: 'notok', messageId: 'miss', expected, actual });\n }\n});\n\nconst round = (value: number, decimals: number) => {\n const factor = 10 ** decimals;\n return Math.round(value * factor) / factor;\n};\n"],"mappings":";;;AAaA,MAAa,CAAC,SAAS,cAAc,gBAAgB;CACjD,UAAU;EACN,MAAM;EACN,iBACI;EACJ,KAAK;EACR;CACD,OACK,YACA,QAAgB,UAAkB,WAAW,MAAM;;AAChD,gCAAI,SAAS,UAAU,CAAC,MAAM,IAAI,CAAC,kFAAI,UAAS,UAAU;AACtD,UAAO;IACH,QAAQ;IACR,WAAW;IACX;IACA;IACA,MAAM,EAAE,UAAU;IAClB,aAAa;IAChB,CAAC;AACF,UAAO;IACH,QAAQ;IACR,WAAW;IACX;IACA;IACA,MAAM,EAAE,UAAU;IAClB,aAAa;IAChB,CAAC;AACF,UAAO;;AAEX,MAAI,MAAM,QAAQ,SAAS,KAAK,SAC5B,QAAO,OAAO;GAAE,QAAQ;GAAM;GAAU;GAAQ,CAAC;AAErD,SAAO,OAAO;GAAE,QAAQ;GAAS,WAAW;GAAQ;GAAU;GAAQ,CAAC;;CAElF,CAAC;AAEF,MAAM,SAAS,OAAe,aAAqB;CAC/C,MAAM,SAAS,MAAM;AACrB,QAAO,KAAK,MAAM,QAAQ,OAAO,GAAG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let hein_assertion_utils = require("hein-assertion-utils");
|
|
3
|
+
hein_assertion_utils = require_rolldown_runtime.__toESM(hein_assertion_utils);
|
|
4
|
+
|
|
5
|
+
//#region src/assert/starts-with.ts
|
|
6
|
+
const [startsWith, notStartsWith] = (0, hein_assertion_utils.createAssertion)({
|
|
7
|
+
messages: {
|
|
8
|
+
wrongStart: "Expected {{= it.actual }} to start with {{= it.expected }}",
|
|
9
|
+
not: "Expected {{= it.actual }} to not start with {{= it.expected }}"
|
|
10
|
+
},
|
|
11
|
+
test: (report) => (actual, start) => {
|
|
12
|
+
if (actual.startsWith(start)) report({
|
|
13
|
+
messageId: "not",
|
|
14
|
+
status: "ok",
|
|
15
|
+
actual,
|
|
16
|
+
expected: start
|
|
17
|
+
});
|
|
18
|
+
else report({
|
|
19
|
+
messageId: "wrongStart",
|
|
20
|
+
status: "notok",
|
|
21
|
+
actual,
|
|
22
|
+
expected: start
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.notStartsWith = notStartsWith;
|
|
29
|
+
exports.startsWith = startsWith;
|
|
30
|
+
//# sourceMappingURL=starts-with.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starts-with.cjs","names":[],"sources":["../../src/assert/starts-with.ts"],"sourcesContent":["import { createAssertion } from 'hein-assertion-utils';\n\ninterface StartsWith {\n /**\n * check if string starts with start\n * @param string\n * @param start\n * @example startsWith('foo', 'f');\n */\n (string: string, start: string): void;\n}\n\nexport const [startsWith, notStartsWith] = createAssertion({\n messages: {\n wrongStart: 'Expected {{= it.actual }} to start with {{= it.expected }}',\n not: 'Expected {{= it.actual }} to not start with {{= it.expected }}'\n },\n test:\n (report): StartsWith =>\n (actual: string, start: string) => {\n if (actual.startsWith(start)) {\n report({\n messageId: 'not',\n status: 'ok',\n actual,\n expected: start\n });\n } else {\n report({\n messageId: 'wrongStart',\n status: 'notok',\n actual,\n expected: start\n });\n }\n }\n});\n"],"mappings":";;;;;AAYA,MAAa,CAAC,YAAY,2DAAiC;CACvD,UAAU;EACN,YAAY;EACZ,KAAK;EACR;CACD,OACK,YACA,QAAgB,UAAkB;AAC/B,MAAI,OAAO,WAAW,MAAM,CACxB,QAAO;GACH,WAAW;GACX,QAAQ;GACR;GACA,UAAU;GACb,CAAC;MAEF,QAAO;GACH,WAAW;GACX,QAAQ;GACR;GACA,UAAU;GACb,CAAC;;CAGjB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/assert/starts-with.d.ts
|
|
2
|
+
interface StartsWith {
|
|
3
|
+
/**
|
|
4
|
+
* check if string starts with start
|
|
5
|
+
* @param string
|
|
6
|
+
* @param start
|
|
7
|
+
* @example startsWith('foo', 'f');
|
|
8
|
+
*/
|
|
9
|
+
(string: string, start: string): void;
|
|
10
|
+
}
|
|
11
|
+
declare const startsWith: StartsWith, notStartsWith: StartsWith;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { notStartsWith, startsWith };
|
|
14
|
+
//# sourceMappingURL=starts-with.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starts-with.d.cts","names":[],"sources":["../../src/assert/starts-with.ts"],"sourcesContent":[],"mappings":";UAEU,UAAA;EAAA;AAUV;;;;;EAA0B,CAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;cAAZ,YAAU,2BAAe"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/assert/starts-with.d.ts
|
|
2
|
+
interface StartsWith {
|
|
3
|
+
/**
|
|
4
|
+
* check if string starts with start
|
|
5
|
+
* @param string
|
|
6
|
+
* @param start
|
|
7
|
+
* @example startsWith('foo', 'f');
|
|
8
|
+
*/
|
|
9
|
+
(string: string, start: string): void;
|
|
10
|
+
}
|
|
11
|
+
declare const startsWith: StartsWith, notStartsWith: StartsWith;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { notStartsWith, startsWith };
|
|
14
|
+
//# sourceMappingURL=starts-with.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starts-with.d.ts","names":[],"sources":["../../src/assert/starts-with.ts"],"sourcesContent":[],"mappings":";UAEU,UAAA;EAAA;AAUV;;;;;EAA0B,CAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;cAAZ,YAAU,2BAAe"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createAssertion } from "hein-assertion-utils";
|
|
2
|
+
|
|
3
|
+
//#region src/assert/starts-with.ts
|
|
4
|
+
const [startsWith, notStartsWith] = createAssertion({
|
|
5
|
+
messages: {
|
|
6
|
+
wrongStart: "Expected {{= it.actual }} to start with {{= it.expected }}",
|
|
7
|
+
not: "Expected {{= it.actual }} to not start with {{= it.expected }}"
|
|
8
|
+
},
|
|
9
|
+
test: (report) => (actual, start) => {
|
|
10
|
+
if (actual.startsWith(start)) report({
|
|
11
|
+
messageId: "not",
|
|
12
|
+
status: "ok",
|
|
13
|
+
actual,
|
|
14
|
+
expected: start
|
|
15
|
+
});
|
|
16
|
+
else report({
|
|
17
|
+
messageId: "wrongStart",
|
|
18
|
+
status: "notok",
|
|
19
|
+
actual,
|
|
20
|
+
expected: start
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { notStartsWith, startsWith };
|
|
27
|
+
//# sourceMappingURL=starts-with.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starts-with.js","names":[],"sources":["../../src/assert/starts-with.ts"],"sourcesContent":["import { createAssertion } from 'hein-assertion-utils';\n\ninterface StartsWith {\n /**\n * check if string starts with start\n * @param string\n * @param start\n * @example startsWith('foo', 'f');\n */\n (string: string, start: string): void;\n}\n\nexport const [startsWith, notStartsWith] = createAssertion({\n messages: {\n wrongStart: 'Expected {{= it.actual }} to start with {{= it.expected }}',\n not: 'Expected {{= it.actual }} to not start with {{= it.expected }}'\n },\n test:\n (report): StartsWith =>\n (actual: string, start: string) => {\n if (actual.startsWith(start)) {\n report({\n messageId: 'not',\n status: 'ok',\n actual,\n expected: start\n });\n } else {\n report({\n messageId: 'wrongStart',\n status: 'notok',\n actual,\n expected: start\n });\n }\n }\n});\n"],"mappings":";;;AAYA,MAAa,CAAC,YAAY,iBAAiB,gBAAgB;CACvD,UAAU;EACN,YAAY;EACZ,KAAK;EACR;CACD,OACK,YACA,QAAgB,UAAkB;AAC/B,MAAI,OAAO,WAAW,MAAM,CACxB,QAAO;GACH,WAAW;GACX,QAAQ;GACR;GACA,UAAU;GACb,CAAC;MAEF,QAAO;GACH,WAAW;GACX,QAAQ;GACR;GACA,UAAU;GACb,CAAC;;CAGjB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_get_type = require('../utils/get-type.cjs');
|
|
3
|
+
const require_process_error = require('../utils/process-error.cjs');
|
|
4
|
+
let hein_assertion_utils = require("hein-assertion-utils");
|
|
5
|
+
hein_assertion_utils = require_rolldown_runtime.__toESM(hein_assertion_utils);
|
|
6
|
+
|
|
7
|
+
//#region src/assert/throws.ts
|
|
8
|
+
const messages = {
|
|
9
|
+
nonError: "Expected function to throw an instance of Error",
|
|
10
|
+
throws: "Expected function to throw",
|
|
11
|
+
invalidConstructor: "Expected function to throw {{= it.expected }}",
|
|
12
|
+
predicate: "Expected {{= it.actual }} to match predicate function",
|
|
13
|
+
regex: "Expected function to throw an error matching {{= it.expected }}",
|
|
14
|
+
not: "Expected function to not throw",
|
|
15
|
+
notConstructor: "Expected function to not throw a {{= it.expected }}",
|
|
16
|
+
notPredicate: "Expected function to not throw an error matching the predicate",
|
|
17
|
+
notRegex: "Expected function to not throw an error matching {{= it.expected }}"
|
|
18
|
+
};
|
|
19
|
+
const [throws, notThrows] = (0, hein_assertion_utils.createAssertion)({
|
|
20
|
+
messages,
|
|
21
|
+
test: (report) => ((callback, narrowerOrMessage, message) => {
|
|
22
|
+
const argumentType = require_get_type.getType(callback);
|
|
23
|
+
if (argumentType !== "function") throw new hein_assertion_utils.AssertionError(argumentType, "function", `Expected ${argumentType} to be a function`);
|
|
24
|
+
try {
|
|
25
|
+
callback();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return require_process_error.processError(report, error, narrowerOrMessage, message);
|
|
28
|
+
}
|
|
29
|
+
return report({
|
|
30
|
+
noStringify: true,
|
|
31
|
+
status: "notok",
|
|
32
|
+
messageId: "throws",
|
|
33
|
+
message: typeof narrowerOrMessage === "string" ? narrowerOrMessage : message
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.notThrows = notThrows;
|
|
40
|
+
exports.throws = throws;
|
|
41
|
+
//# sourceMappingURL=throws.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.cjs","names":["getType","AssertionError","processError"],"sources":["../../src/assert/throws.ts"],"sourcesContent":["import { AssertionError, createAssertion } from 'hein-assertion-utils';\nimport { getType } from '../utils/get-type.js';\nimport { type Constructor, type ErrorPredicate, processError } from '../utils/process-error.js';\n\nexport type ThrowsCallback = () => unknown;\n\ninterface Throw {\n /**\n * check if function throws an error\n * @param callback\n * @example throws(() => { throw new Error('foo'); });\n * @example throws(() => { throw new TypeError('foo'); }, TypeError);\n */\n (callback: ThrowsCallback, message?: string): void;\n /**\n * check if function throws an error matching the constructor\n * @param callback\n * @example throws(() => { throw new TypeError('foo'); }, TypeError);\n */\n (callback: ThrowsCallback, expectedError: Constructor, message?: string): void;\n /**\n * check if function throws an error matching the regex\n * @param callback\n * @example throws(() => { throw new Error('foo'); });\n * @example throws(() => { throw new TypeError('foo'); }, /foo/);\n */\n (callback: ThrowsCallback, expectedError: RegExp, message?: string): void;\n /**\n * check if function throws an error matching the predicate function\n * @param callback\n * @example throws(() => { throw new TypeError('foo'); }, (error) => error.message === 'foo');\n */\n (callback: ThrowsCallback, expectedError: ErrorPredicate, message?: string): void;\n}\n\nconst messages = {\n nonError: 'Expected function to throw an instance of Error',\n throws: 'Expected function to throw',\n invalidConstructor: 'Expected function to throw {{= it.expected }}',\n predicate: 'Expected {{= it.actual }} to match predicate function',\n regex: 'Expected function to throw an error matching {{= it.expected }}',\n not: 'Expected function to not throw',\n notConstructor: 'Expected function to not throw a {{= it.expected }}',\n notPredicate: 'Expected function to not throw an error matching the predicate',\n notRegex: 'Expected function to not throw an error matching {{= it.expected }}'\n};\n\nexport const [throws, notThrows] = createAssertion({\n messages: messages,\n test: (report) =>\n ((callback, narrowerOrMessage, message) => {\n const argumentType = getType(callback);\n if (argumentType !== 'function') {\n throw new AssertionError(argumentType, 'function', `Expected ${ argumentType } to be a function`);\n }\n try {\n callback();\n } catch (error) {\n return processError(report, error, narrowerOrMessage, message);\n }\n return report({\n noStringify: true,\n status: 'notok',\n messageId: 'throws',\n message: typeof narrowerOrMessage === 'string' ? narrowerOrMessage : message\n });\n }) as Throw\n});\n"],"mappings":";;;;;;;AAmCA,MAAM,WAAW;CACb,UAAU;CACV,QAAQ;CACR,oBAAoB;CACpB,WAAW;CACX,OAAO;CACP,KAAK;CACL,gBAAgB;CAChB,cAAc;CACd,UAAU;CACb;AAED,MAAa,CAAC,QAAQ,uDAA6B;CACrC;CACV,OAAO,aACD,UAAU,mBAAmB,YAAY;EACvC,MAAM,eAAeA,yBAAQ,SAAS;AACtC,MAAI,iBAAiB,WACjB,OAAM,IAAIC,oCAAe,cAAc,YAAY,YAAa,aAAc,mBAAmB;AAErG,MAAI;AACA,aAAU;WACL,OAAO;AACZ,UAAOC,mCAAa,QAAQ,OAAO,mBAAmB,QAAQ;;AAElE,SAAO,OAAO;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,SAAS,OAAO,sBAAsB,WAAW,oBAAoB;GACxE,CAAC;;CAEb,CAAC"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
new (...args: any[]): T;
|
|
4
|
-
}
|
|
5
|
-
type ErrorPredicate = (error: Error) => boolean;
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/utils/get-type.d.ts
|
|
8
|
-
type ValueType = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function' | 'null' | 'NaN' | 'array';
|
|
9
|
-
//#endregion
|
|
1
|
+
import { Constructor, ErrorPredicate } from "../utils/process-error.cjs";
|
|
2
|
+
|
|
10
3
|
//#region src/assert/throws.d.ts
|
|
11
4
|
type ThrowsCallback = () => unknown;
|
|
12
5
|
interface Throw {
|
|
@@ -39,5 +32,5 @@ interface Throw {
|
|
|
39
32
|
}
|
|
40
33
|
declare const throws: Throw, notThrows: Throw;
|
|
41
34
|
//#endregion
|
|
42
|
-
export {
|
|
43
|
-
//# sourceMappingURL=throws
|
|
35
|
+
export { ThrowsCallback, notThrows, throws };
|
|
36
|
+
//# sourceMappingURL=throws.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.d.cts","names":[],"sources":["../../src/assert/throws.ts"],"sourcesContent":[],"mappings":";;;KAIY,cAAA;UAEF,KAAA;EAFE;AAA+B;;;;;WAsB5B,EAbA,cAaA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;;;;AAqBf;EAAoB,CAAA,QAAA,EA5BL,cA4BK,EAAA,aAAA,EA5B0B,WA4B1B,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;;;;;;aArBL,+BAA+B;;;;;;aAM/B,+BAA+B;;cAehC,QAAM,kBAAW"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { Constructor, ErrorPredicate } from "../utils/process-error.js";
|
|
2
2
|
|
|
3
|
-
//#region src/utils/process-error.d.ts
|
|
4
|
-
interface Constructor<T = any> {
|
|
5
|
-
new (...args: any[]): T;
|
|
6
|
-
}
|
|
7
|
-
type ErrorPredicate = (error: Error) => boolean;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/utils/get-type.d.ts
|
|
10
|
-
type ValueType = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function' | 'null' | 'NaN' | 'array';
|
|
11
|
-
//#endregion
|
|
12
3
|
//#region src/assert/throws.d.ts
|
|
13
4
|
type ThrowsCallback = () => unknown;
|
|
14
5
|
interface Throw {
|
|
@@ -41,5 +32,5 @@ interface Throw {
|
|
|
41
32
|
}
|
|
42
33
|
declare const throws: Throw, notThrows: Throw;
|
|
43
34
|
//#endregion
|
|
44
|
-
export {
|
|
45
|
-
//# sourceMappingURL=throws
|
|
35
|
+
export { ThrowsCallback, notThrows, throws };
|
|
36
|
+
//# sourceMappingURL=throws.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.d.ts","names":[],"sources":["../../src/assert/throws.ts"],"sourcesContent":[],"mappings":";;;KAIY,cAAA;UAEF,KAAA;EAFE;AAA+B;;;;;WAsB5B,EAbA,cAaA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;;;;AAqBf;EAAoB,CAAA,QAAA,EA5BL,cA4BK,EAAA,aAAA,EA5B0B,WA4B1B,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;;;;;;aArBL,+BAA+B;;;;;;aAM/B,+BAA+B;;cAehC,QAAM,kBAAW"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getType } from "../utils/get-type.js";
|
|
2
|
+
import { processError } from "../utils/process-error.js";
|
|
3
|
+
import { AssertionError, createAssertion } from "hein-assertion-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/assert/throws.ts
|
|
6
|
+
const messages = {
|
|
7
|
+
nonError: "Expected function to throw an instance of Error",
|
|
8
|
+
throws: "Expected function to throw",
|
|
9
|
+
invalidConstructor: "Expected function to throw {{= it.expected }}",
|
|
10
|
+
predicate: "Expected {{= it.actual }} to match predicate function",
|
|
11
|
+
regex: "Expected function to throw an error matching {{= it.expected }}",
|
|
12
|
+
not: "Expected function to not throw",
|
|
13
|
+
notConstructor: "Expected function to not throw a {{= it.expected }}",
|
|
14
|
+
notPredicate: "Expected function to not throw an error matching the predicate",
|
|
15
|
+
notRegex: "Expected function to not throw an error matching {{= it.expected }}"
|
|
16
|
+
};
|
|
17
|
+
const [throws, notThrows] = createAssertion({
|
|
18
|
+
messages,
|
|
19
|
+
test: (report) => ((callback, narrowerOrMessage, message) => {
|
|
20
|
+
const argumentType = getType(callback);
|
|
21
|
+
if (argumentType !== "function") throw new AssertionError(argumentType, "function", `Expected ${argumentType} to be a function`);
|
|
22
|
+
try {
|
|
23
|
+
callback();
|
|
24
|
+
} catch (error) {
|
|
25
|
+
return processError(report, error, narrowerOrMessage, message);
|
|
26
|
+
}
|
|
27
|
+
return report({
|
|
28
|
+
noStringify: true,
|
|
29
|
+
status: "notok",
|
|
30
|
+
messageId: "throws",
|
|
31
|
+
message: typeof narrowerOrMessage === "string" ? narrowerOrMessage : message
|
|
32
|
+
});
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { notThrows, throws };
|
|
38
|
+
//# sourceMappingURL=throws.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.js","names":[],"sources":["../../src/assert/throws.ts"],"sourcesContent":["import { AssertionError, createAssertion } from 'hein-assertion-utils';\nimport { getType } from '../utils/get-type.js';\nimport { type Constructor, type ErrorPredicate, processError } from '../utils/process-error.js';\n\nexport type ThrowsCallback = () => unknown;\n\ninterface Throw {\n /**\n * check if function throws an error\n * @param callback\n * @example throws(() => { throw new Error('foo'); });\n * @example throws(() => { throw new TypeError('foo'); }, TypeError);\n */\n (callback: ThrowsCallback, message?: string): void;\n /**\n * check if function throws an error matching the constructor\n * @param callback\n * @example throws(() => { throw new TypeError('foo'); }, TypeError);\n */\n (callback: ThrowsCallback, expectedError: Constructor, message?: string): void;\n /**\n * check if function throws an error matching the regex\n * @param callback\n * @example throws(() => { throw new Error('foo'); });\n * @example throws(() => { throw new TypeError('foo'); }, /foo/);\n */\n (callback: ThrowsCallback, expectedError: RegExp, message?: string): void;\n /**\n * check if function throws an error matching the predicate function\n * @param callback\n * @example throws(() => { throw new TypeError('foo'); }, (error) => error.message === 'foo');\n */\n (callback: ThrowsCallback, expectedError: ErrorPredicate, message?: string): void;\n}\n\nconst messages = {\n nonError: 'Expected function to throw an instance of Error',\n throws: 'Expected function to throw',\n invalidConstructor: 'Expected function to throw {{= it.expected }}',\n predicate: 'Expected {{= it.actual }} to match predicate function',\n regex: 'Expected function to throw an error matching {{= it.expected }}',\n not: 'Expected function to not throw',\n notConstructor: 'Expected function to not throw a {{= it.expected }}',\n notPredicate: 'Expected function to not throw an error matching the predicate',\n notRegex: 'Expected function to not throw an error matching {{= it.expected }}'\n};\n\nexport const [throws, notThrows] = createAssertion({\n messages: messages,\n test: (report) =>\n ((callback, narrowerOrMessage, message) => {\n const argumentType = getType(callback);\n if (argumentType !== 'function') {\n throw new AssertionError(argumentType, 'function', `Expected ${ argumentType } to be a function`);\n }\n try {\n callback();\n } catch (error) {\n return processError(report, error, narrowerOrMessage, message);\n }\n return report({\n noStringify: true,\n status: 'notok',\n messageId: 'throws',\n message: typeof narrowerOrMessage === 'string' ? narrowerOrMessage : message\n });\n }) as Throw\n});\n"],"mappings":";;;;;AAmCA,MAAM,WAAW;CACb,UAAU;CACV,QAAQ;CACR,oBAAoB;CACpB,WAAW;CACX,OAAO;CACP,KAAK;CACL,gBAAgB;CAChB,cAAc;CACd,UAAU;CACb;AAED,MAAa,CAAC,QAAQ,aAAa,gBAAgB;CACrC;CACV,OAAO,aACD,UAAU,mBAAmB,YAAY;EACvC,MAAM,eAAe,QAAQ,SAAS;AACtC,MAAI,iBAAiB,WACjB,OAAM,IAAI,eAAe,cAAc,YAAY,YAAa,aAAc,mBAAmB;AAErG,MAAI;AACA,aAAU;WACL,OAAO;AACZ,UAAO,aAAa,QAAQ,OAAO,mBAAmB,QAAQ;;AAElE,SAAO,OAAO;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,SAAS,OAAO,sBAAsB,WAAW,oBAAoB;GACxE,CAAC;;CAEb,CAAC"}
|
package/dist/assert.cjs
CHANGED
|
@@ -1,53 +1,144 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_deep_equal = require('./assert/deep-equal.cjs');
|
|
3
|
+
const require_equal = require('./assert/equal.cjs');
|
|
4
|
+
const require_greater_than = require('./assert/greater-than.cjs');
|
|
5
|
+
const require_greater_than_equal = require('./assert/greater-than-equal.cjs');
|
|
6
|
+
const require_has_property = require('./assert/has-property.cjs');
|
|
7
|
+
const require_has_size = require('./assert/has-size.cjs');
|
|
8
|
+
const require_includes = require('./assert/includes.cjs');
|
|
9
|
+
const require_instance_of = require('./assert/instance-of.cjs');
|
|
10
|
+
const require_is_empty = require('./assert/is-empty.cjs');
|
|
11
|
+
const require_is_type = require('./assert/is-type.cjs');
|
|
12
|
+
const require_less_than = require('./assert/less-than.cjs');
|
|
13
|
+
const require_less_than_equal = require('./assert/less-than-equal.cjs');
|
|
14
|
+
const require_match = require('./assert/match.cjs');
|
|
15
|
+
const require_rejects = require('./assert/rejects.cjs');
|
|
16
|
+
const require_throws = require('./assert/throws.cjs');
|
|
17
|
+
const require_deep_has_property = require('./assert/deep-has-property.cjs');
|
|
18
|
+
const require_starts_with = require('./assert/starts-with.cjs');
|
|
19
|
+
const require_ends_with = require('./assert/ends-with.cjs');
|
|
20
|
+
const require_is_before = require('./assert/is-before.cjs');
|
|
21
|
+
const require_is_after = require('./assert/is-after.cjs');
|
|
22
|
+
const require_is_between = require('./assert/is-between.cjs');
|
|
23
|
+
const require_in_ballpark = require('./assert/in-ballpark.cjs');
|
|
24
|
+
const require_round_to = require('./assert/round-to.cjs');
|
|
25
|
+
const require_has_members = require('./assert/has-members.cjs');
|
|
26
|
+
const require_has_keys = require('./assert/has-keys.cjs');
|
|
2
27
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
//#region src/assert.ts
|
|
29
|
+
var assert_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
30
|
+
assert: () => assert,
|
|
31
|
+
deepEqual: () => require_deep_equal.deepEqual,
|
|
32
|
+
deepHasProperty: () => require_deep_has_property.deepHasProperty,
|
|
33
|
+
deepNotHasProperty: () => require_deep_has_property.deepNotHasProperty,
|
|
34
|
+
endsWith: () => require_ends_with.endsWith,
|
|
35
|
+
equal: () => require_equal.equal,
|
|
36
|
+
greaterThan: () => require_greater_than.greaterThan,
|
|
37
|
+
greaterThanEqual: () => require_greater_than_equal.greaterThanEqual,
|
|
38
|
+
hasKeys: () => require_has_keys.hasKeys,
|
|
39
|
+
hasMembers: () => require_has_members.hasMembers,
|
|
40
|
+
hasProperty: () => require_has_property.hasProperty,
|
|
41
|
+
hasSize: () => require_has_size.hasSize,
|
|
42
|
+
inBallpark: () => require_in_ballpark.inBallpark,
|
|
43
|
+
includes: () => require_includes.includes,
|
|
44
|
+
instanceOf: () => require_instance_of.instanceOf,
|
|
45
|
+
isAfter: () => require_is_after.isAfter,
|
|
46
|
+
isBefore: () => require_is_before.isBefore,
|
|
47
|
+
isBetween: () => require_is_between.isBetween,
|
|
48
|
+
isEmpty: () => require_is_empty.isEmpty,
|
|
49
|
+
isType: () => require_is_type.isType,
|
|
50
|
+
lessThan: () => require_less_than.lessThan,
|
|
51
|
+
lessThanEqual: () => require_less_than_equal.lessThanEqual,
|
|
52
|
+
match: () => require_match.match,
|
|
53
|
+
notAfter: () => require_is_after.notAfter,
|
|
54
|
+
notBefore: () => require_is_before.notBefore,
|
|
55
|
+
notBetween: () => require_is_between.notBetween,
|
|
56
|
+
notDeepEqual: () => require_deep_equal.notDeepEqual,
|
|
57
|
+
notEndsWith: () => require_ends_with.notEndsWith,
|
|
58
|
+
notEqual: () => require_equal.notEqual,
|
|
59
|
+
notGreaterThan: () => require_greater_than.notGreaterThan,
|
|
60
|
+
notGreaterThanEqual: () => require_greater_than_equal.notGreaterThanEqual,
|
|
61
|
+
notHasKeys: () => require_has_keys.notHasKeys,
|
|
62
|
+
notHasMembers: () => require_has_members.notHasMembers,
|
|
63
|
+
notHasProperty: () => require_has_property.notHasProperty,
|
|
64
|
+
notHasSize: () => require_has_size.notHasSize,
|
|
65
|
+
notInBallpark: () => require_in_ballpark.notInBallpark,
|
|
66
|
+
notIncludes: () => require_includes.notIncludes,
|
|
67
|
+
notInstanceOf: () => require_instance_of.notInstanceOf,
|
|
68
|
+
notIsEmpty: () => require_is_empty.notIsEmpty,
|
|
69
|
+
notIsType: () => require_is_type.notIsType,
|
|
70
|
+
notLessThan: () => require_less_than.notLessThan,
|
|
71
|
+
notLessThanEqual: () => require_less_than_equal.notLessThanEqual,
|
|
72
|
+
notMatch: () => require_match.notMatch,
|
|
73
|
+
notRejects: () => require_rejects.notRejects,
|
|
74
|
+
notRoundTo: () => require_round_to.notRoundTo,
|
|
75
|
+
notStartsWith: () => require_starts_with.notStartsWith,
|
|
76
|
+
notThrows: () => require_throws.notThrows,
|
|
77
|
+
rejects: () => require_rejects.rejects,
|
|
78
|
+
roundTo: () => require_round_to.roundTo,
|
|
79
|
+
startsWith: () => require_starts_with.startsWith,
|
|
80
|
+
throws: () => require_throws.throws
|
|
81
|
+
});
|
|
82
|
+
const assert = () => {
|
|
83
|
+
throw new Error("Not implemented");
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
exports.assert = assert;
|
|
88
|
+
Object.defineProperty(exports, 'assert_exports', {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () {
|
|
91
|
+
return assert_exports;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
exports.deepEqual = require_deep_equal.deepEqual;
|
|
95
|
+
exports.deepHasProperty = require_deep_has_property.deepHasProperty;
|
|
96
|
+
exports.deepNotHasProperty = require_deep_has_property.deepNotHasProperty;
|
|
97
|
+
exports.endsWith = require_ends_with.endsWith;
|
|
98
|
+
exports.equal = require_equal.equal;
|
|
99
|
+
exports.greaterThan = require_greater_than.greaterThan;
|
|
100
|
+
exports.greaterThanEqual = require_greater_than_equal.greaterThanEqual;
|
|
101
|
+
exports.hasKeys = require_has_keys.hasKeys;
|
|
102
|
+
exports.hasMembers = require_has_members.hasMembers;
|
|
103
|
+
exports.hasProperty = require_has_property.hasProperty;
|
|
104
|
+
exports.hasSize = require_has_size.hasSize;
|
|
105
|
+
exports.inBallpark = require_in_ballpark.inBallpark;
|
|
106
|
+
exports.includes = require_includes.includes;
|
|
107
|
+
exports.instanceOf = require_instance_of.instanceOf;
|
|
108
|
+
exports.isAfter = require_is_after.isAfter;
|
|
109
|
+
exports.isBefore = require_is_before.isBefore;
|
|
110
|
+
exports.isBetween = require_is_between.isBetween;
|
|
111
|
+
exports.isEmpty = require_is_empty.isEmpty;
|
|
112
|
+
exports.isType = require_is_type.isType;
|
|
113
|
+
exports.lessThan = require_less_than.lessThan;
|
|
114
|
+
exports.lessThanEqual = require_less_than_equal.lessThanEqual;
|
|
115
|
+
exports.match = require_match.match;
|
|
116
|
+
exports.notAfter = require_is_after.notAfter;
|
|
117
|
+
exports.notBefore = require_is_before.notBefore;
|
|
118
|
+
exports.notBetween = require_is_between.notBetween;
|
|
119
|
+
exports.notDeepEqual = require_deep_equal.notDeepEqual;
|
|
120
|
+
exports.notEndsWith = require_ends_with.notEndsWith;
|
|
121
|
+
exports.notEqual = require_equal.notEqual;
|
|
122
|
+
exports.notGreaterThan = require_greater_than.notGreaterThan;
|
|
123
|
+
exports.notGreaterThanEqual = require_greater_than_equal.notGreaterThanEqual;
|
|
124
|
+
exports.notHasKeys = require_has_keys.notHasKeys;
|
|
125
|
+
exports.notHasMembers = require_has_members.notHasMembers;
|
|
126
|
+
exports.notHasProperty = require_has_property.notHasProperty;
|
|
127
|
+
exports.notHasSize = require_has_size.notHasSize;
|
|
128
|
+
exports.notInBallpark = require_in_ballpark.notInBallpark;
|
|
129
|
+
exports.notIncludes = require_includes.notIncludes;
|
|
130
|
+
exports.notInstanceOf = require_instance_of.notInstanceOf;
|
|
131
|
+
exports.notIsEmpty = require_is_empty.notIsEmpty;
|
|
132
|
+
exports.notIsType = require_is_type.notIsType;
|
|
133
|
+
exports.notLessThan = require_less_than.notLessThan;
|
|
134
|
+
exports.notLessThanEqual = require_less_than_equal.notLessThanEqual;
|
|
135
|
+
exports.notMatch = require_match.notMatch;
|
|
136
|
+
exports.notRejects = require_rejects.notRejects;
|
|
137
|
+
exports.notRoundTo = require_round_to.notRoundTo;
|
|
138
|
+
exports.notStartsWith = require_starts_with.notStartsWith;
|
|
139
|
+
exports.notThrows = require_throws.notThrows;
|
|
140
|
+
exports.rejects = require_rejects.rejects;
|
|
141
|
+
exports.roundTo = require_round_to.roundTo;
|
|
142
|
+
exports.startsWith = require_starts_with.startsWith;
|
|
143
|
+
exports.throws = require_throws.throws;
|
|
144
|
+
//# sourceMappingURL=assert.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.cjs","names":[],"sources":["../src/assert.ts"],"sourcesContent":["export { deepEqual, notDeepEqual } from './assert/deep-equal.js';\nexport { equal, notEqual } from './assert/equal.js';\nexport { greaterThan, notGreaterThan } from './assert/greater-than.js';\nexport { greaterThanEqual, notGreaterThanEqual } from './assert/greater-than-equal.js';\nexport { hasProperty, notHasProperty } from './assert/has-property.js';\nexport { hasSize, notHasSize } from './assert/has-size.js';\nexport { includes, notIncludes } from './assert/includes.js';\nexport { instanceOf, notInstanceOf } from './assert/instance-of.js';\nexport { isEmpty, notIsEmpty } from './assert/is-empty.js';\nexport { isType, notIsType } from './assert/is-type.js';\nexport { lessThan, notLessThan } from './assert/less-than.js';\nexport { lessThanEqual, notLessThanEqual } from './assert/less-than-equal.js';\nexport { match, notMatch } from './assert/match.js';\nexport { notRejects, rejects } from './assert/rejects.js';\nexport { notThrows, throws } from './assert/throws.js';\nexport { deepHasProperty, deepNotHasProperty } from './assert/deep-has-property.js';\nexport { startsWith, notStartsWith } from './assert/starts-with.js';\nexport { endsWith, notEndsWith } from './assert/ends-with.js';\nexport { isBefore, notBefore } from './assert/is-before.js';\nexport { isAfter, notAfter } from './assert/is-after.js';\nexport { isBetween, notBetween } from './assert/is-between.js';\nexport { inBallpark, notInBallpark } from './assert/in-ballpark.js';\nexport { roundTo, notRoundTo } from './assert/round-to.js';\nexport { hasMembers, notHasMembers } from './assert/has-members.js';\nexport { hasKeys, notHasKeys } from './assert/has-keys.js';\n\nexport const assert = () => {\n throw new Error('Not implemented');\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,eAAe;AACxB,OAAM,IAAI,MAAM,kBAAkB"}
|
package/dist/assert.d.cts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { deepEqual, notDeepEqual } from "./assert/deep-equal.cjs";
|
|
2
|
+
import { equal, notEqual } from "./assert/equal.cjs";
|
|
3
|
+
import { greaterThan, notGreaterThan } from "./assert/greater-than.cjs";
|
|
4
|
+
import { greaterThanEqual, notGreaterThanEqual } from "./assert/greater-than-equal.cjs";
|
|
5
|
+
import { hasProperty, notHasProperty } from "./assert/has-property.cjs";
|
|
6
|
+
import { hasSize, notHasSize } from "./assert/has-size.cjs";
|
|
7
|
+
import { includes, notIncludes } from "./assert/includes.cjs";
|
|
8
|
+
import { instanceOf, notInstanceOf } from "./assert/instance-of.cjs";
|
|
9
|
+
import { isEmpty, notIsEmpty } from "./assert/is-empty.cjs";
|
|
10
|
+
import { isType, notIsType } from "./assert/is-type.cjs";
|
|
11
|
+
import { lessThan, notLessThan } from "./assert/less-than.cjs";
|
|
12
|
+
import { lessThanEqual, notLessThanEqual } from "./assert/less-than-equal.cjs";
|
|
13
|
+
import { match, notMatch } from "./assert/match.cjs";
|
|
14
|
+
import { notRejects, rejects } from "./assert/rejects.cjs";
|
|
15
|
+
import { notThrows, throws } from "./assert/throws.cjs";
|
|
16
|
+
import { deepHasProperty, deepNotHasProperty } from "./assert/deep-has-property.cjs";
|
|
17
|
+
import { notStartsWith, startsWith } from "./assert/starts-with.cjs";
|
|
18
|
+
import { endsWith, notEndsWith } from "./assert/ends-with.cjs";
|
|
19
|
+
import { isBefore, notBefore } from "./assert/is-before.cjs";
|
|
20
|
+
import { isAfter, notAfter } from "./assert/is-after.cjs";
|
|
21
|
+
import { isBetween, notBetween } from "./assert/is-between.cjs";
|
|
22
|
+
import { inBallpark, notInBallpark } from "./assert/in-ballpark.cjs";
|
|
23
|
+
import { notRoundTo, roundTo } from "./assert/round-to.cjs";
|
|
24
|
+
import { hasMembers, notHasMembers } from "./assert/has-members.cjs";
|
|
25
|
+
import { hasKeys, notHasKeys } from "./assert/has-keys.cjs";
|
|
26
|
+
|
|
27
|
+
//#region src/assert.d.ts
|
|
28
|
+
declare namespace assert_d_exports {
|
|
29
|
+
export { assert, deepEqual, deepHasProperty, deepNotHasProperty, endsWith, equal, greaterThan, greaterThanEqual, hasKeys, hasMembers, hasProperty, hasSize, inBallpark, includes, instanceOf, isAfter, isBefore, isBetween, isEmpty, isType, lessThan, lessThanEqual, match, notAfter, notBefore, notBetween, notDeepEqual, notEndsWith, notEqual, notGreaterThan, notGreaterThanEqual, notHasKeys, notHasMembers, notHasProperty, notHasSize, notInBallpark, notIncludes, notInstanceOf, notIsEmpty, notIsType, notLessThan, notLessThanEqual, notMatch, notRejects, notRoundTo, notStartsWith, notThrows, rejects, roundTo, startsWith, throws };
|
|
30
|
+
}
|
|
31
|
+
declare const assert: () => never;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { assert, assert_d_exports, deepEqual, deepHasProperty, deepNotHasProperty, endsWith, equal, greaterThan, greaterThanEqual, hasKeys, hasMembers, hasProperty, hasSize, inBallpark, includes, instanceOf, isAfter, isBefore, isBetween, isEmpty, isType, lessThan, lessThanEqual, match, notAfter, notBefore, notBetween, notDeepEqual, notEndsWith, notEqual, notGreaterThan, notGreaterThanEqual, notHasKeys, notHasMembers, notHasProperty, notHasSize, notInBallpark, notIncludes, notInstanceOf, notIsEmpty, notIsType, notLessThan, notLessThanEqual, notMatch, notRejects, notRoundTo, notStartsWith, notThrows, rejects, roundTo, startsWith, throws };
|
|
34
|
+
//# sourceMappingURL=assert.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.d.cts","names":[],"sources":["../src/assert.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ba"}
|
package/dist/assert.d.ts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { deepEqual, notDeepEqual } from "./assert/deep-equal.js";
|
|
2
|
+
import { equal, notEqual } from "./assert/equal.js";
|
|
3
|
+
import { greaterThan, notGreaterThan } from "./assert/greater-than.js";
|
|
4
|
+
import { greaterThanEqual, notGreaterThanEqual } from "./assert/greater-than-equal.js";
|
|
5
|
+
import { hasProperty, notHasProperty } from "./assert/has-property.js";
|
|
6
|
+
import { hasSize, notHasSize } from "./assert/has-size.js";
|
|
7
|
+
import { includes, notIncludes } from "./assert/includes.js";
|
|
8
|
+
import { instanceOf, notInstanceOf } from "./assert/instance-of.js";
|
|
9
|
+
import { isEmpty, notIsEmpty } from "./assert/is-empty.js";
|
|
10
|
+
import { isType, notIsType } from "./assert/is-type.js";
|
|
11
|
+
import { lessThan, notLessThan } from "./assert/less-than.js";
|
|
12
|
+
import { lessThanEqual, notLessThanEqual } from "./assert/less-than-equal.js";
|
|
13
|
+
import { match, notMatch } from "./assert/match.js";
|
|
14
|
+
import { notRejects, rejects } from "./assert/rejects.js";
|
|
15
|
+
import { notThrows, throws } from "./assert/throws.js";
|
|
16
|
+
import { deepHasProperty, deepNotHasProperty } from "./assert/deep-has-property.js";
|
|
17
|
+
import { notStartsWith, startsWith } from "./assert/starts-with.js";
|
|
18
|
+
import { endsWith, notEndsWith } from "./assert/ends-with.js";
|
|
19
|
+
import { isBefore, notBefore } from "./assert/is-before.js";
|
|
20
|
+
import { isAfter, notAfter } from "./assert/is-after.js";
|
|
21
|
+
import { isBetween, notBetween } from "./assert/is-between.js";
|
|
22
|
+
import { inBallpark, notInBallpark } from "./assert/in-ballpark.js";
|
|
23
|
+
import { notRoundTo, roundTo } from "./assert/round-to.js";
|
|
24
|
+
import { hasMembers, notHasMembers } from "./assert/has-members.js";
|
|
25
|
+
import { hasKeys, notHasKeys } from "./assert/has-keys.js";
|
|
26
|
+
|
|
27
|
+
//#region src/assert.d.ts
|
|
28
|
+
declare namespace assert_d_exports {
|
|
29
|
+
export { assert, deepEqual, deepHasProperty, deepNotHasProperty, endsWith, equal, greaterThan, greaterThanEqual, hasKeys, hasMembers, hasProperty, hasSize, inBallpark, includes, instanceOf, isAfter, isBefore, isBetween, isEmpty, isType, lessThan, lessThanEqual, match, notAfter, notBefore, notBetween, notDeepEqual, notEndsWith, notEqual, notGreaterThan, notGreaterThanEqual, notHasKeys, notHasMembers, notHasProperty, notHasSize, notInBallpark, notIncludes, notInstanceOf, notIsEmpty, notIsType, notLessThan, notLessThanEqual, notMatch, notRejects, notRoundTo, notStartsWith, notThrows, rejects, roundTo, startsWith, throws };
|
|
30
|
+
}
|
|
31
|
+
declare const assert: () => never;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { assert, assert_d_exports, deepEqual, deepHasProperty, deepNotHasProperty, endsWith, equal, greaterThan, greaterThanEqual, hasKeys, hasMembers, hasProperty, hasSize, inBallpark, includes, instanceOf, isAfter, isBefore, isBetween, isEmpty, isType, lessThan, lessThanEqual, match, notAfter, notBefore, notBetween, notDeepEqual, notEndsWith, notEqual, notGreaterThan, notGreaterThanEqual, notHasKeys, notHasMembers, notHasProperty, notHasSize, notInBallpark, notIncludes, notInstanceOf, notIsEmpty, notIsType, notLessThan, notLessThanEqual, notMatch, notRejects, notRoundTo, notStartsWith, notThrows, rejects, roundTo, startsWith, throws };
|
|
34
|
+
//# sourceMappingURL=assert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.d.ts","names":[],"sources":["../src/assert.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ba"}
|