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

Function inferType

cf/src/types.js:221–231  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

219}
220
221export const inferType = function inferType(x) {
222 return (
223 x instanceof Parameter ? x.type :
224 x instanceof Date ? 1184 :
225 x instanceof Uint8Array ? 17 :
226 (x === true || x === false) ? 16 :
227 typeof x === 'bigint' ? 20 :
228 Array.isArray(x) ? inferType(x[0]) :
229 0
230 )
231}
232
233const escapeBackslash = /\\/g
234const escapeQuote = /"/g

Callers 5

arrayFunction · 0.90
handleValueFunction · 0.70
arrayFunction · 0.50
handleValueFunction · 0.50
types.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected