@bigbinary/neeto-playwright-commons 1.26.36 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +65 -45
- package/index.cjs.js.map +1 -1
- package/index.js +65 -45
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -29075,9 +29075,10 @@ function requireAddressparser () {
|
|
|
29075
29075
|
* Converts tokens for a single address into an address object
|
|
29076
29076
|
*
|
|
29077
29077
|
* @param {Array} tokens Tokens object
|
|
29078
|
+
* @param {Number} depth Current recursion depth for nested group protection
|
|
29078
29079
|
* @return {Object} Address object
|
|
29079
29080
|
*/
|
|
29080
|
-
function _handleAddress(tokens) {
|
|
29081
|
+
function _handleAddress(tokens, depth) {
|
|
29081
29082
|
let isGroup = false;
|
|
29082
29083
|
let state = 'text';
|
|
29083
29084
|
let address;
|
|
@@ -29158,7 +29159,7 @@ function requireAddressparser () {
|
|
|
29158
29159
|
// Parse group members, but flatten any nested groups (RFC 5322 doesn't allow nesting)
|
|
29159
29160
|
let groupMembers = [];
|
|
29160
29161
|
if (data.group.length) {
|
|
29161
|
-
let parsedGroup = addressparser(data.group.join(','));
|
|
29162
|
+
let parsedGroup = addressparser(data.group.join(','), { _depth: depth + 1 });
|
|
29162
29163
|
// Flatten: if any member is itself a group, extract its members into the sequence
|
|
29163
29164
|
parsedGroup.forEach(member => {
|
|
29164
29165
|
if (member.group) {
|
|
@@ -29368,6 +29369,13 @@ function requireAddressparser () {
|
|
|
29368
29369
|
}
|
|
29369
29370
|
}
|
|
29370
29371
|
|
|
29372
|
+
/**
|
|
29373
|
+
* Maximum recursion depth for parsing nested groups.
|
|
29374
|
+
* RFC 5322 doesn't allow nested groups, so this is a safeguard against
|
|
29375
|
+
* malicious input that could cause stack overflow.
|
|
29376
|
+
*/
|
|
29377
|
+
const MAX_NESTED_GROUP_DEPTH = 50;
|
|
29378
|
+
|
|
29371
29379
|
/**
|
|
29372
29380
|
* Parses structured e-mail addresses from an address field
|
|
29373
29381
|
*
|
|
@@ -29380,10 +29388,18 @@ function requireAddressparser () {
|
|
|
29380
29388
|
* [{name: 'Name', address: 'address@domain'}]
|
|
29381
29389
|
*
|
|
29382
29390
|
* @param {String} str Address field
|
|
29391
|
+
* @param {Object} options Optional options object
|
|
29392
|
+
* @param {Number} options._depth Internal recursion depth counter (do not set manually)
|
|
29383
29393
|
* @return {Array} An array of address objects
|
|
29384
29394
|
*/
|
|
29385
29395
|
function addressparser(str, options) {
|
|
29386
29396
|
options = options || {};
|
|
29397
|
+
let depth = options._depth || 0;
|
|
29398
|
+
|
|
29399
|
+
// Prevent stack overflow from deeply nested groups (DoS protection)
|
|
29400
|
+
if (depth > MAX_NESTED_GROUP_DEPTH) {
|
|
29401
|
+
return [];
|
|
29402
|
+
}
|
|
29387
29403
|
|
|
29388
29404
|
let tokenizer = new Tokenizer(str);
|
|
29389
29405
|
let tokens = tokenizer.tokenize();
|
|
@@ -29408,7 +29424,7 @@ function requireAddressparser () {
|
|
|
29408
29424
|
}
|
|
29409
29425
|
|
|
29410
29426
|
addresses.forEach(address => {
|
|
29411
|
-
address = _handleAddress(address);
|
|
29427
|
+
address = _handleAddress(address, depth);
|
|
29412
29428
|
if (address.length) {
|
|
29413
29429
|
parsedAddresses = parsedAddresses.concat(address);
|
|
29414
29430
|
}
|
|
@@ -40920,6 +40936,8 @@ function requireStreams () {
|
|
|
40920
40936
|
return streams;
|
|
40921
40937
|
}
|
|
40922
40938
|
|
|
40939
|
+
lib$a.exports;
|
|
40940
|
+
|
|
40923
40941
|
var hasRequiredLib$a;
|
|
40924
40942
|
|
|
40925
40943
|
function requireLib$a () {
|
|
@@ -40931,22 +40949,21 @@ function requireLib$a () {
|
|
|
40931
40949
|
|
|
40932
40950
|
var bomHandling = requireBomHandling();
|
|
40933
40951
|
var mergeModules = requireMergeExports();
|
|
40934
|
-
var iconv = module.exports;
|
|
40935
40952
|
|
|
40936
40953
|
// All codecs and aliases are kept here, keyed by encoding name/alias.
|
|
40937
40954
|
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
|
|
40938
40955
|
// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true
|
|
40939
|
-
|
|
40956
|
+
module.exports.encodings = null;
|
|
40940
40957
|
|
|
40941
40958
|
// Characters emitted in case of error.
|
|
40942
|
-
|
|
40943
|
-
|
|
40959
|
+
module.exports.defaultCharUnicode = "�";
|
|
40960
|
+
module.exports.defaultCharSingleByte = "?";
|
|
40944
40961
|
|
|
40945
40962
|
// Public API.
|
|
40946
|
-
|
|
40963
|
+
module.exports.encode = function encode (str, encoding, options) {
|
|
40947
40964
|
str = "" + (str || ""); // Ensure string.
|
|
40948
40965
|
|
|
40949
|
-
var encoder =
|
|
40966
|
+
var encoder = module.exports.getEncoder(encoding, options);
|
|
40950
40967
|
|
|
40951
40968
|
var res = encoder.write(str);
|
|
40952
40969
|
var trail = encoder.end();
|
|
@@ -40954,17 +40971,17 @@ function requireLib$a () {
|
|
|
40954
40971
|
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res
|
|
40955
40972
|
};
|
|
40956
40973
|
|
|
40957
|
-
|
|
40974
|
+
module.exports.decode = function decode (buf, encoding, options) {
|
|
40958
40975
|
if (typeof buf === "string") {
|
|
40959
|
-
if (!
|
|
40976
|
+
if (!module.exports.skipDecodeWarning) {
|
|
40960
40977
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
40961
|
-
|
|
40978
|
+
module.exports.skipDecodeWarning = true;
|
|
40962
40979
|
}
|
|
40963
40980
|
|
|
40964
40981
|
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
|
|
40965
40982
|
}
|
|
40966
40983
|
|
|
40967
|
-
var decoder =
|
|
40984
|
+
var decoder = module.exports.getDecoder(encoding, options);
|
|
40968
40985
|
|
|
40969
40986
|
var res = decoder.write(buf);
|
|
40970
40987
|
var trail = decoder.end();
|
|
@@ -40972,9 +40989,9 @@ function requireLib$a () {
|
|
|
40972
40989
|
return trail ? (res + trail) : res
|
|
40973
40990
|
};
|
|
40974
40991
|
|
|
40975
|
-
|
|
40992
|
+
module.exports.encodingExists = function encodingExists (enc) {
|
|
40976
40993
|
try {
|
|
40977
|
-
|
|
40994
|
+
module.exports.getCodec(enc);
|
|
40978
40995
|
return true
|
|
40979
40996
|
} catch (e) {
|
|
40980
40997
|
return false
|
|
@@ -40982,31 +40999,31 @@ function requireLib$a () {
|
|
|
40982
40999
|
};
|
|
40983
41000
|
|
|
40984
41001
|
// Legacy aliases to convert functions
|
|
40985
|
-
|
|
40986
|
-
|
|
41002
|
+
module.exports.toEncoding = module.exports.encode;
|
|
41003
|
+
module.exports.fromEncoding = module.exports.decode;
|
|
40987
41004
|
|
|
40988
41005
|
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
|
|
40989
|
-
|
|
41006
|
+
module.exports._codecDataCache = { __proto__: null };
|
|
40990
41007
|
|
|
40991
|
-
|
|
40992
|
-
if (!
|
|
41008
|
+
module.exports.getCodec = function getCodec (encoding) {
|
|
41009
|
+
if (!module.exports.encodings) {
|
|
40993
41010
|
var raw = requireEncodings();
|
|
40994
41011
|
// TODO: In future versions when old nodejs support is removed can use object.assign
|
|
40995
|
-
|
|
40996
|
-
mergeModules(
|
|
41012
|
+
module.exports.encodings = { __proto__: null }; // Initialize as empty object.
|
|
41013
|
+
mergeModules(module.exports.encodings, raw);
|
|
40997
41014
|
}
|
|
40998
41015
|
|
|
40999
41016
|
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
|
41000
|
-
var enc =
|
|
41017
|
+
var enc = module.exports._canonicalizeEncoding(encoding);
|
|
41001
41018
|
|
|
41002
41019
|
// Traverse iconv.encodings to find actual codec.
|
|
41003
41020
|
var codecOptions = {};
|
|
41004
41021
|
while (true) {
|
|
41005
|
-
var codec =
|
|
41022
|
+
var codec = module.exports._codecDataCache[enc];
|
|
41006
41023
|
|
|
41007
41024
|
if (codec) { return codec }
|
|
41008
41025
|
|
|
41009
|
-
var codecDef =
|
|
41026
|
+
var codecDef = module.exports.encodings[enc];
|
|
41010
41027
|
|
|
41011
41028
|
switch (typeof codecDef) {
|
|
41012
41029
|
case "string": // Direct alias to other encoding.
|
|
@@ -41027,9 +41044,9 @@ function requireLib$a () {
|
|
|
41027
41044
|
// The codec function must load all tables and return object with .encoder and .decoder methods.
|
|
41028
41045
|
// It'll be called only once (for each different options object).
|
|
41029
41046
|
//
|
|
41030
|
-
codec = new codecDef(codecOptions,
|
|
41047
|
+
codec = new codecDef(codecOptions, module.exports);
|
|
41031
41048
|
|
|
41032
|
-
|
|
41049
|
+
module.exports._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
|
|
41033
41050
|
return codec
|
|
41034
41051
|
|
|
41035
41052
|
default:
|
|
@@ -41038,13 +41055,13 @@ function requireLib$a () {
|
|
|
41038
41055
|
}
|
|
41039
41056
|
};
|
|
41040
41057
|
|
|
41041
|
-
|
|
41058
|
+
module.exports._canonicalizeEncoding = function (encoding) {
|
|
41042
41059
|
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
|
41043
41060
|
return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "")
|
|
41044
41061
|
};
|
|
41045
41062
|
|
|
41046
|
-
|
|
41047
|
-
var codec =
|
|
41063
|
+
module.exports.getEncoder = function getEncoder (encoding, options) {
|
|
41064
|
+
var codec = module.exports.getCodec(encoding);
|
|
41048
41065
|
var encoder = new codec.encoder(options, codec);
|
|
41049
41066
|
|
|
41050
41067
|
if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options); }
|
|
@@ -41052,8 +41069,8 @@ function requireLib$a () {
|
|
|
41052
41069
|
return encoder
|
|
41053
41070
|
};
|
|
41054
41071
|
|
|
41055
|
-
|
|
41056
|
-
var codec =
|
|
41072
|
+
module.exports.getDecoder = function getDecoder (encoding, options) {
|
|
41073
|
+
var codec = module.exports.getCodec(encoding);
|
|
41057
41074
|
var decoder = new codec.decoder(options, codec);
|
|
41058
41075
|
|
|
41059
41076
|
if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options); }
|
|
@@ -41066,26 +41083,26 @@ function requireLib$a () {
|
|
|
41066
41083
|
// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
|
|
41067
41084
|
// If you would like to enable it explicitly, please add the following code to your app:
|
|
41068
41085
|
// > iconv.enableStreamingAPI(require('stream'));
|
|
41069
|
-
|
|
41070
|
-
if (
|
|
41086
|
+
module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) {
|
|
41087
|
+
if (module.exports.supportsStreams) { return }
|
|
41071
41088
|
|
|
41072
41089
|
// Dependency-inject stream module to create IconvLite stream classes.
|
|
41073
41090
|
var streams = requireStreams()(streamModule);
|
|
41074
41091
|
|
|
41075
41092
|
// Not public API yet, but expose the stream classes.
|
|
41076
|
-
|
|
41077
|
-
|
|
41093
|
+
module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
|
|
41094
|
+
module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
|
|
41078
41095
|
|
|
41079
41096
|
// Streaming API.
|
|
41080
|
-
|
|
41081
|
-
return new
|
|
41097
|
+
module.exports.encodeStream = function encodeStream (encoding, options) {
|
|
41098
|
+
return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options)
|
|
41082
41099
|
};
|
|
41083
41100
|
|
|
41084
|
-
|
|
41085
|
-
return new
|
|
41101
|
+
module.exports.decodeStream = function decodeStream (encoding, options) {
|
|
41102
|
+
return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options)
|
|
41086
41103
|
};
|
|
41087
41104
|
|
|
41088
|
-
|
|
41105
|
+
module.exports.supportsStreams = true;
|
|
41089
41106
|
};
|
|
41090
41107
|
|
|
41091
41108
|
// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
|
|
@@ -41095,10 +41112,10 @@ function requireLib$a () {
|
|
|
41095
41112
|
} catch (e) {}
|
|
41096
41113
|
|
|
41097
41114
|
if (streamModule && streamModule.Transform) {
|
|
41098
|
-
|
|
41115
|
+
module.exports.enableStreamingAPI(streamModule);
|
|
41099
41116
|
} else {
|
|
41100
41117
|
// In rare cases where 'stream' module is not available by default, throw a helpful exception.
|
|
41101
|
-
|
|
41118
|
+
module.exports.encodeStream = module.exports.decodeStream = function () {
|
|
41102
41119
|
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")
|
|
41103
41120
|
};
|
|
41104
41121
|
}
|
|
@@ -51175,7 +51192,6 @@ var require$$11 = [
|
|
|
51175
51192
|
"drive",
|
|
51176
51193
|
"dtv",
|
|
51177
51194
|
"dubai",
|
|
51178
|
-
"dunlop",
|
|
51179
51195
|
"dupont",
|
|
51180
51196
|
"durban",
|
|
51181
51197
|
"dvag",
|
|
@@ -53407,7 +53423,11 @@ function requireMailParser () {
|
|
|
53407
53423
|
result.push(textPart);
|
|
53408
53424
|
}
|
|
53409
53425
|
|
|
53410
|
-
|
|
53426
|
+
// Escape quotes in URL to prevent XSS
|
|
53427
|
+
let safeUrl = link.url.replace(/"/g, '"');
|
|
53428
|
+
// Escape HTML entities in link text
|
|
53429
|
+
let safeText = he.encode(link.text, { useNamedReferences: true });
|
|
53430
|
+
result.push(`<a href="${safeUrl}">${safeText}</a>`);
|
|
53411
53431
|
|
|
53412
53432
|
last = link.lastIndex;
|
|
53413
53433
|
});
|