Skip to content

Commit 5adaf10

Browse files
TrottMylesBorins
authored andcommitted
tools: update minimist@1.2.5
Update minimist used by lint-md.js to 1.2.5. Refs: https://app.snyk.io/vuln/SNYK-JS-MINIMIST-559764 Signed-off-by: Rich Trott <rtrott@gmail.com> PR-URL: #32274 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 59a21e2 commit 5adaf10

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

tools/lint-md.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5962,12 +5962,21 @@ var minimist = function (args, opts) {
59625962

59635963
function setKey (obj, keys, value) {
59645964
var o = obj;
5965-
keys.slice(0,-1).forEach(function (key) {
5965+
for (var i = 0; i < keys.length-1; i++) {
5966+
var key = keys[i];
5967+
if (key === '__proto__') return;
59665968
if (o[key] === undefined) o[key] = {};
5969+
if (o[key] === Object.prototype || o[key] === Number.prototype
5970+
|| o[key] === String.prototype) o[key] = {};
5971+
if (o[key] === Array.prototype) o[key] = [];
59675972
o = o[key];
5968-
});
5973+
}
59695974

59705975
var key = keys[keys.length - 1];
5976+
if (key === '__proto__') return;
5977+
if (o === Object.prototype || o === Number.prototype
5978+
|| o === String.prototype) o = {};
5979+
if (o === Array.prototype) o = [];
59715980
if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
59725981
o[key] = value;
59735982
}
@@ -6065,7 +6074,7 @@ var minimist = function (args, opts) {
60656074
setArg(key, args[i+1], arg);
60666075
i++;
60676076
}
6068-
else if (args[i+1] && /true|false/.test(args[i+1])) {
6077+
else if (args[i+1] && /^(true|false)$/.test(args[i+1])) {
60696078
setArg(key, args[i+1] === 'true', arg);
60706079
i++;
60716080
}
@@ -11282,6 +11291,7 @@ function writeSync(description, options) {
1128211291
file.contents || '',
1128311292
options
1128411293
);
11294+
return file
1128511295
}
1128611296

1128711297
var sync$1 = {
@@ -11368,7 +11378,7 @@ function write$1(description, options, callback) {
1136811378
if (error) {
1136911379
reject(error);
1137011380
} else {
11371-
resolve();
11381+
resolve(file);
1137211382
}
1137311383
}
1137411384
}
@@ -13910,7 +13920,7 @@ var chars = windows$1 ? {error: '×', warning: '‼'} : {error: '✖', warning:
1391013920
var trailing = /\s*$/;
1391113921

1391213922
// Default filename.
13913-
var DEFAULT = '<stdin>';
13923+
var defaultName = '<stdin>';
1391413924

1391513925
var noop = {open: '', close: ''};
1391613926

@@ -14014,7 +14024,7 @@ function parse$4(files, options) {
1401414024
type: 'header',
1401514025
origin: origin,
1401614026
destination: destination,
14017-
name: origin || options.defaultName || DEFAULT,
14027+
name: origin || options.defaultName || defaultName,
1401814028
stored: Boolean(file.stored),
1401914029
moved: Boolean(file.stored && destination !== origin),
1402014030
stats: vfileStatistics(messages)

tools/node-lint-md-cli-rollup/package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)