querier-ts 2.1.0 → 2.1.1
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 +17 -2
- package/lib/__tests__/query.spec.d.ts +1 -0
- package/lib/__tests__/query.spec.d.ts.map +1 -0
- package/lib/__tests__/query.spec.js +193 -87
- package/lib/__tests__/query.spec.js.map +1 -0
- package/lib/core/errors/__tests__/invalid-argument-error.spec.d.ts +1 -0
- package/lib/core/errors/__tests__/invalid-argument-error.spec.d.ts.map +1 -0
- package/lib/core/errors/__tests__/invalid-argument-error.spec.js +7 -45
- package/lib/core/errors/__tests__/invalid-argument-error.spec.js.map +1 -0
- package/lib/core/errors/invalid-argument-error.d.ts +1 -12
- package/lib/core/errors/invalid-argument-error.d.ts.map +1 -1
- package/lib/core/errors/invalid-argument-error.js +2 -8
- package/lib/core/errors/invalid-argument-error.js.map +1 -1
- package/lib/core/types/nullable-condition.d.ts +2 -0
- package/lib/core/types/nullable-condition.d.ts.map +1 -0
- package/lib/core/types/nullable-condition.js +2 -0
- package/lib/core/types/nullable-condition.js.map +1 -0
- package/lib/core/types/query-conditions-group-nullable.d.ts +2 -1
- package/lib/core/types/query-conditions-group-nullable.d.ts.map +1 -1
- package/lib/core/types/validation-options.d.ts +4 -0
- package/lib/core/types/validation-options.d.ts.map +1 -0
- package/lib/core/types/validation-options.js +2 -0
- package/lib/core/types/validation-options.js.map +1 -0
- package/lib/core/validation/__tests__/query-row-validator.spec.d.ts +1 -0
- package/lib/core/validation/__tests__/query-row-validator.spec.d.ts.map +1 -0
- package/lib/core/validation/__tests__/query-row-validator.spec.js +48 -87
- package/lib/core/validation/__tests__/query-row-validator.spec.js.map +1 -0
- package/lib/core/validation/decorators/__tests__/number-validation.spec.d.ts +2 -1
- package/lib/core/validation/decorators/__tests__/number-validation.spec.d.ts.map +1 -0
- package/lib/core/validation/decorators/__tests__/number-validation.spec.js +40 -24
- package/lib/core/validation/decorators/__tests__/number-validation.spec.js.map +1 -0
- package/lib/core/validation/decorators/number-validaton.d.ts.map +1 -1
- package/lib/core/validation/decorators/number-validaton.js +6 -18
- package/lib/core/validation/decorators/number-validaton.js.map +1 -1
- package/lib/core/validation/query-row-validator.d.ts +6 -40
- package/lib/core/validation/query-row-validator.d.ts.map +1 -1
- package/lib/core/validation/query-row-validator.js +22 -44
- package/lib/core/validation/query-row-validator.js.map +1 -1
- package/lib/query.d.ts +18 -17
- package/lib/query.d.ts.map +1 -1
- package/lib/query.js +57 -59
- package/lib/query.js.map +1 -1
- package/lib/utils/functions/generic/__tests__/compare-arrays.spec.d.ts +1 -0
- package/lib/utils/functions/generic/__tests__/compare-arrays.spec.d.ts.map +1 -0
- package/lib/utils/functions/generic/__tests__/compare-arrays.spec.js +6 -7
- package/lib/utils/functions/generic/__tests__/compare-arrays.spec.js.map +1 -0
- package/lib/utils/functions/generic/__tests__/deep-equal.spec.d.ts +1 -0
- package/lib/utils/functions/generic/__tests__/deep-equal.spec.d.ts.map +1 -0
- package/lib/utils/functions/generic/__tests__/deep-equal.spec.js +25 -26
- package/lib/utils/functions/generic/__tests__/deep-equal.spec.js.map +1 -0
- package/lib/utils/functions/generic/__tests__/get-entries.spec.d.ts +1 -0
- package/lib/utils/functions/generic/__tests__/get-entries.spec.d.ts.map +1 -0
- package/lib/utils/functions/generic/__tests__/get-entries.spec.js +7 -8
- package/lib/utils/functions/generic/__tests__/get-entries.spec.js.map +1 -0
- package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.d.ts +2 -0
- package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.d.ts.map +1 -0
- package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.js +82 -0
- package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.js.map +1 -0
- package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.d.ts +1 -0
- package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.d.ts.map +1 -0
- package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.js +10 -11
- package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.js.map +1 -0
- package/lib/utils/functions/sort/__tests__/sort-by-property.spec.d.ts +1 -0
- package/lib/utils/functions/sort/__tests__/sort-by-property.spec.d.ts.map +1 -0
- package/lib/utils/functions/sort/__tests__/sort-by-property.spec.js +24 -12
- package/lib/utils/functions/sort/__tests__/sort-by-property.spec.js.map +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-function.spec.d.ts +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-function.spec.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-function.spec.js +14 -15
- package/lib/utils/functions/type-guards/__tests__/is-function.spec.js.map +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-number.spec.d.ts +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-number.spec.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-number.spec.js +19 -20
- package/lib/utils/functions/type-guards/__tests__/is-number.spec.js.map +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-object.spec.d.ts +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-object.spec.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/__tests__/is-object.spec.js +19 -20
- package/lib/utils/functions/type-guards/__tests__/is-object.spec.js.map +1 -0
- package/package.json +15 -13
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ const authorsWithFirstPostQuery = Query.from(authors)
|
|
|
108
108
|
}));
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
When dealing with
|
|
111
|
+
When dealing with simple scenarios, prefer `select()`:
|
|
112
112
|
|
|
113
113
|
```ts
|
|
114
114
|
// ⚠️ More verbose than necessary
|
|
@@ -276,4 +276,19 @@ Example output:
|
|
|
276
276
|
[1, 'john@icloud.com'],
|
|
277
277
|
[2, 'mary@gmail.com']
|
|
278
278
|
]
|
|
279
|
-
```
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
#### `groupBy(key)`
|
|
284
|
+
|
|
285
|
+
Groups the items by the specified property and returns the result as a `Map`.
|
|
286
|
+
|
|
287
|
+
- `key`: The property name to group by.
|
|
288
|
+
|
|
289
|
+
The returned `Map` uses the property values as keys and arrays of matching items as values.
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
const usersByActiveStatus = Query.from(users).groupBy('active');
|
|
293
|
+
// Map<boolean, User[]>
|
|
294
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.spec.d.ts","sourceRoot":"","sources":["../../src/__tests__/query.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const errors_1 = require("../core/errors");
|
|
4
|
-
const query_1 = require("../query");
|
|
1
|
+
import { InvalidArgumentError } from '../core/errors';
|
|
2
|
+
import { Query } from '../query';
|
|
5
3
|
class User {
|
|
6
4
|
constructor(id, name, permissions, isActive, createdAt, updatedAt) {
|
|
7
5
|
this.id = id;
|
|
@@ -23,143 +21,251 @@ const users = [
|
|
|
23
21
|
describe('Query', () => {
|
|
24
22
|
describe('creation', () => {
|
|
25
23
|
it('should create a query from array', () => {
|
|
26
|
-
const query =
|
|
24
|
+
const query = Query.from(users);
|
|
27
25
|
expect(query.all().length).toBe(3);
|
|
28
26
|
});
|
|
29
27
|
});
|
|
30
|
-
describe('
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
describe('filtering', () => {
|
|
29
|
+
describe('where()', () => {
|
|
30
|
+
it('should filter using object conditions', () => {
|
|
31
|
+
const result = Query.from(users).where({ isActive: true }).all();
|
|
32
|
+
expect(result).toHaveLength(2);
|
|
33
|
+
expect(result.every((u) => u.isActive)).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
it('should filter using function condition', () => {
|
|
36
|
+
const result = Query.from(users)
|
|
37
|
+
.where((user) => user.isAdmin())
|
|
38
|
+
.all();
|
|
39
|
+
expect(result).toHaveLength(1);
|
|
40
|
+
expect(result[0].id).toBe(1);
|
|
41
|
+
});
|
|
42
|
+
it('should combine multiple where calls', () => {
|
|
43
|
+
const result = Query.from(users)
|
|
44
|
+
.where({ isActive: true })
|
|
45
|
+
.where((user) => user.permissions.useCookies)
|
|
46
|
+
.all();
|
|
47
|
+
expect(result).toHaveLength(2);
|
|
48
|
+
});
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
50
|
+
describe('nested where()', () => {
|
|
51
|
+
it('should filter using inner object conditions', () => {
|
|
52
|
+
const result = Query.from(users)
|
|
53
|
+
.where({
|
|
54
|
+
permissions: {
|
|
55
|
+
sendNotifications: true,
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
.all();
|
|
59
|
+
expect(result).toHaveLength(2);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('filterWhere()', () => {
|
|
63
|
+
it('should ignore null conditions', () => {
|
|
64
|
+
const result = Query.from(users)
|
|
65
|
+
.filterWhere({
|
|
66
|
+
isActive: null,
|
|
67
|
+
id: 1,
|
|
68
|
+
})
|
|
69
|
+
.all();
|
|
70
|
+
expect(result).toHaveLength(1);
|
|
71
|
+
expect(result[0].id).toBe(1);
|
|
72
|
+
});
|
|
61
73
|
});
|
|
62
74
|
});
|
|
63
|
-
describe('
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
describe('selection', () => {
|
|
76
|
+
describe('select()', () => {
|
|
77
|
+
it('should select a single column', () => {
|
|
78
|
+
const result = Query.from(users).select('name').column();
|
|
79
|
+
expect(result).toEqual(['John', 'Mary', 'Bob']);
|
|
80
|
+
});
|
|
81
|
+
it('should select multiple columns', () => {
|
|
82
|
+
const result = Query.from(users).select('id', 'name').values();
|
|
83
|
+
expect(result).toEqual([
|
|
84
|
+
[1, 'John'],
|
|
85
|
+
[2, 'Mary'],
|
|
86
|
+
[3, 'Bob'],
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
it('should return objects with only selected fields', () => {
|
|
90
|
+
const result = Query.from(users).select('id', 'name').all();
|
|
91
|
+
expect(result).toEqual([
|
|
92
|
+
{ id: 1, name: 'John' },
|
|
93
|
+
{ id: 2, name: 'Mary' },
|
|
94
|
+
{ id: 3, name: 'Bob' },
|
|
95
|
+
]);
|
|
96
|
+
});
|
|
97
|
+
it('should not include non-selected fields', () => {
|
|
98
|
+
const result = Query.from(users).select('id').first();
|
|
99
|
+
expect(result).toEqual({ id: 1 });
|
|
100
|
+
expect(result.name).toBeUndefined();
|
|
101
|
+
});
|
|
102
|
+
it('should preserve ordering of the selected columns', () => {
|
|
103
|
+
const ascOrderResult = Query.from(users)
|
|
104
|
+
.orderBy('name')
|
|
105
|
+
.select('name')
|
|
106
|
+
.column();
|
|
107
|
+
expect(ascOrderResult).toEqual(['Bob', 'John', 'Mary']);
|
|
108
|
+
const descOrderResult = Query.from(users)
|
|
109
|
+
.orderBy('-name')
|
|
110
|
+
.select('name')
|
|
111
|
+
.column();
|
|
112
|
+
expect(descOrderResult).toEqual(['Mary', 'John', 'Bob']);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
describe('column()', () => {
|
|
116
|
+
it('should return an array of the first column values by default', () => {
|
|
117
|
+
const result = Query.from(users).column();
|
|
118
|
+
expect(result).toEqual([1, 2, 3]);
|
|
119
|
+
});
|
|
120
|
+
it('should return an array of the specified column values', () => {
|
|
121
|
+
const result = Query.from(users).column('name');
|
|
122
|
+
expect(result).toEqual(['John', 'Mary', 'Bob']);
|
|
123
|
+
});
|
|
124
|
+
it('should preserve ordering', () => {
|
|
125
|
+
const result = Query.from(users).orderBy('name').column('name');
|
|
126
|
+
expect(result).toEqual(['Bob', 'John', 'Mary']);
|
|
127
|
+
});
|
|
128
|
+
it('should return empty array if objects have no properties', () => {
|
|
129
|
+
const result = Query.from([{}]).column();
|
|
130
|
+
expect(result).toEqual([]);
|
|
131
|
+
});
|
|
74
132
|
});
|
|
75
133
|
});
|
|
76
|
-
describe('
|
|
77
|
-
it('should
|
|
78
|
-
const result =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
[3, 'Bob'],
|
|
134
|
+
describe('mapping', () => {
|
|
135
|
+
it('should map each row to a new object', () => {
|
|
136
|
+
const result = Query.from(users).map((user) => ({
|
|
137
|
+
id: user.id,
|
|
138
|
+
name: user.name,
|
|
139
|
+
}));
|
|
140
|
+
expect(result.all()).toEqual([
|
|
141
|
+
{ id: 1, name: 'John' },
|
|
142
|
+
{ id: 2, name: 'Mary' },
|
|
143
|
+
{ id: 3, name: 'Bob' },
|
|
87
144
|
]);
|
|
88
145
|
});
|
|
89
146
|
});
|
|
90
147
|
describe('ordering', () => {
|
|
91
148
|
it('should order by ascending property', () => {
|
|
92
|
-
const result =
|
|
149
|
+
const result = Query.from(users).select('name').orderBy('name').column();
|
|
93
150
|
expect(result).toEqual(['Bob', 'John', 'Mary']);
|
|
94
151
|
});
|
|
95
152
|
it('should order by descending property', () => {
|
|
96
|
-
const result =
|
|
153
|
+
const result = Query.from(users).select('id').orderBy('-id').column();
|
|
97
154
|
expect(result).toEqual([3, 2, 1]);
|
|
98
155
|
});
|
|
99
156
|
it('should order by multiple properties', () => {
|
|
100
|
-
const result =
|
|
157
|
+
const result = Query.from(users)
|
|
158
|
+
.select('id', 'isActive')
|
|
101
159
|
.orderBy('isActive', '-id')
|
|
102
|
-
.select('id')
|
|
103
160
|
.column();
|
|
104
161
|
expect(result).toEqual([2, 3, 1]);
|
|
105
162
|
});
|
|
106
|
-
it('should override
|
|
107
|
-
const result =
|
|
108
|
-
.
|
|
163
|
+
it('should override ordering when chaining', () => {
|
|
164
|
+
const result = Query.from(users)
|
|
165
|
+
.select('id', 'isActive')
|
|
109
166
|
.orderBy('-id')
|
|
110
|
-
.
|
|
167
|
+
.orderBy('isActive')
|
|
111
168
|
.column();
|
|
112
|
-
expect(result).toEqual([
|
|
169
|
+
expect(result).toEqual([2, 3, 1]);
|
|
113
170
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
171
|
+
});
|
|
172
|
+
describe('grouping', () => {
|
|
173
|
+
it('should group rows by a simple property', () => {
|
|
174
|
+
const result = Query.from(users).groupBy('isActive');
|
|
175
|
+
expect(result.get(true)).toHaveLength(2);
|
|
176
|
+
expect(result.get(false)).toHaveLength(1);
|
|
177
|
+
});
|
|
178
|
+
it('should group rows by id', () => {
|
|
179
|
+
const result = Query.from(users).groupBy('id');
|
|
180
|
+
expect(result.get(1)?.[0]?.name).toBe('John');
|
|
181
|
+
expect(result.get(2)?.[0]?.name).toBe('Mary');
|
|
182
|
+
expect(result.get(3)?.[0]?.name).toBe('Bob');
|
|
183
|
+
});
|
|
184
|
+
it('should group rows after filtering', () => {
|
|
185
|
+
const result = Query.from(users)
|
|
186
|
+
.where({ isActive: true })
|
|
187
|
+
.groupBy('isActive');
|
|
188
|
+
expect(result.get(true)).toHaveLength(2);
|
|
189
|
+
expect(result.get(false)).toBeUndefined();
|
|
190
|
+
});
|
|
191
|
+
it('should group rows after ordering', () => {
|
|
192
|
+
const result = Query.from(users).orderBy('-id').groupBy('isActive');
|
|
193
|
+
const activeUsers = result.get(true);
|
|
194
|
+
expect(activeUsers[0].id).toBe(3);
|
|
195
|
+
expect(activeUsers[1].id).toBe(1);
|
|
196
|
+
});
|
|
197
|
+
it('should group rows respecting skip and limit', () => {
|
|
198
|
+
const result = Query.from(users)
|
|
199
|
+
.orderBy('id')
|
|
200
|
+
.skip(1)
|
|
201
|
+
.limit(1)
|
|
202
|
+
.groupBy('isActive');
|
|
203
|
+
// only user with id 2 should be in the results
|
|
204
|
+
expect(result.size).toBe(1);
|
|
205
|
+
expect(result.get(false)).toHaveLength(1);
|
|
206
|
+
expect(result.get(false)?.[0]?.id).toBe(2);
|
|
207
|
+
});
|
|
208
|
+
it('should return an empty map if no rows', () => {
|
|
209
|
+
const result = Query.from(users).where({ id: 999 }).groupBy('id');
|
|
210
|
+
expect(result.size).toBe(0);
|
|
211
|
+
});
|
|
212
|
+
it('should group by Date property', () => {
|
|
213
|
+
const result = Query.from(users).groupBy('createdAt');
|
|
214
|
+
expect(result.size).toBe(3);
|
|
121
215
|
});
|
|
122
216
|
});
|
|
123
217
|
describe('pagination', () => {
|
|
124
218
|
it('should skip rows', () => {
|
|
125
|
-
const result =
|
|
219
|
+
const result = Query.from(users).select('id').skip(1).column();
|
|
126
220
|
expect(result).toEqual([2, 3]);
|
|
127
221
|
});
|
|
128
222
|
it('should limit rows', () => {
|
|
129
|
-
const result =
|
|
223
|
+
const result = Query.from(users).select('id').limit(2).column();
|
|
130
224
|
expect(result).toEqual([1, 2]);
|
|
131
225
|
});
|
|
132
226
|
it('should combine skip and limit', () => {
|
|
133
|
-
const result =
|
|
227
|
+
const result = Query.from(users).select('id').skip(1).limit(1).column();
|
|
134
228
|
expect(result).toEqual([2]);
|
|
135
229
|
});
|
|
136
230
|
it('should throw if skip is negative', () => {
|
|
137
|
-
expect(() =>
|
|
231
|
+
expect(() => Query.from(users).skip(-1)).toThrow(InvalidArgumentError);
|
|
138
232
|
});
|
|
139
233
|
it('should throw if limit is not an integer', () => {
|
|
140
|
-
expect(() =>
|
|
234
|
+
expect(() => Query.from(users).limit(1.5)).toThrow(InvalidArgumentError);
|
|
141
235
|
});
|
|
142
236
|
});
|
|
143
237
|
describe('result helpers', () => {
|
|
144
238
|
it('count()', () => {
|
|
145
|
-
expect(
|
|
239
|
+
expect(Query.from(users).count()).toBe(3);
|
|
146
240
|
});
|
|
147
241
|
it('exists()', () => {
|
|
148
|
-
expect(
|
|
242
|
+
expect(Query.from(users).where({ id: 99 }).exists()).toBe(false);
|
|
149
243
|
});
|
|
150
244
|
it('first()', () => {
|
|
151
|
-
expect(
|
|
245
|
+
expect(Query.from(users).first()?.id).toBe(1);
|
|
152
246
|
});
|
|
153
|
-
|
|
154
|
-
|
|
247
|
+
describe('last()', () => {
|
|
248
|
+
it('should return the last object', () => {
|
|
249
|
+
expect(Query.from(users).last()?.id).toBe(3);
|
|
250
|
+
});
|
|
251
|
+
it('should return null if no results', () => {
|
|
252
|
+
expect(Query.from(users).where({ id: 99 }).last()).toBeNull();
|
|
253
|
+
});
|
|
155
254
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
255
|
+
describe('scalar()', () => {
|
|
256
|
+
it('should return the first cell', () => {
|
|
257
|
+
const id = Query.from(users).select('id').scalar();
|
|
258
|
+
expect(id).toBe(1);
|
|
259
|
+
});
|
|
260
|
+
it('should return false if no results', () => {
|
|
261
|
+
const id = Query.from([]).scalar();
|
|
262
|
+
expect(id).toBe(false);
|
|
263
|
+
});
|
|
159
264
|
});
|
|
160
265
|
it('scalar() should return false if no results', () => {
|
|
161
|
-
const result =
|
|
266
|
+
const result = Query.from(users).where({ id: 99 }).scalar();
|
|
162
267
|
expect(result).toBe(false);
|
|
163
268
|
});
|
|
164
269
|
});
|
|
165
270
|
});
|
|
271
|
+
//# sourceMappingURL=query.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.spec.js","sourceRoot":"","sources":["../../src/__tests__/query.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OA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AE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;gBAEnC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;YAE5D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-argument-error.spec.d.ts","sourceRoot":"","sources":["../../../../src/core/errors/__tests__/invalid-argument-error.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,54 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const invalid_argument_error_1 = require("../invalid-argument-error");
|
|
1
|
+
import { InvalidArgumentError } from '../invalid-argument-error';
|
|
4
2
|
describe('InvalidArgumentError', () => {
|
|
5
3
|
it('should be an instance of Error', () => {
|
|
6
|
-
const error = new
|
|
7
|
-
method: 'testMethod',
|
|
8
|
-
param: 'value',
|
|
9
|
-
argument: 123,
|
|
10
|
-
expected: 'a string',
|
|
11
|
-
});
|
|
4
|
+
const error = new InvalidArgumentError('Test error');
|
|
12
5
|
expect(error).toBeInstanceOf(Error);
|
|
13
6
|
});
|
|
14
7
|
it('should have the correct name', () => {
|
|
15
|
-
const error = new
|
|
16
|
-
method: 'testMethod',
|
|
17
|
-
param: 'value',
|
|
18
|
-
argument: 123,
|
|
19
|
-
expected: 'a string',
|
|
20
|
-
});
|
|
8
|
+
const error = new InvalidArgumentError('Test error');
|
|
21
9
|
expect(error.name).toBe('InvalidArgumentError');
|
|
22
10
|
});
|
|
23
|
-
it('should
|
|
24
|
-
const error = new
|
|
25
|
-
|
|
26
|
-
param: 0,
|
|
27
|
-
argument: false,
|
|
28
|
-
expected: 'a boolean',
|
|
29
|
-
});
|
|
30
|
-
expect(error.message).toBe('false is not a valid argument to param 0 on doSomething(). It should be a boolean.');
|
|
31
|
-
});
|
|
32
|
-
it('should expose configuration properties', () => {
|
|
33
|
-
const config = {
|
|
34
|
-
method: 'save',
|
|
35
|
-
param: 'id',
|
|
36
|
-
argument: null,
|
|
37
|
-
expected: 'a non-null value',
|
|
38
|
-
};
|
|
39
|
-
const error = new invalid_argument_error_1.InvalidArgumentError(config);
|
|
40
|
-
expect(error.method).toBe(config.method);
|
|
41
|
-
expect(error.param).toBe(config.param);
|
|
42
|
-
expect(error.argument).toBe(config.argument);
|
|
43
|
-
expect(error.expected).toBe(config.expected);
|
|
44
|
-
});
|
|
45
|
-
it('should preserve prototype chain', () => {
|
|
46
|
-
const error = new invalid_argument_error_1.InvalidArgumentError({
|
|
47
|
-
method: 'run',
|
|
48
|
-
param: 'options',
|
|
49
|
-
argument: {},
|
|
50
|
-
expected: 'a valid options object',
|
|
51
|
-
});
|
|
52
|
-
expect(error instanceof invalid_argument_error_1.InvalidArgumentError).toBe(true);
|
|
11
|
+
it('should have the correct message', () => {
|
|
12
|
+
const error = new InvalidArgumentError('Test error');
|
|
13
|
+
expect(error.message).toBe('Test error');
|
|
53
14
|
});
|
|
54
15
|
});
|
|
16
|
+
//# sourceMappingURL=invalid-argument-error.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-argument-error.spec.js","sourceRoot":"","sources":["../../../../src/core/errors/__tests__/invalid-argument-error.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAErD,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAErD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAErD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
interface InvalidArgumentErrorConfig {
|
|
2
|
-
method: string;
|
|
3
|
-
param: string | number;
|
|
4
|
-
argument: unknown;
|
|
5
|
-
expected: string;
|
|
6
|
-
}
|
|
7
1
|
export declare class InvalidArgumentError extends Error {
|
|
8
|
-
|
|
9
|
-
readonly param: string | number;
|
|
10
|
-
readonly argument: unknown;
|
|
11
|
-
readonly expected: string;
|
|
12
|
-
constructor({ method, param, argument, expected, }: InvalidArgumentErrorConfig);
|
|
2
|
+
constructor(message: string);
|
|
13
3
|
}
|
|
14
|
-
export {};
|
|
15
4
|
//# sourceMappingURL=invalid-argument-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-argument-error.d.ts","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"invalid-argument-error.d.ts","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
export class InvalidArgumentError extends Error {
|
|
2
|
-
constructor(
|
|
3
|
-
super(
|
|
4
|
-
`It should be ${expected}.`);
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
5
4
|
this.name = 'InvalidArgumentError';
|
|
6
|
-
this.method = method;
|
|
7
|
-
this.param = param;
|
|
8
|
-
this.argument = argument;
|
|
9
|
-
this.expected = expected;
|
|
10
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
11
5
|
}
|
|
12
6
|
}
|
|
13
7
|
//# sourceMappingURL=invalid-argument-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-argument-error.js","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invalid-argument-error.js","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullable-condition.d.ts","sourceRoot":"","sources":["../../../src/core/types/nullable-condition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAC3B,CAAC,GACD,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,GACvB,IAAI,GACJ,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullable-condition.js","sourceRoot":"","sources":["../../../src/core/types/nullable-condition.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PropertyOnly } from '../../utils/types';
|
|
2
|
+
import type { NullableCondition } from './nullable-condition';
|
|
2
3
|
export type QueryConditionsGroupNullable<T extends object> = {
|
|
3
|
-
[P in keyof PropertyOnly<T>]?: T[P] extends object ? QueryConditionsGroupNullable<T[P]> : T[P]
|
|
4
|
+
[P in keyof PropertyOnly<T>]?: T[P] extends object ? QueryConditionsGroupNullable<T[P]> : NullableCondition<T[P]>;
|
|
4
5
|
};
|
|
5
6
|
//# sourceMappingURL=query-conditions-group-nullable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-conditions-group-nullable.d.ts","sourceRoot":"","sources":["../../../src/core/types/query-conditions-group-nullable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"query-conditions-group-nullable.d.ts","sourceRoot":"","sources":["../../../src/core/types/query-conditions-group-nullable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,MAAM,IAAI;KAC1D,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAC9C,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAClC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-options.d.ts","sourceRoot":"","sources":["../../../src/core/types/validation-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-options.js","sourceRoot":"","sources":["../../../src/core/types/validation-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-row-validator.spec.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/__tests__/query-row-validator.spec.ts"],"names":[],"mappings":""}
|