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

Function resolvePrecompileOptions

ark/aot/settings.ts:174–196  ·  view source on GitHub ↗
(
	opts: opts = {} as opts
)

Source from the content-addressed store, hash-verified

172}
173
174export const resolvePrecompileOptions = <opts extends PrecompileOptions>(
175 opts: opts = {} as opts
176): opts & PrecompileOptions => {
177 validate(validators.PrecompileOptions as never, definedOf(opts))
178 const resolved = withPreset(opts) as opts
179 const { members = {} } = resolved
180 if (members["~standard.jsonSchema"] && members["~standard"] === false)
181 throw new Error(standardJsonSchemaWithoutStandardMessage)
182 const variant = resolvedVariantOf(resolved)
183 const onArktype = variant && onArktypeOf(resolved.dependencies)
184 if (onArktype)
185 throw new Error(writeVariantDependencyMessage(onArktype, variant))
186 checkStrategyOptions(resolved)
187 if (resolved.runtime === "arktype") {
188 const standaloneOption =
189 resolved.config === false ?
190 "config: false"
191 : standaloneOptions.find(option => resolved[option] !== undefined)
192 if (standaloneOption)
193 throw new Error(writeArktypeRuntimeOptionMessage(standaloneOption))
194 }
195 return resolved
196}
197
198// a dependency the build leaves running on arktype
199const onArktypeOf = (

Callers 11

checkFunction · 0.90
unplugin.tsFile · 0.90
applySettingsFunction · 0.90
checkSettingsFunction · 0.90
registerFunction · 0.90
constructorMethod · 0.90
precompileFunction · 0.90
resolvedOptionsOfFunction · 0.90
cli.tsFile · 0.90
emitPrecompiledFunction · 0.90
settings.test.tsFile · 0.90

Calls 9

definedOfFunction · 0.90
withPresetFunction · 0.90
resolvedVariantOfFunction · 0.90
checkStrategyOptionsFunction · 0.90
onArktypeOfFunction · 0.85
findMethod · 0.80
validateFunction · 0.70

Tested by

no test coverage detected