@augment-vir/assert 30.0.4 → 30.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 (56) hide show
  1. package/dist/assertions/boolean.d.ts +2 -2
  2. package/dist/assertions/boundary.d.ts +2 -2
  3. package/dist/assertions/enum.d.ts +2 -2
  4. package/dist/assertions/equality/entry-equality.d.ts +2 -2
  5. package/dist/assertions/equality/json-equality.d.ts +2 -2
  6. package/dist/assertions/equality/json-equality.js +1 -1
  7. package/dist/assertions/equality/simple-equality.d.ts +2 -2
  8. package/dist/assertions/equality/ts-type-equality.d.ts +4 -17
  9. package/dist/assertions/equality/ts-type-equality.js +1 -0
  10. package/dist/assertions/extendable-assertions.d.ts +43 -914
  11. package/dist/assertions/http.d.ts +1 -1
  12. package/dist/assertions/instance.d.ts +3 -3
  13. package/dist/assertions/keys.d.ts +3 -3
  14. package/dist/assertions/keys.js +1 -1
  15. package/dist/assertions/length.d.ts +2 -3
  16. package/dist/assertions/nullish.d.ts +2 -2
  17. package/dist/assertions/output.d.ts +2 -2
  18. package/dist/assertions/primitive.d.ts +3 -3
  19. package/dist/assertions/promise.d.ts +1 -1
  20. package/dist/assertions/runtime-type.d.ts +3 -3
  21. package/dist/assertions/throws.d.ts +2 -2
  22. package/dist/assertions/uuid.d.ts +2 -2
  23. package/dist/assertions/values.d.ts +2 -2
  24. package/dist/augments/guards/assert-wrap.d.ts +3 -254
  25. package/dist/augments/guards/assert.d.ts +4 -155
  26. package/dist/augments/guards/assert.js +6 -3
  27. package/dist/augments/guards/check-wrap.d.ts +4 -255
  28. package/dist/augments/guards/check-wrap.js +1 -1
  29. package/dist/augments/guards/check.d.ts +4 -255
  30. package/dist/augments/guards/wait-until.d.ts +3 -229
  31. package/dist/guard-types/assert-wrap-function.d.ts +2 -2
  32. package/dist/guard-types/check-function.d.ts +2 -2
  33. package/dist/guard-types/check-wrap-wrapper-function.d.ts +3 -3
  34. package/dist/guard-types/guard-override.d.ts +1 -1
  35. package/dist/guard-types/wait-until-function.d.ts +3 -4
  36. package/dist/index.d.ts +1 -1
  37. package/dist/test-timeout.mock.d.ts +2 -2
  38. package/package.json +2 -2
  39. package/dist/assertions/output.example.d.ts +0 -1
  40. package/dist/assertions/output.example.js +0 -13
  41. package/dist/assertions/runtime-type.example.d.ts +0 -1
  42. package/dist/assertions/runtime-type.example.js +0 -3
  43. package/dist/assertions/throws.example.d.ts +0 -1
  44. package/dist/assertions/throws.example.js +0 -11
  45. package/dist/augments/assertion.error.example.d.ts +0 -1
  46. package/dist/augments/assertion.error.example.js +0 -3
  47. package/dist/augments/guards/assert-wrap.example.d.ts +0 -1
  48. package/dist/augments/guards/assert-wrap.example.js +0 -9
  49. package/dist/augments/guards/assert.example.d.ts +0 -1
  50. package/dist/augments/guards/assert.example.js +0 -4
  51. package/dist/augments/guards/check-wrap.example.d.ts +0 -1
  52. package/dist/augments/guards/check-wrap.example.js +0 -9
  53. package/dist/augments/guards/check.example.d.ts +0 -1
  54. package/dist/augments/guards/check.example.js +0 -5
  55. package/dist/augments/guards/wait-until.example.d.ts +0 -1
  56. package/dist/augments/guards/wait-until.example.js +0 -13
@@ -1,6 +1,6 @@
1
- import { MaybePromise, NarrowToExpected } from '@augment-vir/core';
1
+ import { type MaybePromise, type NarrowToExpected } from '@augment-vir/core';
2
2
  import { autoGuardSymbol } from '../guard-types/guard-override.js';
3
- import { WaitUntilOptions } from '../guard-types/wait-until-function.js';
3
+ import { type WaitUntilOptions } from '../guard-types/wait-until-function.js';
4
4
  /**
5
5
  * All falsy values in JavaScript. This does not include `NaN` because there is no dedicated type
6
6
  * for it in TypeScript.
@@ -1,5 +1,5 @@
1
- import { MaybePromise } from '@augment-vir/core';
2
- import { WaitUntilOptions } from '../guard-types/wait-until-function.js';
1
+ import { type MaybePromise } from '@augment-vir/core';
2
+ import { type WaitUntilOptions } from '../guard-types/wait-until-function.js';
3
3
  declare function endsWith<const ArrayElement>(parent: ReadonlyArray<ArrayElement>, child: ArrayElement, failureMessage?: string | undefined): void;
4
4
  declare function endsWith(parent: string, child: string, failureMessage?: string | undefined): void;
5
5
  declare function endsWith(parent: string | ReadonlyArray<string>, child: string, failureMessage?: string | undefined): void;
@@ -1,6 +1,6 @@
1
1
  import type { NarrowToExpected } from '@augment-vir/core';
2
- import { EnumBaseType, MaybePromise } from '@augment-vir/core';
3
- import { WaitUntilOptions } from '../guard-types/wait-until-function.js';
2
+ import { type EnumBaseType, type MaybePromise } from '@augment-vir/core';
3
+ import { type WaitUntilOptions } from '../guard-types/wait-until-function.js';
4
4
  export declare function isEnumValue<const Expected extends EnumBaseType>(child: unknown, checkEnum: Expected, failureMessage?: string | undefined): asserts child is Expected[keyof Expected];
5
5
  declare function isNotEnumValue<const Actual, const Expected extends EnumBaseType>(child: Actual, checkEnum: Expected, failureMessage?: string | undefined): asserts child is Exclude<Actual, Expected[keyof Expected] | `${Expected[keyof Expected]}`>;
6
6
  export declare const enumGuards: {
@@ -1,7 +1,7 @@
1
1
  import type { NarrowToExpected } from '@augment-vir/core';
2
- import { MaybePromise } from '@augment-vir/core';
2
+ import { type MaybePromise } from '@augment-vir/core';
3
3
  import { autoGuardSymbol } from '../../guard-types/guard-override.js';
4
- import { WaitUntilOptions } from '../../guard-types/wait-until-function.js';
4
+ import { type WaitUntilOptions } from '../../guard-types/wait-until-function.js';
5
5
  declare function entriesEqual<const Actual extends object, const Expected extends Actual>(actual: Actual, expected: Expected, failureMessage?: string | undefined): asserts actual is Expected;
6
6
  declare function notEntriesEqual(actual: object, expected: object, failureMessage?: string | undefined): void;
7
7
  export declare const entryEqualityGuards: {
@@ -1,6 +1,6 @@
1
- import { MaybePromise, NarrowToExpected } from '@augment-vir/core';
1
+ import { type MaybePromise, type NarrowToExpected } from '@augment-vir/core';
2
2
  import { autoGuardSymbol } from '../../guard-types/guard-override.js';
3
- import { WaitUntilOptions } from '../../guard-types/wait-until-function.js';
3
+ import { type WaitUntilOptions } from '../../guard-types/wait-until-function.js';
4
4
  declare function jsonEquals<const Actual, const Expected extends Actual>(actual: Actual, expected: Expected, failureMessage?: string | undefined): asserts actual is Expected;
5
5
  declare function notJsonEquals(actual: unknown, expected: unknown, failureMessage?: string | undefined): void;
6
6
  export declare const jsonEqualityGuards: {
@@ -1,4 +1,4 @@
1
- import { extractErrorMessage } from '@augment-vir/core';
1
+ import { extractErrorMessage, } from '@augment-vir/core';
2
2
  import { AssertionError } from '../../augments/assertion.error.js';
3
3
  import { autoGuard, autoGuardSymbol } from '../../guard-types/guard-override.js';
4
4
  function baseJsonEquals(a, b) {
@@ -1,6 +1,6 @@
1
- import { MaybePromise, NarrowToExpected } from '@augment-vir/core';
1
+ import { type MaybePromise, type NarrowToExpected } from '@augment-vir/core';
2
2
  import { autoGuardSymbol } from '../../guard-types/guard-override.js';
3
- import { WaitUntilOptions } from '../../guard-types/wait-until-function.js';
3
+ import { type WaitUntilOptions } from '../../guard-types/wait-until-function.js';
4
4
  export declare function strictEquals<const Actual, const Expected extends Actual>(actual: Actual, expected: Expected, failureMessage?: string | undefined): asserts actual is Expected;
5
5
  declare function notStrictEquals(actual: unknown, expected: unknown, failureMessage?: string | undefined): void;
6
6
  declare function looseEquals(actual: unknown, expected: unknown, failureMessage?: string | undefined): void;
@@ -1,4 +1,4 @@
1
- import { ExpectTypeOf } from 'expect-type';
1
+ import { type ExpectTypeOf } from 'expect-type';
2
2
  type AssertTypeOf<TestingType> = {
3
3
  equals: ExpectTypeOf<TestingType, {
4
4
  positive: true;
@@ -6,6 +6,9 @@ type AssertTypeOf<TestingType> = {
6
6
  notEquals: ExpectTypeOf<TestingType, {
7
7
  positive: false;
8
8
  }>['toEqualTypeOf'];
9
+ slowEquals: ExpectTypeOf<TestingType, {
10
+ positive: true;
11
+ }>['branded']['toEqualTypeOf'];
9
12
  matches: ExpectTypeOf<TestingType, {
10
13
  positive: true;
11
14
  }>['toMatchTypeOf'];
@@ -20,22 +23,6 @@ input: Actual): AssertTypeOf<Actual>;
20
23
  declare function tsType<Actual>(): AssertTypeOf<Actual>;
21
24
  export declare const tsTypeGuards: {
22
25
  assert: {
23
- /**
24
- * Check if a value or type matches type expectations. Use this to write type tests.
25
- *
26
- * This should not be used in production code. It won't cause any issues there, but it also
27
- * provides no value there.
28
- *
29
- * Performs no type guarding.
30
- *
31
- * @example
32
- *
33
- * ```ts
34
- * import {assert} from '@augment-vir/assert';
35
- *
36
- * assert.tsType('hello').equals<string>();
37
- * ```
38
- */
39
26
  /**
40
27
  * Asserts within the TypeScript type system that a given type or value matches type
41
28
  * expectations (using the [`expect-type`](https://www.npmjs.com/package/expect-type) package.
@@ -8,6 +8,7 @@ input) {
8
8
  notEquals: () => { },
9
9
  matches: () => { },
10
10
  notMatches: () => { },
11
+ slowEquals: () => { },
11
12
  };
12
13
  }
13
14
  const assertions = {