| 9 | // replaces any occurrence of an empty-brackets (e.g: []) with a special Symbol(append) to represent it |
| 10 | // this is going to be useful for the setter method that will push values to the end of the array when finding these |
| 11 | const replaceAppendSymbols = str => { |
| 12 | const matchEmptyBracket = str.match(/^(.*)\[\]\.?(.*)$/) |
| 13 | |
| 14 | if (matchEmptyBracket) { |
| 15 | const [, pre, post] = matchEmptyBracket |
| 16 | return [...replaceAppendSymbols(pre), _append, post].filter(Boolean) |
| 17 | } |
| 18 | |
| 19 | return [str] |
| 20 | } |
| 21 | |
| 22 | const parseKeys = key => { |
| 23 | const sqBracketItems = new Set() |
no test coverage detected