Skip to content

Commit 783007a

Browse files
authored
fix(deploy/functions): parsing list param (#8891)
Resolves firebase/firebase-functions#1605
1 parent 587e0bb commit 783007a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/deploy/functions/params.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@ export class ParamValue {
291291
}
292292

293293
asList(): string[] {
294+
// Handle something like "['a', 'b', 'c']"
295+
if (this.rawValue.includes("[")) {
296+
// Convert quotes to apostrophes
297+
const unquoted = this.rawValue.replace(/'/g, '"');
298+
return JSON.parse(unquoted);
299+
}
300+
301+
// Continue to handle something like "a,b,c"
294302
return this.rawValue.split(this.delimiter);
295303
}
296304

0 commit comments

Comments
 (0)