( from: S, ast: AST.AST )
| 3160 | } |
| 3161 | |
| 3162 | function makeBrandClass<S extends Schema.Any, B extends string | symbol>( |
| 3163 | from: S, |
| 3164 | ast: AST.AST |
| 3165 | ): brand<S, B> { |
| 3166 | return class BrandClass extends make<Schema.Type<S> & Brand<B>, Schema.Encoded<S>, Schema.Context<S>>(ast) { |
| 3167 | static override annotations(annotations: Annotations.Schema<Schema.Type<S> & Brand<B>>): brand<S, B> { |
| 3168 | return makeBrandClass(this.from, mergeSchemaAnnotations(this.ast, annotations)) |
| 3169 | } |
| 3170 | |
| 3171 | static make = (a: Brand.Unbranded<Schema.Type<S> & Brand<B>>, options?: MakeOptions): Schema.Type<S> & Brand<B> => { |
| 3172 | return getDisableValidationMakeOption(options) ? a : ParseResult.validateSync(this)(a) |
| 3173 | } |
| 3174 | |
| 3175 | static from = from |
| 3176 | } |
| 3177 | } |
| 3178 | |
| 3179 | /** |
| 3180 | * Returns a nominal branded schema by applying a brand to a given schema. |
no outgoing calls
no test coverage detected
searching dependent graphs…