( def: unknown, ctx: BaseParseContext )
| 57 | } = {} |
| 58 | |
| 59 | export const parseInnerDefinition = ( |
| 60 | def: unknown, |
| 61 | ctx: BaseParseContext |
| 62 | ): InnerParseResult => { |
| 63 | if (typeof def === "string") { |
| 64 | if (ctx.args && Object.keys(ctx.args).some(k => def.includes(k))) { |
| 65 | // we can only rely on the cache if there are no contextual |
| 66 | // resolutions like "this" or generic args |
| 67 | return parseString(def, ctx) |
| 68 | } |
| 69 | const scopeCache = (parseCache[ctx.$.name] ??= {}) |
| 70 | return (scopeCache[def] ??= parseString(def, ctx)) |
| 71 | } |
| 72 | return hasDomain(def, "object") ? |
| 73 | parseObject(def, ctx) |
| 74 | : throwParseError(writeBadDefinitionTypeMessage(domainOf(def))) |
| 75 | } |
| 76 | |
| 77 | export const parseObject = (def: object, ctx: BaseParseContext): BaseRoot => { |
| 78 | const objectKind = objectKindOf(def) |
no test coverage detected
searching dependent graphs…