(x)
| 265 | } |
| 266 | |
| 267 | function parseEvent(x) { |
| 268 | const xs = x.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i) || [] |
| 269 | |
| 270 | if (!xs) |
| 271 | throw new Error('Malformed subscribe pattern: ' + x) |
| 272 | |
| 273 | const [, command, path, key] = xs |
| 274 | |
| 275 | return (command || '*') |
| 276 | + (path ? ':' + (path.indexOf('.') === -1 ? 'public.' + path : path) : '') |
| 277 | + (key ? '=' + key : '') |
| 278 | } |