lay-sing 0.4.1 → 0.4.2
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/esm/main/expect/to/be.d.ts +7 -19
- package/esm/main/expect/to/be.d.ts.map +1 -1
- package/esm/main/expect/to/be.js.map +1 -1
- package/esm/main/expect/to/equal.d.ts +2 -2
- package/esm/main/expect/to/equal.d.ts.map +1 -1
- package/esm/main/expect/to/equal.js.map +1 -1
- package/esm/main/expect/to/extend.d.ts +7 -13
- package/esm/main/expect/to/extend.d.ts.map +1 -1
- package/esm/main/expect/to/extend.js.map +1 -1
- package/esm/main/expect/to/have-key.d.ts +6 -6
- package/esm/main/expect/to/have-key.d.ts.map +1 -1
- package/esm/main/expect/to/have-key.js.map +1 -1
- package/esm/main/expect/to/proper-extends.d.ts +2 -2
- package/esm/main/expect/to/proper-extends.d.ts.map +1 -1
- package/esm/main/expect/to/proper-extends.js.map +1 -1
- package/esm/main/index.d.ts +2 -2
- package/esm/main/index.d.ts.map +1 -1
- package/esm/main/index.js.map +1 -1
- package/package.json +1 -1
- package/script/main/expect/to/be.d.ts +7 -19
- package/script/main/expect/to/be.d.ts.map +1 -1
- package/script/main/expect/to/be.js.map +1 -1
- package/script/main/expect/to/equal.d.ts +2 -2
- package/script/main/expect/to/equal.d.ts.map +1 -1
- package/script/main/expect/to/equal.js.map +1 -1
- package/script/main/expect/to/extend.d.ts +7 -13
- package/script/main/expect/to/extend.d.ts.map +1 -1
- package/script/main/expect/to/extend.js.map +1 -1
- package/script/main/expect/to/have-key.d.ts +6 -6
- package/script/main/expect/to/have-key.d.ts.map +1 -1
- package/script/main/expect/to/have-key.js.map +1 -1
- package/script/main/expect/to/proper-extends.d.ts +2 -2
- package/script/main/expect/to/proper-extends.d.ts.map +1 -1
- package/script/main/expect/to/proper-extends.js.map +1 -1
- package/script/main/index.d.ts +2 -2
- package/script/main/index.d.ts.map +1 -1
- package/script/main/index.js.map +1 -1
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import type { Exact, If, Xor } from '../../../utils/index.js';
|
|
2
|
-
import type { TypeAssertionResult } from '../index.js';
|
|
2
|
+
import type { ExpectType, TypeAssertionResult } from '../index.js';
|
|
3
3
|
export type Be<T, Inv extends boolean = false> = {
|
|
4
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
5
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
6
|
-
} &
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
never: void;
|
|
10
|
-
}, {}> & If<Xor<Inv, Exact<T, unknown>>, {
|
|
11
|
-
unknown: void;
|
|
12
|
-
}, {}> & If<Xor<Inv, Exact<T, void>>, {
|
|
13
|
-
void: void;
|
|
14
|
-
}, {}> & If<Xor<Inv, Exact<T, null>>, {
|
|
15
|
-
null: void;
|
|
16
|
-
}, {}> & If<Xor<Inv, Exact<T, undefined>>, {
|
|
17
|
-
undefined: void;
|
|
18
|
-
}, {}> & If<Xor<Inv, Exact<T, true>>, {
|
|
19
|
-
true: void;
|
|
20
|
-
}, {}> & If<Xor<Inv, Exact<T, false>>, {
|
|
21
|
-
false: void;
|
|
4
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
5
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
6
|
+
} & Special<T, Inv, any, 'any'> & Special<T, Inv, never, 'never'> & Special<T, Inv, unknown, 'unknown'> & Special<T, Inv, void, 'void'> & Special<T, Inv, null, 'null'> & Special<T, Inv, undefined, 'undefined'> & Special<T, Inv, true, 'true'> & Special<T, Inv, false, 'false'>;
|
|
7
|
+
type Special<T, Inv extends boolean, U, Key extends PropertyKey> = If<Xor<Inv, Exact<T, U>>, {
|
|
8
|
+
[_ in Key]: ExpectType<T>;
|
|
22
9
|
}, {}>;
|
|
10
|
+
export {};
|
|
23
11
|
//# sourceMappingURL=be.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAElE,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IACzC;IACA,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1D,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CAC/D,GACC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAC3B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,GACnC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,CAAC,GACvC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAEnC,KAAK,OAAO,CACV,CAAC,EACD,GAAG,SAAS,OAAO,EACnB,CAAC,EACD,GAAG,SAAS,WAAW,IACrB,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KAAG,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;CAAE,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact, If, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Be<T, Inv extends boolean = false> =\n & {\n <U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n }\n &
|
|
1
|
+
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact, If, Xor } from '../../../utils/index.js'\nimport type { ExpectType, TypeAssertionResult } from '../index.js'\n\nexport type Be<T, Inv extends boolean = false> =\n & {\n <const U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n }\n & Special<T, Inv, any, 'any'>\n & Special<T, Inv, never, 'never'>\n & Special<T, Inv, unknown, 'unknown'>\n & Special<T, Inv, void, 'void'>\n & Special<T, Inv, null, 'null'>\n & Special<T, Inv, undefined, 'undefined'>\n & Special<T, Inv, true, 'true'>\n & Special<T, Inv, false, 'false'>\n\ntype Special<\n T,\n Inv extends boolean,\n U,\n Key extends PropertyKey,\n> = If<Xor<Inv, Exact<T, U>>, { [_ in Key]: ExpectType<T> }, {}>\n"]}
|
|
@@ -20,7 +20,7 @@ export type Equal<T, Inv extends boolean = false> = {
|
|
|
20
20
|
* expect<1>().to.equal<1 | 2>().fail
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
24
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
23
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
24
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=equal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAClD;;;;;;;;;;;;;;;;;;OAkBG;IACH,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAClD;;;;;;;;;;;;;;;;;;OAkBG;IACH,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CAC5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"","sourcesContent":["import type { MutuallyAssignable, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Equal<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type is mutually assignable with the provided type U.\n *\n * It's like:\n *\n * ```ts ignore\n * [T] extends [U] ? [U] extends [T] ? Yes : No : No\n * ```\n *\n * @template U The type to compare with\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<{ a: 1; b: 2 }>().to.equal<{ a: 1 } & { b: 2 }>().pass\n * expect<1>().to.equal<1 | 2>().fail\n * ```\n */\n <U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"","sourcesContent":["import type { MutuallyAssignable, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Equal<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type is mutually assignable with the provided type U.\n *\n * It's like:\n *\n * ```ts ignore\n * [T] extends [U] ? [U] extends [T] ? Yes : No : No\n * ```\n *\n * @template U The type to compare with\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<{ a: 1; b: 2 }>().to.equal<{ a: 1 } & { b: 2 }>().pass\n * expect<1>().to.equal<1 | 2>().fail\n * ```\n */\n <const U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Extends, If, Xor } from '../../../utils/index.js';
|
|
2
|
-
import type { TypeAssertionResult } from '../index.js';
|
|
2
|
+
import type { ExpectType, TypeAssertionResult } from '../index.js';
|
|
3
3
|
export type Extend<T, Inv extends boolean = false> = {
|
|
4
4
|
/**
|
|
5
5
|
* Tests if the current type T extends the provided type U.
|
|
@@ -15,17 +15,11 @@ export type Extend<T, Inv extends boolean = false> = {
|
|
|
15
15
|
* expect<'hello'>().to.extend<string>().pass
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
19
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
20
|
-
} &
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
bigint: void;
|
|
24
|
-
}, {}> & If<Xor<Inv, Extends<T, string>>, {
|
|
25
|
-
string: void;
|
|
26
|
-
}, {}> & If<Xor<Inv, Extends<T, boolean>>, {
|
|
27
|
-
boolean: void;
|
|
28
|
-
}, {}> & If<Xor<Inv, Extends<T, symbol>>, {
|
|
29
|
-
symbol: void;
|
|
18
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
19
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
20
|
+
} & Special<T, Inv, number, 'number'> & Special<T, Inv, bigint, 'bigint'> & Special<T, Inv, string, 'string'> & Special<T, Inv, boolean, 'boolean'> & Special<T, Inv, symbol, 'symbol'>;
|
|
21
|
+
type Special<T, Inv extends boolean, U, Key extends PropertyKey> = If<Xor<Inv, Extends<T, U>>, {
|
|
22
|
+
[_ in Key]: ExpectType<T>;
|
|
30
23
|
}, {}>;
|
|
24
|
+
export {};
|
|
31
25
|
//# sourceMappingURL=extend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAElE,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAC7C;IACA;;;;;;;;;;;;;OAaG;IACH,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CACjE,GACC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,GACnC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;AAErC,KAAK,OAAO,CACV,CAAC,EACD,GAAG,SAAS,OAAO,EACnB,CAAC,EACD,GAAG,SAAS,WAAW,IACrB,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KAAG,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;CAAE,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, If, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Extend<T, Inv extends boolean = false> =\n & {\n /**\n * Tests if the current type T extends the provided type U.\n *\n * @template U The type to check extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * expect<'hello'>().to.extend<string>().pass\n * ```\n */\n <U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n }\n &
|
|
1
|
+
{"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, If, Xor } from '../../../utils/index.js'\nimport type { ExpectType, TypeAssertionResult } from '../index.js'\n\nexport type Extend<T, Inv extends boolean = false> =\n & {\n /**\n * Tests if the current type T extends the provided type U.\n *\n * @template U The type to check extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * expect<'hello'>().to.extend<string>().pass\n * ```\n */\n <const U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n }\n & Special<T, Inv, number, 'number'>\n & Special<T, Inv, bigint, 'bigint'>\n & Special<T, Inv, string, 'string'>\n & Special<T, Inv, boolean, 'boolean'>\n & Special<T, Inv, symbol, 'symbol'>\n\ntype Special<\n T,\n Inv extends boolean,\n U,\n Key extends PropertyKey,\n> = If<Xor<Inv, Extends<T, U>>, { [_ in Key]: ExpectType<T> }, {}>\n"]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Extends, IfTupleIncludes, Xor } from '../../../utils/index.js';
|
|
2
2
|
import type { TypeAssertionResult } from '../index.js';
|
|
3
|
-
type Result<T, K extends PropertyKey, Inv extends boolean = false> = IfTupleIncludes<[
|
|
4
|
-
never,
|
|
5
|
-
any
|
|
6
|
-
], K, never, TypeAssertionResult<T, Xor<Inv, Extends<K, keyof T>>>>;
|
|
7
3
|
export type HaveKey<T, Inv extends boolean = false> = {
|
|
8
4
|
/**
|
|
9
5
|
* Tests if the current type `T` has a property with key `K`.
|
|
@@ -31,8 +27,12 @@ export type HaveKey<T, Inv extends boolean = false> = {
|
|
|
31
27
|
* expect<WithProp>().to.haveKey<'may' | 'unexist'>().fail
|
|
32
28
|
* ```
|
|
33
29
|
*/
|
|
34
|
-
<K extends PropertyKey>(): Result<T, K, Inv>;
|
|
35
|
-
<K extends PropertyKey>(_: K): Result<T, K, Inv>;
|
|
30
|
+
<const K extends PropertyKey>(): Result<T, K, Inv>;
|
|
31
|
+
<const K extends PropertyKey>(_: K): Result<T, K, Inv>;
|
|
36
32
|
};
|
|
33
|
+
type Result<T, K extends PropertyKey, Inv extends boolean = false> = IfTupleIncludes<[
|
|
34
|
+
never,
|
|
35
|
+
any
|
|
36
|
+
], K, never, TypeAssertionResult<T, Xor<Inv, Extends<K, keyof T>>>>;
|
|
37
37
|
export {};
|
|
38
38
|
//# sourceMappingURL=have-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"have-key.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,
|
|
1
|
+
{"version":3,"file":"have-key.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IACpD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;IAClD,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;CACvD,CAAA;AAED,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI,eAAe,CAClF;IAAC,KAAK;IAAE,GAAG;CAAC,EACZ,CAAC,EACD,KAAK,EACL,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CACtD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"have-key.js","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, IfTupleIncludes, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\
|
|
1
|
+
{"version":3,"file":"have-key.js","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, IfTupleIncludes, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type HaveKey<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type `T` has a property with key `K`.\n *\n * @template K The property key to check for\n *\n * ### Behavior\n *\n * - For single keys: succeeds if the key exists in `T`\n * - For union types: succeeds only if **all** keys in the union exist in `T`\n *\n * ### Examples\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * type WithProp = { prop: string; another: number; may?: 5 }\n *\n * // Single key checks\n * expect<WithProp>().to.haveKey<'prop'>().pass\n * expect<WithProp>().to.haveKey<'missing'>().fail\n *\n * // Union type checks\n * expect<WithProp>().to.haveKey<'prop' | 'another'>().pass\n * expect<WithProp>().to.haveKey<'may' | 'unexist'>().fail\n * ```\n */\n <const K extends PropertyKey>(): Result<T, K, Inv>\n <const K extends PropertyKey>(_: K): Result<T, K, Inv>\n}\n\ntype Result<T, K extends PropertyKey, Inv extends boolean = false> = IfTupleIncludes<\n [never, any],\n K,\n never,\n TypeAssertionResult<T, Xor<Inv, Extends<K, keyof T>>>\n>\n"]}
|
|
@@ -15,7 +15,7 @@ export type ProperExtends<T, Inv extends boolean = false> = {
|
|
|
15
15
|
* expect<number>().to.properExtend<number>().fail
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
19
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
18
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
19
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=proper-extends.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proper-extends.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAC1D;;;;;;;;;;;;;OAaG;IACH,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"proper-extends.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAC1D;;;;;;;;;;;;;OAaG;IACH,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACjE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CACtE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proper-extends.js","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"","sourcesContent":["import type { ProperExtend, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type ProperExtends<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type T properly extends the provided type U (extends but is not the same).\n *\n * @template U The type to check proper extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<2>().to.properExtend<number>().pass\n * expect<'a' | 'b'>().to.properExtend<string>().pass\n * expect<number>().to.properExtend<number>().fail\n * ```\n */\n <U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"proper-extends.js","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"","sourcesContent":["import type { ProperExtend, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type ProperExtends<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type T properly extends the provided type U (extends but is not the same).\n *\n * @template U The type to check proper extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<2>().to.properExtend<number>().pass\n * expect<'a' | 'b'>().to.properExtend<string>().pass\n * expect<number>().to.properExtend<number>().fail\n * ```\n */\n <const U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n}\n"]}
|
package/esm/main/index.d.ts
CHANGED
package/esm/main/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,KAAK,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;CACxB,CAAA"}
|
package/esm/main/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,MAAM,GAGf,IAAI,CAAA","sourcesContent":["/**\n * [Full API documentation is available on JSR](https://jsr.io/@leawind/lay-sing/doc)\n *\n * @module\n */\n\nimport type { ExpectType } from './expect/index.js'\nimport { NOOP } from './noop.js'\n\nexport type { ExpectType } from './expect/index.js'\nexport { NOOP } from './noop.js'\n\n/**\n * Creates an instance of ExpectType to perform type-level assertions on the given type.\n * This function enables testing various type relationships at compile time.\n * NOTE: This function does nothing at runtime and is purely for type-level testing.\n *\n * @template T The type to be tested\n *\n * @returns An ExpectType instance with methods to test type relationships\n *\n * @example\n * ```ts\n * // Test exact type equality\n * expect<number>().to.be<number>().pass\n * expect<number>().to.be<string>().fail\n * // Test if one type extends another\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * ```\n */\nexport const expect: {\n <T>(): ExpectType<T>\n <T>(_: T): ExpectType<T>\n} = NOOP\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,MAAM,GAGf,IAAI,CAAA","sourcesContent":["/**\n * [Full API documentation is available on JSR](https://jsr.io/@leawind/lay-sing/doc)\n *\n * @module\n */\n\nimport type { ExpectType } from './expect/index.js'\nimport { NOOP } from './noop.js'\n\nexport type { ExpectType } from './expect/index.js'\nexport { NOOP } from './noop.js'\n\n/**\n * Creates an instance of ExpectType to perform type-level assertions on the given type.\n * This function enables testing various type relationships at compile time.\n * NOTE: This function does nothing at runtime and is purely for type-level testing.\n *\n * @template T The type to be tested\n *\n * @returns An ExpectType instance with methods to test type relationships\n *\n * @example\n * ```ts\n * // Test exact type equality\n * expect<number>().to.be<number>().pass\n * expect<number>().to.be<string>().fail\n * // Test if one type extends another\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * ```\n */\nexport const expect: {\n <const T>(): ExpectType<T>\n <const T>(_: T): ExpectType<T>\n} = NOOP\n"]}
|
package/package.json
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import type { Exact, If, Xor } from '../../../utils/index.js';
|
|
2
|
-
import type { TypeAssertionResult } from '../index.js';
|
|
2
|
+
import type { ExpectType, TypeAssertionResult } from '../index.js';
|
|
3
3
|
export type Be<T, Inv extends boolean = false> = {
|
|
4
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
5
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
6
|
-
} &
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
never: void;
|
|
10
|
-
}, {}> & If<Xor<Inv, Exact<T, unknown>>, {
|
|
11
|
-
unknown: void;
|
|
12
|
-
}, {}> & If<Xor<Inv, Exact<T, void>>, {
|
|
13
|
-
void: void;
|
|
14
|
-
}, {}> & If<Xor<Inv, Exact<T, null>>, {
|
|
15
|
-
null: void;
|
|
16
|
-
}, {}> & If<Xor<Inv, Exact<T, undefined>>, {
|
|
17
|
-
undefined: void;
|
|
18
|
-
}, {}> & If<Xor<Inv, Exact<T, true>>, {
|
|
19
|
-
true: void;
|
|
20
|
-
}, {}> & If<Xor<Inv, Exact<T, false>>, {
|
|
21
|
-
false: void;
|
|
4
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
5
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>;
|
|
6
|
+
} & Special<T, Inv, any, 'any'> & Special<T, Inv, never, 'never'> & Special<T, Inv, unknown, 'unknown'> & Special<T, Inv, void, 'void'> & Special<T, Inv, null, 'null'> & Special<T, Inv, undefined, 'undefined'> & Special<T, Inv, true, 'true'> & Special<T, Inv, false, 'false'>;
|
|
7
|
+
type Special<T, Inv extends boolean, U, Key extends PropertyKey> = If<Xor<Inv, Exact<T, U>>, {
|
|
8
|
+
[_ in Key]: ExpectType<T>;
|
|
22
9
|
}, {}>;
|
|
10
|
+
export {};
|
|
23
11
|
//# sourceMappingURL=be.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAElE,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IACzC;IACA,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1D,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CAC/D,GACC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAC3B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,GACnC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,CAAC,GACvC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAEnC,KAAK,OAAO,CACV,CAAC,EACD,GAAG,SAAS,OAAO,EACnB,CAAC,EACD,GAAG,SAAS,WAAW,IACrB,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KAAG,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;CAAE,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact, If, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Be<T, Inv extends boolean = false> =\n & {\n <U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n }\n &
|
|
1
|
+
{"version":3,"file":"be.js","sourceRoot":"","sources":["../../../../src/main/expect/to/be.ts"],"names":[],"mappings":"","sourcesContent":["import type { Exact, If, Xor } from '../../../utils/index.js'\nimport type { ExpectType, TypeAssertionResult } from '../index.js'\n\nexport type Be<T, Inv extends boolean = false> =\n & {\n <const U>(): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, Exact<T, U>>>\n }\n & Special<T, Inv, any, 'any'>\n & Special<T, Inv, never, 'never'>\n & Special<T, Inv, unknown, 'unknown'>\n & Special<T, Inv, void, 'void'>\n & Special<T, Inv, null, 'null'>\n & Special<T, Inv, undefined, 'undefined'>\n & Special<T, Inv, true, 'true'>\n & Special<T, Inv, false, 'false'>\n\ntype Special<\n T,\n Inv extends boolean,\n U,\n Key extends PropertyKey,\n> = If<Xor<Inv, Exact<T, U>>, { [_ in Key]: ExpectType<T> }, {}>\n"]}
|
|
@@ -20,7 +20,7 @@ export type Equal<T, Inv extends boolean = false> = {
|
|
|
20
20
|
* expect<1>().to.equal<1 | 2>().fail
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
24
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
23
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
24
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=equal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAClD;;;;;;;;;;;;;;;;;;OAkBG;IACH,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAClD;;;;;;;;;;;;;;;;;;OAkBG;IACH,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACvE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CAC5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"","sourcesContent":["import type { MutuallyAssignable, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Equal<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type is mutually assignable with the provided type U.\n *\n * It's like:\n *\n * ```ts ignore\n * [T] extends [U] ? [U] extends [T] ? Yes : No : No\n * ```\n *\n * @template U The type to compare with\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<{ a: 1; b: 2 }>().to.equal<{ a: 1 } & { b: 2 }>().pass\n * expect<1>().to.equal<1 | 2>().fail\n * ```\n */\n <U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../../../src/main/expect/to/equal.ts"],"names":[],"mappings":"","sourcesContent":["import type { MutuallyAssignable, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Equal<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type is mutually assignable with the provided type U.\n *\n * It's like:\n *\n * ```ts ignore\n * [T] extends [U] ? [U] extends [T] ? Yes : No : No\n * ```\n *\n * @template U The type to compare with\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<{ a: 1; b: 2 }>().to.equal<{ a: 1 } & { b: 2 }>().pass\n * expect<1>().to.equal<1 | 2>().fail\n * ```\n */\n <const U>(): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, MutuallyAssignable<T, U>>>\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Extends, If, Xor } from '../../../utils/index.js';
|
|
2
|
-
import type { TypeAssertionResult } from '../index.js';
|
|
2
|
+
import type { ExpectType, TypeAssertionResult } from '../index.js';
|
|
3
3
|
export type Extend<T, Inv extends boolean = false> = {
|
|
4
4
|
/**
|
|
5
5
|
* Tests if the current type T extends the provided type U.
|
|
@@ -15,17 +15,11 @@ export type Extend<T, Inv extends boolean = false> = {
|
|
|
15
15
|
* expect<'hello'>().to.extend<string>().pass
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
19
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
20
|
-
} &
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
bigint: void;
|
|
24
|
-
}, {}> & If<Xor<Inv, Extends<T, string>>, {
|
|
25
|
-
string: void;
|
|
26
|
-
}, {}> & If<Xor<Inv, Extends<T, boolean>>, {
|
|
27
|
-
boolean: void;
|
|
28
|
-
}, {}> & If<Xor<Inv, Extends<T, symbol>>, {
|
|
29
|
-
symbol: void;
|
|
18
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
19
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>;
|
|
20
|
+
} & Special<T, Inv, number, 'number'> & Special<T, Inv, bigint, 'bigint'> & Special<T, Inv, string, 'string'> & Special<T, Inv, boolean, 'boolean'> & Special<T, Inv, symbol, 'symbol'>;
|
|
21
|
+
type Special<T, Inv extends boolean, U, Key extends PropertyKey> = If<Xor<Inv, Extends<T, U>>, {
|
|
22
|
+
[_ in Key]: ExpectType<T>;
|
|
30
23
|
}, {}>;
|
|
24
|
+
export {};
|
|
31
25
|
//# sourceMappingURL=extend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAElE,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAC7C;IACA;;;;;;;;;;;;;OAaG;IACH,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CACjE,GACC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,GACjC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,GACnC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;AAErC,KAAK,OAAO,CACV,CAAC,EACD,GAAG,SAAS,OAAO,EACnB,CAAC,EACD,GAAG,SAAS,WAAW,IACrB,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KAAG,CAAC,IAAI,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;CAAE,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, If, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type Extend<T, Inv extends boolean = false> =\n & {\n /**\n * Tests if the current type T extends the provided type U.\n *\n * @template U The type to check extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * expect<'hello'>().to.extend<string>().pass\n * ```\n */\n <U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n }\n &
|
|
1
|
+
{"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../../src/main/expect/to/extend.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, If, Xor } from '../../../utils/index.js'\nimport type { ExpectType, TypeAssertionResult } from '../index.js'\n\nexport type Extend<T, Inv extends boolean = false> =\n & {\n /**\n * Tests if the current type T extends the provided type U.\n *\n * @template U The type to check extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * expect<'hello'>().to.extend<string>().pass\n * ```\n */\n <const U>(): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, Extends<T, U>>>\n }\n & Special<T, Inv, number, 'number'>\n & Special<T, Inv, bigint, 'bigint'>\n & Special<T, Inv, string, 'string'>\n & Special<T, Inv, boolean, 'boolean'>\n & Special<T, Inv, symbol, 'symbol'>\n\ntype Special<\n T,\n Inv extends boolean,\n U,\n Key extends PropertyKey,\n> = If<Xor<Inv, Extends<T, U>>, { [_ in Key]: ExpectType<T> }, {}>\n"]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Extends, IfTupleIncludes, Xor } from '../../../utils/index.js';
|
|
2
2
|
import type { TypeAssertionResult } from '../index.js';
|
|
3
|
-
type Result<T, K extends PropertyKey, Inv extends boolean = false> = IfTupleIncludes<[
|
|
4
|
-
never,
|
|
5
|
-
any
|
|
6
|
-
], K, never, TypeAssertionResult<T, Xor<Inv, Extends<K, keyof T>>>>;
|
|
7
3
|
export type HaveKey<T, Inv extends boolean = false> = {
|
|
8
4
|
/**
|
|
9
5
|
* Tests if the current type `T` has a property with key `K`.
|
|
@@ -31,8 +27,12 @@ export type HaveKey<T, Inv extends boolean = false> = {
|
|
|
31
27
|
* expect<WithProp>().to.haveKey<'may' | 'unexist'>().fail
|
|
32
28
|
* ```
|
|
33
29
|
*/
|
|
34
|
-
<K extends PropertyKey>(): Result<T, K, Inv>;
|
|
35
|
-
<K extends PropertyKey>(_: K): Result<T, K, Inv>;
|
|
30
|
+
<const K extends PropertyKey>(): Result<T, K, Inv>;
|
|
31
|
+
<const K extends PropertyKey>(_: K): Result<T, K, Inv>;
|
|
36
32
|
};
|
|
33
|
+
type Result<T, K extends PropertyKey, Inv extends boolean = false> = IfTupleIncludes<[
|
|
34
|
+
never,
|
|
35
|
+
any
|
|
36
|
+
], K, never, TypeAssertionResult<T, Xor<Inv, Extends<K, keyof T>>>>;
|
|
37
37
|
export {};
|
|
38
38
|
//# sourceMappingURL=have-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"have-key.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,
|
|
1
|
+
{"version":3,"file":"have-key.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IACpD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;IAClD,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;CACvD,CAAA;AAED,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI,eAAe,CAClF;IAAC,KAAK;IAAE,GAAG;CAAC,EACZ,CAAC,EACD,KAAK,EACL,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CACtD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"have-key.js","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, IfTupleIncludes, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\
|
|
1
|
+
{"version":3,"file":"have-key.js","sourceRoot":"","sources":["../../../../src/main/expect/to/have-key.ts"],"names":[],"mappings":"","sourcesContent":["import type { Extends, IfTupleIncludes, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type HaveKey<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type `T` has a property with key `K`.\n *\n * @template K The property key to check for\n *\n * ### Behavior\n *\n * - For single keys: succeeds if the key exists in `T`\n * - For union types: succeeds only if **all** keys in the union exist in `T`\n *\n * ### Examples\n *\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * type WithProp = { prop: string; another: number; may?: 5 }\n *\n * // Single key checks\n * expect<WithProp>().to.haveKey<'prop'>().pass\n * expect<WithProp>().to.haveKey<'missing'>().fail\n *\n * // Union type checks\n * expect<WithProp>().to.haveKey<'prop' | 'another'>().pass\n * expect<WithProp>().to.haveKey<'may' | 'unexist'>().fail\n * ```\n */\n <const K extends PropertyKey>(): Result<T, K, Inv>\n <const K extends PropertyKey>(_: K): Result<T, K, Inv>\n}\n\ntype Result<T, K extends PropertyKey, Inv extends boolean = false> = IfTupleIncludes<\n [never, any],\n K,\n never,\n TypeAssertionResult<T, Xor<Inv, Extends<K, keyof T>>>\n>\n"]}
|
|
@@ -15,7 +15,7 @@ export type ProperExtends<T, Inv extends boolean = false> = {
|
|
|
15
15
|
* expect<number>().to.properExtend<number>().fail
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
<U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
19
|
-
<U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
18
|
+
<const U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
19
|
+
<const U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>;
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=proper-extends.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proper-extends.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAC1D;;;;;;;;;;;;;OAaG;IACH,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"proper-extends.d.ts","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,GAAG,SAAS,OAAO,GAAG,KAAK,IAAI;IAC1D;;;;;;;;;;;;;OAaG;IACH,CAAC,KAAK,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACjE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;CACtE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proper-extends.js","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"","sourcesContent":["import type { ProperExtend, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type ProperExtends<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type T properly extends the provided type U (extends but is not the same).\n *\n * @template U The type to check proper extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<2>().to.properExtend<number>().pass\n * expect<'a' | 'b'>().to.properExtend<string>().pass\n * expect<number>().to.properExtend<number>().fail\n * ```\n */\n <U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n <U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"proper-extends.js","sourceRoot":"","sources":["../../../../src/main/expect/to/proper-extends.ts"],"names":[],"mappings":"","sourcesContent":["import type { ProperExtend, Xor } from '../../../utils/index.js'\nimport type { TypeAssertionResult } from '../index.js'\n\nexport type ProperExtends<T, Inv extends boolean = false> = {\n /**\n * Tests if the current type T properly extends the provided type U (extends but is not the same).\n *\n * @template U The type to check proper extension against\n *\n * @example\n * ```ts\n * import { expect } from '@leawind/lay-sing'\n *\n * expect<2>().to.properExtend<number>().pass\n * expect<'a' | 'b'>().to.properExtend<string>().pass\n * expect<number>().to.properExtend<number>().fail\n * ```\n */\n <const U>(): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n <const U>(_: U): TypeAssertionResult<T, Xor<Inv, ProperExtend<T, U>>>\n}\n"]}
|
package/script/main/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,KAAK,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;CACxB,CAAA"}
|
package/script/main/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,uCAAgC;AAGhC,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAEb;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,MAAM,GAGf,cAAI,CAAA","sourcesContent":["/**\n * [Full API documentation is available on JSR](https://jsr.io/@leawind/lay-sing/doc)\n *\n * @module\n */\n\nimport type { ExpectType } from './expect/index.js'\nimport { NOOP } from './noop.js'\n\nexport type { ExpectType } from './expect/index.js'\nexport { NOOP } from './noop.js'\n\n/**\n * Creates an instance of ExpectType to perform type-level assertions on the given type.\n * This function enables testing various type relationships at compile time.\n * NOTE: This function does nothing at runtime and is purely for type-level testing.\n *\n * @template T The type to be tested\n *\n * @returns An ExpectType instance with methods to test type relationships\n *\n * @example\n * ```ts\n * // Test exact type equality\n * expect<number>().to.be<number>().pass\n * expect<number>().to.be<string>().fail\n * // Test if one type extends another\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * ```\n */\nexport const expect: {\n <T>(): ExpectType<T>\n <T>(_: T): ExpectType<T>\n} = NOOP\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,uCAAgC;AAGhC,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAEb;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,MAAM,GAGf,cAAI,CAAA","sourcesContent":["/**\n * [Full API documentation is available on JSR](https://jsr.io/@leawind/lay-sing/doc)\n *\n * @module\n */\n\nimport type { ExpectType } from './expect/index.js'\nimport { NOOP } from './noop.js'\n\nexport type { ExpectType } from './expect/index.js'\nexport { NOOP } from './noop.js'\n\n/**\n * Creates an instance of ExpectType to perform type-level assertions on the given type.\n * This function enables testing various type relationships at compile time.\n * NOTE: This function does nothing at runtime and is purely for type-level testing.\n *\n * @template T The type to be tested\n *\n * @returns An ExpectType instance with methods to test type relationships\n *\n * @example\n * ```ts\n * // Test exact type equality\n * expect<number>().to.be<number>().pass\n * expect<number>().to.be<string>().fail\n * // Test if one type extends another\n * expect<3.14>().to.extend<number>().pass\n * expect<2>().to.extend<string>().fail\n * ```\n */\nexport const expect: {\n <const T>(): ExpectType<T>\n <const T>(_: T): ExpectType<T>\n} = NOOP\n"]}
|