Added generic type to assignLength method

This commit is contained in:
Alexander Cerutti
2019-06-12 23:28:59 +02:00
parent 85a107f7ed
commit 48b9cd0b74

View File

@@ -87,6 +87,6 @@ export function generateStringFile(lang: { [index: string]: string }): Buffer {
* @param {Array<Object<string, any>>} source - the main sources of properties * @param {Array<Object<string, any>>} source - the main sources of properties
*/ */
export function assignLength(length: number, ...sources: Array<{ [key: string]: any }>): Array<{ [key: string]: any }> { export function assignLength<T>(length: number, ...sources: Array<{ [key: string]: any }>): { [key: string]: any } & T {
return Object.assign({ length }, ...sources); return Object.assign({ length }, ...sources);
} }