@kensio/smartass 0.0.4 → 0.1.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.
Files changed (63) hide show
  1. package/README.md +4 -0
  2. package/dist/assert/identical/identical.assert.d.ts +6 -0
  3. package/dist/assert/identical/identical.assert.d.ts.map +1 -0
  4. package/dist/assert/identical/identical.assert.js +12 -0
  5. package/dist/assert/identical/identical.assert.js.map +1 -0
  6. package/dist/assert/non-nullable/non-nullable.assert.d.ts.map +1 -1
  7. package/dist/assert/non-nullable/non-nullable.assert.js +5 -2
  8. package/dist/assert/non-nullable/non-nullable.assert.js.map +1 -1
  9. package/dist/assert/not-empty/not-empty.assert.d.ts.map +1 -1
  10. package/dist/assert/not-empty/not-empty.assert.js +1 -1
  11. package/dist/assert/not-empty/not-empty.assert.js.map +1 -1
  12. package/dist/assert/number-between/number-between.assert.d.ts +6 -0
  13. package/dist/assert/number-between/number-between.assert.d.ts.map +1 -0
  14. package/dist/assert/number-between/number-between.assert.js +14 -0
  15. package/dist/assert/number-between/number-between.assert.js.map +1 -0
  16. package/dist/assert/number-to-nearest/number-to-nearest.assert.d.ts +6 -0
  17. package/dist/assert/number-to-nearest/number-to-nearest.assert.d.ts.map +1 -0
  18. package/dist/assert/number-to-nearest/number-to-nearest.assert.js +20 -0
  19. package/dist/assert/number-to-nearest/number-to-nearest.assert.js.map +1 -0
  20. package/dist/assert/one-of/one-of.assert.d.ts.map +1 -1
  21. package/dist/assert/one-of/one-of.assert.js +3 -2
  22. package/dist/assert/one-of/one-of.assert.js.map +1 -1
  23. package/dist/assert/type-bigint/type-bigint.assert.d.ts +5 -0
  24. package/dist/assert/type-bigint/type-bigint.assert.d.ts.map +1 -0
  25. package/dist/assert/type-bigint/type-bigint.assert.js +11 -0
  26. package/dist/assert/type-bigint/type-bigint.assert.js.map +1 -0
  27. package/dist/assert/type-boolean/type-boolean.assert.d.ts +5 -0
  28. package/dist/assert/type-boolean/type-boolean.assert.d.ts.map +1 -0
  29. package/dist/assert/type-boolean/type-boolean.assert.js +11 -0
  30. package/dist/assert/type-boolean/type-boolean.assert.js.map +1 -0
  31. package/dist/assert/type-function/type-function.assert.d.ts +5 -0
  32. package/dist/assert/type-function/type-function.assert.d.ts.map +1 -0
  33. package/dist/assert/type-function/type-function.assert.js +11 -0
  34. package/dist/assert/type-function/type-function.assert.js.map +1 -0
  35. package/dist/assert/type-number/type-number.assert.d.ts +5 -0
  36. package/dist/assert/type-number/type-number.assert.d.ts.map +1 -0
  37. package/dist/assert/type-number/type-number.assert.js +11 -0
  38. package/dist/assert/type-number/type-number.assert.js.map +1 -0
  39. package/dist/assert/type-numeric/type-numeric.assert.d.ts +5 -0
  40. package/dist/assert/type-numeric/type-numeric.assert.d.ts.map +1 -0
  41. package/dist/assert/type-numeric/type-numeric.assert.js +11 -0
  42. package/dist/assert/type-numeric/type-numeric.assert.js.map +1 -0
  43. package/dist/assert/type-object/type-object.assert.d.ts +5 -0
  44. package/dist/assert/type-object/type-object.assert.d.ts.map +1 -0
  45. package/dist/assert/type-object/type-object.assert.js +11 -0
  46. package/dist/assert/type-object/type-object.assert.js.map +1 -0
  47. package/dist/assert/type-string/type-string.assert.d.ts +5 -0
  48. package/dist/assert/type-string/type-string.assert.d.ts.map +1 -0
  49. package/dist/assert/type-string/type-string.assert.js +11 -0
  50. package/dist/assert/type-string/type-string.assert.js.map +1 -0
  51. package/dist/assertion-error.d.ts +7 -0
  52. package/dist/assertion-error.d.ts.map +1 -1
  53. package/dist/assertion-error.js +11 -0
  54. package/dist/assertion-error.js.map +1 -1
  55. package/dist/describe/describe.d.ts +10 -0
  56. package/dist/describe/describe.d.ts.map +1 -0
  57. package/dist/describe/describe.js +181 -0
  58. package/dist/describe/describe.js.map +1 -0
  59. package/dist/index.d.ts +10 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +10 -0
  62. package/dist/index.js.map +1 -1
  63. package/package.json +1 -1
package/README.md CHANGED
@@ -38,12 +38,16 @@ npm install @kensio/smartass
38
38
 
39
39
  ## Assertion functions
40
40
 
41
+ - [assertIdentical](src/assert/identical/identical.assert.ts)
41
42
  - [assertNonNullable](src/assert/non-nullable/non-nullable.assert.ts)
42
43
  - [assertNotEmpty](src/assert/not-empty/not-empty.assert.ts)
44
+ - [assertNumberBetween](src/assert/number-between/number-between.assert.ts)
45
+ - [assertNumberToNearest](src/assert/number-to-nearest/number-to-nearest.assert.ts)
43
46
  - [assertOneOf](src/assert/one-of/one-of.assert.ts)
44
47
  - [assertTypeBigInt](src/assert/type-bigint/type-bigint.assert.ts)
45
48
  - [assertTypeBoolean](src/assert/type-boolean/type-boolean.assert.ts)
46
49
  - [assertTypeFunction](src/assert/type-function/type-function.assert.ts)
47
50
  - [assertTypeNumber](src/assert/type-number/type-number.assert.ts)
51
+ - [assertTypeNumeric](src/assert/type-numeric/type-numeric.assert.ts)
48
52
  - [assertTypeObject](src/assert/type-object/type-object.assert.ts)
49
53
  - [assertTypeString](src/assert/type-string/type-string.assert.ts)
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Assert that a value is strictly identical to an expected value using ===,
3
+ * with type-narrowing.
4
+ */
5
+ export declare function assertIdentical<const TExpected>(value: unknown, expected: TExpected, message?: string): asserts value is typeof expected;
6
+ //# sourceMappingURL=identical.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identical.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/identical/identical.assert.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,SAAS,EAC7C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,SAAS,EACnB,OAAO,SAAkE,GACxE,OAAO,CAAC,KAAK,IAAI,OAAO,QAAQ,CAIlC"}
@@ -0,0 +1,12 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is strictly identical to an expected value using ===,
5
+ * with type-narrowing.
6
+ */
7
+ export function assertIdentical(value, expected, message = `Expected ${desc(value)} to be identical to ${desc(expected)}.`) {
8
+ if (value !== expected) {
9
+ throw new AssertionError(message, value, expected);
10
+ }
11
+ }
12
+ //# sourceMappingURL=identical.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identical.assert.js","sourceRoot":"","sources":["../../../src/assert/identical/identical.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAc,EACd,QAAmB,EACnB,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,uBAAuB,IAAI,CAAC,QAAQ,CAAC,GAAG;IAEzE,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvB,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"non-nullable.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/non-nullable/non-nullable.assert.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAWjC"}
1
+ {"version":3,"file":"non-nullable.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/non-nullable/non-nullable.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAgBjC"}
@@ -1,13 +1,16 @@
1
1
  import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
2
3
  /**
3
4
  * Assert that a value is non-nullable, with type-narrowing.
4
5
  */
5
6
  export function assertNonNullable(value, message) {
6
7
  if (value === null) {
7
- throw new AssertionError(message ?? "Expected value not to be null, but it was null.");
8
+ throw new AssertionError(message ?? `Expected ${desc(value)} not to be null.`, value,
9
+ // eslint-disable-next-line unicorn/no-null
10
+ null);
8
11
  }
9
12
  if (value === undefined) {
10
- throw new AssertionError(message ?? "Expected value not to be undefined, but it was undefined.");
13
+ throw new AssertionError(message ?? `Expected ${desc(value)} not to be undefined.`, value, undefined);
11
14
  }
12
15
  }
13
16
  //# sourceMappingURL=non-nullable.assert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"non-nullable.assert.js","sourceRoot":"","sources":["../../../src/assert/non-nullable/non-nullable.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAQ,EACR,OAAgB;IAEhB,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,iDAAiD,CAC7D,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,2DAA2D,CACvE,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"non-nullable.assert.js","sourceRoot":"","sources":["../../../src/assert/non-nullable/non-nullable.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAQ,EACR,OAAgB;IAEhB,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,YAAY,IAAI,CAAC,KAAK,CAAC,kBAAkB,EACpD,KAAK;QACL,2CAA2C;QAC3C,IAAI,CACL,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,YAAY,IAAI,CAAC,KAAK,CAAC,uBAAuB,EACzD,KAAK,EACL,SAAS,CACV,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"not-empty.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/not-empty/not-empty.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,IAAI,EACtC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAQvC"}
1
+ {"version":3,"file":"not-empty.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/not-empty/not-empty.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,IAAI,EACtC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAUvC"}
@@ -6,7 +6,7 @@ import { AssertionError } from "../../assertion-error.js";
6
6
  export function assertNotEmpty(value, message) {
7
7
  assertNonNullable(value, message);
8
8
  if (value.length === 0) {
9
- throw new AssertionError(message ?? `Expected array not to be empty, but it was empty.`);
9
+ throw new AssertionError(message ?? `Expected array not to be empty, but it was empty.`, value, ["..."]);
10
10
  }
11
11
  }
12
12
  //# sourceMappingURL=not-empty.assert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"not-empty.assert.js","sourceRoot":"","sources":["../../../src/assert/not-empty/not-empty.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAsC,EACtC,OAAgB;IAEhB,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAElC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,mDAAmD,CAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"not-empty.assert.js","sourceRoot":"","sources":["../../../src/assert/not-empty/not-empty.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAsC,EACtC,OAAgB;IAEhB,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAElC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,mDAAmD,EAC9D,KAAK,EACL,CAAC,KAAK,CAAC,CACR,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Assert that a numeric value is between min and max inclusive, with
3
+ * type-narrowing.
4
+ */
5
+ export declare function assertNumberBetween(value: unknown, min: number | bigint, max: number | bigint, message?: string): asserts value is number | bigint;
6
+ //# sourceMappingURL=number-between.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-between.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/number-between/number-between.assert.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,OAAO,SAAmF,GACzF,OAAO,CAAC,KAAK,IAAI,MAAM,GAAG,MAAM,CAUlC"}
@@ -0,0 +1,14 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { assertTypeNumeric } from "../type-numeric/type-numeric.assert.js";
3
+ import { desc, repr } from "../../describe/describe.js";
4
+ /**
5
+ * Assert that a numeric value is between min and max inclusive, with
6
+ * type-narrowing.
7
+ */
8
+ export function assertNumberBetween(value, min, max, message = `Expected ${desc(value)} to be between ${desc(min)} and ${desc(max)} inclusive.`) {
9
+ assertTypeNumeric(value, message);
10
+ if (value < min || value > max) {
11
+ throw new AssertionError(message, value, `${repr(min)} ≤ ${repr(value)} ≤ ${repr(max)}`);
12
+ }
13
+ }
14
+ //# sourceMappingURL=number-between.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-between.assert.js","sourceRoot":"","sources":["../../../src/assert/number-between/number-between.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAc,EACd,GAAoB,EACpB,GAAoB,EACpB,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,aAAa;IAE1F,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAElC,IAAI,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;QAC/B,MAAM,IAAI,cAAc,CACtB,OAAO,EACP,KAAK,EACL,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAC/C,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Assert that a numeric value, when rounded to the nearest given increment,
3
+ * equals the expected value.
4
+ */
5
+ export declare function assertNumberToNearest(value: unknown, toNearest: number, expected: number, message?: string): asserts value is number;
6
+ //# sourceMappingURL=number-to-nearest.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-to-nearest.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/number-to-nearest/number-to-nearest.assert.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,MAAM,CAkBzB"}
@@ -0,0 +1,20 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { repr } from "../../describe/describe.js";
3
+ import { assertTypeNumber } from "../type-number/type-number.assert.js";
4
+ /**
5
+ * Assert that a numeric value, when rounded to the nearest given increment,
6
+ * equals the expected value.
7
+ */
8
+ export function assertNumberToNearest(value, toNearest, expected, message) {
9
+ assertTypeNumber(value);
10
+ const rawRounded = Math.round(value / toNearest) * toNearest;
11
+ // Determine decimal places in toNearest to avoid floating point errors
12
+ const parts = toNearest.toString().split(".");
13
+ const decimalPlaces = parts[1]?.length ?? 0;
14
+ const rounded = Number(rawRounded.toFixed(decimalPlaces));
15
+ if (rounded !== expected) {
16
+ throw new AssertionError(message ??
17
+ `Expected to equal ${repr(expected)} to nearest ${repr(toNearest)}, got ${repr(value)} rounding to ${repr(rounded)}.`, value, `${repr(expected)} (to nearest ${repr(toNearest)})`);
18
+ }
19
+ }
20
+ //# sourceMappingURL=number-to-nearest.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-to-nearest.assert.js","sourceRoot":"","sources":["../../../src/assert/number-to-nearest/number-to-nearest.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAc,EACd,SAAiB,EACjB,QAAgB,EAChB,OAAgB;IAEhB,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAExB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAE7D,uEAAuE;IACvE,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IAE1D,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,IAAI,cAAc,CACtB,OAAO;YACL,qBAAqB,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,CAAC,OAAO,CAAC,GAAG,EACvH,KAAK,EACL,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,IAAI,CAAC,SAAS,CAAC,GAAG,CACpD,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"one-of.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/one-of/one-of.assert.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,QAAQ,SAAS,SAAS,OAAO,EAAE,EACnE,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,QAAQ,EACjB,OAAO,SAAuD,GAC7D,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC,CAInC"}
1
+ {"version":3,"file":"one-of.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/one-of/one-of.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,QAAQ,SAAS,SAAS,OAAO,EAAE,EACnE,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,QAAQ,EACjB,OAAO,SAA2D,GACjE,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC,CAInC"}
@@ -1,10 +1,11 @@
1
1
  import { AssertionError } from "../../assertion-error.js";
2
+ import { desc, repr } from "../../describe/describe.js";
2
3
  /**
3
4
  * Assert that a value is one of a set of expected values, with type-narrowing.
4
5
  */
5
- export function assertOneOf(value, allowed, message = `Expected value to be one of: ${allowed.join(", ")}`) {
6
+ export function assertOneOf(value, allowed, message = `Expected ${desc(value)} to be one of ${repr(allowed)}.`) {
6
7
  if (!allowed.includes(value)) {
7
- throw new AssertionError(message);
8
+ throw new AssertionError(message, value, `one of ${desc(allowed)}`);
8
9
  }
9
10
  }
10
11
  //# sourceMappingURL=one-of.assert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"one-of.assert.js","sourceRoot":"","sources":["../../../src/assert/one-of/one-of.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,KAAc,EACd,OAAiB,EACjB,OAAO,GAAG,gCAAgC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;IAE9D,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"one-of.assert.js","sourceRoot":"","sources":["../../../src/assert/one-of/one-of.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,KAAc,EACd,OAAiB,EACjB,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,OAAO,CAAC,GAAG;IAElE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Asserts that a value is a bigint, with type-narrowing.
3
+ */
4
+ export declare function assertTypeBigInt(value: unknown, message?: string): asserts value is bigint;
5
+ //# sourceMappingURL=type-bigint.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-bigint.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,SAAkD,GACxD,OAAO,CAAC,KAAK,IAAI,MAAM,CAIzB"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Asserts that a value is a bigint, with type-narrowing.
5
+ */
6
+ export function assertTypeBigInt(value, message = `Expected ${desc(value)} to be of type bigint.`) {
7
+ if (typeof value !== "bigint") {
8
+ throw new AssertionError(message, typeof value, "bigint");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-bigint.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-bigint.assert.js","sourceRoot":"","sources":["../../../src/assert/type-bigint/type-bigint.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,wBAAwB;IAEzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a value is of type boolean, with type-narrowing.
3
+ */
4
+ export declare function assertTypeBoolean(value: unknown, message?: string): asserts value is boolean;
5
+ //# sourceMappingURL=type-boolean.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-boolean.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,OAAO,SAAmD,GACzD,OAAO,CAAC,KAAK,IAAI,OAAO,CAI1B"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is of type boolean, with type-narrowing.
5
+ */
6
+ export function assertTypeBoolean(value, message = `Expected ${desc(value)} to be of type boolean.`) {
7
+ if (typeof value !== "boolean") {
8
+ throw new AssertionError(message, typeof value, "boolean");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-boolean.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-boolean.assert.js","sourceRoot":"","sources":["../../../src/assert/type-boolean/type-boolean.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,yBAAyB;IAE1D,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a value is of type function, with type-narrowing.
3
+ */
4
+ export declare function assertTypeFunction(value: unknown, message?: string): asserts value is Function;
5
+ //# sourceMappingURL=type-function.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-function.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-function/type-function.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,SAAoD,GAE1D,OAAO,CAAC,KAAK,IAAI,QAAQ,CAI3B"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is of type function, with type-narrowing.
5
+ */
6
+ export function assertTypeFunction(value, message = `Expected ${desc(value)} to be of type function.`) {
7
+ if (typeof value !== "function") {
8
+ throw new AssertionError(message, typeof value, "function");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-function.assert.js.map
@@ -0,0 +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;AAElD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,0BAA0B;IAG3D,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a value is of type number, with type-narrowing.
3
+ */
4
+ export declare function assertTypeNumber(value: unknown, message?: string): asserts value is number;
5
+ //# sourceMappingURL=type-number.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-number.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-number/type-number.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,SAAkD,GACxD,OAAO,CAAC,KAAK,IAAI,MAAM,CAIzB"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is of type number, with type-narrowing.
5
+ */
6
+ export function assertTypeNumber(value, message = `Expected ${desc(value)} to be of type number.`) {
7
+ if (typeof value !== "number") {
8
+ throw new AssertionError(message, typeof value, "number");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-number.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-number.assert.js","sourceRoot":"","sources":["../../../src/assert/type-number/type-number.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,wBAAwB;IAEzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a value is numeric (number or bigint), with type-narrowing.
3
+ */
4
+ export declare function assertTypeNumeric(value: unknown, message?: string): asserts value is number | bigint;
5
+ //# sourceMappingURL=type-numeric.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-numeric.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-numeric/type-numeric.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,OAAO,SAA4D,GAClE,OAAO,CAAC,KAAK,IAAI,MAAM,GAAG,MAAM,CAIlC"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is numeric (number or bigint), with type-narrowing.
5
+ */
6
+ export function assertTypeNumeric(value, message = `Expected ${desc(value)} to be of type number or bigint.`) {
7
+ if (typeof value !== "number" && typeof value !== "bigint") {
8
+ throw new AssertionError(message, typeof value, "number | bigint");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-numeric.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-numeric.assert.js","sourceRoot":"","sources":["../../../src/assert/type-numeric/type-numeric.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,kCAAkC;IAEnE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3D,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a value is of type object, with type-narrowing.
3
+ */
4
+ export declare function assertTypeObject(value: unknown, message?: string): asserts value is object;
5
+ //# sourceMappingURL=type-object.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-object.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-object/type-object.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,SAAkD,GACxD,OAAO,CAAC,KAAK,IAAI,MAAM,CAIzB"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is of type object, with type-narrowing.
5
+ */
6
+ export function assertTypeObject(value, message = `Expected ${desc(value)} to be of type object.`) {
7
+ if (typeof value !== "object") {
8
+ throw new AssertionError(message, typeof value, "object");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-object.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-object.assert.js","sourceRoot":"","sources":["../../../src/assert/type-object/type-object.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,wBAAwB;IAEzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Assert that a value is of type string, with type-narrowing.
3
+ */
4
+ export declare function assertTypeString(value: unknown, message?: string): asserts value is string;
5
+ //# sourceMappingURL=type-string.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-string.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/type-string/type-string.assert.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,SAAkD,GACxD,OAAO,CAAC,KAAK,IAAI,MAAM,CAIzB"}
@@ -0,0 +1,11 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc } from "../../describe/describe.js";
3
+ /**
4
+ * Assert that a value is of type string, with type-narrowing.
5
+ */
6
+ export function assertTypeString(value, message = `Expected ${desc(value)} to be of type string.`) {
7
+ if (typeof value !== "string") {
8
+ throw new AssertionError(message, typeof value, "string");
9
+ }
10
+ }
11
+ //# sourceMappingURL=type-string.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-string.assert.js","sourceRoot":"","sources":["../../../src/assert/type-string/type-string.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,OAAO,GAAG,YAAY,IAAI,CAAC,KAAK,CAAC,wBAAwB;IAEzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -1,6 +1,13 @@
1
1
  /**
2
2
  * An assertion failed.
3
+ * Provide helpful string message, as well as actual and expected properties to
4
+ * allow test frameworks to display better diffs.
3
5
  */
4
6
  export declare class AssertionError extends Error {
7
+ actual: unknown;
8
+ expected: unknown;
9
+ name: "AssertionError";
10
+ showDiff: boolean;
11
+ constructor(message: string, actual: unknown, expected: unknown);
5
12
  }
6
13
  //# sourceMappingURL=assertion-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertion-error.d.ts","sourceRoot":"","sources":["../src/assertion-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;CAAG"}
1
+ {"version":3,"file":"assertion-error.d.ts","sourceRoot":"","sources":["../src/assertion-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAM9B,MAAM,EAAE,OAAO;IACf,QAAQ,EAAE,OAAO;IANjB,IAAI,EAAG,gBAAgB,CAAU;IAC1C,QAAQ,UAAQ;gBAGd,OAAO,EAAE,MAAM,EACR,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO;CAI3B"}
@@ -1,6 +1,17 @@
1
1
  /**
2
2
  * An assertion failed.
3
+ * Provide helpful string message, as well as actual and expected properties to
4
+ * allow test frameworks to display better diffs.
3
5
  */
4
6
  export class AssertionError extends Error {
7
+ actual;
8
+ expected;
9
+ name = "AssertionError";
10
+ showDiff = true;
11
+ constructor(message, actual, expected) {
12
+ super(message);
13
+ this.actual = actual;
14
+ this.expected = expected;
15
+ }
5
16
  }
6
17
  //# sourceMappingURL=assertion-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertion-error.js","sourceRoot":"","sources":["../src/assertion-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG"}
1
+ {"version":3,"file":"assertion-error.js","sourceRoot":"","sources":["../src/assertion-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAM9B;IACA;IANA,IAAI,GAAG,gBAAyB,CAAC;IAC1C,QAAQ,GAAG,IAAI,CAAC;IAEhB,YACE,OAAe,EACR,MAAe,EACf,QAAiB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,WAAM,GAAN,MAAM,CAAS;QACf,aAAQ,GAAR,QAAQ,CAAS;IAG1B,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Try to make a useful description of a value that is helpful for debugging.
3
+ */
4
+ export declare function desc(value: unknown): string;
5
+ /**
6
+ * Try to make a string representation of a value that is valid ES syntax for
7
+ * that value, or at least unambiguous.
8
+ */
9
+ export declare function repr(value: unknown, seen?: WeakSet<object>): string;
10
+ //# sourceMappingURL=describe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/describe/describe.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAkC3C;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,kBAAwB,GAAG,MAAM,CA+GzE"}
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Try to make a useful description of a value that is helpful for debugging.
3
+ */
4
+ export function desc(value) {
5
+ if (value === null)
6
+ return "null";
7
+ if (value === undefined)
8
+ return "undefined";
9
+ if (typeof value === "boolean" ||
10
+ typeof value === "number" ||
11
+ typeof value === "bigint" ||
12
+ typeof value === "string" ||
13
+ typeof value === "symbol") {
14
+ return `${typeof value} ${repr(value)}`;
15
+ }
16
+ if (typeof value === "function")
17
+ return `${repr(value)} (${String(value.length)} args)`;
18
+ if (Array.isArray(value)) {
19
+ return `array ${repr(value)} (len ${String(value.length)})`;
20
+ }
21
+ if (value instanceof Map) {
22
+ return `${repr(value)} (size ${String(value.size)})`;
23
+ }
24
+ if (value instanceof Set) {
25
+ return `${repr(value)} (size ${String(value.size)})`;
26
+ }
27
+ if (value instanceof RegExp) {
28
+ return `RegExp ${repr(value)}`;
29
+ }
30
+ return `object ${repr(value)}`;
31
+ }
32
+ /**
33
+ * Try to make a string representation of a value that is valid ES syntax for
34
+ * that value, or at least unambiguous.
35
+ */
36
+ export function repr(value, seen = new WeakSet()) {
37
+ // Avoid infinite recursion on circular references.
38
+ if (value !== null && typeof value === "object") {
39
+ if (seen.has(value))
40
+ return "[Circular]";
41
+ seen.add(value);
42
+ }
43
+ if (value === null)
44
+ return "null";
45
+ if (value === undefined)
46
+ return "undefined";
47
+ if (typeof value === "boolean")
48
+ return value ? "true" : "false";
49
+ if (typeof value === "number") {
50
+ if (Object.is(value, -0))
51
+ return "-0";
52
+ if (Number.isNaN(value))
53
+ return "NaN";
54
+ if (value === Infinity)
55
+ return "Infinity";
56
+ if (value === -Infinity)
57
+ return "-Infinity";
58
+ return String(value);
59
+ }
60
+ if (typeof value === "bigint") {
61
+ return `${String(value)}n`;
62
+ }
63
+ if (typeof value === "string") {
64
+ return safeJson(value);
65
+ }
66
+ if (typeof value === "symbol") {
67
+ return value.toString();
68
+ }
69
+ if (typeof value === "function") {
70
+ const name = value.name || "anonymous";
71
+ return `function ${name}(){}`;
72
+ }
73
+ if (Array.isArray(value)) {
74
+ const items = reprList(value, seen);
75
+ return `[${items}]`;
76
+ }
77
+ if (value instanceof Map) {
78
+ const entries = reprList([...value.entries()], seen);
79
+ return `Map([${entries}])`;
80
+ }
81
+ if (value instanceof Set) {
82
+ const entries = reprList([...value.values()], seen);
83
+ return `Set([${entries}])`;
84
+ }
85
+ if (value instanceof WeakMap)
86
+ return "WeakMap{}";
87
+ if (value instanceof WeakSet)
88
+ return "WeakSet{}";
89
+ if (value instanceof Date) {
90
+ if (Number.isNaN(value.getTime()))
91
+ return 'Date("Invalid")';
92
+ return `Date("${value.toISOString()}")`;
93
+ }
94
+ if (value instanceof RegExp) {
95
+ return value.toString();
96
+ }
97
+ if (value instanceof Promise) {
98
+ return "Promise{}";
99
+ }
100
+ if (ArrayBuffer.isView(value)) {
101
+ return `${value.constructor.name} (${String(value.byteLength)} bytes)`;
102
+ }
103
+ if (value instanceof URL)
104
+ return `URL("${value.href}")`;
105
+ if (value instanceof Error) {
106
+ const parts = [`${value.name}(${safeJson(value.message)})`];
107
+ if ("cause" in value && value.cause !== undefined) {
108
+ parts.push(`cause=${desc(value.cause)}`);
109
+ }
110
+ const stack = value.stack?.split("\n")[1]?.trim();
111
+ if (stack !== undefined)
112
+ parts.push(`stack=${stack.replace(/^at\s+/, "")}`);
113
+ return parts.join(" ");
114
+ }
115
+ if (typeof value === "object") {
116
+ const proto = Object.getPrototypeOf(value);
117
+ const ctorName = typeof proto?.constructor?.name === "string"
118
+ ? proto.constructor.name
119
+ : undefined;
120
+ const json = reprObject(value, seen);
121
+ if (ctorName !== undefined && ctorName !== "Object") {
122
+ return `${ctorName} ${json}`;
123
+ }
124
+ if (Object.getPrototypeOf(value) === null) {
125
+ return `Object.create(null) ${json}`;
126
+ }
127
+ return json;
128
+ }
129
+ /* v8 ignore next 1 -- @preserve */
130
+ return safeJson(value);
131
+ }
132
+ function reprList(items, seen) {
133
+ if (items.length <= 10) {
134
+ return items.map((item) => repr(item, seen)).join(",");
135
+ }
136
+ const first = items.slice(0, 3).map((item) => repr(item, seen));
137
+ const last = items.slice(-3).map((item) => repr(item, seen));
138
+ return [...first, "...", ...last].join(",");
139
+ }
140
+ function reprObject(value, seen) {
141
+ let entries;
142
+ try {
143
+ entries = Object.entries(value);
144
+ }
145
+ catch (error) {
146
+ if (error instanceof TypeError) {
147
+ return "[Unserializable object]";
148
+ }
149
+ throw error;
150
+ }
151
+ if (entries.length === 0) {
152
+ return "{}";
153
+ }
154
+ if (entries.length <= 10) {
155
+ const pairs = entries
156
+ .map(([key, val]) => `${safeJson(key)}:${repr(val, seen)}`)
157
+ .join(",");
158
+ return `{${pairs}}`;
159
+ }
160
+ const first = entries
161
+ .slice(0, 3)
162
+ .map(([key, val]) => `${safeJson(key)}:${repr(val, seen)}`);
163
+ const last = entries
164
+ .slice(-3)
165
+ .map(([key, val]) => `${safeJson(key)}:${repr(val, seen)}`);
166
+ return `{${[...first, "...", ...last].join(",")}}`;
167
+ }
168
+ function safeJson(value) {
169
+ try {
170
+ return JSON.stringify(value);
171
+ }
172
+ catch (error) {
173
+ /* v8 ignore next 4 -- @preserve */
174
+ if (error instanceof Error) {
175
+ return `[Unserializable: ${error.name}("${error.message}")]`;
176
+ }
177
+ /* v8 ignore next 1 -- @preserve */
178
+ return "[Unserializable]";
179
+ }
180
+ }
181
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/describe/describe.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,KAAc;IACjC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAE5C,IACE,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,OAAO,GAAG,OAAO,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAC1C,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,UAAU;QAC7B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;IAEzD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,IAAI,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;IAC9D,CAAC;IAED,IAAI,KAAK,YAAY,GAAG,EAAE,CAAC;QACzB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACvD,CAAC;IAED,IAAI,K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AG,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAE9D,OAAO,IAAI,CAAC,GAAG,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACrD,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,mCAAmC;QACnC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,oBAAoB,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,KAAK,CAAC;QAC/D,CAAC;QACD,mCAAmC;QACnC,OAAO,kBAAkB,CAAC;IAC5B,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,14 @@
1
+ export * from "./assert/identical/identical.assert.js";
1
2
  export * from "./assert/non-nullable/non-nullable.assert.js";
2
3
  export * from "./assert/not-empty/not-empty.assert.js";
4
+ export * from "./assert/number-between/number-between.assert.js";
5
+ export * from "./assert/number-to-nearest/number-to-nearest.assert.js";
3
6
  export * from "./assert/one-of/one-of.assert.js";
7
+ export * from "./assert/type-bigint/type-bigint.assert.js";
8
+ export * from "./assert/type-boolean/type-boolean.assert.js";
9
+ export * from "./assert/type-function/type-function.assert.js";
10
+ export * from "./assert/type-number/type-number.assert.js";
11
+ export * from "./assert/type-numeric/type-numeric.assert.js";
12
+ export * from "./assert/type-object/type-object.assert.js";
13
+ export * from "./assert/type-string/type-string.assert.js";
4
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,14 @@
1
+ export * from "./assert/identical/identical.assert.js";
1
2
  export * from "./assert/non-nullable/non-nullable.assert.js";
2
3
  export * from "./assert/not-empty/not-empty.assert.js";
4
+ export * from "./assert/number-between/number-between.assert.js";
5
+ export * from "./assert/number-to-nearest/number-to-nearest.assert.js";
3
6
  export * from "./assert/one-of/one-of.assert.js";
7
+ export * from "./assert/type-bigint/type-bigint.assert.js";
8
+ export * from "./assert/type-boolean/type-boolean.assert.js";
9
+ export * from "./assert/type-function/type-function.assert.js";
10
+ export * from "./assert/type-number/type-number.assert.js";
11
+ export * from "./assert/type-numeric/type-numeric.assert.js";
12
+ export * from "./assert/type-object/type-object.assert.js";
13
+ export * from "./assert/type-string/type-string.assert.js";
4
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,kCAAkC,CAAC;AACjD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Kensio Software",
5
5
  "repository": "https://github.com/KensioSoftware/smartass",
6
6
  "license": "AGPL-3.0",
7
- "version": "0.0.4",
7
+ "version": "0.1.0",
8
8
  "type": "module",
9
9
  "main": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",