Skip to content

Commit

Permalink
Refactor mutableDevice to use Array.from for entries iteration since …
Browse files Browse the repository at this point in the history
…we support node 18 20
  • Loading branch information
Luligu committed Dec 12, 2024
1 parent 7a8af6d commit dab8f88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mutableDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class MutableDevice {
if (!mainDevice.endpoint) throw new Error('Main endpoint is not defined. Call createMainEndpoint() first.');

// Create the child endpoints
for (const [endpoint, device] of this.mutableDevice.entries().filter(([endpoint]) => endpoint !== '')) {
for (const [endpoint, device] of Array.from(this.mutableDevice.entries()).filter(([endpoint]) => endpoint !== '')) {
device.endpoint = mainDevice.endpoint.addChildDeviceType(
endpoint,
device.deviceTypes as AtLeastOne<DeviceTypeDefinition>,
Expand Down

0 comments on commit dab8f88

Please sign in to comment.