hein 0.0.1 → 1.0.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/CHANGELOG.md +30 -0
- package/README.md +31 -4
- package/dist/.tsbuildinfo +1 -0
- package/dist/assert/deep-equal.d.ts +2 -0
- package/dist/assert/deep-equal.d.ts.map +1 -0
- package/dist/assert/{eql.js → deep-equal.js} +9 -7
- package/dist/assert/deep-equal.js.map +1 -0
- package/dist/assert/deep-equal.test.d.ts +2 -0
- package/dist/assert/deep-equal.test.d.ts.map +1 -0
- package/dist/assert/deep-equal.test.js +114 -0
- package/dist/assert/deep-equal.test.js.map +1 -0
- package/dist/assert/deep-has-property.d.ts +2 -0
- package/dist/assert/deep-has-property.d.ts.map +1 -0
- package/dist/assert/deep-has-property.js +30 -0
- package/dist/assert/deep-has-property.js.map +1 -0
- package/dist/assert/deep-has-property.test.d.ts +2 -0
- package/dist/assert/deep-has-property.test.d.ts.map +1 -0
- package/dist/assert/deep-has-property.test.js +40 -0
- package/dist/assert/deep-has-property.test.js.map +1 -0
- package/dist/assert/equal.js +2 -2
- package/dist/assert/equal.js.map +1 -1
- package/dist/assert/equal.test.d.ts +2 -0
- package/dist/assert/equal.test.d.ts.map +1 -0
- package/dist/assert/equal.test.js +57 -0
- package/dist/assert/equal.test.js.map +1 -0
- package/dist/assert/greater-than-equal.js +2 -2
- package/dist/assert/greater-than-equal.js.map +1 -1
- package/dist/assert/greater-than-equal.test.d.ts +2 -0
- package/dist/assert/greater-than-equal.test.d.ts.map +1 -0
- package/dist/assert/greater-than-equal.test.js +17 -0
- package/dist/assert/greater-than-equal.test.js.map +1 -0
- package/dist/assert/greater-than.js +2 -2
- package/dist/assert/greater-than.js.map +1 -1
- package/dist/assert/greater-than.test.d.ts +2 -0
- package/dist/assert/greater-than.test.d.ts.map +1 -0
- package/dist/assert/greater-than.test.js +31 -0
- package/dist/assert/greater-than.test.js.map +1 -0
- package/dist/assert/has-property.d.ts +2 -0
- package/dist/assert/has-property.d.ts.map +1 -0
- package/dist/assert/has-property.js +28 -0
- package/dist/assert/has-property.js.map +1 -0
- package/dist/assert/has-property.test.d.ts +2 -0
- package/dist/assert/has-property.test.d.ts.map +1 -0
- package/dist/assert/has-property.test.js +40 -0
- package/dist/assert/has-property.test.js.map +1 -0
- package/dist/assert/has-size.js +2 -2
- package/dist/assert/has-size.js.map +1 -1
- package/dist/assert/has-size.test.d.ts +2 -0
- package/dist/assert/has-size.test.d.ts.map +1 -0
- package/dist/assert/has-size.test.js +137 -0
- package/dist/assert/has-size.test.js.map +1 -0
- package/dist/assert/includes.d.ts +7 -0
- package/dist/assert/includes.d.ts.map +1 -0
- package/dist/assert/includes.js +32 -0
- package/dist/assert/includes.js.map +1 -0
- package/dist/assert/includes.test.d.ts +2 -0
- package/dist/assert/includes.test.d.ts.map +1 -0
- package/dist/assert/includes.test.js +45 -0
- package/dist/assert/includes.test.js.map +1 -0
- package/dist/assert/instance-of.js +3 -3
- package/dist/assert/instance-of.js.map +1 -1
- package/dist/assert/instance-of.test.d.ts +2 -0
- package/dist/assert/instance-of.test.d.ts.map +1 -0
- package/dist/assert/instance-of.test.js +24 -0
- package/dist/assert/instance-of.test.js.map +1 -0
- package/dist/assert/is-empty.js +2 -2
- package/dist/assert/is-empty.js.map +1 -1
- package/dist/assert/is-empty.test.d.ts +2 -0
- package/dist/assert/is-empty.test.d.ts.map +1 -0
- package/dist/assert/is-empty.test.js +76 -0
- package/dist/assert/is-empty.test.js.map +1 -0
- package/dist/assert/is-type.js +2 -2
- package/dist/assert/is-type.js.map +1 -1
- package/dist/assert/is-type.test.d.ts +2 -0
- package/dist/assert/is-type.test.d.ts.map +1 -0
- package/dist/assert/is-type.test.js +36 -0
- package/dist/assert/is-type.test.js.map +1 -0
- package/dist/assert/less-than-equal.js +2 -2
- package/dist/assert/less-than-equal.js.map +1 -1
- package/dist/assert/less-than-equal.test.d.ts +2 -0
- package/dist/assert/less-than-equal.test.d.ts.map +1 -0
- package/dist/assert/less-than-equal.test.js +51 -0
- package/dist/assert/less-than-equal.test.js.map +1 -0
- package/dist/assert/less-than.js +2 -2
- package/dist/assert/less-than.js.map +1 -1
- package/dist/assert/less-than.test.d.ts +2 -0
- package/dist/assert/less-than.test.d.ts.map +1 -0
- package/dist/assert/less-than.test.js +28 -0
- package/dist/assert/less-than.test.js.map +1 -0
- package/dist/assert/match.d.ts +2 -0
- package/dist/assert/match.d.ts.map +1 -0
- package/dist/assert/match.js +29 -0
- package/dist/assert/match.js.map +1 -0
- package/dist/assert/match.test.d.ts +2 -0
- package/dist/assert/match.test.d.ts.map +1 -0
- package/dist/assert/match.test.js +24 -0
- package/dist/assert/match.test.js.map +1 -0
- package/dist/assert/rejects.js +2 -2
- package/dist/assert/rejects.js.map +1 -1
- package/dist/assert/rejects.test.d.ts +2 -0
- package/dist/assert/rejects.test.d.ts.map +1 -0
- package/dist/assert/rejects.test.js +101 -0
- package/dist/assert/rejects.test.js.map +1 -0
- package/dist/assert/throws.js +3 -3
- package/dist/assert/throws.js.map +1 -1
- package/dist/assert/throws.test.d.ts +2 -0
- package/dist/assert/throws.test.d.ts.map +1 -0
- package/dist/assert/throws.test.js +154 -0
- package/dist/assert/throws.test.js.map +1 -0
- package/dist/assert.d.ts +5 -1
- package/dist/assert.d.ts.map +1 -1
- package/dist/assert.js +16 -4
- package/dist/assert.js.map +1 -1
- package/dist/expect/empty.test.d.ts +2 -0
- package/dist/expect/empty.test.d.ts.map +1 -0
- package/dist/expect/empty.test.js +24 -0
- package/dist/expect/empty.test.js.map +1 -0
- package/dist/expect/eql.d.ts +4 -0
- package/dist/expect/eql.d.ts.map +1 -1
- package/dist/expect/eql.js +7 -3
- package/dist/expect/eql.js.map +1 -1
- package/dist/expect/eql.test.d.ts +2 -0
- package/dist/expect/eql.test.d.ts.map +1 -0
- package/dist/expect/eql.test.js +28 -0
- package/dist/expect/eql.test.js.map +1 -0
- package/dist/expect/equal-shorthand.js +3 -3
- package/dist/expect/equal-shorthand.js.map +1 -1
- package/dist/expect/equal-shorthand.test.d.ts +2 -0
- package/dist/expect/equal-shorthand.test.d.ts.map +1 -0
- package/dist/expect/equal-shorthand.test.js +34 -0
- package/dist/expect/equal-shorthand.test.js.map +1 -0
- package/dist/expect/equal.js +10 -1
- package/dist/expect/equal.js.map +1 -1
- package/dist/expect/equal.test.d.ts +2 -0
- package/dist/expect/equal.test.d.ts.map +1 -0
- package/dist/expect/equal.test.js +30 -0
- package/dist/expect/equal.test.js.map +1 -0
- package/dist/expect/greater-than-equal.test.d.ts +2 -0
- package/dist/expect/greater-than-equal.test.d.ts.map +1 -0
- package/dist/expect/greater-than-equal.test.js +24 -0
- package/dist/expect/greater-than-equal.test.js.map +1 -0
- package/dist/expect/greater-than.test.d.ts +2 -0
- package/dist/expect/greater-than.test.d.ts.map +1 -0
- package/dist/expect/greater-than.test.js +24 -0
- package/dist/expect/greater-than.test.js.map +1 -0
- package/dist/expect/has-property.d.ts +7 -0
- package/dist/expect/has-property.d.ts.map +1 -0
- package/dist/expect/has-property.js +22 -0
- package/dist/expect/has-property.js.map +1 -0
- package/dist/expect/has-property.test.d.ts +2 -0
- package/dist/expect/has-property.test.d.ts.map +1 -0
- package/dist/expect/has-property.test.js +39 -0
- package/dist/expect/has-property.test.js.map +1 -0
- package/dist/expect/include.d.ts +25 -0
- package/dist/expect/include.d.ts.map +1 -0
- package/dist/expect/include.js +22 -0
- package/dist/expect/include.js.map +1 -0
- package/dist/expect/include.test.d.ts +2 -0
- package/dist/expect/include.test.d.ts.map +1 -0
- package/dist/expect/include.test.js +33 -0
- package/dist/expect/include.test.js.map +1 -0
- package/dist/expect/instance-of-shorthand.d.ts.map +1 -1
- package/dist/expect/instance-of-shorthand.test.d.ts +2 -0
- package/dist/expect/instance-of-shorthand.test.d.ts.map +1 -0
- package/dist/expect/instance-of-shorthand.test.js +42 -0
- package/dist/expect/instance-of-shorthand.test.js.map +1 -0
- package/dist/expect/instance-of.test.d.ts +2 -0
- package/dist/expect/instance-of.test.d.ts.map +1 -0
- package/dist/expect/instance-of.test.js +24 -0
- package/dist/expect/instance-of.test.js.map +1 -0
- package/dist/expect/length.test.d.ts +2 -0
- package/dist/expect/length.test.d.ts.map +1 -0
- package/dist/expect/length.test.js +24 -0
- package/dist/expect/length.test.js.map +1 -0
- package/dist/expect/less-than-equal.test.d.ts +2 -0
- package/dist/expect/less-than-equal.test.d.ts.map +1 -0
- package/dist/expect/less-than-equal.test.js +26 -0
- package/dist/expect/less-than-equal.test.js.map +1 -0
- package/dist/expect/less-than.test.d.ts +2 -0
- package/dist/expect/less-than.test.d.ts.map +1 -0
- package/dist/expect/less-than.test.js +26 -0
- package/dist/expect/less-than.test.js.map +1 -0
- package/dist/expect/match.d.ts +10 -0
- package/dist/expect/match.d.ts.map +1 -0
- package/dist/expect/match.js +18 -0
- package/dist/expect/match.js.map +1 -0
- package/dist/expect/match.test.d.ts +2 -0
- package/dist/expect/match.test.d.ts.map +1 -0
- package/dist/expect/match.test.js +24 -0
- package/dist/expect/match.test.js.map +1 -0
- package/dist/expect/reject.test.d.ts +2 -0
- package/dist/expect/reject.test.d.ts.map +1 -0
- package/dist/expect/reject.test.js +26 -0
- package/dist/expect/reject.test.js.map +1 -0
- package/dist/expect/throw.test.d.ts +2 -0
- package/dist/expect/throw.test.d.ts.map +1 -0
- package/dist/expect/throw.test.js +31 -0
- package/dist/expect/throw.test.js.map +1 -0
- package/dist/expect/type-shorthand.d.ts.map +1 -1
- package/dist/expect/type-shorthand.test.d.ts +2 -0
- package/dist/expect/type-shorthand.test.d.ts.map +1 -0
- package/dist/expect/type-shorthand.test.js +57 -0
- package/dist/expect/type-shorthand.test.js.map +1 -0
- package/dist/expect/type.test.d.ts +2 -0
- package/dist/expect/type.test.d.ts.map +1 -0
- package/dist/expect/type.test.js +24 -0
- package/dist/expect/type.test.js.map +1 -0
- package/dist/expect.d.ts +3 -0
- package/dist/expect.d.ts.map +1 -1
- package/dist/expect.js +20 -9
- package/dist/expect.js.map +1 -1
- package/dist/expect.test.d.ts +2 -0
- package/dist/expect.test.d.ts.map +1 -0
- package/dist/expect.test.js +19 -0
- package/dist/expect.test.js.map +1 -0
- package/dist/expect.types.d.ts +2 -1
- package/dist/expect.types.d.ts.map +1 -1
- package/dist/expect.types.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/mixins.d.ts +5 -3
- package/dist/mixins.d.ts.map +1 -1
- package/dist/mixins.js.map +1 -1
- package/dist/utils/get-size.test.d.ts +2 -0
- package/dist/utils/get-size.test.d.ts.map +1 -0
- package/dist/utils/get-size.test.js +25 -0
- package/dist/utils/get-size.test.js.map +1 -0
- package/dist/utils/match.test.d.ts +2 -0
- package/dist/utils/match.test.d.ts.map +1 -0
- package/dist/utils/match.test.js +318 -0
- package/dist/utils/match.test.js.map +1 -0
- package/dist/utils/process-error.d.ts +1 -1
- package/dist/utils/process-error.d.ts.map +1 -1
- package/dist/utils/validate-numeric-and-dates.js +2 -2
- package/dist/utils/validate-numeric-and-dates.js.map +1 -1
- package/package.json +26 -15
- package/.eslintrc +0 -167
- package/.mocharc.json +0 -4
- package/.nycrc +0 -16
- package/DIFFERENCES_WITH_CHAI.md +0 -49
- package/dist/assert/eql.d.ts +0 -2
- package/dist/assert/eql.d.ts.map +0 -1
- package/dist/assert/eql.js.map +0 -1
- package/dist/utils/assertion.d.ts +0 -25
- package/dist/utils/assertion.d.ts.map +0 -1
- package/dist/utils/assertion.js +0 -45
- package/dist/utils/assertion.js.map +0 -1
- package/dist/utils/stringify.d.ts +0 -2
- package/dist/utils/stringify.d.ts.map +0 -1
- package/dist/utils/stringify.js +0 -18
- package/dist/utils/stringify.js.map +0 -1
- package/tsconfig.json +0 -19
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const assert_1 = require("../assert");
|
|
4
|
+
class FailError extends Error {
|
|
5
|
+
}
|
|
6
|
+
const fail = () => {
|
|
7
|
+
throw new FailError('Expected function to throw');
|
|
8
|
+
};
|
|
9
|
+
describe('assert/throws', () => {
|
|
10
|
+
it(`should throw if the callback doesn't throw`, () => {
|
|
11
|
+
try {
|
|
12
|
+
(0, assert_1.throws)(() => { });
|
|
13
|
+
fail();
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
it('should not throw if callback throws', () => {
|
|
20
|
+
(0, assert_1.throws)(() => {
|
|
21
|
+
throw new Error('Things are bad');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
it('should throw with provided message', () => {
|
|
25
|
+
try {
|
|
26
|
+
(0, assert_1.throws)(() => { }, 'Things are bad');
|
|
27
|
+
fail();
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error instanceof FailError) {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
if (error.message !== 'Things are bad') {
|
|
34
|
+
throw new Error('Expected message to be "Things are bad"');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
it(`should not throw if error message matches the provided RegExp`, () => {
|
|
39
|
+
(0, assert_1.throws)(() => {
|
|
40
|
+
throw new Error('Things are bad');
|
|
41
|
+
}, /Things are bad/);
|
|
42
|
+
});
|
|
43
|
+
it(`should throw if error message doesn't match the provided RegExp`, () => {
|
|
44
|
+
(0, assert_1.throws)(() => {
|
|
45
|
+
(0, assert_1.throws)(() => {
|
|
46
|
+
throw new Error('Things are bad');
|
|
47
|
+
}, /Things are good/);
|
|
48
|
+
}, /Expected function to throw an error matching \/Things are good\//);
|
|
49
|
+
});
|
|
50
|
+
it(`should throw with the provide message if error message doesn't match the provided RegExp`, () => {
|
|
51
|
+
(0, assert_1.throws)(() => {
|
|
52
|
+
(0, assert_1.throws)(() => {
|
|
53
|
+
throw new Error('Things are bad');
|
|
54
|
+
}, /Things are good/, 'Damn');
|
|
55
|
+
}, /Damn/);
|
|
56
|
+
});
|
|
57
|
+
it(`should throw if error isn't an instance of the provided constructor`, () => {
|
|
58
|
+
class CustomError extends Error {
|
|
59
|
+
}
|
|
60
|
+
(0, assert_1.throws)(() => {
|
|
61
|
+
(0, assert_1.throws)(() => { throw new Error(); }, CustomError);
|
|
62
|
+
}, /Expected function to throw CustomError/);
|
|
63
|
+
});
|
|
64
|
+
it('should not throw if error is an instance of the provided constructor', () => {
|
|
65
|
+
class CustomError extends Error {
|
|
66
|
+
}
|
|
67
|
+
(0, assert_1.throws)(() => { throw new CustomError(); }, CustomError);
|
|
68
|
+
});
|
|
69
|
+
it(`should throw with the provided message if error isn't an instance of the provided constructor`, () => {
|
|
70
|
+
class CustomError extends Error {
|
|
71
|
+
}
|
|
72
|
+
(0, assert_1.throws)(() => {
|
|
73
|
+
(0, assert_1.throws)(() => { throw new Error(); }, CustomError, 'Damn');
|
|
74
|
+
}, /Damn/);
|
|
75
|
+
});
|
|
76
|
+
it('should throw if error predicate function returns false for the thrown error', () => {
|
|
77
|
+
(0, assert_1.throws)(() => {
|
|
78
|
+
(0, assert_1.throws)(() => { throw new Error('oops'); }, () => false);
|
|
79
|
+
}, /Expected Error: oops to match predicate function/);
|
|
80
|
+
});
|
|
81
|
+
it('should not throw if error predicate function returns true for the thrown error', () => {
|
|
82
|
+
(0, assert_1.throws)(() => { throw new Error('oops'); }, () => true);
|
|
83
|
+
});
|
|
84
|
+
it('should throw with the provided message if error predicate function returns false for the thrown error', () => {
|
|
85
|
+
(0, assert_1.throws)(() => {
|
|
86
|
+
(0, assert_1.throws)(() => { throw new Error('oops'); }, () => false, 'Damn');
|
|
87
|
+
}, /Damn/);
|
|
88
|
+
});
|
|
89
|
+
it('should throw if first argument is not a function', () => {
|
|
90
|
+
try {
|
|
91
|
+
(0, assert_1.throws)(1);
|
|
92
|
+
fail();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (error instanceof FailError) {
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
if (error.message !== 'Expected number to be a function') {
|
|
99
|
+
throw new Error(`Expected "${error.message}" to be "Expected number to be a function"`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
describe('assert/notThrows', () => {
|
|
104
|
+
const errorCallback = () => {
|
|
105
|
+
throw new Error('Correct');
|
|
106
|
+
};
|
|
107
|
+
it(`should not throw error if callback doesn't throw`, () => {
|
|
108
|
+
(0, assert_1.notThrows)(() => { });
|
|
109
|
+
});
|
|
110
|
+
it('should throw error if callback throws', () => {
|
|
111
|
+
(0, assert_1.throws)(() => (0, assert_1.notThrows)(errorCallback));
|
|
112
|
+
});
|
|
113
|
+
it('should throw errors with specified message', () => {
|
|
114
|
+
(0, assert_1.throws)(() => (0, assert_1.notThrows)(errorCallback, 'Error happened'), /Error happened/);
|
|
115
|
+
});
|
|
116
|
+
it('should throw when error matches the provided RegExp', () => {
|
|
117
|
+
(0, assert_1.throws)(() => (0, assert_1.notThrows)(errorCallback, /Correct/), /Expected function to not throw/);
|
|
118
|
+
});
|
|
119
|
+
it(`should not throw when error doesn't match the provided RegExp`, () => {
|
|
120
|
+
(0, assert_1.notThrows)(errorCallback, /Incorrect/);
|
|
121
|
+
});
|
|
122
|
+
it('should throw when error matches the provided constructor', () => {
|
|
123
|
+
class CustomError extends Error {
|
|
124
|
+
}
|
|
125
|
+
(0, assert_1.throws)(() => (0, assert_1.notThrows)(() => { throw new CustomError(); }, CustomError), /Expected function to not throw a CustomError/);
|
|
126
|
+
});
|
|
127
|
+
it(`should not throw when error doesn't match the provided constructor`, () => {
|
|
128
|
+
class CustomError extends Error {
|
|
129
|
+
}
|
|
130
|
+
(0, assert_1.notThrows)(() => (0, assert_1.notThrows)(() => { throw new Error(); }, CustomError));
|
|
131
|
+
});
|
|
132
|
+
it('should throw when error matches the provided predicate', () => {
|
|
133
|
+
(0, assert_1.throws)(() => (0, assert_1.notThrows)(() => { throw new Error(); }, () => true), /Expected function to not throw/);
|
|
134
|
+
});
|
|
135
|
+
it(`should not throw when error doesn't match the provided predicate`, () => {
|
|
136
|
+
(0, assert_1.notThrows)(() => { throw new Error(); }, () => false);
|
|
137
|
+
});
|
|
138
|
+
it('should throw if first argument is not a function', () => {
|
|
139
|
+
try {
|
|
140
|
+
(0, assert_1.notThrows)(1);
|
|
141
|
+
fail();
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
if (error instanceof FailError) {
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
if (error.message !== 'Expected number to be a function') {
|
|
148
|
+
throw new Error(`Expected "${error.message}" to be "Expected number to be a function"`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
//# sourceMappingURL=throws.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throws.test.js","sourceRoot":"","sources":["../../src/assert/throws.test.ts"],"names":[],"mappings":";;AAAA,sCAA8C;AAE9C,MAAM,SAAU,SAAQ,KAAK;CAAI;AAEjC,MAAM,IAAI,GAAG,GAAG,EAAE;IACd,MAAM,IAAI,SAAS,CAAC,4BAA4B,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,IAAI;YACA,IAAA,eAAM,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YAClB,IAAI,EAAE,CAAC;SACV;QAAC,WAAM;YACJ,OAAO;SACV;IACL,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC3C,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAA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AE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YACxD,IAAI;gBACA,IAAA,kBAAS,EAAC,CAAQ,CAAC,CAAC;gBACpB,IAAI,EAAE,CAAC;aACV;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,KAAK,YAAY,SAAS,EAAE;oBAC5B,MAAM,KAAK,CAAC;iBACf;gBACD,IAAI,KAAK,CAAC,OAAO,KAAK,kCAAkC,EAAE;oBACtD,MAAM,IAAI,KAAK,CAAC,aAAc,KAAK,CAAC,OAAQ,4CAA4C,CAAC,CAAC;iBAC7F;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist/assert.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { deepEqual, notDeepEqual } from './assert/deep-equal';
|
|
2
2
|
export { equal, notEqual } from './assert/equal';
|
|
3
3
|
export { greaterThan, notGreaterThan } from './assert/greater-than';
|
|
4
4
|
export { greaterThanEqual, notGreaterThanEqual } from './assert/greater-than-equal';
|
|
5
|
+
export { hasProperty, notHasProperty } from './assert/has-property';
|
|
5
6
|
export { hasSize, notHasSize } from './assert/has-size';
|
|
7
|
+
export { includes, notIncludes } from './assert/includes';
|
|
6
8
|
export { instanceOf, notInstanceOf } from './assert/instance-of';
|
|
7
9
|
export { isEmpty, notIsEmpty } from './assert/is-empty';
|
|
8
10
|
export { isType, notIsType } from './assert/is-type';
|
|
9
11
|
export { lessThan, notLessThan } from './assert/less-than';
|
|
10
12
|
export { lessThanEqual, notLessThanEqual } from './assert/less-than-equal';
|
|
13
|
+
export { match, notMatch } from './assert/match';
|
|
11
14
|
export { notRejects, rejects } from './assert/rejects';
|
|
12
15
|
export { notThrows, throws } from './assert/throws';
|
|
16
|
+
export { deepHasProperty, deepNotHasProperty } from './assert/deep-has-property';
|
|
13
17
|
export declare const assert: () => never;
|
|
14
18
|
//# sourceMappingURL=assert.d.ts.map
|
package/dist/assert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,eAAO,MAAM,MAAM,aAElB,CAAC"}
|
package/dist/assert.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assert = exports.throws = exports.notThrows = exports.rejects = exports.notRejects = exports.notLessThanEqual = exports.lessThanEqual = exports.notLessThan = exports.lessThan = exports.notIsType = exports.isType = exports.notIsEmpty = exports.isEmpty = exports.notInstanceOf = exports.instanceOf = exports.notHasSize = exports.hasSize = exports.notGreaterThanEqual = exports.greaterThanEqual = exports.notGreaterThan = exports.greaterThan = exports.notEqual = exports.equal = exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.assert = exports.deepNotHasProperty = exports.deepHasProperty = exports.throws = exports.notThrows = exports.rejects = exports.notRejects = exports.notMatch = exports.match = exports.notLessThanEqual = exports.lessThanEqual = exports.notLessThan = exports.lessThan = exports.notIsType = exports.isType = exports.notIsEmpty = exports.isEmpty = exports.notInstanceOf = exports.instanceOf = exports.notIncludes = exports.includes = exports.notHasSize = exports.hasSize = exports.notHasProperty = exports.hasProperty = exports.notGreaterThanEqual = exports.greaterThanEqual = exports.notGreaterThan = exports.greaterThan = exports.notEqual = exports.equal = exports.notDeepEqual = exports.deepEqual = void 0;
|
|
4
|
+
var deep_equal_1 = require("./assert/deep-equal");
|
|
5
|
+
Object.defineProperty(exports, "deepEqual", { enumerable: true, get: function () { return deep_equal_1.deepEqual; } });
|
|
6
|
+
Object.defineProperty(exports, "notDeepEqual", { enumerable: true, get: function () { return deep_equal_1.notDeepEqual; } });
|
|
7
7
|
var equal_1 = require("./assert/equal");
|
|
8
8
|
Object.defineProperty(exports, "equal", { enumerable: true, get: function () { return equal_1.equal; } });
|
|
9
9
|
Object.defineProperty(exports, "notEqual", { enumerable: true, get: function () { return equal_1.notEqual; } });
|
|
@@ -13,9 +13,15 @@ Object.defineProperty(exports, "notGreaterThan", { enumerable: true, get: functi
|
|
|
13
13
|
var greater_than_equal_1 = require("./assert/greater-than-equal");
|
|
14
14
|
Object.defineProperty(exports, "greaterThanEqual", { enumerable: true, get: function () { return greater_than_equal_1.greaterThanEqual; } });
|
|
15
15
|
Object.defineProperty(exports, "notGreaterThanEqual", { enumerable: true, get: function () { return greater_than_equal_1.notGreaterThanEqual; } });
|
|
16
|
+
var has_property_1 = require("./assert/has-property");
|
|
17
|
+
Object.defineProperty(exports, "hasProperty", { enumerable: true, get: function () { return has_property_1.hasProperty; } });
|
|
18
|
+
Object.defineProperty(exports, "notHasProperty", { enumerable: true, get: function () { return has_property_1.notHasProperty; } });
|
|
16
19
|
var has_size_1 = require("./assert/has-size");
|
|
17
20
|
Object.defineProperty(exports, "hasSize", { enumerable: true, get: function () { return has_size_1.hasSize; } });
|
|
18
21
|
Object.defineProperty(exports, "notHasSize", { enumerable: true, get: function () { return has_size_1.notHasSize; } });
|
|
22
|
+
var includes_1 = require("./assert/includes");
|
|
23
|
+
Object.defineProperty(exports, "includes", { enumerable: true, get: function () { return includes_1.includes; } });
|
|
24
|
+
Object.defineProperty(exports, "notIncludes", { enumerable: true, get: function () { return includes_1.notIncludes; } });
|
|
19
25
|
var instance_of_1 = require("./assert/instance-of");
|
|
20
26
|
Object.defineProperty(exports, "instanceOf", { enumerable: true, get: function () { return instance_of_1.instanceOf; } });
|
|
21
27
|
Object.defineProperty(exports, "notInstanceOf", { enumerable: true, get: function () { return instance_of_1.notInstanceOf; } });
|
|
@@ -31,12 +37,18 @@ Object.defineProperty(exports, "notLessThan", { enumerable: true, get: function
|
|
|
31
37
|
var less_than_equal_1 = require("./assert/less-than-equal");
|
|
32
38
|
Object.defineProperty(exports, "lessThanEqual", { enumerable: true, get: function () { return less_than_equal_1.lessThanEqual; } });
|
|
33
39
|
Object.defineProperty(exports, "notLessThanEqual", { enumerable: true, get: function () { return less_than_equal_1.notLessThanEqual; } });
|
|
40
|
+
var match_1 = require("./assert/match");
|
|
41
|
+
Object.defineProperty(exports, "match", { enumerable: true, get: function () { return match_1.match; } });
|
|
42
|
+
Object.defineProperty(exports, "notMatch", { enumerable: true, get: function () { return match_1.notMatch; } });
|
|
34
43
|
var rejects_1 = require("./assert/rejects");
|
|
35
44
|
Object.defineProperty(exports, "notRejects", { enumerable: true, get: function () { return rejects_1.notRejects; } });
|
|
36
45
|
Object.defineProperty(exports, "rejects", { enumerable: true, get: function () { return rejects_1.rejects; } });
|
|
37
46
|
var throws_1 = require("./assert/throws");
|
|
38
47
|
Object.defineProperty(exports, "notThrows", { enumerable: true, get: function () { return throws_1.notThrows; } });
|
|
39
48
|
Object.defineProperty(exports, "throws", { enumerable: true, get: function () { return throws_1.throws; } });
|
|
49
|
+
var deep_has_property_1 = require("./assert/deep-has-property");
|
|
50
|
+
Object.defineProperty(exports, "deepHasProperty", { enumerable: true, get: function () { return deep_has_property_1.deepHasProperty; } });
|
|
51
|
+
Object.defineProperty(exports, "deepNotHasProperty", { enumerable: true, get: function () { return deep_has_property_1.deepNotHasProperty; } });
|
|
40
52
|
const assert = () => {
|
|
41
53
|
throw new Error('Not implemented');
|
|
42
54
|
};
|
package/dist/assert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../src/assert.ts"],"names":[],"mappings":";;;AAAA,kDAA8D;AAArD,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAChC,wCAAiD;AAAxC,8FAAA,KAAK,OAAA;AAAE,iGAAA,QAAQ,OAAA;AACxB,sDAAoE;AAA3D,2GAAA,WAAW,OAAA;AAAE,8GAAA,cAAc,OAAA;AACpC,kEAAoF;AAA3E,sHAAA,gBAAgB,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AAC9C,sDAAoE;AAA3D,2GAAA,WAAW,OAAA;AAAE,8GAAA,cAAc,OAAA;AACpC,8CAAwD;AAA/C,mGAAA,OAAO,OAAA;AAAE,sGAAA,UAAU,OAAA;AAC5B,8CAA0D;AAAjD,oGAAA,QAAQ,OAAA;AAAE,uGAAA,WAAW,OAAA;AAC9B,oDAAiE;AAAxD,yGAAA,UAAU,OAAA;AAAE,4GAAA,aAAa,OAAA;AAClC,8CAAwD;AAA/C,mGAAA,OAAO,OAAA;AAAE,sGAAA,UAAU,OAAA;AAC5B,4CAAqD;AAA5C,iGAAA,MAAM,OAAA;AAAE,oGAAA,SAAS,OAAA;AAC1B,gDAA2D;AAAlD,qGAAA,QAAQ,OAAA;AAAE,wGAAA,WAAW,OAAA;AAC9B,4DAA2E;AAAlE,gHAAA,aAAa,OAAA;AAAE,mHAAA,gBAAgB,OAAA;AACxC,wCAAiD;AAAxC,8FAAA,KAAK,OAAA;AAAE,iGAAA,QAAQ,OAAA;AACxB,4CAAuD;AAA9C,qGAAA,UAAU,OAAA;AAAE,kGAAA,OAAO,OAAA;AAC5B,0CAAoD;AAA3C,mGAAA,SAAS,OAAA;AAAE,gGAAA,MAAM,OAAA;AAC1B,gEAAiF;AAAxE,oHAAA,eAAe,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAErC,MAAM,MAAM,GAAG,GAAG,EAAE;IACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,MAAM,UAEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.test.d.ts","sourceRoot":"","sources":["../../src/expect/empty.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const expect_1 = require("../expect");
|
|
4
|
+
describe('expect/empty', () => {
|
|
5
|
+
it('should not throw if array is empty', () => {
|
|
6
|
+
(0, expect_1.expect)([]).to.be.empty();
|
|
7
|
+
});
|
|
8
|
+
it('should throw if array is not empty', () => {
|
|
9
|
+
(0, expect_1.expect)(() => {
|
|
10
|
+
(0, expect_1.expect)([1]).to.be.empty();
|
|
11
|
+
}).to.throw(/Expected array to be empty/);
|
|
12
|
+
});
|
|
13
|
+
describe('not', () => {
|
|
14
|
+
it('should throw if array is empty', () => {
|
|
15
|
+
(0, expect_1.expect)(() => {
|
|
16
|
+
(0, expect_1.expect)([]).not.to.be.empty();
|
|
17
|
+
}).to.throw(/Expected array to not be empty/);
|
|
18
|
+
});
|
|
19
|
+
it('should not throw if array is not empty', () => {
|
|
20
|
+
(0, expect_1.expect)([1]).not.to.be.empty();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=empty.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.test.js","sourceRoot":"","sources":["../../src/expect/empty.test.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AAEnC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,IAAA,eAAM,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACjB,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACtC,IAAA,eAAM,EAAC,GAAG,EAAE;gBACR,IAAA,eAAM,EAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAC9C,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist/expect/eql.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
declare type DeepPartial<T> = {
|
|
2
|
+
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : DeepPartial<T[P]>;
|
|
3
|
+
};
|
|
1
4
|
declare module '../expect.types' {
|
|
2
5
|
interface ValueExpect<T> {
|
|
3
6
|
/**
|
|
4
7
|
* check for deep equality
|
|
5
8
|
*/
|
|
6
9
|
eql(value: T): this;
|
|
10
|
+
partially: ValueExpect<DeepPartial<T>>;
|
|
7
11
|
}
|
|
8
12
|
}
|
|
9
13
|
export {};
|
package/dist/expect/eql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eql.d.ts","sourceRoot":"","sources":["../../src/expect/eql.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,iBAAiB,CAAC;IAC7B,UAAU,WAAW,CAAC,CAAC;QACnB;;WAEG;QACH,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"eql.d.ts","sourceRoot":"","sources":["../../src/expect/eql.ts"],"names":[],"mappings":"AAGA,aAAK,WAAW,CAAC,CAAC,IAAI;KACjB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3F,CAAC;AAEF,OAAO,QAAQ,iBAAiB,CAAC;IAC7B,UAAU,WAAW,CAAC,CAAC;QACnB;;WAEG;QACH,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QACpB,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;CACJ"}
|
package/dist/expect/eql.js
CHANGED
|
@@ -3,14 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const assert_1 = require("../assert");
|
|
4
4
|
const mixins_1 = require("../mixins");
|
|
5
5
|
(0, mixins_1.use)({
|
|
6
|
+
partially: {
|
|
7
|
+
type: 'property',
|
|
8
|
+
value: () => ({ partial: true })
|
|
9
|
+
},
|
|
6
10
|
eql: {
|
|
7
11
|
type: 'method',
|
|
8
|
-
value: ({ value, inverted }) => (other) => {
|
|
12
|
+
value: ({ value, inverted, partial }) => (other) => {
|
|
9
13
|
if (inverted) {
|
|
10
|
-
(0, assert_1.
|
|
14
|
+
(0, assert_1.notDeepEqual)(value, other, partial);
|
|
11
15
|
}
|
|
12
16
|
else {
|
|
13
|
-
(0, assert_1.
|
|
17
|
+
(0, assert_1.deepEqual)(value, other, partial);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
}
|
package/dist/expect/eql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eql.js","sourceRoot":"","sources":["../../src/expect/eql.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"eql.js","sourceRoot":"","sources":["../../src/expect/eql.ts"],"names":[],"mappings":";;AAAA,sCAAoD;AACpD,sCAAgC;AAgBhC,IAAA,YAAG,EAAC;IACA,SAAS,EAAE;QACP,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KACnC;IACD,GAAG,EAAE;QACD,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,KAAU,EAAE,EAAE;YACpD,IAAI,QAAQ,EAAE;gBACV,IAAA,qBAAY,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;aACvC;iBAAM;gBACH,IAAA,kBAAS,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;aACpC;QACL,CAAC;KACJ;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eql.test.d.ts","sourceRoot":"","sources":["../../src/expect/eql.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const expect_1 = require("../expect");
|
|
4
|
+
describe('expect/eql', () => {
|
|
5
|
+
it('should not throw for deep equality', () => {
|
|
6
|
+
(0, expect_1.expect)({ a: 1 }).to.eql({ a: 1 });
|
|
7
|
+
});
|
|
8
|
+
it('should not throw with functions', () => {
|
|
9
|
+
const x = () => { };
|
|
10
|
+
(0, expect_1.expect)(x).to.eql(x);
|
|
11
|
+
});
|
|
12
|
+
it('should throw when one object has a different value for the same property', () => {
|
|
13
|
+
(0, expect_1.expect)(() => {
|
|
14
|
+
(0, expect_1.expect)({ a: 1 }).to.eql({ a: 2 });
|
|
15
|
+
}).to.throw();
|
|
16
|
+
});
|
|
17
|
+
it('should do a partial deep equality with .partially', () => {
|
|
18
|
+
(0, expect_1.expect)({ a: 1, b: { c: 2, d: 3 } }).to.partially.eql({ b: { c: 2 } });
|
|
19
|
+
});
|
|
20
|
+
describe('not', () => {
|
|
21
|
+
it('should invert the assertion', () => {
|
|
22
|
+
(0, expect_1.expect)(() => {
|
|
23
|
+
(0, expect_1.expect)({ a: 1 }).not.to.eql({ a: 1 });
|
|
24
|
+
}).to.throw();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=eql.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eql.test.js","sourceRoot":"","sources":["../../src/expect/eql.test.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AAEnC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAChF,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACjB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAA,eAAM,EAAC,GAAG,EAAE;gBACR,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const assert_1 = require("../assert");
|
|
4
4
|
const mixins_1 = require("../mixins");
|
|
5
|
-
const
|
|
5
|
+
const hein_assertion_utils_1 = require("hein-assertion-utils");
|
|
6
6
|
const values = {
|
|
7
7
|
false: false,
|
|
8
8
|
true: true
|
|
@@ -12,14 +12,14 @@ const values = {
|
|
|
12
12
|
type: 'method',
|
|
13
13
|
value: ({ inverted, value }) => () => {
|
|
14
14
|
if (inverted) {
|
|
15
|
-
const message = (0,
|
|
15
|
+
const message = (0, hein_assertion_utils_1.format)('Expected {{ value }} to not be {{ key }}', {
|
|
16
16
|
key,
|
|
17
17
|
value
|
|
18
18
|
}, true);
|
|
19
19
|
(0, assert_1.notEqual)(value, expectValue, message);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
const message = (0,
|
|
22
|
+
const message = (0, hein_assertion_utils_1.format)('Expected {{ value }} to be {{ key }}', {
|
|
23
23
|
key,
|
|
24
24
|
value
|
|
25
25
|
}, true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equal-shorthand.js","sourceRoot":"","sources":["../../src/expect/equal-shorthand.ts"],"names":[],"mappings":";;AAAA,sCAA4C;AAC5C,sCAAuC;AACvC
|
|
1
|
+
{"version":3,"file":"equal-shorthand.js","sourceRoot":"","sources":["../../src/expect/equal-shorthand.ts"],"names":[],"mappings":";;AAAA,sCAA4C;AAC5C,sCAAuC;AACvC,+DAA8C;AAgB9C,MAAM,MAAM,GAAG;IACX,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;CACb,CAAC;AAEF,IAAA,YAAG,EAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,EAAE;IACrE,OAAO,CAAC,GAAG,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAc,EAAE,EAAE,CAAC,GAAG,EAAE;gBAC7C,IAAI,QAAQ,EAAE;oBACV,MAAM,OAAO,GAAG,IAAA,6BAAM,EAClB,0CAA0C,EAC1C;wBACI,GAAG;wBACH,KAAK;qBACR,EACD,IAAI,CACP,CAAC;oBACF,IAAA,iBAAQ,EAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;iBACzC;qBAAM;oBACH,MAAM,OAAO,GAAG,IAAA,6BAAM,EAClB,sCAAsC,EACtC;wBACI,GAAG;wBACH,KAAK;qBACR,EACD,IAAI,CACP,CAAC;oBACF,IAAA,cAAK,EAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;iBACtC;YACL,CAAC;SACJ,CAAC,CAAC;AACP,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal-shorthand.test.d.ts","sourceRoot":"","sources":["../../src/expect/equal-shorthand.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable mocha/no-setup-in-describe */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
5
|
+
const expect_1 = require("../expect");
|
|
6
|
+
const values = {
|
|
7
|
+
false: false,
|
|
8
|
+
true: true
|
|
9
|
+
};
|
|
10
|
+
describe('expect/equal shorthands', () => {
|
|
11
|
+
for (const [method, value] of Object.entries(values)) {
|
|
12
|
+
describe(method, () => {
|
|
13
|
+
it(`should not throw if value is ${method}`, () => {
|
|
14
|
+
(0, expect_1.expect)(value).to.be[method]();
|
|
15
|
+
});
|
|
16
|
+
it(`should throw if value is not ${method}`, () => {
|
|
17
|
+
const regex = new RegExp(`Expected ${!value} to be ${method}`);
|
|
18
|
+
(0, expect_1.expect)(() => (0, expect_1.expect)(!value).to.be[method]()).to.throw(regex);
|
|
19
|
+
});
|
|
20
|
+
describe('not', () => {
|
|
21
|
+
it(`should not throw if value is ${!value}`, () => {
|
|
22
|
+
(0, expect_1.expect)(!value).to.not.be[method]();
|
|
23
|
+
});
|
|
24
|
+
it(`should throw if value is ${value}`, () => {
|
|
25
|
+
const regex = new RegExp(`Expected ${value} to not be ${method}`);
|
|
26
|
+
(0, expect_1.expect)(() => (0, expect_1.expect)(value).to.not.be[method]()).to.throw(regex);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
(0, expect_1.expect)(false).to.be.false;
|
|
32
|
+
(0, expect_1.expect)(true).to.be.true;
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=equal-shorthand.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal-shorthand.test.js","sourceRoot":"","sources":["../../src/expect/equal-shorthand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,CAAC,CAAC;oBACtE,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACpE,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;IACD,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAC1B,IAAA,eAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;AAC5B,CAAC,CAAC,CAAC"}
|
package/dist/expect/equal.js
CHANGED
|
@@ -5,7 +5,16 @@ const mixins_1 = require("../mixins");
|
|
|
5
5
|
(0, mixins_1.use)({
|
|
6
6
|
equal: {
|
|
7
7
|
type: 'method',
|
|
8
|
-
value: ({ value, inverted }) => (other, message) => {
|
|
8
|
+
value: ({ value, inverted, deep }) => (other, message) => {
|
|
9
|
+
if (deep) {
|
|
10
|
+
if (inverted) {
|
|
11
|
+
(0, assert_1.notDeepEqual)(value, other, message);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
(0, assert_1.deepEqual)(value, other, message);
|
|
15
|
+
}
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
9
18
|
if (inverted) {
|
|
10
19
|
(0, assert_1.notEqual)(value, other, message);
|
|
11
20
|
}
|
package/dist/expect/equal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../src/expect/equal.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../src/expect/equal.ts"],"names":[],"mappings":";;AAAA,sCAAqE;AACrE,sCAAgC;AAehC,IAAA,YAAG,EAAC;IACA,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,KAAU,EAAE,OAAgB,EAAE,EAAE;YACnE,IAAI,IAAI,EAAE;gBACN,IAAI,QAAQ,EAAE;oBACV,IAAA,qBAAY,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;iBACvC;qBAAM;oBACH,IAAA,kBAAS,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;iBACpC;gBACD,OAAO;aACV;YACD,IAAI,QAAQ,EAAE;gBACV,IAAA,iBAAQ,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;aACnC;iBAAM;gBACH,IAAA,cAAK,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;aAChC;QACL,CAAC;KACJ;IACD,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal.test.d.ts","sourceRoot":"","sources":["../../src/expect/equal.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const expect_1 = require("../expect");
|
|
4
|
+
describe('expect/equal', () => {
|
|
5
|
+
it('should not throw for strict equality', () => {
|
|
6
|
+
(0, expect_1.expect)(1).to.eq(1);
|
|
7
|
+
});
|
|
8
|
+
it('should throw if values are not equal', () => {
|
|
9
|
+
(0, expect_1.expect)(() => {
|
|
10
|
+
// @ts-expect-error intentionally wrong type
|
|
11
|
+
(0, expect_1.expect)(1).to.equal('a');
|
|
12
|
+
}).to.throw();
|
|
13
|
+
});
|
|
14
|
+
it('should throw if values are only deep equal', () => {
|
|
15
|
+
(0, expect_1.expect)(() => {
|
|
16
|
+
(0, expect_1.expect)({ a: 1 }).to.equal({ a: 1 });
|
|
17
|
+
}).to.throw();
|
|
18
|
+
});
|
|
19
|
+
it('should use deep equality if chained after .deep', () => {
|
|
20
|
+
(0, expect_1.expect)({ a: 1 }).deep.equal({ a: 1 });
|
|
21
|
+
});
|
|
22
|
+
describe('not', () => {
|
|
23
|
+
it('should invert the assertion', () => {
|
|
24
|
+
(0, expect_1.expect)(() => {
|
|
25
|
+
(0, expect_1.expect)(1).not.to.equal(1);
|
|
26
|
+
}).to.throw();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=equal.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal.test.js","sourceRoot":"","sources":["../../src/expect/equal.test.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AAEnC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,4CAA4C;YAC5C,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACvD,IAAA,eAAM,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACjB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAA,eAAM,EAAC,GAAG,EAAE;gBACR,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater-than-equal.test.d.ts","sourceRoot":"","sources":["../../src/expect/greater-than-equal.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const expect_1 = require("../expect");
|
|
4
|
+
describe('expect/greaterThanEqual', () => {
|
|
5
|
+
it('should not throw when expectation is smaller than actual', () => {
|
|
6
|
+
(0, expect_1.expect)(1).to.be.greaterThanOrEqual(0);
|
|
7
|
+
});
|
|
8
|
+
it('should not throw when expectation is equal to actual', () => {
|
|
9
|
+
(0, expect_1.expect)(1).to.be.greaterThanOrEqual(1);
|
|
10
|
+
});
|
|
11
|
+
it('should throw when expectation is bigger than actual', () => {
|
|
12
|
+
(0, expect_1.expect)(() => {
|
|
13
|
+
(0, expect_1.expect)(1).to.be.greaterThanOrEqual(2);
|
|
14
|
+
}).to.throw();
|
|
15
|
+
});
|
|
16
|
+
describe('not', () => {
|
|
17
|
+
it('should invert the assertion', () => {
|
|
18
|
+
(0, expect_1.expect)(() => {
|
|
19
|
+
(0, expect_1.expect)(1).not.to.be.greaterThanOrEqual(0);
|
|
20
|
+
}).to.throw();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=greater-than-equal.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater-than-equal.test.js","sourceRoot":"","sources":["../../src/expect/greater-than-equal.test.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AAEnC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAChE,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC5D,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC3D,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACjB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAA,eAAM,EAAC,GAAG,EAAE;gBACR,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater-than.test.d.ts","sourceRoot":"","sources":["../../src/expect/greater-than.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const expect_1 = require("../expect");
|
|
4
|
+
describe('expect/greaterThan', () => {
|
|
5
|
+
it('should not throw when expectation is smaller than actual', () => {
|
|
6
|
+
(0, expect_1.expect)(1).to.be.greaterThan(0);
|
|
7
|
+
});
|
|
8
|
+
it('should throw when expectation is bigger than actual', () => {
|
|
9
|
+
(0, expect_1.expect)(() => {
|
|
10
|
+
(0, expect_1.expect)(1).to.be.greaterThan(2);
|
|
11
|
+
}).to.throw();
|
|
12
|
+
});
|
|
13
|
+
it('should work with dates', () => {
|
|
14
|
+
(0, expect_1.expect)(new Date(1)).to.be.gt(new Date(0));
|
|
15
|
+
});
|
|
16
|
+
describe('not', () => {
|
|
17
|
+
it('should invert the assertion', () => {
|
|
18
|
+
(0, expect_1.expect)(() => {
|
|
19
|
+
(0, expect_1.expect)(1).not.to.be.greaterThan(0);
|
|
20
|
+
}).to.throw();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=greater-than.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greater-than.test.js","sourceRoot":"","sources":["../../src/expect/greater-than.test.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AAEnC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAChE,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC3D,IAAA,eAAM,EAAC,GAAG,EAAE;YACR,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAC9B,IAAA,eAAM,EAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;QACjB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,IAAA,eAAM,EAAC,GAAG,EAAE;gBACR,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|