| 641 | /** @type {(string|number)[]} */ | 641 | /** @type {(string|number)[]} */ |
| 642 | let values = Array.isArray(value) ? value : value.split(' '); | 642 | let values = Array.isArray(value) ? value : value.split(' '); |
| 643 | | 643 | |
| 644 | // If a JSON array was provided as the only value, convert it to an array | 644 | // If an array of strings was provided as the only value, convert it to an array |
| 645 | if (values.length === 1 && typeof values[0] === 'string' && values[0].startsWith('[')) { | 645 | if (values.length === 1 && typeof values[0] === 'string') { |
| | 646 | if (values[0].startsWith('[')) { |
| | 647 | // JSON-style array |
| 646 | values = convertValueType(values[0], 'array'); | 648 | values = convertValueType(values[0], 'array'); |
| | 649 | } else { |
| | 650 | // Space-separated string |
| | 651 | values = values[0].split(' '); |
| | 652 | } |
| 647 | } | 653 | } |
| 648 | | 654 | |
| 649 | const array = values.map(i => typeof i === 'string' ? i.trim() : i) | 655 | const array = values.map(i => typeof i === 'string' ? i.trim() : i) |