(value: unknown)
| 1257 | const wrappedObjects = new WeakMap<object, unknown>(); |
| 1258 | |
| 1259 | function shouldWrapObject(value: unknown): value is object { |
| 1260 | if (!value || typeof value !== 'object') return false; |
| 1261 | // Drizzle query builders are thenable objects (QueryPromise) but are not native Promises. |
| 1262 | // They still need wrapping so we can provide sqlite-style `.all/.get/.run` shims. |
| 1263 | if (value instanceof Promise) return false; |
| 1264 | return true; |
| 1265 | } |
| 1266 | |
| 1267 | function wrapQueryLike<T>(value: T): T { |
| 1268 | if (!shouldWrapObject(value)) return value; |
no outgoing calls
no test coverage detected