5htp-core 0.3.6-2 → 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-2",
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",
@@ -176,15 +176,13 @@ export default class SQL extends Service<Config, Hooks, Application, Services> {
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);
181
-
182
- } else if (forStorage) {
183
-
184
- // Format array values for storing
185
- if (Array.isArray( data )) {
186
- data = data.join(', ')
187
- }
182
+ // Array: if for storage, reparate items with a comma
183
+ else if (forStorage && Array.isArray( data )) {
184
+ data = data.join(',')
185
+ }
188
186
  }
189
187
 
190
188
  return mysql.escape(data);
@@ -535,7 +533,7 @@ export default class SQL extends Service<Config, Hooks, Application, Services> {
535
533
  const { '*': updateAll, ...customValuesToUpdate } = colsToUpdate;
536
534
 
537
535
  for (const colKey in customValuesToUpdate)
538
- valuesToUpdate[ colKey ] = this.esc(customValuesToUpdate[ colKey ]);
536
+ valuesToUpdate[ colKey ] = this.esc(customValuesToUpdate[ colKey ], true);
539
537
 
540
538
  if (updateAll)
541
539
  valuesNamesToUpdate = Object.keys(table.colonnes);//table.columnNamesButPk;