(entry: CompilerRegistry.Entry, input: unknown, options: Schema.MakeOptions | undefined)
| 1136 | } |
| 1137 | |
| 1138 | function constructSync<T>(entry: CompilerRegistry.Entry, input: unknown, options: Schema.MakeOptions | undefined): T { |
| 1139 | const parseOptions = constructorParseOptions(options) |
| 1140 | const make = CompilerRegistry.compilerAdaptersEnabled ? entry.make : undefined |
| 1141 | if (make !== undefined && input !== InternalParser.missing) { |
| 1142 | let output: unknown |
| 1143 | try { |
| 1144 | output = make(input, parseOptions) |
| 1145 | } catch (error) { |
| 1146 | throwConstructorDefect(error) |
| 1147 | } |
| 1148 | if (output !== CompilerRegistry.invalid && output !== InternalParser.missing) return output as T |
| 1149 | } |
| 1150 | return runSync(constructEffect<T>(entry, input, parseOptions), constructorDefectMessage) |
| 1151 | } |
| 1152 | |
| 1153 | /** |
| 1154 | * Constructs a class instance from its type-side declaration. |
no test coverage detected