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

Function typeHandlers

cjs/src/types.js:201–210  ·  view source on GitHub ↗
(types)

Source from the content-addressed store, hash-verified

199}
200
201function typeHandlers(types) {
202 return Object.keys(types).reduce((acc, k) => {
203 types[k].from && [].concat(types[k].from).forEach(x => acc.parsers[x] = types[k].parse)
204 if (types[k].serialize) {
205 acc.serializers[types[k].to] = types[k].serialize
206 types[k].from && [].concat(types[k].from).forEach(x => acc.serializers[x] = types[k].serialize)
207 }
208 return acc
209 }, { parsers: {}, serializers: {} })
210}
211
212function escapeIdentifiers(xs, { transform: { column } }) {
213 return xs.map(x => escapeIdentifier(column.to ? column.to(x) : x)).join(',')

Callers 1

types.jsFile · 0.70

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected