assertron 11.1.4 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/assert-order/InvalidOrder.d.ts +1 -1
- package/cjs/assert-order/InvalidOrder.d.ts.map +1 -1
- package/cjs/assert-order/StateMachine.d.ts +1 -1
- package/cjs/assert-order/StateMachine.d.ts.map +1 -1
- package/cjs/assertron/assertron.d.ts +1 -1
- package/cjs/assertron/assertron.d.ts.map +1 -1
- package/cjs/assertron/assertron.js.map +1 -1
- package/cjs/assertron/satisfies.d.ts +1 -1
- package/cjs/assertron/satisfies.d.ts.map +1 -1
- package/cjs/assertron/throws.d.ts +1 -1
- package/cjs/assertron/throws.d.ts.map +1 -1
- package/cjs/errors.d.ts +3 -3
- package/cjs/errors.d.ts.map +1 -1
- package/cjs/errors.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +15 -1
- package/cjs/index.js.map +1 -1
- package/cjs/utils/isErrorConstructor.d.ts +1 -1
- package/cjs/utils/isErrorConstructor.d.ts.map +1 -1
- package/cjs/utils/notSatisfiedMessage.d.ts +1 -1
- package/cjs/utils/notSatisfiedMessage.d.ts.map +1 -1
- package/cjs/utils/unexpectedErrorMessage.d.ts +1 -1
- package/cjs/utils/unexpectedErrorMessage.d.ts.map +1 -1
- package/esm/assert-order/InvalidOrder.d.ts +1 -1
- package/esm/assert-order/InvalidOrder.d.ts.map +1 -1
- package/esm/assert-order/StateMachine.d.ts +1 -1
- package/esm/assert-order/StateMachine.d.ts.map +1 -1
- package/esm/assertron/assertron.d.ts +1 -1
- package/esm/assertron/assertron.d.ts.map +1 -1
- package/esm/assertron/assertron.js.map +1 -1
- package/esm/assertron/satisfies.d.ts +1 -1
- package/esm/assertron/satisfies.d.ts.map +1 -1
- package/esm/assertron/throws.d.ts +1 -1
- package/esm/assertron/throws.d.ts.map +1 -1
- package/esm/errors.d.ts +3 -3
- package/esm/errors.d.ts.map +1 -1
- package/esm/errors.js.map +1 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -1
- package/esm/utils/isErrorConstructor.d.ts +1 -1
- package/esm/utils/isErrorConstructor.d.ts.map +1 -1
- package/esm/utils/notSatisfiedMessage.d.ts +1 -1
- package/esm/utils/notSatisfiedMessage.d.ts.map +1 -1
- package/esm/utils/unexpectedErrorMessage.d.ts +1 -1
- package/esm/utils/unexpectedErrorMessage.d.ts.map +1 -1
- package/package.json +3 -3
- package/ts/assert-order/InvalidOrder.ts +1 -1
- package/ts/assert-order/StateMachine.ts +1 -1
- package/ts/assertron/assertron.ts +1 -1
- package/ts/assertron/satisfies.ts +1 -1
- package/ts/assertron/throws.ts +1 -1
- package/ts/errors.ts +3 -3
- package/ts/index.ts +17 -1
- package/ts/testUtils.ts +1 -1
- package/ts/utils/isErrorConstructor.ts +1 -1
- package/ts/utils/notSatisfiedMessage.ts +1 -1
- package/ts/utils/unexpectedErrorMessage.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidOrder.d.ts","sourceRoot":"","sources":["../../ts/assert-order/InvalidOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"InvalidOrder.d.ts","sourceRoot":"","sources":["../../ts/assert-order/InvalidOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC,qBAAa,YAAa,SAAQ,cAAc;IAC3B,KAAK,EAAE,KAAK;IAAS,MAAM,EAAE,MAAM;IAAS,IAAI,EAAE,GAAG,EAAE;gBAAvD,KAAK,EAAE,KAAK,EAAS,MAAM,EAAE,MAAM,EAAS,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO;CAG5G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../ts/assert-order/StateMachine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../ts/assert-order/StateMachine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AA8BvC,qBAAa,YAAY;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAK;IACjD,IAAI,SAAI;IACR,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,OAAO,SAAI;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;gBACP,OAAO,CAAC,EAAE,MAAM;IAI5B,IAAI,CAAC,IAAI,EAAE,MAAM;IAKjB,IAAI;IASJ,WAAW;IAMX,GAAG,IAAI,KAAK;IAUZ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI;IAGrC,UAAU,CAAC,IAAI,EAAE,MAAM;IAGvB,OAAO,CAAC,IAAI,EAAE,MAAM;IAGpB,gBAAgB;IAGhB,aAAa;IAGb,WAAW;IAIX,YAAY;CAGb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnyConstructor } from 'type-plus';
|
|
2
2
|
import type { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
3
|
-
import { SatisfyExpectation } from './satisfies.js';
|
|
3
|
+
import { type SatisfyExpectation } from './satisfies.js';
|
|
4
4
|
export type Assertron = {
|
|
5
5
|
false(value: unknown): asserts value is false;
|
|
6
6
|
falsy(value: any): asserts value is false | 0 | '' | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertron.d.ts","sourceRoot":"","sources":["../../ts/assertron/assertron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAQnE,OAAO,EAAa,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"assertron.d.ts","sourceRoot":"","sources":["../../ts/assertron/assertron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAQnE,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAInE,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IAC9C,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACtE,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAClG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,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C,CAAC,GAAG,CAAC,CAAC;IACtH,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,SAkBvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertron.js","sourceRoot":"","sources":["../../ts/assertron/assertron.ts"],"names":[],"mappings":";;;AACA,4CAA6C;AAE7C,gDAAmD;AACnD,yCAAkC;AAClC,uDAAgD;AAChD,iDAA0C;AAC1C,6CAAsC;AACtC,2CAAoC;AACpC,+CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"assertron.js","sourceRoot":"","sources":["../../ts/assertron/assertron.ts"],"names":[],"mappings":";;;AACA,4CAA6C;AAE7C,gDAAmD;AACnD,yCAAkC;AAClC,uDAAgD;AAChD,iDAA0C;AAC1C,6CAAsC;AACtC,2CAAoC;AACpC,+CAAwC;AACxC,iDAAmE;AACnE,2CAAoC;AACpC,2CAAoC;AAmBvB,QAAA,SAAS,GAAc;IAClC,KAAK,CAAC,KAAU;QACd,IAAI,KAAK,KAAK,KAAK;YACjB,MAAM,IAAI,0BAAc,CAAC,IAAA,0BAAe,EAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,iBAAS,CAAC,KAAK,EAAE,CAAC,CAAA;IACrF,CAAC;IACD,KAAK,EAAL,gBAAK;IACL,YAAY,EAAZ,8BAAY;IACZ,SAAS,EAAT,wBAAS;IACT,OAAO,EAAP,oBAAO;IACP,MAAM,EAAN,kBAAM;IACN,QAAQ,EAAR,sBAAQ;IACR,SAAS,EAAT,wBAAS;IACT,MAAM,EAAN,kBAAM;IACN,IAAI,CAAC,KAAU;QACb,IAAI,KAAK,KAAK,IAAI;YAChB,MAAM,IAAI,0BAAc,CAAC,IAAA,0BAAe,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,iBAAS,CAAC,IAAI,EAAE,CAAC,CAAA;IACnF,CAAC;IACD,MAAM,EAAN,kBAAM;CACP,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { If, IsExtend, NonComposableTypes } from 'type-plus';
|
|
1
|
+
import type { If, IsExtend, NonComposableTypes } from 'type-plus';
|
|
2
2
|
export type SatisfyExpectation<T> = If<IsExtend<T, string>, T | RegExp, If<IsExtend<T, NonComposableTypes>, T, If<IsExtend<T, Array<any>>, T extends Array<infer E> ? Array<SatisfyExpectation<E>> : never, {
|
|
3
3
|
[P in keyof T]?: T[P] extends string ? SatisfyExpectation<T[P]> | RegExp : SatisfyExpectation<T[P]>;
|
|
4
4
|
}>>> | ((v: T) => boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfies.d.ts","sourceRoot":"","sources":["../../ts/assertron/satisfies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"satisfies.d.ts","sourceRoot":"","sources":["../../ts/assertron/satisfies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAIjE,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,EAAE,CACpC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,EACnB,CAAC,GAAG,MAAM,EACV,EAAE,CACA,QAAQ,CAAC,CAAC,EAAE,kBAAkB,CAAC,EAC/B,CAAC,EACD,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EACxB,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAC/D;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAClC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GACjC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3B,CACF,CAAC,CACL,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA;AAEvB;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,QAAQ,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC,QAKhH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
1
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
2
2
|
export declare function throws<E extends Error>(value: PromiseLike<any>, error?: ErrorValidator | ErrorConstructor<E>): Promise<E>;
|
|
3
3
|
export declare function throws<E extends Error>(value: (...args: any[]) => never, error?: ErrorValidator | ErrorConstructor<E>): E;
|
|
4
4
|
export declare function throws<E extends Error, R = any>(value: (...args: any[]) => R, error?: ErrorValidator | ErrorConstructor<E>): R extends Promise<any> ? Promise<E> : E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../ts/assertron/throws.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../ts/assertron/throws.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGnE,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC1H,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAC1H,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AACrK,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,EAAE,cAAc,GAAG,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
|
package/cjs/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RequiredPick } from 'type-plus';
|
|
1
|
+
import { ModuleError } from 'iso-error';
|
|
2
|
+
import type { RequiredPick } from 'type-plus';
|
|
3
3
|
/**
|
|
4
4
|
* A base error for all assertion errors
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ export declare class AssertionError extends ModuleError {
|
|
|
7
7
|
constructor(message: string, options: AssertionError.Options);
|
|
8
8
|
}
|
|
9
9
|
export declare namespace AssertionError {
|
|
10
|
-
type Options = RequiredPick<
|
|
10
|
+
type Options = RequiredPick<ModuleError.Options, 'ssf'>;
|
|
11
11
|
}
|
|
12
12
|
export declare class FailOnOccurrence extends AssertionError {
|
|
13
13
|
occurrence: number;
|
package/cjs/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO;CAG7D;AAED,yBAAiB,cAAc,CAAC;IAC9B,KAAY,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;CAC/D;AAED,qBAAa,gBAAiB,SAAQ,cAAc;IAC/B,UAAU,EAAE,MAAM;IAAS,KAAK,EAAE,GAAG;gBAArC,UAAU,EAAE,MAAM,EAAS,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO;CAG1F"}
|
package/cjs/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAEvC,+CAAmD;AAEnD;;GAEG;AACH,MAAa,cAAe,SAAQ,uBAAW;IAC7C,YAAY,OAAe,EAAE,OAA+B;QAC1D,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IACtC,CAAC;CACF;AAJD,wCAIC;AAMD,MAAa,gBAAiB,SAAQ,cAAc;IAClD,YAAmB,UAAkB,EAAS,KAAU,EAAE,OAA+B;QACvF,KAAK,CAAC,IAAA,2BAAgB,EAAC,UAAU,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAA;QADzC;;;;mBAAO,UAAU;WAAQ;QAAE;;;;mBAAO,KAAK;WAAK;IAExD,CAAC;CACF;AAJD,4CAIC"}
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { assertron } from './assertron/index.js';
|
|
2
|
+
export { anything, has, every, hasAll, isInClosedInterval, isInLeftClosedInterval, isInOpenInterval, isInRange, isInRightClosedInterval, isTypeOf, none, some, startsWith } from 'satisfier';
|
|
2
3
|
export * from './assert-order/index.js';
|
|
3
4
|
export * from './assertron/index.js';
|
|
4
5
|
export * from './errors.js';
|
|
5
|
-
export default assertron;
|
|
6
6
|
export { assertron as a };
|
|
7
|
+
export default assertron;
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,EACN,QAAQ,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,MAAM,WAAW,CAAA;AAClB,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,CAAA;AAEzB,eAAe,SAAS,CAAA"}
|
package/cjs/index.js
CHANGED
|
@@ -14,9 +14,23 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.a = void 0;
|
|
17
|
+
exports.a = exports.startsWith = exports.some = exports.none = exports.isTypeOf = exports.isInRightClosedInterval = exports.isInRange = exports.isInOpenInterval = exports.isInLeftClosedInterval = exports.isInClosedInterval = exports.hasAll = exports.every = exports.has = exports.anything = void 0;
|
|
18
18
|
const index_js_1 = require("./assertron/index.js");
|
|
19
19
|
Object.defineProperty(exports, "a", { enumerable: true, get: function () { return index_js_1.assertron; } });
|
|
20
|
+
var satisfier_1 = require("satisfier");
|
|
21
|
+
Object.defineProperty(exports, "anything", { enumerable: true, get: function () { return satisfier_1.anything; } });
|
|
22
|
+
Object.defineProperty(exports, "has", { enumerable: true, get: function () { return satisfier_1.has; } });
|
|
23
|
+
Object.defineProperty(exports, "every", { enumerable: true, get: function () { return satisfier_1.every; } });
|
|
24
|
+
Object.defineProperty(exports, "hasAll", { enumerable: true, get: function () { return satisfier_1.hasAll; } });
|
|
25
|
+
Object.defineProperty(exports, "isInClosedInterval", { enumerable: true, get: function () { return satisfier_1.isInClosedInterval; } });
|
|
26
|
+
Object.defineProperty(exports, "isInLeftClosedInterval", { enumerable: true, get: function () { return satisfier_1.isInLeftClosedInterval; } });
|
|
27
|
+
Object.defineProperty(exports, "isInOpenInterval", { enumerable: true, get: function () { return satisfier_1.isInOpenInterval; } });
|
|
28
|
+
Object.defineProperty(exports, "isInRange", { enumerable: true, get: function () { return satisfier_1.isInRange; } });
|
|
29
|
+
Object.defineProperty(exports, "isInRightClosedInterval", { enumerable: true, get: function () { return satisfier_1.isInRightClosedInterval; } });
|
|
30
|
+
Object.defineProperty(exports, "isTypeOf", { enumerable: true, get: function () { return satisfier_1.isTypeOf; } });
|
|
31
|
+
Object.defineProperty(exports, "none", { enumerable: true, get: function () { return satisfier_1.none; } });
|
|
32
|
+
Object.defineProperty(exports, "some", { enumerable: true, get: function () { return satisfier_1.some; } });
|
|
33
|
+
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return satisfier_1.startsWith; } });
|
|
20
34
|
__exportStar(require("./assert-order/index.js"), exports);
|
|
21
35
|
__exportStar(require("./assertron/index.js"), exports);
|
|
22
36
|
__exportStar(require("./errors.js"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAgD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAgD;AAoB1B,kFApBb,oBAAS,OAoBK;AAlBvB,uCAckB;AAbjB,qGAAA,QAAQ,OAAA;AACR,gGAAA,GAAG,OAAA;AACH,kGAAA,KAAK,OAAA;AACL,mGAAA,MAAM,OAAA;AACN,+GAAA,kBAAkB,OAAA;AAClB,mHAAA,sBAAsB,OAAA;AACtB,6GAAA,gBAAgB,OAAA;AAChB,sGAAA,SAAS,OAAA;AACT,oHAAA,uBAAuB,OAAA;AACvB,qGAAA,QAAQ,OAAA;AACR,iGAAA,IAAI,OAAA;AACJ,iGAAA,IAAI,OAAA;AACJ,uGAAA,UAAU,OAAA;AAEX,0DAAuC;AACvC,uDAAoC;AACpC,8CAA2B;AAG3B,kBAAe,oBAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isErrorConstructor.d.ts","sourceRoot":"","sources":["../../ts/utils/isErrorConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"isErrorConstructor.d.ts","sourceRoot":"","sources":["../../ts/utils/isErrorConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAErF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notSatisfiedMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/notSatisfiedMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"notSatisfiedMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/notSatisfiedMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGrC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,EAAE,UAKlD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
1
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
2
2
|
export declare function unexpectedErrorMessage(actual: any, expected: ErrorValidator | ErrorConstructor<any>): string;
|
|
3
3
|
//# sourceMappingURL=unexpectedErrorMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unexpectedErrorMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/unexpectedErrorMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"unexpectedErrorMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/unexpectedErrorMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGnE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,UAGnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidOrder.d.ts","sourceRoot":"","sources":["../../ts/assert-order/InvalidOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"InvalidOrder.d.ts","sourceRoot":"","sources":["../../ts/assert-order/InvalidOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC,qBAAa,YAAa,SAAQ,cAAc;IAC3B,KAAK,EAAE,KAAK;IAAS,MAAM,EAAE,MAAM;IAAS,IAAI,EAAE,GAAG,EAAE;gBAAvD,KAAK,EAAE,KAAK,EAAS,MAAM,EAAE,MAAM,EAAS,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO;CAG5G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../ts/assert-order/StateMachine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../ts/assert-order/StateMachine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AA8BvC,qBAAa,YAAY;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAK;IACjD,IAAI,SAAI;IACR,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,OAAO,SAAI;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;gBACP,OAAO,CAAC,EAAE,MAAM;IAI5B,IAAI,CAAC,IAAI,EAAE,MAAM;IAKjB,IAAI;IASJ,WAAW;IAMX,GAAG,IAAI,KAAK;IAUZ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI;IAGrC,UAAU,CAAC,IAAI,EAAE,MAAM;IAGvB,OAAO,CAAC,IAAI,EAAE,MAAM;IAGpB,gBAAgB;IAGhB,aAAa;IAGb,WAAW;IAIX,YAAY;CAGb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnyConstructor } from 'type-plus';
|
|
2
2
|
import type { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
3
|
-
import { SatisfyExpectation } from './satisfies.js';
|
|
3
|
+
import { type SatisfyExpectation } from './satisfies.js';
|
|
4
4
|
export type Assertron = {
|
|
5
5
|
false(value: unknown): asserts value is false;
|
|
6
6
|
falsy(value: any): asserts value is false | 0 | '' | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertron.d.ts","sourceRoot":"","sources":["../../ts/assertron/assertron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAQnE,OAAO,EAAa,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"assertron.d.ts","sourceRoot":"","sources":["../../ts/assertron/assertron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM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,IAAI;YAChB,MAAM,IAAI,cAAc,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;IACnF,CAAC;IACD,MAAM;CACP,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { If, IsExtend, NonComposableTypes } from 'type-plus';
|
|
1
|
+
import type { If, IsExtend, NonComposableTypes } from 'type-plus';
|
|
2
2
|
export type SatisfyExpectation<T> = If<IsExtend<T, string>, T | RegExp, If<IsExtend<T, NonComposableTypes>, T, If<IsExtend<T, Array<any>>, T extends Array<infer E> ? Array<SatisfyExpectation<E>> : never, {
|
|
3
3
|
[P in keyof T]?: T[P] extends string ? SatisfyExpectation<T[P]> | RegExp : SatisfyExpectation<T[P]>;
|
|
4
4
|
}>>> | ((v: T) => boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfies.d.ts","sourceRoot":"","sources":["../../ts/assertron/satisfies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"satisfies.d.ts","sourceRoot":"","sources":["../../ts/assertron/satisfies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAIjE,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,EAAE,CACpC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,EACnB,CAAC,GAAG,MAAM,EACV,EAAE,CACA,QAAQ,CAAC,CAAC,EAAE,kBAAkB,CAAC,EAC/B,CAAC,EACD,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EACxB,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAC/D;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAClC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GACjC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3B,CACF,CAAC,CACL,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA;AAEvB;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,QAAQ,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC,QAKhH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
1
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
2
2
|
export declare function throws<E extends Error>(value: PromiseLike<any>, error?: ErrorValidator | ErrorConstructor<E>): Promise<E>;
|
|
3
3
|
export declare function throws<E extends Error>(value: (...args: any[]) => never, error?: ErrorValidator | ErrorConstructor<E>): E;
|
|
4
4
|
export declare function throws<E extends Error, R = any>(value: (...args: any[]) => R, error?: ErrorValidator | ErrorConstructor<E>): R extends Promise<any> ? Promise<E> : E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../ts/assertron/throws.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"throws.d.ts","sourceRoot":"","sources":["../../ts/assertron/throws.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGnE,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC1H,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAC1H,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AACrK,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,EAAE,cAAc,GAAG,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
|
package/esm/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RequiredPick } from 'type-plus';
|
|
1
|
+
import { ModuleError } from 'iso-error';
|
|
2
|
+
import type { RequiredPick } from 'type-plus';
|
|
3
3
|
/**
|
|
4
4
|
* A base error for all assertion errors
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ export declare class AssertionError extends ModuleError {
|
|
|
7
7
|
constructor(message: string, options: AssertionError.Options);
|
|
8
8
|
}
|
|
9
9
|
export declare namespace AssertionError {
|
|
10
|
-
type Options = RequiredPick<
|
|
10
|
+
type Options = RequiredPick<ModuleError.Options, 'ssf'>;
|
|
11
11
|
}
|
|
12
12
|
export declare class FailOnOccurrence extends AssertionError {
|
|
13
13
|
occurrence: number;
|
package/esm/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO;CAG7D;AAED,yBAAiB,cAAc,CAAC;IAC9B,KAAY,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;CAC/D;AAED,qBAAa,gBAAiB,SAAQ,cAAc;IAC/B,UAAU,EAAE,MAAM;IAAS,KAAK,EAAE,GAAG;gBAArC,UAAU,EAAE,MAAM,EAAS,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,CAAC,OAAO;CAG1F"}
|
package/esm/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,OAAe,EAAE,OAA+B;QAC1D,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IACtC,CAAC;CACF;AAMD,MAAM,OAAO,gBAAiB,SAAQ,cAAc;IAClD,YAAmB,UAAkB,EAAS,KAAU,EAAE,OAA+B;QACvF,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAA;QADzC;;;;mBAAO,UAAU;WAAQ;QAAE;;;;mBAAO,KAAK;WAAK;IAExD,CAAC;CACF"}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { assertron } from './assertron/index.js';
|
|
2
|
+
export { anything, has, every, hasAll, isInClosedInterval, isInLeftClosedInterval, isInOpenInterval, isInRange, isInRightClosedInterval, isTypeOf, none, some, startsWith } from 'satisfier';
|
|
2
3
|
export * from './assert-order/index.js';
|
|
3
4
|
export * from './assertron/index.js';
|
|
4
5
|
export * from './errors.js';
|
|
5
|
-
export default assertron;
|
|
6
6
|
export { assertron as a };
|
|
7
|
+
export default assertron;
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,EACN,QAAQ,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,MAAM,WAAW,CAAA;AAClB,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,CAAA;AAEzB,eAAe,SAAS,CAAA"}
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { assertron } from './assertron/index.js';
|
|
2
|
+
export { anything, has, every, hasAll, isInClosedInterval, isInLeftClosedInterval, isInOpenInterval, isInRange, isInRightClosedInterval, isTypeOf, none, some, startsWith } from 'satisfier';
|
|
2
3
|
export * from './assert-order/index.js';
|
|
3
4
|
export * from './assertron/index.js';
|
|
4
5
|
export * from './errors.js';
|
|
5
|
-
export default assertron;
|
|
6
6
|
export { assertron as a };
|
|
7
|
+
export default assertron;
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,EACN,QAAQ,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,MAAM,WAAW,CAAA;AAClB,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,CAAA;AAEzB,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isErrorConstructor.d.ts","sourceRoot":"","sources":["../../ts/utils/isErrorConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"isErrorConstructor.d.ts","sourceRoot":"","sources":["../../ts/utils/isErrorConstructor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAErF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notSatisfiedMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/notSatisfiedMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"notSatisfiedMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/notSatisfiedMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGrC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,EAAE,UAKlD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
1
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js';
|
|
2
2
|
export declare function unexpectedErrorMessage(actual: any, expected: ErrorValidator | ErrorConstructor<any>): string;
|
|
3
3
|
//# sourceMappingURL=unexpectedErrorMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unexpectedErrorMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/unexpectedErrorMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"unexpectedErrorMessage.d.ts","sourceRoot":"","sources":["../../ts/utils/unexpectedErrorMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGnE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,UAGnG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assertron",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "A supplementary assertion library",
|
|
5
5
|
"homepage": "https://github.com/unional/assertron",
|
|
6
6
|
"bugs": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"path-equal": "^1.2.5",
|
|
61
61
|
"satisfier": "^5.4.2",
|
|
62
62
|
"tersify": "^3.11.1",
|
|
63
|
-
"type-plus": "^6.
|
|
63
|
+
"type-plus": "^6.5.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@commitlint/cli": "^17.0.2",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"npm-run-all": "^4.1.5",
|
|
90
90
|
"pinst": "^3.0.0",
|
|
91
91
|
"rimraf": "^3.0.2",
|
|
92
|
-
"semantic-release": "^
|
|
92
|
+
"semantic-release": "^21.0.1",
|
|
93
93
|
"size-limit": "^8.0.0",
|
|
94
94
|
"ts-jest": "^29.0.0",
|
|
95
95
|
"tslib": "^2.4.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AssertionError } from '../errors.js'
|
|
2
|
-
import { State } from './types.js'
|
|
2
|
+
import type { State } from './types.js'
|
|
3
3
|
|
|
4
4
|
export class InvalidOrder extends AssertionError {
|
|
5
5
|
constructor(public state: State, public method: string, public args: any[], options: AssertionError.Options) {
|
|
@@ -8,7 +8,7 @@ import { pathEqual } from './pathEqual.js'
|
|
|
8
8
|
import { rejects } from './rejects.js'
|
|
9
9
|
import { repeat } from './repeat.js'
|
|
10
10
|
import { resolves } from './resolves.js'
|
|
11
|
-
import { satisfies, SatisfyExpectation } from './satisfies.js'
|
|
11
|
+
import { satisfies, type SatisfyExpectation } from './satisfies.js'
|
|
12
12
|
import { throws } from './throws.js'
|
|
13
13
|
import { truthy } from './truthy.js'
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSatisfier } from 'satisfier'
|
|
2
|
-
import { If, IsExtend, NonComposableTypes } from 'type-plus'
|
|
2
|
+
import type { If, IsExtend, NonComposableTypes } from 'type-plus'
|
|
3
3
|
import { AssertionError } from '../errors.js'
|
|
4
4
|
import { notSatisfiedMessage } from '../utils/index.js'
|
|
5
5
|
|
package/ts/assertron/throws.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isPromise from 'is-promise'
|
|
2
2
|
import { AssertionError } from '../errors.js'
|
|
3
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js'
|
|
3
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js'
|
|
4
4
|
import { isErrorConstructor, notRejectedMessage, notThrownMessage, unexpectedErrorMessage } from '../utils/index.js'
|
|
5
5
|
|
|
6
6
|
export function throws<E extends Error>(value: PromiseLike<any>, error?: ErrorValidator | ErrorConstructor<E>): Promise<E>
|
package/ts/errors.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RequiredPick } from 'type-plus'
|
|
1
|
+
import { ModuleError } from 'iso-error'
|
|
2
|
+
import type { RequiredPick } from 'type-plus'
|
|
3
3
|
import { failOnOccurrence } from './utils/index.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -12,7 +12,7 @@ export class AssertionError extends ModuleError {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export namespace AssertionError {
|
|
15
|
-
export type Options = RequiredPick<
|
|
15
|
+
export type Options = RequiredPick<ModuleError.Options, 'ssf'>
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export class FailOnOccurrence extends AssertionError {
|
package/ts/index.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { assertron } from './assertron/index.js'
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
anything,
|
|
5
|
+
has,
|
|
6
|
+
every,
|
|
7
|
+
hasAll,
|
|
8
|
+
isInClosedInterval,
|
|
9
|
+
isInLeftClosedInterval,
|
|
10
|
+
isInOpenInterval,
|
|
11
|
+
isInRange,
|
|
12
|
+
isInRightClosedInterval,
|
|
13
|
+
isTypeOf,
|
|
14
|
+
none,
|
|
15
|
+
some,
|
|
16
|
+
startsWith
|
|
17
|
+
} from 'satisfier'
|
|
3
18
|
export * from './assert-order/index.js'
|
|
4
19
|
export * from './assertron/index.js'
|
|
5
20
|
export * from './errors.js'
|
|
6
|
-
export default assertron
|
|
7
21
|
export { assertron as a }
|
|
22
|
+
|
|
23
|
+
export default assertron
|
package/ts/testUtils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorConstructor } from '../types.js'
|
|
1
|
+
import type { ErrorConstructor } from '../types.js'
|
|
2
2
|
|
|
3
3
|
export function isErrorConstructor(validator: any): validator is ErrorConstructor<any> {
|
|
4
4
|
return Object.prototype.isPrototypeOf.call(Error.prototype, validator.prototype)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tersify } from 'tersify'
|
|
2
|
-
import { ErrorConstructor, ErrorValidator } from '../types.js'
|
|
2
|
+
import type { ErrorConstructor, ErrorValidator } from '../types.js'
|
|
3
3
|
import { isErrorConstructor } from './isErrorConstructor.js'
|
|
4
4
|
|
|
5
5
|
export function unexpectedErrorMessage(actual: any, expected: ErrorValidator | ErrorConstructor<any>) {
|