mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-19 14:04:32 +07:00
node_modules: update (#349)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
9d0c26ec8b
commit
0a1f5db16c
36 files changed
+1934
-648
No files matched your search
+22
-5
@@ -19,10 +19,27 @@ import * as punycode from '../punycode/index.js';
|
||||
// Matches a "scheme:" not followed by "//" (and with something after it), used
|
||||
// to re-insert the authority separator the legacy parser did not require.
|
||||
const SLASHLESS_AUTHORITY = /^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/;
|
||||
// Leading and trailing C0 controls and spaces, which the WHATWG parser strips before it
|
||||
// looks at the input. Stripped up front so that the slash-less form is recognized in a
|
||||
// value read from a file with a trailing newline as well.
|
||||
const SURROUNDING_WHITESPACE = /^[\x00-\x20]+|[\x00-\x20]+$/g;
|
||||
/**
|
||||
* Drops the leading and trailing C0 controls and spaces, which the WHATWG parser strips
|
||||
* before it looks at the input. Stripped up front so that the slash-less form is recognized
|
||||
* in a value read from a file with a trailing newline as well. An index scan, the regex
|
||||
* /^[\x00-\x20]+|[\x00-\x20]+$/g retried a run of spaces inside the value from every
|
||||
* position in it
|
||||
*
|
||||
* @param input URL string
|
||||
* @returns The string without the surrounding controls and spaces
|
||||
*/
|
||||
function stripSurroundingWhitespace(input) {
|
||||
let start = 0;
|
||||
let end = input.length;
|
||||
while (start < end && input.charCodeAt(start) <= 0x20) {
|
||||
start++;
|
||||
}
|
||||
while (end > start && input.charCodeAt(end - 1) <= 0x20) {
|
||||
end--;
|
||||
}
|
||||
return input.slice(start, end);
|
||||
}
|
||||
// Leading characters legacy url.parse() skips before it reads the scheme
|
||||
const LEGACY_TRIM = /^[\x00-\x20\u00a0\ufeff]+/;
|
||||
// The authority of a "scheme://authority/..." or a scheme-relative "//authority/..."
|
||||
@@ -117,7 +134,7 @@ function normalizeHostname(raw, href) {
|
||||
return mapped;
|
||||
}
|
||||
export const parse = (input, parseQueryString) => {
|
||||
input = (input || '').replace(SURROUNDING_WHITESPACE, '');
|
||||
input = stripSurroundingWhitespace(input || '');
|
||||
// Legacy url.parse() parses a "user:pass@host:port" authority that follows
|
||||
// the scheme even without the "//" separator, for schemes outside its
|
||||
// built-in slashed-protocol list (smtp:/smtps:/socks:/...). The WHATWG
|
||||
|
||||
Reference in new issue
Block a user