@dascompany/database 3.1.3 → 3.1.5
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.
|
@@ -18,7 +18,10 @@ export default class QueryParamCreator {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
static isArrayType(type) {
|
|
21
|
-
if (type == ParameterType.arrayString ||
|
|
21
|
+
if (type == ParameterType.arrayString ||
|
|
22
|
+
type == ParameterType.arrayNumber ||
|
|
23
|
+
type == ParameterType.arrayBoolean ||
|
|
24
|
+
type == ParameterType.arrayBigint)
|
|
22
25
|
return true;
|
|
23
26
|
else
|
|
24
27
|
return false;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default class ResultsCorrector {
|
|
2
|
+
static correctRows(rows) {
|
|
3
|
+
rows.forEach((row) => {
|
|
4
|
+
Object.keys(row).forEach((key) => {
|
|
5
|
+
if (this.isNumber(row[key]))
|
|
6
|
+
row[key] = Number(row[key]);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
return rows;
|
|
10
|
+
}
|
|
11
|
+
static isNumber(n) {
|
|
12
|
+
return !isNaN(parseFloat(n)) && !isNaN(n - 0);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -2,8 +2,8 @@ import StockObjectMapper from "./StockObjectMapper";
|
|
|
2
2
|
export default abstract class StockObject {
|
|
3
3
|
private id;
|
|
4
4
|
protected abstract getMapper(): StockObjectMapper;
|
|
5
|
-
getId():
|
|
6
|
-
setId(
|
|
5
|
+
getId(): string | null;
|
|
6
|
+
setId(id: string): void;
|
|
7
7
|
save(): Promise<void>;
|
|
8
8
|
delete(): Promise<void>;
|
|
9
9
|
}
|