@openfn/language-http 5.1.0 → 5.1.1
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/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -342,7 +342,8 @@ function del(path, params, callback) {
|
|
|
342
342
|
}
|
|
343
343
|
function parseXML(body, script) {
|
|
344
344
|
return (state) => {
|
|
345
|
-
const
|
|
345
|
+
const resolvedBody = (0, import_language_common.expandReferences)(body)(state);
|
|
346
|
+
const $ = import_cheerio.default.load(resolvedBody);
|
|
346
347
|
(0, import_cheerio_tableparser.default)($);
|
|
347
348
|
if (script) {
|
|
348
349
|
const result = script($);
|
|
@@ -353,7 +354,7 @@ function parseXML(body, script) {
|
|
|
353
354
|
return (0, import_language_common.composeNextState)(state, { body: result });
|
|
354
355
|
}
|
|
355
356
|
} else {
|
|
356
|
-
return (0, import_language_common.composeNextState)(state, { body });
|
|
357
|
+
return (0, import_language_common.composeNextState)(state, { body: resolvedBody });
|
|
357
358
|
}
|
|
358
359
|
};
|
|
359
360
|
}
|
package/dist/index.js
CHANGED
|
@@ -314,7 +314,8 @@ function del(path, params, callback) {
|
|
|
314
314
|
}
|
|
315
315
|
function parseXML(body, script) {
|
|
316
316
|
return (state) => {
|
|
317
|
-
const
|
|
317
|
+
const resolvedBody = expandReferences(body)(state);
|
|
318
|
+
const $ = cheerio.load(resolvedBody);
|
|
318
319
|
cheerioTableparser($);
|
|
319
320
|
if (script) {
|
|
320
321
|
const result = script($);
|
|
@@ -325,7 +326,7 @@ function parseXML(body, script) {
|
|
|
325
326
|
return composeNextState(state, { body: result });
|
|
326
327
|
}
|
|
327
328
|
} else {
|
|
328
|
-
return composeNextState(state, { body });
|
|
329
|
+
return composeNextState(state, { body: resolvedBody });
|
|
329
330
|
}
|
|
330
331
|
};
|
|
331
332
|
}
|