flamerest 1.0.53 → 1.0.56

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.
Files changed (2) hide show
  1. package/REST.js +5 -5
  2. package/package.json +1 -1
package/REST.js CHANGED
@@ -298,7 +298,7 @@ class FLAMEREST {
298
298
  * @param tree дерево
299
299
  * @return Promise<>
300
300
  */
301
- get(table, where, expand, fields, sortfields, page, perPage, RemoveDuplicates, format, titles, tree) {
301
+ get(table, where, extfields, fields, sortfields, page, perPage, RemoveDuplicates, format, titles, tree) {
302
302
 
303
303
  // Нормализуем имена таблиц
304
304
  table = table.replace(/_/g, "");
@@ -327,8 +327,8 @@ class FLAMEREST {
327
327
  if (sortfields !== undefined && sortfields !== null)
328
328
  json.sort = sortfields;
329
329
 
330
- if (expand !== undefined && expand !== null)
331
- json.expand = expand;
330
+ if (extfields !== undefined && extfields !== null)
331
+ json.extfields = extfields;
332
332
 
333
333
  if (RemoveDuplicates !== undefined && RemoveDuplicates !== null)
334
334
  json.RemoveDuplicates = true;
@@ -355,7 +355,7 @@ class FLAMEREST {
355
355
  * @returns {object}
356
356
  */
357
357
  all(table, params) {
358
- return this.get(table, params?.where, null, params?.fields, params?.sort, params?.page, params?.perPage, null, null, null, params?.tree);
358
+ return this.get(table, params?.where, params?.extfields, params?.fields, params?.sort, params?.page, params?.perPage, null, null, null, params?.tree);
359
359
  }
360
360
 
361
361
  /**
@@ -574,7 +574,7 @@ class FLAMEREST {
574
574
  if (!values.hasOwnProperty(prop)) continue;
575
575
 
576
576
  // объекты проходим рекурсивно
577
- if (typeof values[prop] === 'object' && typeof object[prop] === 'object') { this.fillObject(object[prop], values[prop]); continue }
577
+ if (typeof values[prop] === 'object' && typeof object[prop] === 'object' && values[prop] !== null && object[prop] !== null) { this.fillObject(object[prop], values[prop]); continue }
578
578
 
579
579
  // тут остались все обычные типы - записываем
580
580
  object[prop] = values[prop];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flamerest",
3
- "version": "1.0.53",
3
+ "version": "1.0.56",
4
4
  "description": "",
5
5
  "main": "REST.js",
6
6
  "typings": "./REST.d.ts",