Use this.getListArray to prevent extra conversions

This commit is contained in:
Sam Carlton 2022-05-20 13:37:50 -05:00
parent b6ed198000
commit a7e30e4a99

View file

@ -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