@dascompany/database 3.1.1 → 3.1.3
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.
|
@@ -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(clientId:
|
|
5
|
+
getId(): number | null;
|
|
6
|
+
setId(clientId: number): void;
|
|
7
7
|
save(): Promise<void>;
|
|
8
8
|
delete(): Promise<void>;
|
|
9
9
|
}
|
package/dist/utils/Filters.js
CHANGED
|
@@ -14,11 +14,11 @@ export default class Filters {
|
|
|
14
14
|
return value;
|
|
15
15
|
}
|
|
16
16
|
static sanitizeString(value) {
|
|
17
|
-
value = value.
|
|
18
|
-
value = value.
|
|
19
|
-
value = value.
|
|
20
|
-
value = value.replace(/[^a-zA-Z0-9
|
|
21
|
-
value = value.
|
|
17
|
+
value = value.replace(/<[^>]*>/g, '');
|
|
18
|
+
value = value.replace(/ó/g, 'ó');
|
|
19
|
+
value = value.replace(/&[a-zA-Z0-9#]+;/g, '');
|
|
20
|
+
value = value.replace(/[^a-zA-Z0-9-żźćńółęąśŻŹĆĄŚĘŁÓŃ., ]/g, '');
|
|
21
|
+
value = value.trim();
|
|
22
22
|
return value;
|
|
23
23
|
}
|
|
24
24
|
static databaseColumn(value) {
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|