node_modules/.cache/esm/6826f6c2f3ed612d.js
/**
 * Parses a query string item according to the connection string spec
 *
 * @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
@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 @param { Array|String } value The value to parse @return { Array|Object|String } The parsed value
function parseQueryStringItemValue(value) {
  if (Array.isArray(value)) {
    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(parts[1]);
      return result;
    }, {});
  } else if (value.indexOf(',') > 0) {
    value = value.split(',').map(v => {
      return parseQueryStringItemValue(v);
    });
  } else if (value.toLowerCase() === 'true' || value.toLowerCase() === 'false') {
    value = value.toLowerCase() === 'true';
  } else if (!Number.isNaN(value)) {
    const numericValue = parseFloat(value);
    if (!Number.isNaN(numericValue)) {
      value = parseFloat(value);
    }
  }
  return value;
}
function parseQueryStringItemValue ( value ) { if ( Array . isArray ( value ) ) { 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 ( parts [ 1 ] ) ; return result ; } , { } ) ; } else if ( value . indexOf ( ',' ) > 0 ) { value = value . split ( ',' ) . map ( v => { return parseQueryStringItemValue ( v ) ; } ) ; } else if ( value . toLowerCase ( ) === 'true' || value . toLowerCase ( ) === 'false' ) { value = value . toLowerCase ( ) === 'true' ; } else if ( ! Number . isNaN ( value ) ) { 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 {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 @param { Array|String } value The value to parse @return { Array|Object|String } The parsed value
// deduplicate and simplify arrays