Upgrade minimist to 1.2.6
This CL updates minimist to 1.2.6 to fix a critical security
vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2021-44906
The fix was made by running:
`npm run install-deps audit fix --audit-level=critical`
Bug: none
Change-Id: I51103b525d9969e03000d55af86cebdabc7e0366
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3591079
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Brandon Walderman <brwalder@microsoft.com>
diff --git a/node_modules/path-parse/.travis.yml b/node_modules/path-parse/.travis.yml
deleted file mode 100644
index dae31da..0000000
--- a/node_modules/path-parse/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: node_js
-node_js:
- - "0.12"
- - "0.11"
- - "0.10"
- - "0.10.12"
- - "0.8"
- - "0.6"
- - "iojs"
diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js
index 3b7601f..f062d0a 100644
--- a/node_modules/path-parse/index.js
+++ b/node_modules/path-parse/index.js
@@ -2,29 +2,14 @@
var isWindows = process.platform === 'win32';
-// Regex to split a windows path into three parts: [*, device, slash,
-// tail] windows-only
-var splitDeviceRe =
- /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
-
-// Regex to split the tail part of the above into [*, dir, basename, ext]
-var splitTailRe =
- /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
+// Regex to split a windows path into into [dir, root, basename, name, ext]
+var splitWindowsRe =
+ /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
var win32 = {};
-// Function to split a filename into [root, dir, basename, ext]
function win32SplitPath(filename) {
- // Separate device+slash from tail
- var result = splitDeviceRe.exec(filename),
- device = (result[1] || '') + (result[2] || ''),
- tail = result[3] || '';
- // Split the tail into dir, basename and extension
- var result2 = splitTailRe.exec(tail),
- dir = result2[1],
- basename = result2[2],
- ext = result2[3];
- return [device, dir, basename, ext];
+ return splitWindowsRe.exec(filename).slice(1);
}
win32.parse = function(pathString) {
@@ -34,24 +19,24 @@
);
}
var allParts = win32SplitPath(pathString);
- if (!allParts || allParts.length !== 4) {
+ if (!allParts || allParts.length !== 5) {
throw new TypeError("Invalid path '" + pathString + "'");
}
return {
- root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, -1),
+ root: allParts[1],
+ dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
base: allParts[2],
- ext: allParts[3],
- name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
+ ext: allParts[4],
+ name: allParts[3]
};
};
-// Split a filename into [root, dir, basename, ext], unix version
+// Split a filename into [dir, root, basename, name, ext], unix version
// 'root' is just a slash, or nothing.
var splitPathRe =
- /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
+ /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
var posix = {};
@@ -67,19 +52,16 @@
);
}
var allParts = posixSplitPath(pathString);
- if (!allParts || allParts.length !== 4) {
+ if (!allParts || allParts.length !== 5) {
throw new TypeError("Invalid path '" + pathString + "'");
}
- allParts[1] = allParts[1] || '';
- allParts[2] = allParts[2] || '';
- allParts[3] = allParts[3] || '';
-
+
return {
- root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, -1),
+ root: allParts[1],
+ dir: allParts[0].slice(0, -1),
base: allParts[2],
- ext: allParts[3],
- name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
+ ext: allParts[4],
+ name: allParts[3],
};
};
diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json
index 21332bb..36c23f8 100644
--- a/node_modules/path-parse/package.json
+++ b/node_modules/path-parse/package.json
@@ -1,6 +1,6 @@
{
"name": "path-parse",
- "version": "1.0.6",
+ "version": "1.0.7",
"description": "Node.js path.parse() ponyfill",
"main": "index.js",
"scripts": {
diff --git a/node_modules/path-parse/test.js b/node_modules/path-parse/test.js
deleted file mode 100644
index 0b30c12..0000000
--- a/node_modules/path-parse/test.js
+++ /dev/null
@@ -1,77 +0,0 @@
-var assert = require('assert');
-var pathParse = require('./index');
-
-var winParseTests = [
- [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'],
- [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'],
- [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'],
- [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'],
- [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'],
- [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'],
-
- // unc
- [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'],
- [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'],
- [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'],
- [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share']
-];
-
-var winSpecialCaseFormatTests = [
- [{dir: 'some\\dir'}, 'some\\dir\\'],
- [{base: 'index.html'}, 'index.html'],
- [{}, '']
-];
-
-var unixParseTests = [
- [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'],
- [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'],
- [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'],
- [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'],
- [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'],
- [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'],
- [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'],
- [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'],
- [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo']
-];
-
-var unixSpecialCaseFormatTests = [
- [{dir: 'some/dir'}, 'some/dir/'],
- [{base: 'index.html'}, 'index.html'],
- [{}, '']
-];
-
-var errors = [
- {input: null, message: /Parameter 'pathString' must be a string, not/},
- {input: {}, message: /Parameter 'pathString' must be a string, not object/},
- {input: true, message: /Parameter 'pathString' must be a string, not boolean/},
- {input: 1, message: /Parameter 'pathString' must be a string, not number/},
- {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/},
-];
-
-checkParseFormat(pathParse.win32, winParseTests);
-checkParseFormat(pathParse.posix, unixParseTests);
-checkErrors(pathParse.win32);
-checkErrors(pathParse.posix);
-
-function checkErrors(parse) {
- errors.forEach(function(errorCase) {
- try {
- parse(errorCase.input);
- } catch(err) {
- assert.ok(err instanceof TypeError);
- assert.ok(
- errorCase.message.test(err.message),
- 'expected ' + errorCase.message + ' to match ' + err.message
- );
- return;
- }
-
- assert.fail('should have thrown');
- });
-}
-
-function checkParseFormat(parse, testCases) {
- testCases.forEach(function(testCase) {
- assert.deepEqual(parse(testCase[1]), testCase[0]);
- });
-}