Skip to content

Commit

Permalink
feat(type): allow type annotation options to be extracted
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus S. Abildskov <[email protected]>
  • Loading branch information
marcus-sa committed Feb 9, 2024
1 parent 3e09ddf commit 53216ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/type/src/reflection/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +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?: never | [T, Options] };

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

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

0 comments on commit 53216ff

Please sign in to comment.