@teamkeel/testing-runtime 0.398.0 → 0.399.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/package.json +1 -1
- package/src/Executor.mjs +8 -2
package/package.json
CHANGED
package/src/Executor.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import jwt from "jsonwebtoken";
|
|
2
|
-
import { InlineFile, File } from "@teamkeel/functions-runtime";
|
|
2
|
+
import { InlineFile, File, Duration } from "@teamkeel/functions-runtime";
|
|
3
3
|
|
|
4
4
|
export class Executor {
|
|
5
5
|
constructor(props) {
|
|
@@ -128,7 +128,9 @@ async function parseInputs(inputs) {
|
|
|
128
128
|
if (inputs != null && typeof inputs === "object") {
|
|
129
129
|
for (const keys of Object.keys(inputs)) {
|
|
130
130
|
if (inputs[keys] !== null && typeof inputs[keys] === "object") {
|
|
131
|
-
if (
|
|
131
|
+
if (isDuration(inputs[keys])) {
|
|
132
|
+
inputs[keys] = inputs[keys].toISOString();
|
|
133
|
+
} else if (isInlineFileOrFile(inputs[keys])) {
|
|
132
134
|
const contents = await inputs[keys].read();
|
|
133
135
|
inputs[keys] = `data:${inputs[keys].contentType};name=${
|
|
134
136
|
inputs[keys].filename
|
|
@@ -150,6 +152,10 @@ function isInlineFileOrFile(obj) {
|
|
|
150
152
|
);
|
|
151
153
|
}
|
|
152
154
|
|
|
155
|
+
function isDuration(obj) {
|
|
156
|
+
return obj && typeof obj === "object" && obj.constructor.name === "Duration";
|
|
157
|
+
}
|
|
158
|
+
|
|
153
159
|
function parseOutputs(data) {
|
|
154
160
|
if (!data) {
|
|
155
161
|
return null;
|