MCPcopy Create free account
hub / github.com/Keyang/node-csvtojson / escapeQuote

Method escapeQuote

src/rowSplit.ts:188–196  ·  view source on GitHub ↗
(segment: string)

Source from the content-addressed store, hash-verified

186
187
188 private escapeQuote(segment: string): string {
189 const key = "es|" + this.quote + "|" + this.escape;
190 if (this.cachedRegExp[key] === undefined) {
191 this.cachedRegExp[key] = new RegExp('\\' + this.escape + '\\' + this.quote, 'g');
192 }
193 const regExp = this.cachedRegExp[key];
194 // console.log(regExp,segment);
195 return segment.replace(regExp, this.quote);
196 }
197 parseMultiLines(lines: Fileline[]): MultipleRowResult {
198 const csvLines: string[][] = [];
199 let left = "";

Callers 4

toCSVRowMethod · 0.95
browser.jsFile · 0.80
csvtojson.min.jsFile · 0.80
rowSplit.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected