Skip to content

Commit

Permalink
fix: as value is an array we need to spread it otherwise the function…
Browse files Browse the repository at this point in the history
… being call will just receive an array (topology-foundation#285)

Signed-off-by: Sacha Froment <[email protected]>
Co-authored-by: Jan Lewandowski <[email protected]>
  • Loading branch information
sfroment and JanLewDev authored Dec 11, 2024
1 parent 20450ef commit 09bf989
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,14 @@ export class DRPObject implements IDRPObject {
}

for (const op of linearizedOperations) {
drp[op.type](op.value);
const args = Array.isArray(op.value) ? op.value : [op.value];
drp[op.type](...args);
}
if (vertexOperation) {
drp[vertexOperation.type](vertexOperation.value);
const args = Array.isArray(vertexOperation.value)
? vertexOperation.value
: [vertexOperation.value];
drp[vertexOperation.type](...args);
}

const varNames: string[] = Object.keys(drp);
Expand Down

0 comments on commit 09bf989

Please sign in to comment.