MCPcopy Create free account
hub / github.com/arktypeio/arktype / ajvModule

Function ajvModule

ark/repo/bench/bundle.ts:26–42  ·  view source on GitHub ↗
(scenario: SizedScenario)

Source from the content-addressed store, hash-verified

24
25// ajv's standalone code, which needs no compiler at runtime
26const ajvModule = async (scenario: SizedScenario) => {
27 const schemas: Record<string, object> = await import(
28 join(apps, scenario, "ajv.ts")
29 )
30 const ajv = ajvOf({
31 schemas: Object.values(schemas),
32 code: {
33 source: true,
34 esm: true,
35 formats: _`require("ajv-formats/dist/formats").fullFormats`
36 }
37 })
38 return standaloneCode.default(
39 ajv,
40 Object.fromEntries(Object.keys(schemas).map(name => [name, name]))
41 )
42}
43
44// sized only: arktype precompiled with the "smallest" preset. Every bundle is
45// a production build (esbuild's "production" condition), which prunes a

Callers 1

entryFunction · 0.85

Calls 4

ajvOfFunction · 0.90
joinFunction · 0.85
defaultMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected