diff --git a/packages/properties/src.ts/index.ts b/packages/properties/src.ts/index.ts index f77608750b..8ee66d3c60 100644 --- a/packages/properties/src.ts/index.ts +++ b/packages/properties/src.ts/index.ts @@ -22,17 +22,13 @@ export function getStatic(ctor: any, key: string): T { return null; } -export type Similar = { - [P in keyof T]: T[P]; -} - export type Resolvable = { [P in keyof T]: T[P] | Promise; } type Result = { key: string, value: any}; -export async function resolveProperties(object: Readonly>): Promise> { +export async function resolveProperties(object: Readonly>): Promise { const promises: Array> = Object.keys(object).map((key) => { const value = object[>key]; return Promise.resolve(value).then((v) => ({ key: key, value: v })); @@ -41,9 +37,9 @@ export async function resolveProperties(object: Readonly>): Pro const results = await Promise.all(promises); return results.reduce((accum, result) => { - accum[>(result.key)] = result.value; + accum[(result.key)] = result.value; return accum; - }, >{ }); + }, { }); } export function checkProperties(object: any, properties: { [ name: string ]: boolean }): void { @@ -58,7 +54,7 @@ export function checkProperties(object: any, properties: { [ name: string ]: boo }); } -export function shallowCopy(object: T): Similar { +export function shallowCopy(object: T): T { const result: any = {}; for (const key in object) { result[key] = object[key]; } return result; @@ -110,7 +106,7 @@ function _deepCopy(object: any): any { return logger.throwArgumentError(`Cannot deepCopy ${ typeof(object) }`, "object", object); } -export function deepCopy(object: T): Similar { +export function deepCopy(object: T): T { return _deepCopy(object); }