(value, parser)
| 56 | exports.stringify = stringify; |
| 57 | |
| 58 | function parse(value, parser) { |
| 59 | if (value === null) return null; |
| 60 | if (value === 'empty') { |
| 61 | return []; |
| 62 | } |
| 63 | |
| 64 | let result = value |
| 65 | .substring(1, value.length - 1) |
| 66 | .split(',', 2); |
| 67 | |
| 68 | if (result.length !== 2) return value; |
| 69 | |
| 70 | result = result.map((item, index) => { |
| 71 | return { |
| 72 | value: parseRangeBound(item, parser), |
| 73 | inclusive: index === 0 ? value[0] === '[' : value[value.length - 1] === ']' |
| 74 | }; |
| 75 | }); |
| 76 | |
| 77 | return result; |
| 78 | } |
| 79 | exports.parse = parse; |
no test coverage detected