diff --git a/test/github-issues/6580/entity/Comment.ts b/test/github-issues/6580/entity/Comment.ts new file mode 100644 index 0000000000..1ef8a1139b --- /dev/null +++ b/test/github-issues/6580/entity/Comment.ts @@ -0,0 +1,4 @@ +export class Comment { + any: any; + object: {[k: string]: any}; +} diff --git a/test/github-issues/6580/issue-6580.ts b/test/github-issues/6580/issue-6580.ts new file mode 100644 index 0000000000..d309ad411e --- /dev/null +++ b/test/github-issues/6580/issue-6580.ts @@ -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): void { + } + + it("DeepPartial should correctly handle any", () => { + attemptDeepPartial({ + any: { + foo: 'bar', + } + }) + }); + + it("DeepPartial should correctly handle {[k: string]: any}", () => { + attemptDeepPartial({ + object: { + foo: 'bar' + }, + }) + }); +});