Skip to content

Commit

Permalink
Better typing support for Description.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jan 8, 2020
1 parent 1e72fc7 commit d0f4642
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/properties/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ export function deepCopy(object: any): any {
throw new Error("Cannot deepCopy " + typeof(object));
}

export class Description {
constructor(info: any) {
export class Description<T = any> {
constructor(info: T) {
for (const key in info) {
(<any>this)[key] = deepCopy(info[key]);
}
Object.freeze(this);
}
}

0 comments on commit d0f4642

Please sign in to comment.