wao 0.15.4 → 0.15.5
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/cjs/utils.js +14 -2
- package/esm/utils.js +14 -2
- package/package.json +1 -1
package/cjs/utils.js
CHANGED
|
@@ -294,6 +294,7 @@ var _getTagVal2 = function _getTagVal(get, res, from) {
|
|
|
294
294
|
}
|
|
295
295
|
} else {
|
|
296
296
|
var _res$Messages2;
|
|
297
|
+
var i = 0;
|
|
297
298
|
var _iterator5 = _createForOfIteratorHelper((_res$Messages2 = res.Messages) !== null && _res$Messages2 !== void 0 ? _res$Messages2 : []),
|
|
298
299
|
_step5;
|
|
299
300
|
try {
|
|
@@ -310,7 +311,12 @@ var _getTagVal2 = function _getTagVal(get, res, from) {
|
|
|
310
311
|
if (v.Data) out = v.Data;
|
|
311
312
|
try {
|
|
312
313
|
if (_get.json || _get === true) out = JSON.parse(out);
|
|
313
|
-
} catch (e) {
|
|
314
|
+
} catch (e) {
|
|
315
|
+
out = null;
|
|
316
|
+
}
|
|
317
|
+
if (out !== null && typeof _get.match === "function") {
|
|
318
|
+
if (!_get.match(out, i, res)) out = null;
|
|
319
|
+
}
|
|
314
320
|
} else if (_typeof(_get) === "object" && typeof _get.name === "string") {
|
|
315
321
|
var _v$Tags;
|
|
316
322
|
var _from2 = null;
|
|
@@ -319,9 +325,15 @@ var _getTagVal2 = function _getTagVal(get, res, from) {
|
|
|
319
325
|
out = getTag((_v$Tags = v.Tags) !== null && _v$Tags !== void 0 ? _v$Tags : [], _get.name);
|
|
320
326
|
try {
|
|
321
327
|
if (_get.json) out = JSON.parse(out);
|
|
322
|
-
} catch (e) {
|
|
328
|
+
} catch (e) {
|
|
329
|
+
out = null;
|
|
330
|
+
}
|
|
331
|
+
if (out !== null && typeof _get.match === "function") {
|
|
332
|
+
if (!_get.match(out, i, res)) out = null;
|
|
333
|
+
}
|
|
323
334
|
} else out = getTag((_v$Tags2 = v.Tags) !== null && _v$Tags2 !== void 0 ? _v$Tags2 : [], _get);
|
|
324
335
|
if (out) break;
|
|
336
|
+
i++;
|
|
325
337
|
}
|
|
326
338
|
} catch (err) {
|
|
327
339
|
_iterator5.e(err);
|
package/esm/utils.js
CHANGED
|
@@ -168,6 +168,7 @@ const _getTagVal = (get, res, from) => {
|
|
|
168
168
|
out = {}
|
|
169
169
|
for (const k in _get.obj ?? {}) out[k] = _getTagVal(_get.obj[k], res, from)
|
|
170
170
|
} else {
|
|
171
|
+
let i = 0
|
|
171
172
|
for (const v of res.Messages ?? []) {
|
|
172
173
|
if (typeof _get === "object" && isNil(_get.name) && isNil(_get.data)) {
|
|
173
174
|
_get.data = true
|
|
@@ -182,7 +183,12 @@ const _getTagVal = (get, res, from) => {
|
|
|
182
183
|
if (v.Data) out = v.Data
|
|
183
184
|
try {
|
|
184
185
|
if (_get.json || _get === true) out = JSON.parse(out)
|
|
185
|
-
} catch (e) {
|
|
186
|
+
} catch (e) {
|
|
187
|
+
out = null
|
|
188
|
+
}
|
|
189
|
+
if (out !== null && typeof _get.match === "function") {
|
|
190
|
+
if (!_get.match(out, i, res)) out = null
|
|
191
|
+
}
|
|
186
192
|
} else if (typeof _get === "object" && typeof _get.name === "string") {
|
|
187
193
|
let _from = null
|
|
188
194
|
if (is(Object, _get) && _get.from) _from = _get.from
|
|
@@ -190,9 +196,15 @@ const _getTagVal = (get, res, from) => {
|
|
|
190
196
|
out = getTag(v.Tags ?? [], _get.name)
|
|
191
197
|
try {
|
|
192
198
|
if (_get.json) out = JSON.parse(out)
|
|
193
|
-
} catch (e) {
|
|
199
|
+
} catch (e) {
|
|
200
|
+
out = null
|
|
201
|
+
}
|
|
202
|
+
if (out !== null && typeof _get.match === "function") {
|
|
203
|
+
if (!_get.match(out, i, res)) out = null
|
|
204
|
+
}
|
|
194
205
|
} else out = getTag(v.Tags ?? [], _get)
|
|
195
206
|
if (out) break
|
|
207
|
+
i++
|
|
196
208
|
}
|
|
197
209
|
}
|
|
198
210
|
return out
|