querier-ts 2.3.0 → 2.4.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.
Files changed (169) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/README.md +78 -0
  3. package/dist/cjs/index.cjs +1 -0
  4. package/{lib/query.d.ts → dist/esm/index.d.ts} +122 -33
  5. package/dist/esm/index.js +1 -0
  6. package/package.json +39 -27
  7. package/lib/core/errors/index.d.ts +0 -2
  8. package/lib/core/errors/index.d.ts.map +0 -1
  9. package/lib/core/errors/index.js +0 -2
  10. package/lib/core/errors/index.js.map +0 -1
  11. package/lib/core/errors/invalid-argument-error.d.ts +0 -4
  12. package/lib/core/errors/invalid-argument-error.d.ts.map +0 -1
  13. package/lib/core/errors/invalid-argument-error.js +0 -7
  14. package/lib/core/errors/invalid-argument-error.js.map +0 -1
  15. package/lib/core/types/attribute-validation-function.d.ts +0 -2
  16. package/lib/core/types/attribute-validation-function.d.ts.map +0 -1
  17. package/lib/core/types/attribute-validation-function.js +0 -2
  18. package/lib/core/types/attribute-validation-function.js.map +0 -1
  19. package/lib/core/types/column-condition.d.ts +0 -7
  20. package/lib/core/types/column-condition.d.ts.map +0 -1
  21. package/lib/core/types/column-condition.js +0 -2
  22. package/lib/core/types/column-condition.js.map +0 -1
  23. package/lib/core/types/index.d.ts +0 -5
  24. package/lib/core/types/index.d.ts.map +0 -1
  25. package/lib/core/types/index.js +0 -5
  26. package/lib/core/types/index.js.map +0 -1
  27. package/lib/core/types/nullable-condition.d.ts +0 -2
  28. package/lib/core/types/nullable-condition.d.ts.map +0 -1
  29. package/lib/core/types/nullable-condition.js +0 -2
  30. package/lib/core/types/nullable-condition.js.map +0 -1
  31. package/lib/core/types/ordering-column.d.ts +0 -3
  32. package/lib/core/types/ordering-column.d.ts.map +0 -1
  33. package/lib/core/types/ordering-column.js +0 -2
  34. package/lib/core/types/ordering-column.js.map +0 -1
  35. package/lib/core/types/query-conditions-group-nullable.d.ts +0 -6
  36. package/lib/core/types/query-conditions-group-nullable.d.ts.map +0 -1
  37. package/lib/core/types/query-conditions-group-nullable.js +0 -2
  38. package/lib/core/types/query-conditions-group-nullable.js.map +0 -1
  39. package/lib/core/types/query-conditions-group.d.ts +0 -5
  40. package/lib/core/types/query-conditions-group.d.ts.map +0 -1
  41. package/lib/core/types/query-conditions-group.js +0 -2
  42. package/lib/core/types/query-conditions-group.js.map +0 -1
  43. package/lib/core/types/query-row-validator-initializer.d.ts +0 -9
  44. package/lib/core/types/query-row-validator-initializer.d.ts.map +0 -1
  45. package/lib/core/types/query-row-validator-initializer.js +0 -2
  46. package/lib/core/types/query-row-validator-initializer.js.map +0 -1
  47. package/lib/core/types/validation-options.d.ts +0 -4
  48. package/lib/core/types/validation-options.d.ts.map +0 -1
  49. package/lib/core/types/validation-options.js +0 -2
  50. package/lib/core/types/validation-options.js.map +0 -1
  51. package/lib/core/validation/decorators/index.d.ts +0 -2
  52. package/lib/core/validation/decorators/index.d.ts.map +0 -1
  53. package/lib/core/validation/decorators/index.js +0 -2
  54. package/lib/core/validation/decorators/index.js.map +0 -1
  55. package/lib/core/validation/decorators/number-validaton.d.ts +0 -5
  56. package/lib/core/validation/decorators/number-validaton.d.ts.map +0 -1
  57. package/lib/core/validation/decorators/number-validaton.js +0 -84
  58. package/lib/core/validation/decorators/number-validaton.js.map +0 -1
  59. package/lib/core/validation/index.d.ts +0 -2
  60. package/lib/core/validation/index.d.ts.map +0 -1
  61. package/lib/core/validation/index.js +0 -2
  62. package/lib/core/validation/index.js.map +0 -1
  63. package/lib/core/validation/query-row-validator.d.ts +0 -24
  64. package/lib/core/validation/query-row-validator.d.ts.map +0 -1
  65. package/lib/core/validation/query-row-validator.js +0 -59
  66. package/lib/core/validation/query-row-validator.js.map +0 -1
  67. package/lib/index.d.ts +0 -2
  68. package/lib/index.d.ts.map +0 -1
  69. package/lib/index.js +0 -2
  70. package/lib/index.js.map +0 -1
  71. package/lib/query.d.ts.map +0 -1
  72. package/lib/query.js +0 -393
  73. package/lib/query.js.map +0 -1
  74. package/lib/utils/functions/generic/compare-arrays.d.ts +0 -2
  75. package/lib/utils/functions/generic/compare-arrays.d.ts.map +0 -1
  76. package/lib/utils/functions/generic/compare-arrays.js +0 -3
  77. package/lib/utils/functions/generic/compare-arrays.js.map +0 -1
  78. package/lib/utils/functions/generic/deep-equal.d.ts +0 -2
  79. package/lib/utils/functions/generic/deep-equal.d.ts.map +0 -1
  80. package/lib/utils/functions/generic/deep-equal.js +0 -20
  81. package/lib/utils/functions/generic/deep-equal.js.map +0 -1
  82. package/lib/utils/functions/generic/get-entries.d.ts +0 -2
  83. package/lib/utils/functions/generic/get-entries.d.ts.map +0 -1
  84. package/lib/utils/functions/generic/get-entries.js +0 -4
  85. package/lib/utils/functions/generic/get-entries.js.map +0 -1
  86. package/lib/utils/functions/generic/get-object-property-names.d.ts +0 -3
  87. package/lib/utils/functions/generic/get-object-property-names.d.ts.map +0 -1
  88. package/lib/utils/functions/generic/get-object-property-names.js +0 -4
  89. package/lib/utils/functions/generic/get-object-property-names.js.map +0 -1
  90. package/lib/utils/functions/generic/index.d.ts +0 -4
  91. package/lib/utils/functions/generic/index.d.ts.map +0 -1
  92. package/lib/utils/functions/generic/index.js +0 -4
  93. package/lib/utils/functions/generic/index.js.map +0 -1
  94. package/lib/utils/functions/sort/index.d.ts +0 -3
  95. package/lib/utils/functions/sort/index.d.ts.map +0 -1
  96. package/lib/utils/functions/sort/index.js +0 -3
  97. package/lib/utils/functions/sort/index.js.map +0 -1
  98. package/lib/utils/functions/sort/sort-by-properties.d.ts +0 -3
  99. package/lib/utils/functions/sort/sort-by-properties.d.ts.map +0 -1
  100. package/lib/utils/functions/sort/sort-by-properties.js +0 -16
  101. package/lib/utils/functions/sort/sort-by-properties.js.map +0 -1
  102. package/lib/utils/functions/sort/sort-by-property.d.ts +0 -3
  103. package/lib/utils/functions/sort/sort-by-property.d.ts.map +0 -1
  104. package/lib/utils/functions/sort/sort-by-property.js +0 -25
  105. package/lib/utils/functions/sort/sort-by-property.js.map +0 -1
  106. package/lib/utils/functions/type-guards/index.d.ts +0 -4
  107. package/lib/utils/functions/type-guards/index.d.ts.map +0 -1
  108. package/lib/utils/functions/type-guards/index.js +0 -4
  109. package/lib/utils/functions/type-guards/index.js.map +0 -1
  110. package/lib/utils/functions/type-guards/is-function.d.ts +0 -10
  111. package/lib/utils/functions/type-guards/is-function.d.ts.map +0 -1
  112. package/lib/utils/functions/type-guards/is-function.js +0 -11
  113. package/lib/utils/functions/type-guards/is-function.js.map +0 -1
  114. package/lib/utils/functions/type-guards/is-number.d.ts +0 -9
  115. package/lib/utils/functions/type-guards/is-number.d.ts.map +0 -1
  116. package/lib/utils/functions/type-guards/is-number.js +0 -9
  117. package/lib/utils/functions/type-guards/is-number.js.map +0 -1
  118. package/lib/utils/functions/type-guards/is-object.d.ts +0 -9
  119. package/lib/utils/functions/type-guards/is-object.d.ts.map +0 -1
  120. package/lib/utils/functions/type-guards/is-object.js +0 -9
  121. package/lib/utils/functions/type-guards/is-object.js.map +0 -1
  122. package/lib/utils/types/add-prefix-to-object.d.ts +0 -4
  123. package/lib/utils/types/add-prefix-to-object.d.ts.map +0 -1
  124. package/lib/utils/types/add-prefix-to-object.js +0 -2
  125. package/lib/utils/types/add-prefix-to-object.js.map +0 -1
  126. package/lib/utils/types/allowed-names.d.ts +0 -6
  127. package/lib/utils/types/allowed-names.d.ts.map +0 -1
  128. package/lib/utils/types/allowed-names.js +0 -2
  129. package/lib/utils/types/allowed-names.js.map +0 -1
  130. package/lib/utils/types/flag-excluded-type.d.ts +0 -7
  131. package/lib/utils/types/flag-excluded-type.d.ts.map +0 -1
  132. package/lib/utils/types/flag-excluded-type.js +0 -2
  133. package/lib/utils/types/flag-excluded-type.js.map +0 -1
  134. package/lib/utils/types/generic-object.d.ts +0 -4
  135. package/lib/utils/types/generic-object.d.ts.map +0 -1
  136. package/lib/utils/types/generic-object.js +0 -2
  137. package/lib/utils/types/generic-object.js.map +0 -1
  138. package/lib/utils/types/index.d.ts +0 -11
  139. package/lib/utils/types/index.d.ts.map +0 -1
  140. package/lib/utils/types/index.js +0 -11
  141. package/lib/utils/types/index.js.map +0 -1
  142. package/lib/utils/types/omit-type.d.ts +0 -6
  143. package/lib/utils/types/omit-type.d.ts.map +0 -1
  144. package/lib/utils/types/omit-type.js +0 -2
  145. package/lib/utils/types/omit-type.js.map +0 -1
  146. package/lib/utils/types/partial-of-properties.d.ts +0 -3
  147. package/lib/utils/types/partial-of-properties.d.ts.map +0 -1
  148. package/lib/utils/types/partial-of-properties.js +0 -2
  149. package/lib/utils/types/partial-of-properties.js.map +0 -1
  150. package/lib/utils/types/prop-of.d.ts +0 -6
  151. package/lib/utils/types/prop-of.d.ts.map +0 -1
  152. package/lib/utils/types/prop-of.js +0 -2
  153. package/lib/utils/types/prop-of.js.map +0 -1
  154. package/lib/utils/types/property-only.d.ts +0 -5
  155. package/lib/utils/types/property-only.d.ts.map +0 -1
  156. package/lib/utils/types/property-only.js +0 -2
  157. package/lib/utils/types/property-only.js.map +0 -1
  158. package/lib/utils/types/recursive-partial.d.ts +0 -4
  159. package/lib/utils/types/recursive-partial.d.ts.map +0 -1
  160. package/lib/utils/types/recursive-partial.js +0 -2
  161. package/lib/utils/types/recursive-partial.js.map +0 -1
  162. package/lib/utils/types/sort-function.d.ts +0 -2
  163. package/lib/utils/types/sort-function.d.ts.map +0 -1
  164. package/lib/utils/types/sort-function.js +0 -2
  165. package/lib/utils/types/sort-function.js.map +0 -1
  166. package/lib/utils/types/type.d.ts +0 -5
  167. package/lib/utils/types/type.d.ts.map +0 -1
  168. package/lib/utils/types/type.js +0 -2
  169. package/lib/utils/types/type.js.map +0 -1
package/lib/query.js DELETED
@@ -1,393 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __param = (this && this.__param) || function (paramIndex, decorator) {
8
- return function (target, key) { decorator(target, key, paramIndex); }
9
- };
10
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11
- if (kind === "m") throw new TypeError("Private method is not writable");
12
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
- };
16
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
- };
21
- var _Query_rows, _Query_startAt, _Query_limit;
22
- import { QueryRowValidator } from './core/validation';
23
- import { integer, min, validateNumbers } from './core/validation/decorators';
24
- import { getObjectPropertyNames } from './utils/functions/generic/get-object-property-names';
25
- import { sortByProperties } from './utils/functions/sort';
26
- import { isFunction } from './utils/functions/type-guards';
27
- /**
28
- * Allows filtering data from an array of objects.
29
- *
30
- * @example
31
- * ```ts
32
- * interface User {
33
- * id: string;
34
- * email: string;
35
- * isActive: boolean;
36
- * createdAt: string;
37
- * updatedAt: string;
38
- * }
39
- *
40
- * const users: User[] = [];
41
- *
42
- * // Filtering objects
43
- *
44
- * const activeGmailUsers = Query.from(users)
45
- * .where({
46
- * isActive: true,
47
- * email: (email) => email.endsWith('@gmail.com'),
48
- * })
49
- * .all();
50
- *
51
- * // Selecting specific data
52
- *
53
- * const userEmails = Query.from(users)
54
- * .select('email')
55
- * .column();
56
- *
57
- * const lastUserId = Query.from(users)
58
- * .select('id')
59
- * .orderBy('-createdAt')
60
- * .scalar();
61
- *
62
- * // Checking information
63
- *
64
- * const userExists = Query.from(users)
65
- * .where({
66
- * id: 'some-id',
67
- * })
68
- * .exists();
69
- *
70
- * const numberOfUsers = Query.from(users).count();
71
- * ```
72
- */
73
- export class Query {
74
- /**
75
- * Initializes the query.
76
- *
77
- * @param rows Rows to be queried.
78
- */
79
- constructor(rows) {
80
- /**
81
- * Rows to be queried.
82
- */
83
- _Query_rows.set(this, []);
84
- /**
85
- * Number of results to skip.
86
- */
87
- _Query_startAt.set(this, 0);
88
- /**
89
- * Limit of results.
90
- */
91
- _Query_limit.set(this, null);
92
- __classPrivateFieldSet(this, _Query_rows, [...rows], "f");
93
- }
94
- /**
95
- * Creates a new query based on the given data.
96
- *
97
- * @param rows Rows to be queried.
98
- *
99
- * @returns Query to the given rows.
100
- */
101
- static from(rows) {
102
- return new Query(rows);
103
- }
104
- /**
105
- * Defines specific columns to be returned on the final results.
106
- *
107
- * @param columns Selected columns.
108
- *
109
- * @returns Current query.
110
- */
111
- select(...columns) {
112
- // extract selected columns
113
- const rows = [];
114
- for (const row of __classPrivateFieldGet(this, _Query_rows, "f")) {
115
- const result = {};
116
- for (const column of columns) {
117
- result[column] = row[column];
118
- }
119
- rows.push(result);
120
- }
121
- // create new query
122
- const query = new Query(rows);
123
- this.cloneStateInto(query);
124
- return query;
125
- }
126
- /**
127
- * Maps each row to a new object and returns a new query.
128
- *
129
- * @param callback Function to be called for each row.
130
- * @returns New query with the mapped rows.
131
- */
132
- map(callback) {
133
- // map rows
134
- const rows = [];
135
- for (const row of __classPrivateFieldGet(this, _Query_rows, "f")) {
136
- rows.push(callback(row));
137
- }
138
- // create new query
139
- const query = new Query(rows);
140
- this.cloneStateInto(query);
141
- return query;
142
- }
143
- /**
144
- * Applies conditions to the query.
145
- *
146
- * @param condition Filter to be applied to the query.
147
- *
148
- * If a callback function is provided, it must return a boolean value.
149
- *
150
- * If an object is provided, its properties must be attributes of `T` and their
151
- * corresponding values must be the expected values for the attributes or a
152
- * callback functions that return boolean values.
153
- *
154
- * @returns Current query.
155
- */
156
- where(condition) {
157
- this.filterRows(condition);
158
- return this;
159
- }
160
- /**
161
- * Applies a set of conditions to the query ignoring `null` and `undefined`
162
- * values as conditions.
163
- *
164
- * @param condition An object where each property represents an attribute
165
- * to be validated. The values can be literal or callback functions that
166
- * return a boolean. If `null` or `undefined` is passed, that condition
167
- * will be skipped.
168
- *
169
- * @returns Current query.
170
- */
171
- filterWhere(condition) {
172
- this.filterRows(condition, { ignoreNullValues: true });
173
- return this;
174
- }
175
- /**
176
- * Adds ordering to the results.
177
- *
178
- * This method should be called after `select()`; otherwise, the ordering will
179
- * be applied only to the selected columns.
180
- *
181
- * @example
182
- * ```ts
183
- * // ❌ "age" will not be ordered, because it is not part of the selected columns
184
- * const query = Query.from(users)
185
- * .orderBy('-age')
186
- * .select('name');
187
- *
188
- * // ✅ "age" will be ordered
189
- * const query = Query.from(users)
190
- * .select('name', 'age')
191
- * .orderBy('-age');
192
- * ```
193
- *
194
- * @param columns Ascending or descending columns. To mark a field as
195
- * descending, prefix it with `-`.
196
- *
197
- * @returns Current query.
198
- */
199
- orderBy(...columns) {
200
- __classPrivateFieldSet(this, _Query_rows, __classPrivateFieldGet(this, _Query_rows, "f").sort(sortByProperties(...columns)), "f");
201
- return this;
202
- }
203
- /**
204
- * Defines the number of rows to skip.
205
- *
206
- * @param numberOfRows Numbers of rows to skip. Only non negative integer numbers
207
- * are allowed.
208
- *
209
- * @returns Current query.
210
- *
211
- * @throws {InvalidArgumentError} If the given number is less than 0.
212
- */
213
- skip(numberOfRows) {
214
- __classPrivateFieldSet(this, _Query_startAt, numberOfRows, "f");
215
- return this;
216
- }
217
- /**
218
- * Defines a limit for the number of results.
219
- *
220
- * @param limit Limit of results. Only non negative integer numbers are allowed.
221
- *
222
- * @returns Current query.
223
- *
224
- * @throws {InvalidArgumentError} If the given limit is less than 0.
225
- */
226
- limit(limit) {
227
- __classPrivateFieldSet(this, _Query_limit, limit, "f");
228
- return this;
229
- }
230
- groupBy(groupArg, mapArg) {
231
- const rows = this.getLimitedRows();
232
- const map = new Map();
233
- const hasCallback = isFunction(groupArg);
234
- for (const row of rows) {
235
- const index = hasCallback ? groupArg(row) : row[groupArg];
236
- const value = mapArg ? mapArg(row) : row;
237
- if (map.has(index)) {
238
- map.get(index).push(value);
239
- }
240
- else {
241
- map.set(index, [value]);
242
- }
243
- }
244
- return map;
245
- }
246
- /**
247
- * Returns all results.
248
- *
249
- * @returns All filtered rows.
250
- */
251
- all() {
252
- return this.getLimitedRows();
253
- }
254
- /**
255
- * Returns the first result.
256
- *
257
- * @returns The first result.
258
- */
259
- first() {
260
- const rows = this.getLimitedRows();
261
- return rows.length > 0 ? rows[0] : null;
262
- }
263
- /**
264
- * Returns the last result.
265
- *
266
- * @returns The last result.
267
- */
268
- last() {
269
- const rows = this.getLimitedRows();
270
- return rows[rows.length - 1] ?? null;
271
- }
272
- /**
273
- * Returns the value of the first (selected) column of the first row.
274
- *
275
- * @returns First value or `false`, if none row exists.
276
- */
277
- scalar() {
278
- const firstObject = this.first();
279
- const firstColumn = this.getFirstColumn();
280
- return firstObject && firstColumn ? firstObject[firstColumn] : false;
281
- }
282
- column(column) {
283
- if (column === undefined) {
284
- const firstColumn = this.getFirstColumn();
285
- if (!firstColumn) {
286
- return [];
287
- }
288
- column = firstColumn;
289
- }
290
- return this.getLimitedRows().map((row) => row[column]);
291
- }
292
- /**
293
- * Returns the values of the rows. If there are selected columns, only their
294
- * values will be returned.
295
- *
296
- * @returns Array with the values of all rows.
297
- */
298
- values() {
299
- const rows = [];
300
- for (const row of this.getLimitedRows()) {
301
- rows.push(Object.values(row));
302
- }
303
- return rows;
304
- }
305
- /**
306
- * Returns the current number of rows.
307
- *
308
- * @return Filtered rows count.
309
- */
310
- count() {
311
- return this.getLimitedRows().length;
312
- }
313
- /**
314
- * Checks if there is at least one row compatible with the query.
315
- *
316
- * @returns Whether any row exists after filtering.
317
- */
318
- exists() {
319
- return this.count() > 0;
320
- }
321
- /**
322
- * Filters the rows according to the given conditions.
323
- *
324
- * @param condition Object or callback function.
325
- */
326
- filterRows(condition, options) {
327
- const rows = __classPrivateFieldGet(this, _Query_rows, "f");
328
- const result = [];
329
- if (isFunction(condition)) {
330
- for (let i = 0; i < rows.length; i++) {
331
- const row = rows[i];
332
- if (condition(row)) {
333
- result.push(row);
334
- }
335
- }
336
- }
337
- else {
338
- for (let i = 0; i < rows.length; i++) {
339
- const row = rows[i];
340
- if (QueryRowValidator.validate(row, condition, options)) {
341
- result.push(row);
342
- }
343
- }
344
- }
345
- __classPrivateFieldSet(this, _Query_rows, result, "f");
346
- }
347
- /**
348
- * Returns the first selected column or the first key of some row.
349
- *
350
- * @returns The first column or `null`, if none is selected or there is no row.
351
- */
352
- getFirstColumn() {
353
- const firstRow = this.first();
354
- if (!firstRow) {
355
- return null;
356
- }
357
- const columns = getObjectPropertyNames(firstRow);
358
- if (columns.length > 0) {
359
- return columns[0];
360
- }
361
- return null;
362
- }
363
- /**
364
- * Returns the rows that should be used in the final results.
365
- *
366
- * @returns Rows within the specified limit.
367
- */
368
- getLimitedRows() {
369
- const rows = [...__classPrivateFieldGet(this, _Query_rows, "f")];
370
- return rows.slice(__classPrivateFieldGet(this, _Query_startAt, "f"), __classPrivateFieldGet(this, _Query_startAt, "f") + (__classPrivateFieldGet(this, _Query_limit, "f") ?? rows.length));
371
- }
372
- /**
373
- * Copies the state of the current query into the given query.
374
- *
375
- * @param query Query to copy the state into.
376
- */
377
- cloneStateInto(query) {
378
- __classPrivateFieldSet(query, _Query_startAt, __classPrivateFieldGet(this, _Query_startAt, "f"), "f");
379
- __classPrivateFieldSet(query, _Query_limit, __classPrivateFieldGet(this, _Query_limit, "f"), "f");
380
- }
381
- }
382
- _Query_rows = new WeakMap(), _Query_startAt = new WeakMap(), _Query_limit = new WeakMap();
383
- __decorate([
384
- validateNumbers,
385
- __param(0, integer),
386
- __param(0, min(0))
387
- ], Query.prototype, "skip", null);
388
- __decorate([
389
- validateNumbers,
390
- __param(0, integer),
391
- __param(0, min(0))
392
- ], Query.prototype, "limit", null);
393
- //# sourceMappingURL=query.js.map
package/lib/query.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,OAAO,KAAK;IAgBhB;;;;OAIG;IACH,YAAoB,IAAS;QApB7B;;WAEG;QACH,sBAAa,EAAE,EAAC;QAEhB;;WAEG;QACH,yBAAW,CAAC,EAAC;QAEb;;WAEG;QACH,uBAAwB,IAAI,EAAC;QAQ3B,uBAAA,IAAI,eAAS,CAAC,GAAG,IAAI,CAAC,MAAA,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAmB,IAAS;QACrC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,GAAG,OAAiB;QAIpB,2BAA2B;QAC3B,MAAM,IAAI,GAAW,EAAE,CAAC;QAExB,KAAK,MAAM,GAAG,IAAI,uBAAA,IAAI,mBAAM,EA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AAC;QAEjD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,CAAC,CAAE,CAAC;QACrB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACK,cAAc;QACpB,MAAM,IAAI,GAAG,CAAC,GAAG,uBAAA,IAAI,mBAAM,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC,KAAK,CACf,uBAAA,IAAI,sBAAS,EACb,uBAAA,IAAI,sBAAS,GAAG,CAAC,uBAAA,IAAI,oBAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAC7C,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACK,cAAc,CAAmB,KAAe;QACtD,uBAAA,KAAK,kBAAY,uBAAA,IAAI,sBAAS,MAAA,CAAC;QAC/B,uBAAA,KAAK,gBAAU,uBAAA,IAAI,oBAAO,MAAA,CAAC;IAC7B,CAAC;CACF;;AAtQC;IADC,eAAe;IACV,WAAA,OAAO,CAAA;IAAE,WAAA,GAAG,CAAC,CAAC,CAAC,CAAA;iCAIpB;AAYD;IADC,eAAe;IACT,WAAA,OAAO,CAAA;IAAE,WAAA,GAAG,CAAC,CAAC,CAAC,CAAA;kCAIrB"}
@@ -1,2 +0,0 @@
1
- export declare const compareArrays: <T>(a: T[], b: T[]) => boolean;
2
- //# sourceMappingURL=compare-arrays.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare-arrays.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/generic/compare-arrays.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,KAAG,OACc,CAAC"}
@@ -1,3 +0,0 @@
1
- import { deepEqual } from './deep-equal';
2
- export const compareArrays = (a, b) => a.length === b.length && a.every((v, i) => deepEqual(v, b[i]));
3
- //# sourceMappingURL=compare-arrays.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare-arrays.js","sourceRoot":"","sources":["../../../../src/utils/functions/generic/compare-arrays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,CAAM,EAAE,CAAM,EAAW,EAAE,CAC1D,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const deepEqual: (a: unknown, b: unknown) => boolean;
2
- //# sourceMappingURL=deep-equal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deep-equal.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/generic/deep-equal.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OA4BlD,CAAC"}
@@ -1,20 +0,0 @@
1
- import { isObject } from '../type-guards';
2
- export const deepEqual = (a, b) => {
3
- if (a === b) {
4
- return true;
5
- }
6
- if (!isObject(a) || !isObject(b)) {
7
- return false;
8
- }
9
- if (Array.isArray(a) !== Array.isArray(b)) {
10
- return false;
11
- }
12
- const keysA = Object.keys(a);
13
- const keysB = Object.keys(b);
14
- if (keysA.length !== keysB.length) {
15
- return false;
16
- }
17
- return keysA.every((key) => Object.prototype.hasOwnProperty.call(b, key) &&
18
- deepEqual(a[key], b[key]));
19
- };
20
- //# sourceMappingURL=deep-equal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deep-equal.js","sourceRoot":"","sources":["../../../../src/utils/functions/generic/deep-equal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE;IAC3D,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAChB,CAAC,GAAG,EAAE,EAAE,CACN,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC;QAC5C,SAAS,CACN,CAA6B,CAAC,GAAG,CAAC,EAClC,CAA6B,CAAC,GAAG,CAAC,CACpC,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function getEntries<T extends Record<PropertyKey, unknown>>(obj: T): [keyof T, T[keyof T]][];
2
- //# sourceMappingURL=get-entries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-entries.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/generic/get-entries.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAC/D,GAAG,EAAE,CAAC,GACL,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAEzB"}
@@ -1,4 +0,0 @@
1
- export function getEntries(obj) {
2
- return Object.entries(obj);
3
- }
4
- //# sourceMappingURL=get-entries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-entries.js","sourceRoot":"","sources":["../../../../src/utils/functions/generic/get-entries.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CACxB,GAAM;IAEN,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAA4B,CAAC;AACxD,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { PropOf } from '../../types';
2
- export declare function getObjectPropertyNames<T extends object>(obj: T): PropOf<T>[];
3
- //# sourceMappingURL=get-object-property-names.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-object-property-names.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/generic/get-object-property-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAI5E"}
@@ -1,4 +0,0 @@
1
- export function getObjectPropertyNames(obj) {
2
- return Object.keys(obj).filter((key) => typeof obj[key] !== 'function');
3
- }
4
- //# sourceMappingURL=get-object-property-names.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-object-property-names.js","sourceRoot":"","sources":["../../../../src/utils/functions/generic/get-object-property-names.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAmB,GAAM;IAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAC5B,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,GAAc,CAAC,KAAK,UAAU,CACpC,CAAC;AACnB,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './compare-arrays';
2
- export * from './deep-equal';
3
- export * from './get-entries';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/generic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './compare-arrays';
2
- export * from './deep-equal';
3
- export * from './get-entries';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/functions/generic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './sort-by-properties';
2
- export * from './sort-by-property';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/sort/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './sort-by-properties';
2
- export * from './sort-by-property';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/functions/sort/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { addPrefixToObject, PropertyOnly, PropOf, SortFunction } from '../../types';
2
- export declare function sortByProperties<T extends object>(...props: (PropOf<T> | keyof addPrefixToObject<PropertyOnly<T>, '-'>)[]): SortFunction<T>;
3
- //# sourceMappingURL=sort-by-properties.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sort-by-properties.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/sort/sort-by-properties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,GAAG,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GACtE,YAAY,CAAC,CAAC,CAAC,CAgBjB"}
@@ -1,16 +0,0 @@
1
- import { sortByProperty } from '.';
2
- export function sortByProperties(...props) {
3
- return (a, b) => {
4
- if (props.length === 0) {
5
- return 0;
6
- }
7
- for (const prop of props) {
8
- const result = sortByProperty(prop)(a, b);
9
- if (result !== 0) {
10
- return result;
11
- }
12
- }
13
- return 0;
14
- };
15
- }
16
- //# sourceMappingURL=sort-by-properties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sort-by-properties.js","sourceRoot":"","sources":["../../../../src/utils/functions/sort/sort-by-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAQnC,MAAM,UAAU,gBAAgB,CAC9B,GAAG,KAAoE;IAEvE,OAAO,CAAC,CAAI,EAAE,CAAI,EAAU,EAAE;QAC5B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,CAAC;QACX,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,cAAc,CAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAE7C,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;gBACjB,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { addPrefixToObject, PropertyOnly, PropOf, SortFunction } from '../../types';
2
- export declare function sortByProperty<T extends object>(property: PropOf<T> | keyof addPrefixToObject<PropertyOnly<T>, '-'>): SortFunction<T>;
3
- //# sourceMappingURL=sort-by-property.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sort-by-property.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/sort/sort-by-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAC7C,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAClE,YAAY,CAAC,CAAC,CAAC,CAwBjB"}
@@ -1,25 +0,0 @@
1
- export function sortByProperty(property) {
2
- let sortOrder = 1;
3
- let prop = property;
4
- if (prop.startsWith('-')) {
5
- sortOrder = -1;
6
- prop = prop.slice(1);
7
- }
8
- const key = prop;
9
- return (a, b) => {
10
- const valueA = a[key];
11
- const valueB = b[key];
12
- if (valueA == null && valueB == null)
13
- return 0;
14
- if (valueA == null)
15
- return 1 * sortOrder;
16
- if (valueB == null)
17
- return -1 * sortOrder;
18
- if (valueA < valueB)
19
- return -1 * sortOrder;
20
- if (valueA > valueB)
21
- return 1 * sortOrder;
22
- return 0;
23
- };
24
- }
25
- //# sourceMappingURL=sort-by-property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sort-by-property.js","sourceRoot":"","sources":["../../../../src/utils/functions/sort/sort-by-property.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,cAAc,CAC5B,QAAmE;IAEnE,IAAI,SAAS,GAAW,CAAC,CAAC;IAC1B,IAAI,IAAI,GAAG,QAAkB,CAAC;IAE9B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,SAAS,GAAG,CAAC,CAAC,CAAC;QACf,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,GAAG,GAAG,IAAe,CAAC;IAE5B,OAAO,CAAC,CAAI,EAAE,CAAI,EAAU,EAAE;QAC5B,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACtB,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAEtB,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI;YAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,MAAM,IAAI,IAAI;YAAE,OAAO,CAAC,GAAG,SAAS,CAAC;QACzC,IAAI,MAAM,IAAI,IAAI;YAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;QAE1C,IAAI,MAAM,GAAG,MAAM;YAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;QAC3C,IAAI,MAAM,GAAG,MAAM;YAAE,OAAO,CAAC,GAAG,SAAS,CAAC;QAE1C,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './is-function';
2
- export * from './is-number';
3
- export * from './is-object';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './is-function';
2
- export * from './is-number';
3
- export * from './is-object';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Determines if the given value is a function.
3
- *
4
- * @param value The value to check.
5
- *
6
- * @returns Validation result.
7
- *
8
- */
9
- export declare const isFunction: (value: unknown) => value is (...args: any[]) => unknown;
10
- //# sourceMappingURL=is-function.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-function.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-function.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,OAAO,KACb,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAsC,CAAC"}
@@ -1,11 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /**
3
- * Determines if the given value is a function.
4
- *
5
- * @param value The value to check.
6
- *
7
- * @returns Validation result.
8
- *
9
- */
10
- export const isFunction = (value) => typeof value === 'function';
11
- //# sourceMappingURL=is-function.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-function.js","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-function.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAAc,EACwB,EAAE,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC"}