(
opts: opts = {} as opts
)
| 172 | } |
| 173 | |
| 174 | export 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 |
| 199 | const onArktypeOf = ( |
no test coverage detected