Skip to content

Commit 67d0b34

Browse files
authored
Merge pull request #37 from martinRenou/support_number_input
Support Number input
2 parents ca727e5 + bb6e233 commit 67d0b34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/EffectBlock.ts

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ class Effect extends Block {
8787
}
8888
// List of components is given, verify components length
8989
else {
90+
if (typeof input == 'number' && this.inputDimension == 1) {
91+
input = [input];
92+
}
93+
9094
if (input.length != this.inputDimension) {
9195
throw 'This effect needs ${this.inputDimension} component(s) as input, but ${input} was given';
9296
}

0 commit comments

Comments
 (0)