Use GenericEmbedded for embedded schemas
This commit is contained in:
parent
8b7ea7c589
commit
972085a59b
|
@ -18,10 +18,10 @@ export function compile(
|
|||
): string {
|
||||
const mod = new ModuleContext(env, modulePath, schema, options);
|
||||
|
||||
mod.definePreamble(`let __schema: _.Value<unknown> | null = null;`);
|
||||
mod.definePreamble(`let __schema: _.Value | null = null;`);
|
||||
mod.definePreamble(seq(`export function _schema() `, block(
|
||||
seq(`if (__schema === null) `, block(
|
||||
`__schema = _.decode(_.Bytes.fromHex("${encode(fromSchema(schema)).toHex()}"))`)),
|
||||
`__schema = _.decode<_.GenericEmbedded>(_.Bytes.fromHex("${encode(fromSchema(schema)).toHex()}"))`)),
|
||||
`return __schema`)));
|
||||
|
||||
const embeddedName = schema.embeddedType;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue