Skip to content

Commit

Permalink
refactor(json-schema): refactor stringify type to fix literal type is…
Browse files Browse the repository at this point in the history
… erased (#1508)
  • Loading branch information
liuweiGL authored May 26, 2021
1 parent fb7654e commit 43e79a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/json-schema/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ export interface ISchemaTransformerOptions extends ISchemaFieldFactoryOptions {
}

export type Stringify<P extends { [key: string]: any }> = {
[key in keyof P]?: P[key] | string
/**
* Use `string & {}` instead of string to keep Literal Type for ISchema#component and ISchema#decorator
*/
[key in keyof P]?: P[key] | (string & {})
}

export type ISchema<
Expand Down

0 comments on commit 43e79a6

Please sign in to comment.