MCPcopy Create free account
hub / github.com/porsager/postgres / parseEvent

Function parseEvent

cjs/src/subscribe.js:266–277  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

264}
265
266function 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}

Callers 1

subscribeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected