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.
- package/dist/base/oneEntry.js +16 -11
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/dist/base/oneEntry.js
CHANGED
|
@@ -118,19 +118,24 @@ class OneEntry {
|
|
|
118
118
|
return result.slice(0, (result.length - 1));
|
|
119
119
|
}
|
|
120
120
|
_normalizeData(data) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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) {
|