oneentry 1.0.40 → 1.0.41

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.
@@ -118,19 +118,24 @@ class OneEntry {
118
118
  return result.slice(0, (result.length - 1));
119
119
  }
120
120
  _normalizeData(data) {
121
- const normalizeData = {};
122
- for (let key in data) {
123
- if (Array.isArray(data[key]) || !data[key] || typeof data[key] !== 'object') {
124
- normalizeData[key] = data[key];
125
- }
126
- else if (data[key][this._defaultLangCode]) {
127
- normalizeData[key] = data[key][this._defaultLangCode];
128
- }
129
- else {
130
- normalizeData[key] = this._normalizeData(data[key]);
121
+ if (Array.isArray(data)) {
122
+ return data.map(item => this._normalizeData(item));
123
+ }
124
+ else {
125
+ const normalizeData = {};
126
+ for (let key in data) {
127
+ if (Array.isArray(data[key]) || !data[key] || typeof data[key] !== 'object') {
128
+ normalizeData[key] = data[key];
129
+ }
130
+ else if (data[key][this._defaultLangCode]) {
131
+ normalizeData[key] = data[key][this._defaultLangCode];
132
+ }
133
+ else {
134
+ normalizeData[key] = this._normalizeData(data[key]);
135
+ }
131
136
  }
137
+ return normalizeData;
132
138
  }
133
- return normalizeData;
134
139
  }
135
140
  }
136
141
  exports.default = OneEntry;
package/dist/index.d.ts CHANGED
@@ -36,6 +36,9 @@ interface IDefineApi {
36
36
  /**
37
37
  * Define API.
38
38
  * @param {string} url - URl of your project.
39
+ * @param {IConfig} config - Custom configuration settings
40
+ * @param {string} [config.token] - Optional token parameter
41
+ * @param {string} [config.langCode] - Optional langCode parameter
39
42
  * @returns {IDefineApi} - List of methods set.
40
43
  */
41
44
  export declare function defineOneEntry(url: string, config: IConfig): IDefineApi;
package/dist/index.js CHANGED
@@ -20,6 +20,9 @@ const markersApi_1 = require("./markers/markersApi");
20
20
  /**
21
21
  * Define API.
22
22
  * @param {string} url - URl of your project.
23
+ * @param {IConfig} config - Custom configuration settings
24
+ * @param {string} [config.token] - Optional token parameter
25
+ * @param {string} [config.langCode] - Optional langCode parameter
23
26
  * @returns {IDefineApi} - List of methods set.
24
27
  */
25
28
  function defineOneEntry(url, config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",