From 040aed7c91c5983e9726b19f8e10d73a8e46f558 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 24 Sep 2024 10:22:51 +0100 Subject: [PATCH] ProjectionFn -> BranchProjection --- types/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 6f4a5ad9..125bc5e7 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -103,7 +103,9 @@ interface EncoderOptions { * The index muss be a number between 0 and length-1 of the passed types. * In this case (a branch index) the union will use an unwrapped representation. Otherwise (undefined), the union will be wrapped. */ -type ProjectionFn = (types: ReadonlyArray) => ((val: unknown) => number) | undefined; +type BranchProjection = (types: ReadonlyArray) => + | ((val: unknown) => number) + | undefined; interface ForSchemaOptions { assertLogicalTypes: boolean; @@ -113,7 +115,7 @@ interface ForSchemaOptions { omitRecordMethods: boolean; registry: { [name: string]: Type }; typeHook: (schema: Schema | string, opts: ForSchemaOptions) => Type | undefined; - wrapUnions: ProjectionFn | boolean | 'auto' | 'always' | 'never'; + wrapUnions: BranchProjection | boolean | 'auto' | 'always' | 'never'; } interface TypeOptions extends ForSchemaOptions {