document-ir 0.0.6 → 0.0.8
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/README.md +2 -13
- package/esm/WhitespaceStretchingTransformer.d.ts +2 -2
- package/esm/WhitespaceStretchingTransformer.js +17 -15
- package/esm/WhitespaceTransformer.js +7 -7
- package/package.json +2 -7
- package/script/WhitespaceStretchingTransformer.d.ts +2 -2
- package/script/WhitespaceStretchingTransformer.js +17 -15
- package/script/WhitespaceTransformer.js +7 -7
- package/esm/ArrayCollapseTransformer_test.d.ts +0 -1
- package/esm/ExampleDocument.d.ts +0 -2
- package/esm/IdentityTransformer_test.d.ts +0 -1
- package/esm/TextCollapseTransformer_test.d.ts +0 -1
- package/esm/TextVisitor_test.d.ts +0 -1
- package/esm/WhitespaceStretchingTransformer_test.d.ts +0 -1
- package/esm/WhitespaceTransformer_test.d.ts +0 -1
- package/esm/_dnt.test_shims.d.ts +0 -5
- package/esm/deps/deno.land/std@0.192.0/fmt/colors.d.ts +0 -270
- package/esm/deps/deno.land/std@0.192.0/testing/_diff.d.ts +0 -26
- package/esm/deps/deno.land/std@0.192.0/testing/_format.d.ts +0 -1
- package/esm/deps/deno.land/std@0.192.0/testing/asserts.d.ts +0 -284
- package/script/ArrayCollapseTransformer_test.d.ts +0 -1
- package/script/ExampleDocument.d.ts +0 -2
- package/script/IdentityTransformer_test.d.ts +0 -1
- package/script/TextCollapseTransformer_test.d.ts +0 -1
- package/script/TextVisitor_test.d.ts +0 -1
- package/script/WhitespaceStretchingTransformer_test.d.ts +0 -1
- package/script/WhitespaceTransformer_test.d.ts +0 -1
- package/script/_dnt.test_shims.d.ts +0 -5
- package/script/deps/deno.land/std@0.192.0/fmt/colors.d.ts +0 -270
- package/script/deps/deno.land/std@0.192.0/testing/_diff.d.ts +0 -26
- package/script/deps/deno.land/std@0.192.0/testing/_format.d.ts +0 -1
- package/script/deps/deno.land/std@0.192.0/testing/asserts.d.ts +0 -284
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
export declare class AssertionError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
constructor(message: string);
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Deep equality comparison used in assertions
|
|
7
|
-
* @param c actual value
|
|
8
|
-
* @param d expected value
|
|
9
|
-
*/
|
|
10
|
-
export declare function equal(c: unknown, d: unknown): boolean;
|
|
11
|
-
/** Make an assertion, error will be thrown if `expr` does not have truthy value. */
|
|
12
|
-
export declare function assert(expr: unknown, msg?: string): asserts expr;
|
|
13
|
-
/** Make an assertion, error will be thrown if `expr` have truthy value. */
|
|
14
|
-
type Falsy = false | 0 | 0n | "" | null | undefined;
|
|
15
|
-
export declare function assertFalse(expr: unknown, msg?: string): asserts expr is Falsy;
|
|
16
|
-
/**
|
|
17
|
-
* Make an assertion that `actual` and `expected` are equal, deeply. If not
|
|
18
|
-
* deeply equal, then throw.
|
|
19
|
-
*
|
|
20
|
-
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* import { assertEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
25
|
-
*
|
|
26
|
-
* Deno.test("example", function (): void {
|
|
27
|
-
* assertEquals("world", "world");
|
|
28
|
-
* assertEquals({ hello: "world" }, { hello: "world" });
|
|
29
|
-
* });
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function assertEquals<T>(actual: T, expected: T, msg?: string): void;
|
|
33
|
-
/**
|
|
34
|
-
* Make an assertion that `actual` and `expected` are not equal, deeply.
|
|
35
|
-
* If not then throw.
|
|
36
|
-
*
|
|
37
|
-
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* import { assertNotEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
42
|
-
*
|
|
43
|
-
* assertNotEquals<number>(1, 2)
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function assertNotEquals<T>(actual: T, expected: T, msg?: string): void;
|
|
47
|
-
/**
|
|
48
|
-
* Make an assertion that `actual` and `expected` are strictly equal. If
|
|
49
|
-
* not then throw.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { assertStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
54
|
-
*
|
|
55
|
-
* Deno.test("isStrictlyEqual", function (): void {
|
|
56
|
-
* const a = {};
|
|
57
|
-
* const b = a;
|
|
58
|
-
* assertStrictEquals(a, b);
|
|
59
|
-
* });
|
|
60
|
-
*
|
|
61
|
-
* // This test fails
|
|
62
|
-
* Deno.test("isNotStrictlyEqual", function (): void {
|
|
63
|
-
* const a = {};
|
|
64
|
-
* const b = {};
|
|
65
|
-
* assertStrictEquals(a, b);
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare function assertStrictEquals<T>(actual: unknown, expected: T, msg?: string): asserts actual is T;
|
|
70
|
-
/**
|
|
71
|
-
* Make an assertion that `actual` and `expected` are not strictly equal.
|
|
72
|
-
* If the values are strictly equal then throw.
|
|
73
|
-
*
|
|
74
|
-
* ```ts
|
|
75
|
-
* import { assertNotStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
76
|
-
*
|
|
77
|
-
* assertNotStrictEquals(1, 1)
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
export declare function assertNotStrictEquals<T>(actual: T, expected: T, msg?: string): void;
|
|
81
|
-
/**
|
|
82
|
-
* Make an assertion that `actual` and `expected` are almost equal numbers through
|
|
83
|
-
* a given tolerance. It can be used to take into account IEEE-754 double-precision
|
|
84
|
-
* floating-point representation limitations.
|
|
85
|
-
* If the values are not almost equal then throw.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```ts
|
|
89
|
-
* import { assertAlmostEquals, assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
90
|
-
*
|
|
91
|
-
* assertAlmostEquals(0.1, 0.2);
|
|
92
|
-
*
|
|
93
|
-
* // Using a custom tolerance value
|
|
94
|
-
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16);
|
|
95
|
-
* assertThrows(() => assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17));
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
export declare function assertAlmostEquals(actual: number, expected: number, tolerance?: number, msg?: string): void;
|
|
99
|
-
type AnyConstructor = new (...args: any[]) => any;
|
|
100
|
-
type GetConstructorType<T extends AnyConstructor> = T extends new (...args: any) => infer C ? C : never;
|
|
101
|
-
/**
|
|
102
|
-
* Make an assertion that `obj` is an instance of `type`.
|
|
103
|
-
* If not then throw.
|
|
104
|
-
*/
|
|
105
|
-
export declare function assertInstanceOf<T extends AnyConstructor>(actual: unknown, expectedType: T, msg?: string): asserts actual is GetConstructorType<T>;
|
|
106
|
-
/**
|
|
107
|
-
* Make an assertion that `obj` is not an instance of `type`.
|
|
108
|
-
* If so, then throw.
|
|
109
|
-
*/
|
|
110
|
-
export declare function assertNotInstanceOf<A, T>(actual: A, unexpectedType: new (...args: any[]) => T, msg?: string): asserts actual is Exclude<A, T>;
|
|
111
|
-
/**
|
|
112
|
-
* Make an assertion that actual is not null or undefined.
|
|
113
|
-
* If not then throw.
|
|
114
|
-
*/
|
|
115
|
-
export declare function assertExists<T>(actual: T, msg?: string): asserts actual is NonNullable<T>;
|
|
116
|
-
/**
|
|
117
|
-
* Make an assertion that actual includes expected. If not
|
|
118
|
-
* then throw.
|
|
119
|
-
*/
|
|
120
|
-
export declare function assertStringIncludes(actual: string, expected: string, msg?: string): void;
|
|
121
|
-
/**
|
|
122
|
-
* Make an assertion that `actual` includes the `expected` values.
|
|
123
|
-
* If not then an error will be thrown.
|
|
124
|
-
*
|
|
125
|
-
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```ts
|
|
129
|
-
* import { assertArrayIncludes } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
130
|
-
*
|
|
131
|
-
* assertArrayIncludes<number>([1, 2], [2])
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
export declare function assertArrayIncludes<T>(actual: ArrayLike<T>, expected: ArrayLike<T>, msg?: string): void;
|
|
135
|
-
/**
|
|
136
|
-
* Make an assertion that `actual` match RegExp `expected`. If not
|
|
137
|
-
* then throw.
|
|
138
|
-
*/
|
|
139
|
-
export declare function assertMatch(actual: string, expected: RegExp, msg?: string): void;
|
|
140
|
-
/**
|
|
141
|
-
* Make an assertion that `actual` not match RegExp `expected`. If match
|
|
142
|
-
* then throw.
|
|
143
|
-
*/
|
|
144
|
-
export declare function assertNotMatch(actual: string, expected: RegExp, msg?: string): void;
|
|
145
|
-
/**
|
|
146
|
-
* Make an assertion that `actual` object is a subset of `expected` object, deeply.
|
|
147
|
-
* If not, then throw.
|
|
148
|
-
*/
|
|
149
|
-
export declare function assertObjectMatch(actual: Record<PropertyKey, any>, expected: Record<PropertyKey, unknown>, msg?: string): void;
|
|
150
|
-
/**
|
|
151
|
-
* Forcefully throws a failed assertion
|
|
152
|
-
*/
|
|
153
|
-
export declare function fail(msg?: string): never;
|
|
154
|
-
/**
|
|
155
|
-
* Make an assertion that `error` is an `Error`.
|
|
156
|
-
* If not then an error will be thrown.
|
|
157
|
-
* An error class and a string that should be included in the
|
|
158
|
-
* error message can also be asserted.
|
|
159
|
-
*/
|
|
160
|
-
export declare function assertIsError<E extends Error = Error>(error: unknown, ErrorClass?: new (...args: any[]) => E, msgIncludes?: string, msg?: string): asserts error is E;
|
|
161
|
-
/**
|
|
162
|
-
* Executes a function, expecting it to throw. If it does not, then it
|
|
163
|
-
* throws.
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```ts
|
|
167
|
-
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
168
|
-
*
|
|
169
|
-
* Deno.test("doesThrow", function (): void {
|
|
170
|
-
* assertThrows((): void => {
|
|
171
|
-
* throw new TypeError("hello world!");
|
|
172
|
-
* });
|
|
173
|
-
* });
|
|
174
|
-
*
|
|
175
|
-
* // This test will not pass.
|
|
176
|
-
* Deno.test("fails", function (): void {
|
|
177
|
-
* assertThrows((): void => {
|
|
178
|
-
* console.log("Hello world");
|
|
179
|
-
* });
|
|
180
|
-
* });
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
export declare function assertThrows(fn: () => unknown, msg?: string): unknown;
|
|
184
|
-
/**
|
|
185
|
-
* Executes a function, expecting it to throw. If it does not, then it
|
|
186
|
-
* throws. An error class and a string that should be included in the
|
|
187
|
-
* error message can also be asserted.
|
|
188
|
-
*
|
|
189
|
-
* @example
|
|
190
|
-
*
|
|
191
|
-
* ```ts
|
|
192
|
-
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
193
|
-
*
|
|
194
|
-
* Deno.test("doesThrow", function (): void {
|
|
195
|
-
* assertThrows((): void => {
|
|
196
|
-
* throw new TypeError("hello world!");
|
|
197
|
-
* }, TypeError);
|
|
198
|
-
* assertThrows(
|
|
199
|
-
* (): void => {
|
|
200
|
-
* throw new TypeError("hello world!");
|
|
201
|
-
* },
|
|
202
|
-
* TypeError,
|
|
203
|
-
* "hello",
|
|
204
|
-
* );
|
|
205
|
-
* });
|
|
206
|
-
*
|
|
207
|
-
* // This test will not pass.
|
|
208
|
-
* Deno.test("fails", function (): void {
|
|
209
|
-
* assertThrows((): void => {
|
|
210
|
-
* console.log("Hello world");
|
|
211
|
-
* });
|
|
212
|
-
* });
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
215
|
-
export declare function assertThrows<E extends Error = Error>(fn: () => unknown, ErrorClass: new (...args: any[]) => E, msgIncludes?: string, msg?: string): E;
|
|
216
|
-
/**
|
|
217
|
-
* Executes a function which returns a promise, expecting it to reject.
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* ```ts
|
|
221
|
-
* import { assertRejects } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
222
|
-
*
|
|
223
|
-
* Deno.test("doesThrow", async function () {
|
|
224
|
-
* await assertRejects(
|
|
225
|
-
* async () => {
|
|
226
|
-
* throw new TypeError("hello world!");
|
|
227
|
-
* },
|
|
228
|
-
* );
|
|
229
|
-
* await assertRejects(
|
|
230
|
-
* async () => {
|
|
231
|
-
* return Promise.reject(new Error());
|
|
232
|
-
* },
|
|
233
|
-
* );
|
|
234
|
-
* });
|
|
235
|
-
*
|
|
236
|
-
* // This test will not pass.
|
|
237
|
-
* Deno.test("fails", async function () {
|
|
238
|
-
* await assertRejects(
|
|
239
|
-
* async () => {
|
|
240
|
-
* console.log("Hello world");
|
|
241
|
-
* },
|
|
242
|
-
* );
|
|
243
|
-
* });
|
|
244
|
-
* ```
|
|
245
|
-
*/
|
|
246
|
-
export declare function assertRejects(fn: () => PromiseLike<unknown>, msg?: string): Promise<unknown>;
|
|
247
|
-
/**
|
|
248
|
-
* Executes a function which returns a promise, expecting it to reject.
|
|
249
|
-
* If it does not, then it throws. An error class and a string that should be
|
|
250
|
-
* included in the error message can also be asserted.
|
|
251
|
-
*
|
|
252
|
-
* @example
|
|
253
|
-
* ```ts
|
|
254
|
-
* import { assertRejects } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
255
|
-
*
|
|
256
|
-
* Deno.test("doesThrow", async function () {
|
|
257
|
-
* await assertRejects(async () => {
|
|
258
|
-
* throw new TypeError("hello world!");
|
|
259
|
-
* }, TypeError);
|
|
260
|
-
* await assertRejects(
|
|
261
|
-
* async () => {
|
|
262
|
-
* throw new TypeError("hello world!");
|
|
263
|
-
* },
|
|
264
|
-
* TypeError,
|
|
265
|
-
* "hello",
|
|
266
|
-
* );
|
|
267
|
-
* });
|
|
268
|
-
*
|
|
269
|
-
* // This test will not pass.
|
|
270
|
-
* Deno.test("fails", async function () {
|
|
271
|
-
* await assertRejects(
|
|
272
|
-
* async () => {
|
|
273
|
-
* console.log("Hello world");
|
|
274
|
-
* },
|
|
275
|
-
* );
|
|
276
|
-
* });
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
279
|
-
export declare function assertRejects<E extends Error = Error>(fn: () => PromiseLike<unknown>, ErrorClass: new (...args: any[]) => E, msgIncludes?: string, msg?: string): Promise<E>;
|
|
280
|
-
/** Use this to stub out methods that will throw when invoked. */
|
|
281
|
-
export declare function unimplemented(msg?: string): never;
|
|
282
|
-
/** Use this to assert unreachable code. */
|
|
283
|
-
export declare function unreachable(): never;
|
|
284
|
-
export {};
|