@teamkeel/testing-runtime 0.394.0-prerelease → 0.394.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/Executor.mjs +15 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamkeel/testing-runtime",
3
- "version": "0.394.0-prerelease",
3
+ "version": "0.394.1",
4
4
  "description": "Internal package used by the generated @teamkeel/testing package",
5
5
  "exports": "./src/index.mjs",
6
6
  "typings": "src/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "prettier": "3.1.1"
19
19
  },
20
20
  "dependencies": {
21
- "@teamkeel/functions-runtime": "link:../functions-runtime",
21
+ "@teamkeel/functions-runtime": "0.394.0",
22
22
  "jsonwebtoken": "^9.0.2",
23
23
  "kysely": "^0.26.3",
24
24
  "lodash.ismatch": "^4.4.0",
package/src/Executor.mjs CHANGED
@@ -115,17 +115,16 @@ export class Executor {
115
115
  }
116
116
 
117
117
  async function parseInputs(inputs) {
118
- // console.log(inputs)
119
118
  if (inputs != null && typeof inputs === "object") {
120
- for (const i of Object.keys(inputs)) {
121
- if (inputs[i] !== null && typeof inputs[i] === "object") {
122
- if (inputs[i] instanceof InlineFile || inputs[i] instanceof File) {
123
- const contents = await inputs[i].read();
124
- inputs[i] = `data:${inputs[i].contentType};name=${
125
- inputs[i].filename
119
+ for (const keys of Object.keys(inputs)) {
120
+ if (inputs[keys] !== null && typeof inputs[keys] === "object") {
121
+ if (isInlineFileOrFile(inputs[keys])) {
122
+ const contents = await inputs[keys].read();
123
+ inputs[keys] = `data:${inputs[keys].contentType};name=${
124
+ inputs[keys].filename
126
125
  };base64,${contents.toString("base64")}`;
127
126
  } else {
128
- inputs[i] = await parseInputs(inputs[i]);
127
+ inputs[keys] = await parseInputs(inputs[keys]);
129
128
  }
130
129
  }
131
130
  }
@@ -133,6 +132,14 @@ async function parseInputs(inputs) {
133
132
  return inputs;
134
133
  }
135
134
 
135
+ function isInlineFileOrFile(obj) {
136
+ return (
137
+ obj &&
138
+ typeof obj === "object" &&
139
+ (obj.constructor.name === "InlineFile" || obj.constructor.name === "File")
140
+ );
141
+ }
142
+
136
143
  function parseOutputs(data) {
137
144
  if (!data) {
138
145
  return null;