update node_modules

This commit is contained in:
bitkarrot
2022-03-20 22:29:16 -07:00
parent c97bfff58e
commit ff7f8a6ab0
115 changed files with 5651 additions and 2419 deletions

28
node_modules/cookie/index.js generated vendored
View File

@@ -22,7 +22,6 @@ exports.serialize = serialize;
var decode = decodeURIComponent;
var encode = encodeURIComponent;
var pairSplitRegExp = /; */;
/**
* RegExp to match field-content in RFC 7230 sec 3.2
@@ -53,28 +52,29 @@ function parse(str, options) {
var obj = {}
var opt = options || {};
var pairs = str.split(pairSplitRegExp);
var pairs = str.split(';')
var dec = opt.decode || decode;
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i];
var eq_idx = pair.indexOf('=');
var index = pair.indexOf('=')
// skip things that don't look like key=value
if (eq_idx < 0) {
if (index < 0) {
continue;
}
var key = pair.substr(0, eq_idx).trim()
var val = pair.substr(++eq_idx, pair.length).trim();
// quoted values
if ('"' == val[0]) {
val = val.slice(1, -1);
}
var key = pair.substring(0, index).trim()
// only assign once
if (undefined == obj[key]) {
var val = pair.substring(index + 1, pair.length).trim()
// quoted values
if (val[0] === '"') {
val = val.slice(1, -1)
}
obj[key] = tryDecode(val, dec);
}
}
@@ -120,7 +120,11 @@ function serialize(name, val, options) {
if (null != opt.maxAge) {
var maxAge = opt.maxAge - 0;
if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
if (isNaN(maxAge) || !isFinite(maxAge)) {
throw new TypeError('option maxAge is invalid')
}
str += '; Max-Age=' + Math.floor(maxAge);
}