(displayPattern: string)
| 19 | // --------------------------------------------------------------------------- |
| 20 | |
| 21 | export const toPolicyPattern = (displayPattern: string): string => { |
| 22 | if (displayPattern === "*") return "*"; |
| 23 | const firstDot = displayPattern.indexOf("."); |
| 24 | if (firstDot === -1) return displayPattern; // bare integration slug, no tail |
| 25 | const integration = displayPattern.slice(0, firstDot); |
| 26 | const rest = displayPattern.slice(firstDot + 1); |
| 27 | if (rest === "*") return displayPattern; // `integration.*` — trailing * is already a subtree |
| 28 | return `${integration}.*.*.${rest}`; |
| 29 | }; |
| 30 | |
| 31 | export { matchPattern }; |
| 32 |
no outgoing calls
no test coverage detected