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

Function defaultEscape

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

Source from the content-addressed store, hash-verified

1085 * @since 4.0.0
1086 */
1087export function defaultEscape(c: string) {
1088 const re = new RegExp(c, "g")
1089 const double = c + c
1090 const dot = c + "." + c
1091 return function(str: string): string {
1092 return c + str.replace(re, double).replace(/\./g, dot) + c
1093 }
1094}
1095
1096/**
1097 * 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