lib/uri_parser.js
function parseQueryStringItemValue(key, value) {
  if (Array.isArray(value)) {
    // deduplicate and simplify arrays
    value = value.filter((v, idx) => value.indexOf(v) === idx);
    if (value.length === 1) value = value[0];
  } else if (value.indexOf(':') > 0) {
    value = value.split(',').reduce((result, pair) => {
      const parts = pair.split(':');
      result[parts[0]] = parseQueryStringItemValue(key, parts[1]);
      return result;
    }, {});
  } else if (value.indexOf(',') > 0) {
    value = value.split(',').map(v => {
      return parseQueryStringItemValue(key, v);
    });
  } else if (value.toLowerCase() === 'true' || value.toLowerCase() === 'false') {
    value = value.toLowerCase() === 'true';
  } else if (!Number.isNaN(value) && !STRING_OPTIONS.has(key)) {
    const numericValue = parseFloat(value);
    if (!Number.isNaN(numericValue)) {
      value = parseFloat(value);
    }
  }

  return value;
}
function parseQueryStringItemValue(key, value) {
  if (Array.isArray(value)) {
    // deduplicate and simplify arrays
    value = value.filter((v, idx) => value.indexOf(v) === idx);
    if (value.length === 1) value = value[0];
  } else if (value.indexOf(':') > 0) {
    value = value.split(',').reduce((result, pair) => {
      const parts = pair.split(':');
      result[parts[0]] = parseQueryStringItemValue(key, parts[1]);
      return result;
    }, {});
  } else if (value.indexOf(',') > 0) {
    value = value.split(',').map(v => {
      return parseQueryStringItemValue(key, v);
    });
  } else if (value.toLowerCase() === 'true' || value.toLowerCase() === 'false') {
    value = value.toLowerCase() === 'true';
  } else if (!Number.isNaN(value) && !STRING_OPTIONS.has(key)) {
    const numericValue = parseFloat(value);
    if (!Number.isNaN(numericValue)) {
      value = parseFloat(value);
    }
  }

  return value;
}
function parseQueryStringItemValue ( key , value ) { if ( Array . isArray ( value ) ) { // deduplicate and simplify arrays value = value . filter ( ( v , idx ) => value . indexOf ( v ) === idx ) ; if ( value . length === 1 ) value = value [ 0 ] ; } else if ( value . indexOf ( ':' ) > 0 ) { value = value . split ( ',' ) . reduce ( ( result , pair ) => { const parts = pair . split ( ':' ) ; result [ parts [ 0 ] ] = parseQueryStringItemValue ( key , parts [ 1 ] ) ; return result ; } , { } ) ; } else if ( value . indexOf ( ',' ) > 0 ) { value = value . split ( ',' ) . map ( v => { return parseQueryStringItemValue ( key , v ) ; } ) ; } else if ( value . toLowerCase ( ) === 'true' || value . toLowerCase ( ) === 'false' ) { value = value . toLowerCase ( ) === 'true' ; } else if ( ! Number . isNaN ( value ) && ! STRING_OPTIONS . has ( key ) ) { const numericValue = parseFloat ( value ) ; if ( ! Number . isNaN ( numericValue ) ) { value = parseFloat ( value ) ; } } return value ; }
Parses a query string item according to the connection string spec

@param {string} key The key for the parsed value
@param {Array|String} value The value to parse
@return {Array|Object|String} The parsed value
Parses a query string item according to the connection string spec