(key?: string)
| 82 | export const SLUG_MISSING_REQUIRED_DATE = 'SLUG_MISSING_REQUIRED_DATE'; |
| 83 | |
| 84 | export function keyToPathArray(key?: string) { |
| 85 | if (!key) { |
| 86 | return []; |
| 87 | } |
| 88 | const parts = []; |
| 89 | const separator = ''; |
| 90 | const chars = key.split(separator); |
| 91 | |
| 92 | let currentChar; |
| 93 | let currentStr = []; |
| 94 | while ((currentChar = chars.shift())) { |
| 95 | if (['[', ']', '.'].includes(currentChar)) { |
| 96 | if (currentStr.length > 0) { |
| 97 | parts.push(currentStr.join(separator)); |
| 98 | } |
| 99 | currentStr = []; |
| 100 | } else { |
| 101 | currentStr.push(currentChar); |
| 102 | } |
| 103 | } |
| 104 | if (currentStr.length > 0) { |
| 105 | parts.push(currentStr.join(separator)); |
| 106 | } |
| 107 | return parts; |
| 108 | } |
| 109 | |
| 110 | export function expandPath({ |
| 111 | data, |
no outgoing calls
no test coverage detected