Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: DeepPartial with any and {[k: string]: any} (#6581)
* test: Test DeepPartial with any and {[k: string]: any} This tests #6580. * fix: DeepPartial with any and {[k: string]: any} Fixes #6580.
- Loading branch information
1 parent
9d2df28
commit 8d90d40
Showing
3 changed files
with
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class Comment { | ||
any: any; | ||
object: {[k: string]: any}; | ||
} |
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,24 @@ | ||
import {DeepPartial} from "../../../src"; | ||
import {Comment} from "./entity/Comment"; | ||
|
||
describe("github issues > #6580 DeepPartial does not handle `any` and `{[k: string]}`", () => { | ||
|
||
function attemptDeepPartial(entityLike: DeepPartial<Comment>): void { | ||
} | ||
|
||
it("DeepPartial should correctly handle any", () => { | ||
attemptDeepPartial({ | ||
any: { | ||
foo: 'bar', | ||
} | ||
}) | ||
}); | ||
|
||
it("DeepPartial should correctly handle {[k: string]: any}", () => { | ||
attemptDeepPartial({ | ||
object: { | ||
foo: 'bar' | ||
}, | ||
}) | ||
}); | ||
}); |