(data: any)
| 284 | const __: ExpectedConfigShape = {} as DrizzleConfig; |
| 285 | |
| 286 | export function isConfig(data: any): boolean { |
| 287 | if (typeof data !== 'object' || data === null) return false; |
| 288 | |
| 289 | if (data.constructor.name !== 'Object') return false; |
| 290 | |
| 291 | if ('logger' in data) { |
| 292 | const type = typeof data['logger']; |
| 293 | if ( |
| 294 | type !== 'boolean' && (type !== 'object' || typeof data['logger']['logQuery'] !== 'function') |
| 295 | && type !== 'undefined' |
| 296 | ) return false; |
| 297 | |
| 298 | return true; |
| 299 | } |
| 300 | |
| 301 | if ('schema' in data) { |
| 302 | const type = typeof data['schema']; |
| 303 | if (type !== 'object' && type !== 'undefined') return false; |
| 304 | |
| 305 | return true; |
| 306 | } |
| 307 | |
| 308 | if ('casing' in data) { |
| 309 | const type = typeof data['casing']; |
| 310 | if (type !== 'string' && type !== 'undefined') return false; |
| 311 | |
| 312 | return true; |
| 313 | } |
| 314 | |
| 315 | if ('mode' in data) { |
| 316 | if (data['mode'] !== 'default' || data['mode'] !== 'planetscale' || data['mode'] !== undefined) return false; |
| 317 | |
| 318 | return true; |
| 319 | } |
| 320 | |
| 321 | if ('connection' in data) { |
| 322 | const type = typeof data['connection']; |
| 323 | if (type !== 'string' && type !== 'object' && type !== 'undefined') return false; |
| 324 | |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | if ('client' in data) { |
| 329 | const type = typeof data['client']; |
| 330 | if (type !== 'object' && type !== 'function' && type !== 'undefined') return false; |
| 331 | |
| 332 | return true; |
| 333 | } |
| 334 | |
| 335 | if (Object.keys(data).length === 0) return true; |
| 336 | |
| 337 | return false; |
| 338 | } |
| 339 | |
| 340 | export type NeonAuthToken = string | (() => string | Promise<string>); |
| 341 |
no outgoing calls
no test coverage detected