-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deepMerge): deepMerge is altering parameter definitions (#1888)
- Loading branch information
Showing
6 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test/valid-data/type-intersection-partial-conflict-union-alias/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type X = 'a' | 'b' | ||
|
||
type Foo = { | ||
foo: X | ||
} | ||
|
||
export type A = Foo & { | ||
foo: 'a' | ||
} | ||
|
||
export type B = Foo & { | ||
foo: 'b' | ||
} | ||
|
||
export type MyType = A | B |
42 changes: 42 additions & 0 deletions
42
test/valid-data/type-intersection-partial-conflict-union-alias/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$ref": "#/definitions/MyType", | ||
"definitions": { | ||
"MyType": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/A" | ||
}, | ||
{ | ||
"$ref": "#/definitions/B" | ||
} | ||
] | ||
}, | ||
"A": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"foo": { | ||
"type": "string", | ||
"const": "a" | ||
} | ||
}, | ||
"required": [ | ||
"foo" | ||
] | ||
}, | ||
"B": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"foo": { | ||
"type": "string", | ||
"const": "b" | ||
} | ||
}, | ||
"required": [ | ||
"foo" | ||
] | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test/valid-data/type-intersection-partial-conflict-union/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type Foo = { | ||
foo: 'a' | 'b' | ||
} | ||
|
||
export type A = Foo & { | ||
foo: 'a' | ||
} | ||
|
||
export type B = Foo & { | ||
foo: 'b' | ||
} | ||
|
||
export type MyType = A | B |
42 changes: 42 additions & 0 deletions
42
test/valid-data/type-intersection-partial-conflict-union/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$ref": "#/definitions/MyType", | ||
"definitions": { | ||
"MyType": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/A" | ||
}, | ||
{ | ||
"$ref": "#/definitions/B" | ||
} | ||
] | ||
}, | ||
"A": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"foo": { | ||
"type": "string", | ||
"const": "a" | ||
} | ||
}, | ||
"required": [ | ||
"foo" | ||
] | ||
}, | ||
"B": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"foo": { | ||
"type": "string", | ||
"const": "b" | ||
} | ||
}, | ||
"required": [ | ||
"foo" | ||
] | ||
} | ||
} | ||
} |