@signpostmarv/ts-assert 0.1.1 → 0.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/generated/assertions.js +258 -258
- package/lib/main.d.ts +11 -3
- package/lib/main.js +10 -1
- package/package.json +1 -1
- package/generated/assertions.js.map +0 -1
- package/generated/assertions.ts +0 -2328
- package/lib/main.js.map +0 -1
- package/lib/main.ts +0 -39
package/lib/main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EACjB,YAAY,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAKN,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,gBAAgB,CAC/B,IAAS,EACT,IAAY,EACZ,OAAqB;IAErB,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5B,MAAM,CAAC,KAAK,CACX,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,EAC7D,OAAO,CACP,CAAC;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CACtC,KAAU,EACV,aAA4B,EAC5B,OAAqB;IAErB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/C,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,eAAe;IACd,GAAG,SAAS;IACZ,gBAAgB;IAChB,uBAAuB;CACvB,CAAC"}
|
package/lib/main.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import generated, {
|
|
2
|
-
isExpression,
|
|
3
|
-
} from '../generated/assertions';
|
|
4
|
-
import assert from 'node:assert/strict';
|
|
5
|
-
import ts, {
|
|
6
|
-
FalseLiteral,
|
|
7
|
-
Node,
|
|
8
|
-
TrueLiteral,
|
|
9
|
-
TypeNode,
|
|
10
|
-
} from 'typescript';
|
|
11
|
-
|
|
12
|
-
export function isBooleanLiteral(
|
|
13
|
-
node:Node,
|
|
14
|
-
type:boolean,
|
|
15
|
-
message?:string|Error
|
|
16
|
-
): asserts node is typeof type extends true ? TrueLiteral : FalseLiteral {
|
|
17
|
-
isExpression(node, message);
|
|
18
|
-
assert.equal(
|
|
19
|
-
node.kind,
|
|
20
|
-
type ? ts.SyntaxKind.TrueKeyword : ts.SyntaxKind.FalseKeyword,
|
|
21
|
-
message
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function isTokenWithExpectedKind(
|
|
26
|
-
maybe:Node,
|
|
27
|
-
expected_kind: ts.SyntaxKind,
|
|
28
|
-
message?:string|Error
|
|
29
|
-
): asserts maybe is TypeNode & {kind: typeof expected_kind} {
|
|
30
|
-
assert.equal(ts.isToken(maybe), true, message);
|
|
31
|
-
assert.equal(ts.isTokenKind(maybe.kind), true, message);
|
|
32
|
-
assert.equal(maybe.kind, expected_kind, message);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default {
|
|
36
|
-
...generated,
|
|
37
|
-
isBooleanLiteral,
|
|
38
|
-
isTokenWithExpectedKind,
|
|
39
|
-
};
|