From a7e30e4a9966ef753f6f356148133c6fa5ac9fba Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Fri, 20 May 2022 13:37:50 -0500 Subject: [PATCH] Use this.getListArray to prevent extra conversions --- build-lists.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-lists.js b/build-lists.js index 208d812..40a386e 100644 --- a/build-lists.js +++ b/build-lists.js @@ -244,6 +244,8 @@ class BuildLists { const hasSaveMethod = listOptions.hasOwnProperty('beforeSave') const saveMethod = hasSaveMethod ? listOptions.beforeSave : listSet => Array.from( listSet ) + + // console.log('listFullPath', listFullPath) const saveableList = saveMethod( this.lists[listOptions.name] ) @@ -396,7 +398,7 @@ class BuildLists { const { errors } = await PromisePool .withConcurrency( poolSize ) - .for( Array.from( this.lists[listOptions.name] ) ) + .for( this.getListArray( listOptions.name ) ) .process(async ( listEntry, index, pool ) => { // console.log('listEntry', listEntry) @@ -433,7 +435,7 @@ class BuildLists { // Add device support if ( this.shouldHaveDeviceSupport( listEntry ) ) { - const deviceList = Array.from( this.lists[ 'device' ] ) + const deviceList = this.getListArray( 'device' ) listEntry.deviceSupport = deviceList.map( device => { const supportsApp = deviceSupportsApp( device, listEntry ) @@ -458,8 +460,6 @@ class BuildLists { throw new Error( errors ) } - // Array.from( this.lists[listOptions.name] ) - // Count saved files const fileCount = fs.readdirSync( apiListDirectory ).length