Convert objects and arrays to script correctly

ifql/join
ebb-tide 2018-05-25 17:20:11 -07:00
parent 11d859ca2e
commit c82493d06b
1 changed files with 6 additions and 1 deletions

View File

@ -258,7 +258,12 @@ export class IFQLPage extends PureComponent<Props, State> {
}
if (type === argTypes.ARRAY) {
return `${key}: [${value}]`
return `${key}: ["${value}"]`
}
if (type === argTypes.OBJECT) {
const valueString = _.map(value, (v, k) => k + ':' + v).join(',')
return `${key}: {${valueString}}`
}
return `${key}: ${value}`