MCPcopy Create free account
hub / github.com/Effect-TS/effect / defaultEscape

Function defaultEscape

packages/effect/src/sql/Statement.ts:1246–1253  ·  view source on GitHub ↗
(c: string)

Source from the content-addressed store, hash-verified

1244 * @since 4.0.0
1245 */
1246export function defaultEscape(c: string) {
1247 const re = new RegExp(c, "g")
1248 const double = c + c
1249 const dot = c + "." + c
1250 return function(str: string): string {
1251 return c + str.replace(re, double).replace(/\./g, dot) + c
1252 }
1253}
1254
1255/**
1256 * Classifies a JavaScript value as a SQL primitive kind, treating `undefined`

Callers 1

Statement.tsFile · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected