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