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

Function typeHandlers

cf/src/types.js:202–211  ·  view source on GitHub ↗
(types)

Source from the content-addressed store, hash-verified

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

Callers 2

types.jsFile · 0.70
mergeUserTypesFunction · 0.70

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected