MCPcopy Create free account
hub / github.com/processing/p5.js / generateWebAPISchemas

Function generateWebAPISchemas

src/core/friendly_errors/param_validator.js:83–90  ·  view source on GitHub ↗
(apiObjects)

Source from the content-addressed store, hash-verified

81 ];
82
83 function generateWebAPISchemas(apiObjects) {
84 return apiObjects.reduce((acc, obj) => {
85 acc[obj] = z.custom(data => data instanceof globalThis[obj], {
86 message: `Expected a ${obj}`
87 });
88 return acc;
89 }, {});
90 }
91
92 const webAPISchemas = generateWebAPISchemas(webAPIObjects);
93 // Add web API schemas to the schema map.

Callers 1

validateParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected