2020-02-18 08:57:00 +01:00
|
|
|
export function buildObjectCollection<T, U>(collection: T[] | undefined, builder: new (p: T) => U) {
|
2019-09-02 14:35:50 +02:00
|
|
|
if (!collection || Array.isArray(collection) === false) return [];
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
return collection.map((v) => new builder(v));
|
2019-09-02 14:35:50 +02:00
|
|
|
}
|