@agimon-ai/po-runner 0.0.0-alpha.69 → 0.0.0-alpha.70
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.
|
@@ -218,8 +218,9 @@ declare const runner: {
|
|
|
218
218
|
};`;
|
|
219
219
|
function parameters(input, fields, optional = false) {
|
|
220
220
|
if (input === void 0 && optional) return {};
|
|
221
|
-
if (
|
|
222
|
-
|
|
221
|
+
if (typeof input === "string" && fields.includes("id")) return { id: input };
|
|
222
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) throw new Error(`Expected an object with the documented runner fields: ${fields.join(", ")}.`);
|
|
223
|
+
for (const key of Object.keys(input)) if (!fields.includes(key)) throw new Error(`Unknown runner field: ${key}. Allowed: ${fields.join(", ")}.`);
|
|
223
224
|
return input;
|
|
224
225
|
}
|
|
225
226
|
function optionalString(record, field) {
|