Skip to content

Commit

Permalink
feat(type): allow type annotation options to be extracted attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Feb 9, 2024
1 parent fa64d90 commit 465f995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/type/src/reflection/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1548,9 +1548,9 @@ export interface EntityOptions {
* const param1 = typeToObject(data[0]); //yes
* ```
*/
export type TypeAnnotation<T extends string, Options = never> = { __meta?: never | [T, Options] };
export type TypeAnnotation<T extends string, Options = never> = { __meta?: [T, never | Options] };

export type ExtractTypeAnnotationOptions<T extends TypeAnnotation<string, any>> = Exclude<NonNullable<T['__meta']>, never>[1];
export type ExtractTypeAnnotationOptions<T extends TypeAnnotation<string, any>> = Exclude<NonNullable<T['__meta']>[1], never>;

/**
* Type to decorate an interface/object literal with entity information.
Expand Down

0 comments on commit 465f995

Please sign in to comment.