( brand: B, annotations?: Annotations.Schema<Schema.Type<S> & Brand<B>> )
| 3195 | * @since 3.10.0 |
| 3196 | */ |
| 3197 | export const brand = <S extends Schema.Any, B extends string | symbol>( |
| 3198 | brand: B, |
| 3199 | annotations?: Annotations.Schema<Schema.Type<S> & Brand<B>> |
| 3200 | ) => |
| 3201 | (self: S): brand<S, B> => { |
| 3202 | const annotation: AST.BrandAnnotation = option_.match(AST.getBrandAnnotation(self.ast), { |
| 3203 | onNone: () => [brand], |
| 3204 | onSome: (brands) => [...brands, brand] |
| 3205 | }) |
| 3206 | const ast = AST.annotations( |
| 3207 | self.ast, |
| 3208 | toASTAnnotations({ |
| 3209 | [AST.BrandAnnotationId]: annotation, |
| 3210 | ...annotations |
| 3211 | }) |
| 3212 | ) |
| 3213 | return makeBrandClass(self, ast) |
| 3214 | } |
| 3215 | |
| 3216 | /** |
| 3217 | * @category combinators |
nothing calls this directly
no test coverage detected