querier-ts 1.0.1 → 2.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.
Files changed (172) hide show
  1. package/README.md +76 -70
  2. package/lib/core/errors/index.d.ts +1 -0
  3. package/lib/core/errors/index.d.ts.map +1 -0
  4. package/lib/core/errors/index.js +2 -17
  5. package/lib/core/errors/index.js.map +1 -0
  6. package/lib/core/errors/invalid-argument-error.d.ts +1 -0
  7. package/lib/core/errors/invalid-argument-error.d.ts.map +1 -0
  8. package/lib/core/errors/invalid-argument-error.js +2 -5
  9. package/lib/core/errors/invalid-argument-error.js.map +1 -0
  10. package/lib/core/types/attribute-validation-function.d.ts +1 -0
  11. package/lib/core/types/attribute-validation-function.d.ts.map +1 -0
  12. package/lib/core/types/attribute-validation-function.js +2 -2
  13. package/lib/core/types/attribute-validation-function.js.map +1 -0
  14. package/lib/core/types/column-condition.d.ts +3 -2
  15. package/lib/core/types/column-condition.d.ts.map +1 -0
  16. package/lib/core/types/column-condition.js +2 -2
  17. package/lib/core/types/column-condition.js.map +1 -0
  18. package/lib/core/types/index.d.ts +1 -0
  19. package/lib/core/types/index.d.ts.map +1 -0
  20. package/lib/core/types/index.js +5 -20
  21. package/lib/core/types/index.js.map +1 -0
  22. package/lib/core/types/ordering-column.d.ts +3 -0
  23. package/lib/core/types/ordering-column.d.ts.map +1 -0
  24. package/lib/core/types/ordering-column.js +2 -0
  25. package/lib/core/types/ordering-column.js.map +1 -0
  26. package/lib/core/types/query-conditions-group-nullable.d.ts +2 -1
  27. package/lib/core/types/query-conditions-group-nullable.d.ts.map +1 -0
  28. package/lib/core/types/query-conditions-group-nullable.js +2 -2
  29. package/lib/core/types/query-conditions-group-nullable.js.map +1 -0
  30. package/lib/core/types/query-conditions-group.d.ts +2 -1
  31. package/lib/core/types/query-conditions-group.d.ts.map +1 -0
  32. package/lib/core/types/query-conditions-group.js +2 -2
  33. package/lib/core/types/query-conditions-group.js.map +1 -0
  34. package/lib/core/types/query-row-validator-initializer.d.ts +2 -1
  35. package/lib/core/types/query-row-validator-initializer.d.ts.map +1 -0
  36. package/lib/core/types/query-row-validator-initializer.js +2 -2
  37. package/lib/core/types/query-row-validator-initializer.js.map +1 -0
  38. package/lib/core/validation/decorators/index.d.ts +1 -0
  39. package/lib/core/validation/decorators/index.d.ts.map +1 -0
  40. package/lib/core/validation/decorators/index.js +2 -17
  41. package/lib/core/validation/decorators/index.js.map +1 -0
  42. package/lib/core/validation/decorators/number-validaton.d.ts +5 -36
  43. package/lib/core/validation/decorators/number-validaton.d.ts.map +1 -0
  44. package/lib/core/validation/decorators/number-validaton.js +86 -113
  45. package/lib/core/validation/decorators/number-validaton.js.map +1 -0
  46. package/lib/core/validation/index.d.ts +1 -0
  47. package/lib/core/validation/index.d.ts.map +1 -0
  48. package/lib/core/validation/index.js +2 -17
  49. package/lib/core/validation/index.js.map +1 -0
  50. package/lib/core/validation/query-row-validator.d.ts +2 -1
  51. package/lib/core/validation/query-row-validator.d.ts.map +1 -0
  52. package/lib/core/validation/query-row-validator.js +9 -12
  53. package/lib/core/validation/query-row-validator.js.map +1 -0
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.d.ts.map +1 -0
  56. package/lib/index.js +2 -17
  57. package/lib/index.js.map +1 -0
  58. package/lib/query.d.ts +34 -5
  59. package/lib/query.d.ts.map +1 -0
  60. package/lib/query.js +117 -62
  61. package/lib/query.js.map +1 -0
  62. package/lib/utils/functions/generic/compare-arrays.d.ts +1 -0
  63. package/lib/utils/functions/generic/compare-arrays.d.ts.map +1 -0
  64. package/lib/utils/functions/generic/compare-arrays.js +3 -6
  65. package/lib/utils/functions/generic/compare-arrays.js.map +1 -0
  66. package/lib/utils/functions/generic/deep-equal.d.ts +1 -0
  67. package/lib/utils/functions/generic/deep-equal.d.ts.map +1 -0
  68. package/lib/utils/functions/generic/deep-equal.js +5 -8
  69. package/lib/utils/functions/generic/deep-equal.js.map +1 -0
  70. package/lib/utils/functions/generic/get-entries.d.ts +2 -5
  71. package/lib/utils/functions/generic/get-entries.d.ts.map +1 -0
  72. package/lib/utils/functions/generic/get-entries.js +3 -9
  73. package/lib/utils/functions/generic/get-entries.js.map +1 -0
  74. package/lib/utils/functions/generic/get-object-property-names.d.ts +3 -0
  75. package/lib/utils/functions/generic/get-object-property-names.d.ts.map +1 -0
  76. package/lib/utils/functions/generic/get-object-property-names.js +4 -0
  77. package/lib/utils/functions/generic/get-object-property-names.js.map +1 -0
  78. package/lib/utils/functions/generic/index.d.ts +1 -0
  79. package/lib/utils/functions/generic/index.d.ts.map +1 -0
  80. package/lib/utils/functions/generic/index.js +4 -19
  81. package/lib/utils/functions/generic/index.js.map +1 -0
  82. package/lib/utils/functions/sort/index.d.ts +1 -0
  83. package/lib/utils/functions/sort/index.d.ts.map +1 -0
  84. package/lib/utils/functions/sort/index.js +3 -18
  85. package/lib/utils/functions/sort/index.js.map +1 -0
  86. package/lib/utils/functions/sort/sort-by-properties.d.ts +2 -1
  87. package/lib/utils/functions/sort/sort-by-properties.d.ts.map +1 -0
  88. package/lib/utils/functions/sort/sort-by-properties.js +4 -7
  89. package/lib/utils/functions/sort/sort-by-properties.js.map +1 -0
  90. package/lib/utils/functions/sort/sort-by-property.d.ts +2 -1
  91. package/lib/utils/functions/sort/sort-by-property.d.ts.map +1 -0
  92. package/lib/utils/functions/sort/sort-by-property.js +2 -4
  93. package/lib/utils/functions/sort/sort-by-property.js.map +1 -0
  94. package/lib/utils/functions/type-guards/index.d.ts +1 -0
  95. package/lib/utils/functions/type-guards/index.d.ts.map +1 -0
  96. package/lib/utils/functions/type-guards/index.js +4 -19
  97. package/lib/utils/functions/type-guards/index.js.map +1 -0
  98. package/lib/utils/functions/type-guards/is-function.d.ts +1 -0
  99. package/lib/utils/functions/type-guards/is-function.d.ts.map +1 -0
  100. package/lib/utils/functions/type-guards/is-function.js +2 -5
  101. package/lib/utils/functions/type-guards/is-function.js.map +1 -0
  102. package/lib/utils/functions/type-guards/is-number.d.ts +1 -0
  103. package/lib/utils/functions/type-guards/is-number.d.ts.map +1 -0
  104. package/lib/utils/functions/type-guards/is-number.js +2 -5
  105. package/lib/utils/functions/type-guards/is-number.js.map +1 -0
  106. package/lib/utils/functions/type-guards/is-object.d.ts +1 -0
  107. package/lib/utils/functions/type-guards/is-object.d.ts.map +1 -0
  108. package/lib/utils/functions/type-guards/is-object.js +2 -5
  109. package/lib/utils/functions/type-guards/is-object.js.map +1 -0
  110. package/lib/utils/types/add-prefix-to-object.d.ts +1 -0
  111. package/lib/utils/types/add-prefix-to-object.d.ts.map +1 -0
  112. package/lib/utils/types/add-prefix-to-object.js +2 -2
  113. package/lib/utils/types/add-prefix-to-object.js.map +1 -0
  114. package/lib/utils/types/allowed-names.d.ts +2 -1
  115. package/lib/utils/types/allowed-names.d.ts.map +1 -0
  116. package/lib/utils/types/allowed-names.js +2 -2
  117. package/lib/utils/types/allowed-names.js.map +1 -0
  118. package/lib/utils/types/flag-excluded-type.d.ts +1 -0
  119. package/lib/utils/types/flag-excluded-type.d.ts.map +1 -0
  120. package/lib/utils/types/flag-excluded-type.js +2 -2
  121. package/lib/utils/types/flag-excluded-type.js.map +1 -0
  122. package/lib/utils/types/generic-object.d.ts +1 -0
  123. package/lib/utils/types/generic-object.d.ts.map +1 -0
  124. package/lib/utils/types/generic-object.js +2 -2
  125. package/lib/utils/types/generic-object.js.map +1 -0
  126. package/lib/utils/types/index.d.ts +1 -0
  127. package/lib/utils/types/index.d.ts.map +1 -0
  128. package/lib/utils/types/index.js +11 -26
  129. package/lib/utils/types/index.js.map +1 -0
  130. package/lib/utils/types/omit-type.d.ts +2 -1
  131. package/lib/utils/types/omit-type.d.ts.map +1 -0
  132. package/lib/utils/types/omit-type.js +2 -2
  133. package/lib/utils/types/omit-type.js.map +1 -0
  134. package/lib/utils/types/partial-of-properties.d.ts +2 -1
  135. package/lib/utils/types/partial-of-properties.d.ts.map +1 -0
  136. package/lib/utils/types/partial-of-properties.js +2 -2
  137. package/lib/utils/types/partial-of-properties.js.map +1 -0
  138. package/lib/utils/types/prop-of.d.ts +2 -1
  139. package/lib/utils/types/prop-of.d.ts.map +1 -0
  140. package/lib/utils/types/prop-of.js +2 -2
  141. package/lib/utils/types/prop-of.js.map +1 -0
  142. package/lib/utils/types/property-only.d.ts +2 -1
  143. package/lib/utils/types/property-only.d.ts.map +1 -0
  144. package/lib/utils/types/property-only.js +2 -2
  145. package/lib/utils/types/property-only.js.map +1 -0
  146. package/lib/utils/types/recursive-partial.d.ts +1 -0
  147. package/lib/utils/types/recursive-partial.d.ts.map +1 -0
  148. package/lib/utils/types/recursive-partial.js +2 -2
  149. package/lib/utils/types/recursive-partial.js.map +1 -0
  150. package/lib/utils/types/sort-function.d.ts +1 -0
  151. package/lib/utils/types/sort-function.d.ts.map +1 -0
  152. package/lib/utils/types/sort-function.js +2 -2
  153. package/lib/utils/types/sort-function.js.map +1 -0
  154. package/lib/utils/types/type.d.ts +1 -0
  155. package/lib/utils/types/type.d.ts.map +1 -0
  156. package/lib/utils/types/type.js +2 -2
  157. package/lib/utils/types/type.js.map +1 -0
  158. package/package.json +23 -10
  159. package/lib/base-object.d.ts +0 -6
  160. package/lib/base-object.js +0 -15
  161. package/lib/errors/index.d.ts +0 -2
  162. package/lib/errors/index.js +0 -5
  163. package/lib/errors/invalid-argument-error.d.ts +0 -10
  164. package/lib/errors/invalid-argument-error.js +0 -11
  165. package/lib/query-conditions-group-nullable.d.ts +0 -4
  166. package/lib/query-conditions-group-nullable.js +0 -2
  167. package/lib/query-conditions-group.d.ts +0 -4
  168. package/lib/query-conditions-group.js +0 -2
  169. package/lib/query-row-validator.d.ts +0 -72
  170. package/lib/query-row-validator.js +0 -85
  171. package/lib/utils/decorators/number-validaton.d.ts +0 -36
  172. package/lib/utils/decorators/number-validaton.js +0 -124
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-function.js","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-function.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAI,KAAc,EAAc,EAAE,CAC1D,OAAO,KAAK,KAAK,UAAU,CAAC"}
@@ -6,3 +6,4 @@
6
6
  * @returns Validation result.
7
7
  */
8
8
  export declare const isNumber: (value: unknown) => value is number;
9
+ //# sourceMappingURL=is-number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-number.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-number.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MACxB,CAAC"}
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNumber = void 0;
4
1
  /**
5
2
  * Determines if the given value is a number.
6
3
  *
@@ -8,5 +5,5 @@ exports.isNumber = void 0;
8
5
  *
9
6
  * @returns Validation result.
10
7
  */
11
- const isNumber = (value) => typeof value === 'number';
12
- exports.isNumber = isNumber;
8
+ export const isNumber = (value) => typeof value === 'number';
9
+ //# sourceMappingURL=is-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-number.js","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-number.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAC1D,OAAO,KAAK,KAAK,QAAQ,CAAC"}
@@ -6,3 +6,4 @@
6
6
  * @returns Validation result.
7
7
  */
8
8
  export declare const isObject: (value: unknown) => value is object;
9
+ //# sourceMappingURL=is-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-object.d.ts","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MACN,CAAC"}
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isObject = void 0;
4
1
  /**
5
2
  * Determines if the given value is an object.
6
3
  *
@@ -8,5 +5,5 @@ exports.isObject = void 0;
8
5
  *
9
6
  * @returns Validation result.
10
7
  */
11
- const isObject = (value) => typeof value === 'object' && value !== null;
12
- exports.isObject = isObject;
8
+ export const isObject = (value) => typeof value === 'object' && value !== null;
9
+ //# sourceMappingURL=is-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-object.js","sourceRoot":"","sources":["../../../../src/utils/functions/type-guards/is-object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAC1D,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export type addPrefixToObject<T, P extends string> = {
2
2
  [K in keyof T as K extends string ? `${P}${K}` : never]: T[K];
3
3
  };
4
+ //# sourceMappingURL=add-prefix-to-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-prefix-to-object.d.ts","sourceRoot":"","sources":["../../../src/utils/types/add-prefix-to-object.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI;KAClD,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CAC9D,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=add-prefix-to-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-prefix-to-object.js","sourceRoot":"","sources":["../../../src/utils/types/add-prefix-to-object.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
- import { FlagExcludedType } from '.';
1
+ import type { FlagExcludedType } from '.';
2
2
  /**
3
3
  * Gets the keys that are not flagged as 'never'.
4
4
  */
5
5
  export type AllowedNames<Base, Type> = FlagExcludedType<Base, Type>[keyof Base];
6
+ //# sourceMappingURL=allowed-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowed-names.d.ts","sourceRoot":"","sources":["../../../src/utils/types/allowed-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,EAAE,IAAI,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=allowed-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowed-names.js","sourceRoot":"","sources":["../../../src/utils/types/allowed-names.ts"],"names":[],"mappings":""}
@@ -4,3 +4,4 @@
4
4
  export type FlagExcludedType<Base, Type> = {
5
5
  [Key in keyof Base]: Base[Key] extends Type ? never : Key;
6
6
  };
7
+ //# sourceMappingURL=flag-excluded-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flag-excluded-type.d.ts","sourceRoot":"","sources":["../../../src/utils/types/flag-excluded-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI;KACxC,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,GAAG;CAC1D,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=flag-excluded-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flag-excluded-type.js","sourceRoot":"","sources":["../../../src/utils/types/flag-excluded-type.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
1
  export interface GenericObject {
2
2
  [key: string]: unknown;
3
3
  }
4
+ //# sourceMappingURL=generic-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-object.d.ts","sourceRoot":"","sources":["../../../src/utils/types/generic-object.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=generic-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-object.js","sourceRoot":"","sources":["../../../src/utils/types/generic-object.ts"],"names":[],"mappings":""}
@@ -8,3 +8,4 @@ export * from './prop-of';
8
8
  export * from './property-only';
9
9
  export * from './recursive-partial';
10
10
  export * from './sort-function';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
@@ -1,26 +1,11 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./add-prefix-to-object"), exports);
18
- __exportStar(require("./allowed-names"), exports);
19
- __exportStar(require("./flag-excluded-type"), exports);
20
- __exportStar(require("./generic-object"), exports);
21
- __exportStar(require("./omit-type"), exports);
22
- __exportStar(require("./partial-of-properties"), exports);
23
- __exportStar(require("./prop-of"), exports);
24
- __exportStar(require("./property-only"), exports);
25
- __exportStar(require("./recursive-partial"), exports);
26
- __exportStar(require("./sort-function"), exports);
1
+ export * from './add-prefix-to-object';
2
+ export * from './allowed-names';
3
+ export * from './flag-excluded-type';
4
+ export * from './generic-object';
5
+ export * from './omit-type';
6
+ export * from './partial-of-properties';
7
+ export * from './prop-of';
8
+ export * from './property-only';
9
+ export * from './recursive-partial';
10
+ export * from './sort-function';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
@@ -1,5 +1,6 @@
1
- import { AllowedNames } from '.';
1
+ import type { AllowedNames } from '.';
2
2
  /**
3
3
  * Use this with a simple Pick to get the right interface, excluding the undesired type.
4
4
  */
5
5
  export type OmitType<Base, Type> = Pick<Base, AllowedNames<Base, Type>>;
6
+ //# sourceMappingURL=omit-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit-type.d.ts","sourceRoot":"","sources":["../../../src/utils/types/omit-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=omit-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit-type.js","sourceRoot":"","sources":["../../../src/utils/types/omit-type.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
- import { PropertyOnly } from '.';
1
+ import type { PropertyOnly } from '.';
2
2
  export type PartialOfProperties<T extends object> = Partial<PropertyOnly<T>>;
3
+ //# sourceMappingURL=partial-of-properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial-of-properties.d.ts","sourceRoot":"","sources":["../../../src/utils/types/partial-of-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEtC,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=partial-of-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial-of-properties.js","sourceRoot":"","sources":["../../../src/utils/types/partial-of-properties.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
- import { PropertyOnly } from '.';
1
+ import type { PropertyOnly } from '.';
2
2
  /**
3
3
  * Represents a property of a class or interface.
4
4
  */
5
5
  export type PropOf<T extends object> = keyof PropertyOnly<T>;
6
+ //# sourceMappingURL=prop-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-of.d.ts","sourceRoot":"","sources":["../../../src/utils/types/prop-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=prop-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-of.js","sourceRoot":"","sources":["../../../src/utils/types/prop-of.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { NonFunctionKeys } from 'utility-types';
1
+ import type { NonFunctionKeys } from 'utility-types';
2
2
  export type PropertyOnly<T extends object> = {
3
3
  [P in NonFunctionKeys<T>]: T[P];
4
4
  };
5
+ //# sourceMappingURL=property-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-only.d.ts","sourceRoot":"","sources":["../../../src/utils/types/property-only.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI;KAC1C,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=property-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-only.js","sourceRoot":"","sources":["../../../src/utils/types/property-only.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
1
  export type RecursivePartial<T> = {
2
2
  [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
3
3
  };
4
+ //# sourceMappingURL=recursive-partial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursive-partial.d.ts","sourceRoot":"","sources":["../../../src/utils/types/recursive-partial.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;KAC/B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACrC,gBAAgB,CAAC,CAAC,CAAC,EAAE,GACrB,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACtB,CAAC,CAAC,CAAC,CAAC;CACX,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=recursive-partial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursive-partial.js","sourceRoot":"","sources":["../../../src/utils/types/recursive-partial.ts"],"names":[],"mappings":""}
@@ -1 +1,2 @@
1
1
  export type SortFunction<T> = (a: T, b: T) => number;
2
+ //# sourceMappingURL=sort-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-function.d.ts","sourceRoot":"","sources":["../../../src/utils/types/sort-function.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=sort-function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-function.js","sourceRoot":"","sources":["../../../src/utils/types/sort-function.ts"],"names":[],"mappings":""}
@@ -2,3 +2,4 @@
2
2
  * Represents a class.
3
3
  */
4
4
  export type Type<T = unknown> = new (...args: unknown[]) => T;
5
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/utils/types/type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,GAAG,OAAO,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/utils/types/type.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "querier-ts",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Query tool for analysing arrays of objects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
8
8
  "lib/**/*"
9
9
  ],
10
+ "lint-staged": {
11
+ "src/**/*.ts": [
12
+ "prettier --write",
13
+ "eslint --fix"
14
+ ]
15
+ },
10
16
  "repository": {
11
17
  "type": "git",
12
18
  "url": "git+https://github.com/luizfilipezs/query-ts.git"
@@ -26,24 +32,31 @@
26
32
  },
27
33
  "homepage": "https://github.com/luizfilipezs/query-ts#readme",
28
34
  "dependencies": {
29
- "reflect-metadata": "^0.2.2",
30
35
  "utility-types": "^3.11.0"
31
36
  },
32
37
  "devDependencies": {
33
- "@types/jest": "^30.0.0",
34
- "jest": "^30.2.0",
38
+ "@eslint/js": "^10.0.1",
39
+ "@vitest/coverage-v8": "^4.1.2",
40
+ "eslint": "^10.0.3",
41
+ "eslint-config-prettier": "^10.1.8",
42
+ "eslint-plugin-prettier": "^5.5.5",
43
+ "globals": "^17.4.0",
44
+ "husky": "^9.1.7",
45
+ "jiti": "^2.6.1",
46
+ "lint-staged": "^16.4.0",
35
47
  "prettier": "^3.8.1",
36
48
  "prettier-plugin-organize-imports": "^4.3.0",
37
- "ts-jest": "^29.4.6",
38
- "tslint": "^6.1.3",
39
- "tslint-config-prettier": "^1.18.0",
40
- "typescript": "~5.9.3"
49
+ "typescript": "~5.9.3",
50
+ "typescript-eslint": "^8.57.1",
51
+ "vitest": "^4.1.2"
41
52
  },
42
53
  "scripts": {
43
- "test": "jest --config jest.config.ts",
54
+ "test": "vitest",
55
+ "test:cov": "vitest --coverage",
44
56
  "build": "tsc",
57
+ "type-check": "tsc --noEmit",
45
58
  "format": "prettier --write \"src/**/*.ts\"",
46
- "lint": "tslint -p tsconfig.json",
59
+ "lint": "eslint \"src/**/*.ts\" --fix",
47
60
  "preversion": "pnpm lint",
48
61
  "version": "pnpm format && git add -A src",
49
62
  "postversion": "git push && git push --tags"
@@ -1,6 +0,0 @@
1
- import { PartialOfProperties } from './utils/types';
2
- export declare abstract class BaseObject {
3
- constructor(init?: PartialOfProperties<BaseObject>);
4
- setAttribute<K extends keyof this>(attribute: K, value: this[K]): void;
5
- setAttributes(attributes: PartialOfProperties<this>): void;
6
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseObject = void 0;
4
- class BaseObject {
5
- constructor(init = {}) {
6
- this.setAttributes(init);
7
- }
8
- setAttribute(attribute, value) {
9
- this[attribute] = value;
10
- }
11
- setAttributes(attributes) {
12
- Object.assign(this, attributes);
13
- }
14
- }
15
- exports.BaseObject = BaseObject;
@@ -1,2 +0,0 @@
1
- import { InvalidArgumentError } from './invalid-argument-error';
2
- export { InvalidArgumentError, };
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvalidArgumentError = void 0;
4
- const invalid_argument_error_1 = require("./invalid-argument-error");
5
- Object.defineProperty(exports, "InvalidArgumentError", { enumerable: true, get: function () { return invalid_argument_error_1.InvalidArgumentError; } });
@@ -1,10 +0,0 @@
1
- interface InvalidArgumentErrorConfig {
2
- method: string;
3
- param: string | number;
4
- argument: any;
5
- expected: string;
6
- }
7
- export declare class InvalidArgumentError extends Error {
8
- constructor({ method, param, argument, expected }: InvalidArgumentErrorConfig);
9
- }
10
- export {};
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvalidArgumentError = void 0;
4
- class InvalidArgumentError extends Error {
5
- constructor({ method, param, argument, expected }) {
6
- super(`${argument} is not a valid argument to param ${param} on ${method}(). ` +
7
- `It should be ${expected}.`);
8
- this.name = 'InvalidArgumentError';
9
- }
10
- }
11
- exports.InvalidArgumentError = InvalidArgumentError;
@@ -1,4 +0,0 @@
1
- import { PropertyOnly } from './utils/types';
2
- export declare type QueryConditionsGroupNullable<T extends object> = {
3
- [P in keyof PropertyOnly<T>]?: T[P] extends object ? QueryConditionsGroupNullable<T[P]> : T[P] | ((value: T[P]) => boolean) | null;
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import { PropertyOnly } from './utils/types';
2
- export declare type QueryConditionsGroup<T extends object> = {
3
- [P in keyof PropertyOnly<T>]?: T[P] extends object ? QueryConditionsGroup<T[P]> : T[P] | ((value: T[P]) => boolean);
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,72 +0,0 @@
1
- import { BaseObject } from './base-object';
2
- import { QueryConditionsGroupNullable } from './query-conditions-group-nullable';
3
- /**
4
- * Validator configuration.
5
- */
6
- interface QueryRowValidatorInitializer<T extends object> {
7
- conditionsObject: QueryConditionsGroupNullable<T>;
8
- ignoreNullValues: boolean;
9
- }
10
- /**
11
- * Validates a row in the query.
12
- */
13
- export declare class QueryRowValidator<T extends object> extends BaseObject {
14
- /**
15
- * Row to be validated.
16
- */
17
- private row;
18
- /**
19
- * Conditions to be applied to the row.
20
- */
21
- private conditionsObject;
22
- /**
23
- * Indicates whether conditions with `null` and `undefined` values should be
24
- * skipped.
25
- */
26
- private ignoreNullValues;
27
- /**
28
- * Initializes the validator.
29
- *
30
- * @param {T} row Row to validated.
31
- * @param {QueryRowValidatorInitializer<T>} config Validator configuration.
32
- */
33
- private constructor();
34
- /**
35
- * Validates a row.
36
- *
37
- * @param {T} row Row to validated.
38
- * @param {QueryRowValidatorInitializer<T>} config Validator configuration.
39
- */
40
- static validate<T extends object>(row: T, config: QueryRowValidatorInitializer<T>): boolean;
41
- /**
42
- * Applies the validation to the row.
43
- *
44
- * @returns {boolean} `true` if the row is valid, `false` otherwise.
45
- */
46
- private validate;
47
- /**
48
- * Validates every condition.
49
- *
50
- * @returns {boolean} Validation result.
51
- */
52
- private validateConditions;
53
- /**
54
- * Validate a condition to a specific column.
55
- *
56
- * @param {P} columnName Column name.
57
- * @param {ColumnCondition<T, P>} condition Condition to be validated.
58
- *
59
- * @returns {boolean} Validation result.
60
- */
61
- private validateColumnCondition;
62
- /**
63
- * Validates an object inside the row.
64
- *
65
- * @param {object} obj Object to validated.
66
- * @param {QueryConditionsGroupNullable<O>} conditionsObject Conditions to be applied to the object.
67
- *
68
- * @returns {boolean} Validation result.
69
- */
70
- private validateInnerObject;
71
- }
72
- export {};