MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isJsonValue

Function isJsonValue

packages/plugins/openapi/src/sdk/spec-overrides.ts:84–93  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

82const patchFailure = (detail: string) => new PatchApplicationFailure({ detail });
83
84const isJsonValue = (value: unknown): value is JsonValue => {
85 if (value === null) return true;
86 if (typeof value === "string" || typeof value === "boolean") return true;
87 if (typeof value === "number") return Number.isFinite(value);
88 if (Array.isArray(value)) return value.every(isJsonValue);
89 if (typeof value !== "object") return false;
90 const prototype = Object.getPrototypeOf(value);
91 if (prototype !== Object.prototype && prototype !== null) return false;
92 return Object.values(value).every(isJsonValue);
93};
94
95const overrideError = (operationIndex: number, operation: string, path: string, detail: string) =>
96 new OpenApiSpecOverrideError({

Callers 1

spec-overrides.tsFile · 0.85

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected