5htp-core 0.3.6-1 → 0.3.6-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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp-core",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.3.6-
|
|
4
|
+
"version": "0.3.6-3",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -345,7 +345,7 @@ export default class ClientRouter<
|
|
|
345
345
|
|
|
346
346
|
} catch (e) {
|
|
347
347
|
console.error(`Failed to fetch the route ${route.chunk}`, e);
|
|
348
|
-
this.app.handleError(new Error("Failed to load content. Please
|
|
348
|
+
this.app.handleError(new Error("Failed to load content. Please reload the page and try again."));
|
|
349
349
|
throw e;
|
|
350
350
|
}
|
|
351
351
|
|
|
@@ -170,14 +170,19 @@ export default class SQL extends Service<Config, Hooks, Application, Services> {
|
|
|
170
170
|
return query;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
public esc(data: any) {
|
|
173
|
+
public esc( data: any, forStorage: boolean = false ) {
|
|
174
174
|
|
|
175
175
|
// JSON object
|
|
176
176
|
// TODO: do it via datatypes.ts
|
|
177
177
|
if (typeof data === 'object' && data !== null) {
|
|
178
178
|
|
|
179
|
+
// Object: stringify in JSON
|
|
179
180
|
if (data.constructor.name === "Object")
|
|
180
181
|
data = safeStringify(data);
|
|
182
|
+
// Array: if for storage, reparate items with a comma
|
|
183
|
+
else if (forStorage && Array.isArray( data )) {
|
|
184
|
+
data = data.join(',')
|
|
185
|
+
}
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
return mysql.escape(data);
|
|
@@ -474,7 +479,7 @@ export default class SQL extends Service<Config, Hooks, Application, Services> {
|
|
|
474
479
|
const values: string[] = [];
|
|
475
480
|
for (const col of colNames)
|
|
476
481
|
if (col in entry)
|
|
477
|
-
values.push( this.esc( entry[col] ));
|
|
482
|
+
values.push( this.esc( entry[col], true));
|
|
478
483
|
else
|
|
479
484
|
values.push("DEFAULT");
|
|
480
485
|
|
|
@@ -528,7 +533,7 @@ export default class SQL extends Service<Config, Hooks, Application, Services> {
|
|
|
528
533
|
const { '*': updateAll, ...customValuesToUpdate } = colsToUpdate;
|
|
529
534
|
|
|
530
535
|
for (const colKey in customValuesToUpdate)
|
|
531
|
-
valuesToUpdate[ colKey ] = this.esc(customValuesToUpdate[ colKey ]);
|
|
536
|
+
valuesToUpdate[ colKey ] = this.esc(customValuesToUpdate[ colKey ], true);
|
|
532
537
|
|
|
533
538
|
if (updateAll)
|
|
534
539
|
valuesNamesToUpdate = Object.keys(table.colonnes);//table.columnNamesButPk;
|