Skip to content

Commit 496a528

Browse files
nodejs-github-botdanielleadams
authored andcommitted
tools: update lint-md-dependencies to rollup@3.4.0
PR-URL: #45638 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 3461329 commit 496a528

File tree

3 files changed

+52
-48
lines changed

3 files changed

+52
-48
lines changed

tools/lint-md/lint-md.mjs

+20-16
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,20 @@ class VFileMessage extends Error {
258258
}
259259
this.name = stringifyPosition(place) || '1:1';
260260
this.message = typeof reason === 'object' ? reason.message : reason;
261-
this.stack = typeof reason === 'object' ? reason.stack : '';
261+
this.stack = '';
262+
if (typeof reason === 'object' && reason.stack) {
263+
this.stack = reason.stack;
264+
}
262265
this.reason = this.message;
263266
this.fatal;
264267
this.line = position.start.line;
265268
this.column = position.start.column;
269+
this.position = position;
266270
this.source = parts[0];
267271
this.ruleId = parts[1];
268-
this.position = position;
272+
this.file;
269273
this.actual;
270274
this.expected;
271-
this.file;
272275
this.url;
273276
this.note;
274277
}
@@ -7770,17 +7773,18 @@ function remarkParse(options) {
77707773
Object.assign(this, {Parser: parser});
77717774
}
77727775

7773-
var own$4 = {}.hasOwnProperty;
7776+
const own$4 = {}.hasOwnProperty;
77747777
function zwitch(key, options) {
7775-
var settings = options || {};
7776-
function one(value) {
7777-
var fn = one.invalid;
7778-
var handlers = one.handlers;
7778+
const settings = options || {};
7779+
function one(value, ...parameters) {
7780+
let fn = one.invalid;
7781+
const handlers = one.handlers;
77797782
if (value && own$4.call(value, key)) {
7780-
fn = own$4.call(handlers, value[key]) ? handlers[value[key]] : one.unknown;
7783+
const id = String(value[key]);
7784+
fn = own$4.call(handlers, id) ? handlers[id] : one.unknown;
77817785
}
77827786
if (fn) {
7783-
return fn.apply(this, arguments)
7787+
return fn.call(this, value, ...parameters)
77847788
}
77857789
}
77867790
one.handlers = settings.handlers || {};
@@ -7948,14 +7952,14 @@ function hardBreak(_, _1, context, safe) {
79487952
return '\\\n'
79497953
}
79507954

7951-
function longestStreak(value, character) {
7955+
function longestStreak(value, substring) {
79527956
const source = String(value);
7953-
let index = source.indexOf(character);
7957+
let index = source.indexOf(substring);
79547958
let expected = index;
79557959
let count = 0;
79567960
let max = 0;
7957-
if (typeof character !== 'string' || character.length !== 1) {
7958-
throw new Error('Expected character')
7961+
if (typeof substring !== 'string') {
7962+
throw new TypeError('Expected substring')
79597963
}
79607964
while (index !== -1) {
79617965
if (index === expected) {
@@ -7965,8 +7969,8 @@ function longestStreak(value, character) {
79657969
} else {
79667970
count = 1;
79677971
}
7968-
expected = index + 1;
7969-
index = source.indexOf(character, expected);
7972+
expected = index + substring.length;
7973+
index = source.indexOf(substring, expected);
79707974
}
79717975
return max
79727976
}

tools/lint-md/package-lock.json

+31-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/lint-md/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"devDependencies": {
1717
"@rollup/plugin-commonjs": "^23.0.2",
1818
"@rollup/plugin-node-resolve": "^15.0.1",
19-
"rollup": "^3.3.0",
19+
"rollup": "^3.4.0",
2020
"rollup-plugin-cleanup": "^3.2.1"
2121
}
2222
}

0 commit comments

Comments
 (0)