diff --git a/src/modules/system/index.ts b/src/modules/system/index.ts index 250f1fb83c2..200deafe49c 100644 --- a/src/modules/system/index.ts +++ b/src/modules/system/index.ts @@ -14,25 +14,6 @@ const commonMimeTypes = [ 'text/html', ]; -/** - * Converts the given set to an array. - * - * @param set The set to convert. - */ -// TODO ST-DDT 2022-03-11: Replace with Array.from(Set) -function setToArray(set: Set): T[] { - // shortcut if Array.from is available - if (Array.from) { - return Array.from(set); - } - - const array: T[] = []; - set.forEach((item) => { - array.push(item); - }); - return array; -} - /** * Generates fake data for many computer systems properties. */ @@ -121,7 +102,7 @@ export class System { typeSet.add(type); }); - const types = setToArray(typeSet); + const types = Array.from(typeSet); return this.faker.helpers.arrayElement(types); } @@ -151,8 +132,7 @@ export class System { } }); - const extensions = setToArray(extensionSet); - + const extensions = Array.from(extensionSet); return this.faker.helpers.arrayElement(extensions); }