Parse cookie `str`.

@param {String} str
@return {Object}
@api private
513424
function parse(str) {
  var obj = {};
  var pairs = str.split(/ *; */);
  var pair;
  if ('' == pairs[0]) return obj;
  for (var i = 0; i < pairs.length; ++i) {
    pair = pairs[i].split('=');
    obj[decode(pair[0])] = decode(pair[1]);
  }
  return obj;
}
230978
function defaultParse(str) {
  if (typeof str !== 'string') {
    return undefined;
  }
  var split = str.split('-');
  if (split.length !== 3) {
    return undefined;
  }
  var year = parseInt(split[0], 10);
  var month = parseInt(split[1], 10) - 1;
  var day = parseInt(split[2], 10);
  if (isNaN(year) || String(year).length > 4 || isNaN(month) || isNaN(day) || day <= 0 || day > 31 || month < 0 || month >= 12) {
    return undefined;
  }

  return new Date(year, month, day);
}
777806
function fastparse (str) {
  if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
    return parse(str)
  }

  var pathname = str
  var query = null
  var search = null

  // This takes the regexp from https://github.com/joyent/node/pull/7878
  // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/
  // And unrolls it into a for loop
  for (var i = 1; i < str.length; i++) {
    switch (str.charCodeAt(i)) {
      case 0x3f: /* ?  */
        if (search === null) {
          pathname = str.substring(0, i)
          query = str.substring(i + 1)
          search = str.substring(i)
        }
        break
      case 0x09: /* \t */
      case 0x0a: /* \n */
      case 0x0c: /* \f */
      case 0x0d: /* \r */
      case 0x20: /*    */
      case 0x23: /* #  */
      case 0xa0:
      case 0xfeff:
        return parse(str)
    }
  }

  var url = Url !== undefined
    ? new Url()
    : {}

  url.path = str
  url.href = str
  url.pathname = pathname

  if (search !== null) {
    url.query = query
    url.search = search
  }

  return url
}
1056703
function reader(str) {
  var matched;

  utils.some(rules, function (rule) {
    return utils.some(rule.regex, function (regex) {
      var match = str.match(regex),
        normalized;

      if (!match) {
        return;
      }

      normalized = match[rule.idx || 0].replace(/\s*$/, '');
      normalized = (rule.hasOwnProperty('replace') && rule.replace.hasOwnProperty(normalized)) ? rule.replace[normalized] : normalized;

      matched = {
        match: normalized,
        type: rule.type,
        length: match[0].length
      };
      return true;
    });
  });

  if (!matched) {
    matched = {
      match: str,
      type: TYPES.UNKNOWN,
      length: str.length
    };
  }

  return matched;
}
1164514
function __Cookies(_cookies) {
  this.cookies = {};
  if (!_cookies || typeof _cookies !== 'string') {
    _cookies = '';
  }

  if (_cookies && _cookies.length) {
    var self = this;
    var i;
    var key;
    var val;

    _cookies.split(/;\ */).forEach(function (pair) {
      i = pair.indexOf('=');
      if (i < 0) {
        return;
      }

      key = unescape(pair.substr(0, i).trim());
      val = pair.substr(++i, pair.length).trim();

      if (val[0] === '"') {
        val = val.slice(1, -1);
      }

      if (self.cookies[key] === void 0) {
        try {
          self.cookies[key] = unescape(val);
        } catch (e) {
          self.cookies[key] = val;
        }
      }
    });
  }
}
648043
function ( str ) {
            if ( !str ) return '';
    
            var _this = this,
                regAry = $B.object.toArray( _this.HTML_CHARACTERS, 'key' ),
                reg = new RegExp( '(' + regAry.join('|') + '|&#[0-9]{1,5};' + ')', 'g' );
    
            return str.replace( reg, function ( match, capture ) {
                return ( capture in _this.HTML_CHARACTERS ) ? _this.HTML_CHARACTERS[capture] : String.fromCharCode(parseInt(capture.substr(2), 10));
            });
        }
916090
function parse(str) {
	str = '(' + str.trim() + ')';

	/**
	 * expr
	 */

	return expr();

	/**
	 * Assert `expr`.
	 */

	function error(expr, msg) {
		if (expr) return;
		var ctx = str.slice(0, 10);
		assert(0, msg + ' near `' + ctx + '`');
	}

	/**
	 * '(' binop ')'
	 */

	function expr() {
		error('(' == str[0], "missing opening '('");
		str = str.slice(1);

		var node = binop();

		error(')' == str[0], "missing closing ')'");
		str = str.slice(1);

		return node;
	}

	/**
	 * field | expr
	 */

	function primary() {
		return field()
			|| expr();
	}

	/**
	 * primary (OR|AND) binop
	 */

	function binop() {
		var left = primary();

		var m = str.match(/^ *(OR|AND) */i);
		if (!m) return left;

		str = str.slice(m[0].length);

		var right = binop();

		return {
			type: 'op',
			op: m[1].toLowerCase(),
			left: left,
			right: right
		}
	}

	/**
	 * FIELD[:VALUE]
	 */

	function field() {
		var val = true;
		var m = str.match(/^([-.\w]+)/);
		if (!m) return;

		var name = m[0];
		str = str.slice(name.length);

		var m = str.match(/^:([-*\w.]+|".*?"|'.*?'|\/(.*?)\/) */);
		if (m) {
			str = str.slice(m[0].length);
			val = m[1];
			if (numeric(val)) val = parseFloat(val);
		}

		return {
			type: 'field',
			name: name,
			value: coerce(val)
		}
	}
}
365509
function parse(str) {

    let res = {};

    str.split(constants.REGEX.newline).map(line => {

        line = line.trim();

        // ignore empty lines and comments
        if (!line || line[0] === '#') {
            return;
        }

        // replace variables that are not escaped
        line = line.replace(constants.REGEX.args, (match, $1, $2) => {

            let key = $1 !== undefined ? $1 : $2;

            if (match.slice(0, 2) === '\\\\') {
                return match.slice(2);
            }

            return process.env[key] !== undefined ? process.env[key] : res[key];

        });

        // find the line split index based on the first occurence of = sign
        let index = line.indexOf('=') > -1 ? line.indexOf('=') : line.length;

        // get key/val and trim whitespace
        let key = line.slice(0, index).trim();
        let val = line.slice(index +1).trim();

        val = parseComment(val).replace(constants.REGEX.quotes, '');

        res[key] = unescape(val);

    });

    return res;

}
790036
function(s_str) {
		if(H_SPARQL_CHARS[s_str[0]]) return s_str;
		else if(s_str.indexOf(':') != -1) return s_str;
		else if(/^(?:[0-9]|(?:\-|\.|\-\.)[0-9])/.test(s_str)) return s_str;
		else return JSON.stringify(s_str);
	}
305611
function(str) {
           var reg, value = null;
           if(typeof str === 'string' && str.length) {
               reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
               value = str.split(reg);
           } else if($.isArray(str)) {
               value = str; 
           } else {
               value = [str];
           }
           return value;
        }
503587
function decode(str) {
  let off = 0;
  let olen = 0;
  const slen = str.length;
  const stra = [];
  const len = str.length;

  while (off < slen - 1 && olen < len) {
    let code = str.charCodeAt(off++);
    const c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
    code = str.charCodeAt(off++);
    const c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
    if (c1 === -1 || c2 === -1) break;
    let o = (c1 << 2) >>> 0;
    o |= (c2 & 0x30) >> 4;
    stra.push(String.fromCharCode(o));
    if (++olen >= len || off >= slen) break;
    code = str.charCodeAt(off++);
    const c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
    if (c3 === -1) break;
    o = ((c2 & 0x0f) << 4) >>> 0;
    o |= (c3 & 0x3c) >> 2;
    stra.push(String.fromCharCode(o));
    if (++olen >= len || off >= slen) break;
    code = str.charCodeAt(off++);
    const c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1;
    o = ((c3 & 0x03) << 6) >>> 0;
    o |= c4;
    stra.push(String.fromCharCode(o));
    ++olen;
  }
  const buffa = [];
  for (off = 0; off < olen; off++) buffa.push(stra[off].charCodeAt(0));
  return Buffer.from(buffa);
}
477896
private function parseCookies($str) {  
	    
	    if(false === is_string($str)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($str)), E_USER_ERROR);
		}

	    $jar 	 = [];
		$headers = explode("\n", trim($str));

		foreach($headers as $header) {

			if(preg_match('/^set-cookie: /i', $header)) {
				
				$cookie = [];

				//Match name and value
				preg_match('/^set-cookie: ([^=]+)=([^;]+)/i', $header, $match);

				if(count($match) === 3) {
					
					$cookie['name']  = $match[1];
					$cookie['value'] = $match[2];
				
					//Match expires
					$cookie['expires'] = null;

					preg_match('/; expires=([^;]+)/i', $header, $match);

					if(count($match) === 2) {
						$cookie['expires'] = strtotime(urldecode(trim($match[1])));
					}

					//Match domain
					$cookie['domain'] = null;

					preg_match('/; domain=([^;]+)/i', $header, $match);

					if(count($match) === 2) {
						$cookie['domain'] = urldecode(trim($match[1]));
					}

					//Match secure
					$cookie['secure'] = false;

					preg_match('/; secure/i', $header, $match);

					if(count($match) === 1) {
						$cookie['secure'] = true;
					}

					//Match httponly
					$cookie['httponly'] = false;

					preg_match('/; httponly/i', $header, $match);

					if(count($match) === 1) {
						$cookie['httponly'] = true;
					}

					//Add cookie to the jar
					if(count($cookie) > 0) {
						$jar[] = $cookie;
					}
				}
			}
		}

		return $jar;
	}
1062795
function parse (str) {
  if (Buffer.isBuffer(str)) str = str.toString();
  type('str', str, 'String');
  try {
    return JSON.parse(str);
  } catch (ex) {
    ex.message = 'Unable to parse JSON: ' + ex.message + '\nAttempted to parse: ' + str;
    throw ex;
  }
}
49728
private Cookie createCookie(String str) throws UnsupportedEncodingException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Cookie name = " + AUTH_COOKIE + " value = " + str);
    }
    Cookie cookie = new Cookie(AUTH_COOKIE, str);

    cookie.setMaxAge(cookieMaxAge);
    if (cookieDomain != null) {
      cookie.setDomain(cookieDomain);
    }
    if (cookiePath != null) {
      cookie.setPath(cookiePath);
    }
    cookie.setSecure(isCookieSecure);
    return cookie;
  }
916713
function str2obj(str) {
  if (!str) {
    return {};
  }

  return str.split('&').reduce(function (acc, cur) {
    var _cur$split = cur.split('='),
        _cur$split2 = _slicedToArray(_cur$split, 2),
        k = _cur$split2[0],
        v = _cur$split2[1];

    k = decodeURIComponent(k);
    v = decodeURIComponent(v);
    return _extends({}, acc, _defineProperty({}, k, v));
  }, {});
}
241840
function parse_messages (parser_type, str) {
  var parser = new HTTPParser(parser_type);
  var buffer = new Buffer(str, 'utf-8');
  var output = [];

  parser.onMessageBegin = function() {
    output.push({
      versionMajor: undefined,
      versionMinor: undefined,
      method: undefined,
      uri: undefined,
      statusCode: undefined,
      headers: {},
      body: "",
      complete: false
    });
    parser.field = null;
    parser.value = null;
  };

  parser.onURL = function(b, start, len) {
    var slice = b.toString('ascii', start, start + len);
    if (output[output.length-1].url) {
      output[output.length-1].url += slice;
    } else {
      // Almost always will branch here.
      output[output.length-1].url = slice;
    }
  };
  
  parser.onHeaderField = function(b, start, len) {
    var slice = b.toString('ascii', start, start + len).toLowerCase();
    if (parser.value != undefined) {
      // note that this overwrites dup headers
      output[output.length-1].headers[parser.field] = parser.value;
      parser.field = null;
      parser.value = null;
    }
    if (parser.field) {
      parser.field += slice;
    } else {
      parser.field = slice;
    }
  };

  parser.onHeaderValue = function(b, start, len) {
    var slice = b.toString('ascii', start, start + len);
    if (parser.value) {
      parser.value += slice;
    } else {
      parser.value = slice;
    }
  };

  parser.onHeadersComplete = function(info) {
    if (parser.field && (parser.value != undefined)) {
      output[output.length-1].headers[parser.field] = parser.value;
      parser.field = null;
      parser.value = null;
    }

    output[output.length-1].versionMajor = info.versionMajor;
    output[output.length-1].versionMinor = info.versionMinor;
    output[output.length-1].statusCode = info.statusCode;
    output[output.length-1].method = info.method;

    return false // isHeadResponse;
  };

  parser.onBody = function(b, start, len) {
    var slice = b.slice(start, start + len);
    output[output.length-1].body += slice;
  };

  parser.onMessageComplete = function() {
    output[output.length-1].complete = true;
    if (parser.field && (parser.value != undefined)) {
      output[output.length-1].headers[parser.field] = parser.value;
    }  
  }
  
  parser.execute(buffer, 0, buffer.length);
  
  // filter out incomplete responses.
  var complete_output = [];
  output.forEach(function (o) {
    if (o.complete) {
      complete_output.push(o);
    }
  })
  return complete_output;
}
143681
function (str) {
      return str.split(';').map(function (e, i) {
        return plugs[i].parse(e)
      })
    }