(
value: unknown,
onCustom: (
type: Custom<string, unknown, unknown>,
placeholder: (u: unknown) => string,
withoutTransform: boolean
) => readonly [sql: string, binds: ReadonlyArray<unknown>],
placeholder: (u: unknown) => string,
withoutTransform: boolean
)
| 1779 | } |
| 1780 | |
| 1781 | const extractPrimitive = ( |
| 1782 | value: unknown, |
| 1783 | onCustom: ( |
| 1784 | type: Custom<string, unknown, unknown>, |
| 1785 | placeholder: (u: unknown) => string, |
| 1786 | withoutTransform: boolean |
| 1787 | ) => readonly [sql: string, binds: ReadonlyArray<unknown>], |
| 1788 | placeholder: (u: unknown) => string, |
| 1789 | withoutTransform: boolean |
| 1790 | ): unknown => { |
| 1791 | if (value === undefined) { |
| 1792 | return null |
| 1793 | } else if (isFragment(value)) { |
| 1794 | const head = value.segments[0] |
| 1795 | if (head._tag === "Custom") { |
| 1796 | const compiled = onCustom(head, placeholder, withoutTransform) |
| 1797 | return compiled[1][0] ?? null |
| 1798 | } else if (head._tag === "Parameter") { |
| 1799 | return head.value |
| 1800 | } |
| 1801 | return null |
| 1802 | } |
| 1803 | return value |
| 1804 | } |
| 1805 | |
| 1806 | const escapeSqlite = defaultEscape("\"") |
| 1807 |
no test coverage detected