MCPcopy Create free account
hub / github.com/Inist-CNRS/node-csv-string / QuotedValue

Method QuotedValue

src/Parser.ts:162–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160 }
161
162 private QuotedValue(): Value | undefined {
163 if (this.input.charAt(this.pointer) === this.quote) {
164 let searchIndex;
165 let index = 1;
166 while (true) {
167 searchIndex = this.input.slice(this.pointer + index).search(this.quote);
168 if (searchIndex === -1) {
169 return;
170 }
171 if (
172 this.input.charAt(this.pointer + index + searchIndex + 1) ===
173 this.quote
174 ) {
175 index += searchIndex + 2;
176 continue;
177 }
178 const value = this.input.slice(
179 this.pointer,
180 this.pointer + index + searchIndex + 1
181 );
182 this.pointer += value.length;
183 return value;
184 }
185 }
186 }
187
188 private EOF(): boolean {
189 return this.pointer >= this.input.length;

Callers 1

ValueMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected