MCPcopy
hub / github.com/mongodb/node-mongodb-native / entriesFromString

Function entriesFromString

src/connection_string.ts:204–217  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

202}
203
204function* entriesFromString(value: string): Generator<[string, string]> {
205 if (value === '') {
206 return;
207 }
208 const keyValuePairs = value.split(',');
209 for (const keyValue of keyValuePairs) {
210 const [key, value] = keyValue.split(/:(.*)/);
211 if (value == null) {
212 throw new MongoParseError('Cannot have undefined values in key value pairs');
213 }
214
215 yield [key, value];
216 }
217}
218
219class CaseInsensitiveMap<Value = any> extends Map<string, Value> {
220 constructor(entries: Array<[string, any]> = []) {

Callers 1

transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected