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.
- package/README.md +76 -70
- package/lib/core/errors/index.d.ts +1 -0
- package/lib/core/errors/index.d.ts.map +1 -0
- package/lib/core/errors/index.js +2 -17
- package/lib/core/errors/index.js.map +1 -0
- package/lib/core/errors/invalid-argument-error.d.ts +1 -0
- package/lib/core/errors/invalid-argument-error.d.ts.map +1 -0
- package/lib/core/errors/invalid-argument-error.js +2 -5
- package/lib/core/errors/invalid-argument-error.js.map +1 -0
- package/lib/core/types/attribute-validation-function.d.ts +1 -0
- package/lib/core/types/attribute-validation-function.d.ts.map +1 -0
- package/lib/core/types/attribute-validation-function.js +2 -2
- package/lib/core/types/attribute-validation-function.js.map +1 -0
- package/lib/core/types/column-condition.d.ts +3 -2
- package/lib/core/types/column-condition.d.ts.map +1 -0
- package/lib/core/types/column-condition.js +2 -2
- package/lib/core/types/column-condition.js.map +1 -0
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/index.d.ts.map +1 -0
- package/lib/core/types/index.js +5 -20
- package/lib/core/types/index.js.map +1 -0
- package/lib/core/types/ordering-column.d.ts +3 -0
- package/lib/core/types/ordering-column.d.ts.map +1 -0
- package/lib/core/types/ordering-column.js +2 -0
- package/lib/core/types/ordering-column.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 -0
- package/lib/core/types/query-conditions-group-nullable.js +2 -2
- package/lib/core/types/query-conditions-group-nullable.js.map +1 -0
- package/lib/core/types/query-conditions-group.d.ts +2 -1
- package/lib/core/types/query-conditions-group.d.ts.map +1 -0
- package/lib/core/types/query-conditions-group.js +2 -2
- package/lib/core/types/query-conditions-group.js.map +1 -0
- package/lib/core/types/query-row-validator-initializer.d.ts +2 -1
- package/lib/core/types/query-row-validator-initializer.d.ts.map +1 -0
- package/lib/core/types/query-row-validator-initializer.js +2 -2
- package/lib/core/types/query-row-validator-initializer.js.map +1 -0
- package/lib/core/validation/decorators/index.d.ts +1 -0
- package/lib/core/validation/decorators/index.d.ts.map +1 -0
- package/lib/core/validation/decorators/index.js +2 -17
- package/lib/core/validation/decorators/index.js.map +1 -0
- package/lib/core/validation/decorators/number-validaton.d.ts +5 -36
- package/lib/core/validation/decorators/number-validaton.d.ts.map +1 -0
- package/lib/core/validation/decorators/number-validaton.js +86 -113
- package/lib/core/validation/decorators/number-validaton.js.map +1 -0
- package/lib/core/validation/index.d.ts +1 -0
- package/lib/core/validation/index.d.ts.map +1 -0
- package/lib/core/validation/index.js +2 -17
- package/lib/core/validation/index.js.map +1 -0
- package/lib/core/validation/query-row-validator.d.ts +2 -1
- package/lib/core/validation/query-row-validator.d.ts.map +1 -0
- package/lib/core/validation/query-row-validator.js +9 -12
- package/lib/core/validation/query-row-validator.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -17
- package/lib/index.js.map +1 -0
- package/lib/query.d.ts +34 -5
- package/lib/query.d.ts.map +1 -0
- package/lib/query.js +117 -62
- package/lib/query.js.map +1 -0
- package/lib/utils/functions/generic/compare-arrays.d.ts +1 -0
- package/lib/utils/functions/generic/compare-arrays.d.ts.map +1 -0
- package/lib/utils/functions/generic/compare-arrays.js +3 -6
- package/lib/utils/functions/generic/compare-arrays.js.map +1 -0
- package/lib/utils/functions/generic/deep-equal.d.ts +1 -0
- package/lib/utils/functions/generic/deep-equal.d.ts.map +1 -0
- package/lib/utils/functions/generic/deep-equal.js +5 -8
- package/lib/utils/functions/generic/deep-equal.js.map +1 -0
- package/lib/utils/functions/generic/get-entries.d.ts +2 -5
- package/lib/utils/functions/generic/get-entries.d.ts.map +1 -0
- package/lib/utils/functions/generic/get-entries.js +3 -9
- package/lib/utils/functions/generic/get-entries.js.map +1 -0
- package/lib/utils/functions/generic/get-object-property-names.d.ts +3 -0
- package/lib/utils/functions/generic/get-object-property-names.d.ts.map +1 -0
- package/lib/utils/functions/generic/get-object-property-names.js +4 -0
- package/lib/utils/functions/generic/get-object-property-names.js.map +1 -0
- package/lib/utils/functions/generic/index.d.ts +1 -0
- package/lib/utils/functions/generic/index.d.ts.map +1 -0
- package/lib/utils/functions/generic/index.js +4 -19
- package/lib/utils/functions/generic/index.js.map +1 -0
- package/lib/utils/functions/sort/index.d.ts +1 -0
- package/lib/utils/functions/sort/index.d.ts.map +1 -0
- package/lib/utils/functions/sort/index.js +3 -18
- package/lib/utils/functions/sort/index.js.map +1 -0
- package/lib/utils/functions/sort/sort-by-properties.d.ts +2 -1
- package/lib/utils/functions/sort/sort-by-properties.d.ts.map +1 -0
- package/lib/utils/functions/sort/sort-by-properties.js +4 -7
- package/lib/utils/functions/sort/sort-by-properties.js.map +1 -0
- package/lib/utils/functions/sort/sort-by-property.d.ts +2 -1
- package/lib/utils/functions/sort/sort-by-property.d.ts.map +1 -0
- package/lib/utils/functions/sort/sort-by-property.js +2 -4
- package/lib/utils/functions/sort/sort-by-property.js.map +1 -0
- package/lib/utils/functions/type-guards/index.d.ts +1 -0
- package/lib/utils/functions/type-guards/index.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/index.js +4 -19
- package/lib/utils/functions/type-guards/index.js.map +1 -0
- package/lib/utils/functions/type-guards/is-function.d.ts +1 -0
- package/lib/utils/functions/type-guards/is-function.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/is-function.js +2 -5
- package/lib/utils/functions/type-guards/is-function.js.map +1 -0
- package/lib/utils/functions/type-guards/is-number.d.ts +1 -0
- package/lib/utils/functions/type-guards/is-number.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/is-number.js +2 -5
- package/lib/utils/functions/type-guards/is-number.js.map +1 -0
- package/lib/utils/functions/type-guards/is-object.d.ts +1 -0
- package/lib/utils/functions/type-guards/is-object.d.ts.map +1 -0
- package/lib/utils/functions/type-guards/is-object.js +2 -5
- package/lib/utils/functions/type-guards/is-object.js.map +1 -0
- package/lib/utils/types/add-prefix-to-object.d.ts +1 -0
- package/lib/utils/types/add-prefix-to-object.d.ts.map +1 -0
- package/lib/utils/types/add-prefix-to-object.js +2 -2
- package/lib/utils/types/add-prefix-to-object.js.map +1 -0
- package/lib/utils/types/allowed-names.d.ts +2 -1
- package/lib/utils/types/allowed-names.d.ts.map +1 -0
- package/lib/utils/types/allowed-names.js +2 -2
- package/lib/utils/types/allowed-names.js.map +1 -0
- package/lib/utils/types/flag-excluded-type.d.ts +1 -0
- package/lib/utils/types/flag-excluded-type.d.ts.map +1 -0
- package/lib/utils/types/flag-excluded-type.js +2 -2
- package/lib/utils/types/flag-excluded-type.js.map +1 -0
- package/lib/utils/types/generic-object.d.ts +1 -0
- package/lib/utils/types/generic-object.d.ts.map +1 -0
- package/lib/utils/types/generic-object.js +2 -2
- package/lib/utils/types/generic-object.js.map +1 -0
- package/lib/utils/types/index.d.ts +1 -0
- package/lib/utils/types/index.d.ts.map +1 -0
- package/lib/utils/types/index.js +11 -26
- package/lib/utils/types/index.js.map +1 -0
- package/lib/utils/types/omit-type.d.ts +2 -1
- package/lib/utils/types/omit-type.d.ts.map +1 -0
- package/lib/utils/types/omit-type.js +2 -2
- package/lib/utils/types/omit-type.js.map +1 -0
- package/lib/utils/types/partial-of-properties.d.ts +2 -1
- package/lib/utils/types/partial-of-properties.d.ts.map +1 -0
- package/lib/utils/types/partial-of-properties.js +2 -2
- package/lib/utils/types/partial-of-properties.js.map +1 -0
- package/lib/utils/types/prop-of.d.ts +2 -1
- package/lib/utils/types/prop-of.d.ts.map +1 -0
- package/lib/utils/types/prop-of.js +2 -2
- package/lib/utils/types/prop-of.js.map +1 -0
- package/lib/utils/types/property-only.d.ts +2 -1
- package/lib/utils/types/property-only.d.ts.map +1 -0
- package/lib/utils/types/property-only.js +2 -2
- package/lib/utils/types/property-only.js.map +1 -0
- package/lib/utils/types/recursive-partial.d.ts +1 -0
- package/lib/utils/types/recursive-partial.d.ts.map +1 -0
- package/lib/utils/types/recursive-partial.js +2 -2
- package/lib/utils/types/recursive-partial.js.map +1 -0
- package/lib/utils/types/sort-function.d.ts +1 -0
- package/lib/utils/types/sort-function.d.ts.map +1 -0
- package/lib/utils/types/sort-function.js +2 -2
- package/lib/utils/types/sort-function.js.map +1 -0
- package/lib/utils/types/type.d.ts +1 -0
- package/lib/utils/types/type.d.ts.map +1 -0
- package/lib/utils/types/type.js +2 -2
- package/lib/utils/types/type.js.map +1 -0
- package/package.json +23 -10
- package/lib/base-object.d.ts +0 -6
- package/lib/base-object.js +0 -15
- package/lib/errors/index.d.ts +0 -2
- package/lib/errors/index.js +0 -5
- package/lib/errors/invalid-argument-error.d.ts +0 -10
- package/lib/errors/invalid-argument-error.js +0 -11
- package/lib/query-conditions-group-nullable.d.ts +0 -4
- package/lib/query-conditions-group-nullable.js +0 -2
- package/lib/query-conditions-group.d.ts +0 -4
- package/lib/query-conditions-group.js +0 -2
- package/lib/query-row-validator.d.ts +0 -72
- package/lib/query-row-validator.js +0 -85
- package/lib/utils/decorators/number-validaton.d.ts +0 -36
- 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"}
|
|
@@ -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
|
-
|
|
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"}
|
|
@@ -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
|
-
|
|
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"}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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"}
|
package/lib/utils/types/index.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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
|
-
|
|
2
|
-
|
|
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":""}
|
|
@@ -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"}
|
package/lib/utils/types/type.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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": "
|
|
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
|
-
"@
|
|
34
|
-
"
|
|
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
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
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": "
|
|
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": "
|
|
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"
|
package/lib/base-object.d.ts
DELETED
|
@@ -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
|
-
}
|
package/lib/base-object.js
DELETED
|
@@ -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;
|
package/lib/errors/index.d.ts
DELETED
package/lib/errors/index.js
DELETED
|
@@ -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,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 {};
|