@powfix/core-js 0.13.16 → 0.13.18
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelAttributeColumnOptions } from "sequelize";
|
|
1
|
+
import { ModelAttributeColumnOptions, WhereOptions } from "sequelize";
|
|
2
2
|
interface UuidColumnOptions extends Omit<ModelAttributeColumnOptions, 'type'> {
|
|
3
3
|
columnName: string;
|
|
4
4
|
}
|
|
@@ -33,5 +33,6 @@ export declare class SequelizeUtils {
|
|
|
33
33
|
allowNull: boolean;
|
|
34
34
|
}) => Partial<ModelAttributeColumnOptions>;
|
|
35
35
|
static getUuidColumn: ({ columnName, ...overrideOptions }: UuidColumnOptions) => Partial<ModelAttributeColumnOptions>;
|
|
36
|
+
static getNullableArrayFilter<T = undefined>(arr: (null | any)[]): WhereOptions<T>;
|
|
36
37
|
}
|
|
37
38
|
export {};
|
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.SequelizeUtils = void 0;
|
|
15
|
+
const sequelize_1 = require("sequelize");
|
|
15
16
|
const UuidUtils_1 = require("../../UuidUtils");
|
|
16
17
|
class SequelizeUtils {
|
|
17
18
|
static decimal2Number(value) {
|
|
@@ -24,6 +25,18 @@ class SequelizeUtils {
|
|
|
24
25
|
}
|
|
25
26
|
return parsed;
|
|
26
27
|
}
|
|
28
|
+
static getNullableArrayFilter(arr) {
|
|
29
|
+
return {
|
|
30
|
+
[sequelize_1.Op.and]: arr.map(value => {
|
|
31
|
+
if (value === null) {
|
|
32
|
+
return {
|
|
33
|
+
[sequelize_1.Op.is]: null
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
}
|
|
27
40
|
}
|
|
28
41
|
exports.SequelizeUtils = SequelizeUtils;
|
|
29
42
|
SequelizeUtils.getPrimaryUuidColumn = () => ({
|