From 98e5e53482cc637a0352215ffd31ca4b9c38eccc Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Mon, 28 Nov 2022 19:51:55 -0500 Subject: [PATCH] tools: update lint-md-dependencies to rollup@3.4.0 PR-URL: https://github.com/nodejs/node/pull/45638 Reviewed-By: Moshe Atlow Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Rich Trott --- tools/lint-md/lint-md.mjs | 36 ++++++++++--------- tools/lint-md/package-lock.json | 62 ++++++++++++++++----------------- tools/lint-md/package.json | 2 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/tools/lint-md/lint-md.mjs b/tools/lint-md/lint-md.mjs index e1f827a40906ba..2295bec2e227c2 100644 --- a/tools/lint-md/lint-md.mjs +++ b/tools/lint-md/lint-md.mjs @@ -258,17 +258,20 @@ class VFileMessage extends Error { } this.name = stringifyPosition(place) || '1:1'; this.message = typeof reason === 'object' ? reason.message : reason; - this.stack = typeof reason === 'object' ? reason.stack : ''; + this.stack = ''; + if (typeof reason === 'object' && reason.stack) { + this.stack = reason.stack; + } this.reason = this.message; this.fatal; this.line = position.start.line; this.column = position.start.column; + this.position = position; this.source = parts[0]; this.ruleId = parts[1]; - this.position = position; + this.file; this.actual; this.expected; - this.file; this.url; this.note; } @@ -7770,17 +7773,18 @@ function remarkParse(options) { Object.assign(this, {Parser: parser}); } -var own$4 = {}.hasOwnProperty; +const own$4 = {}.hasOwnProperty; function zwitch(key, options) { - var settings = options || {}; - function one(value) { - var fn = one.invalid; - var handlers = one.handlers; + const settings = options || {}; + function one(value, ...parameters) { + let fn = one.invalid; + const handlers = one.handlers; if (value && own$4.call(value, key)) { - fn = own$4.call(handlers, value[key]) ? handlers[value[key]] : one.unknown; + const id = String(value[key]); + fn = own$4.call(handlers, id) ? handlers[id] : one.unknown; } if (fn) { - return fn.apply(this, arguments) + return fn.call(this, value, ...parameters) } } one.handlers = settings.handlers || {}; @@ -7948,14 +7952,14 @@ function hardBreak(_, _1, context, safe) { return '\\\n' } -function longestStreak(value, character) { +function longestStreak(value, substring) { const source = String(value); - let index = source.indexOf(character); + let index = source.indexOf(substring); let expected = index; let count = 0; let max = 0; - if (typeof character !== 'string' || character.length !== 1) { - throw new Error('Expected character') + if (typeof substring !== 'string') { + throw new TypeError('Expected substring') } while (index !== -1) { if (index === expected) { @@ -7965,8 +7969,8 @@ function longestStreak(value, character) { } else { count = 1; } - expected = index + 1; - index = source.indexOf(character, expected); + expected = index + substring.length; + index = source.indexOf(substring, expected); } return max } diff --git a/tools/lint-md/package-lock.json b/tools/lint-md/package-lock.json index 5150c335acb23c..c260536fc8de3b 100644 --- a/tools/lint-md/package-lock.json +++ b/tools/lint-md/package-lock.json @@ -18,7 +18,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^23.0.2", "@rollup/plugin-node-resolve": "^15.0.1", - "rollup": "^3.3.0", + "rollup": "^3.4.0", "rollup-plugin-cleanup": "^3.2.1" } }, @@ -509,9 +509,9 @@ } }, "node_modules/longest-streak": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.0.1.tgz", - "integrity": "sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2207,9 +2207,9 @@ } }, "node_modules/rollup": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.3.0.tgz", - "integrity": "sha512-wqOV/vUJCYEbWsXvwCkgGWvgaEnsbn4jxBQWKpN816CqsmCimDmCNJI83c6if7QVD4v/zlyRzxN7U2yDT5rfoA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.4.0.tgz", + "integrity": "sha512-4g8ZrEFK7UbDvy3JF+d5bLiC8UKkS3n/27/cnVeESwB1LVPl6MoPL32/6+SCQ1vHTp6Mvp2veIHtwELhi+uXEw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -2537,9 +2537,9 @@ } }, "node_modules/vfile": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.5.tgz", - "integrity": "sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ==", + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.6.tgz", + "integrity": "sha512-ADBsmerdGBs2WYckrLBEmuETSPyTD4TuLxTrw0DvjirxW1ra4ZwkbzG8ndsv3Q57smvHxo677MHaQrY9yxH8cA==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -2565,9 +2565,9 @@ } }, "node_modules/vfile-message": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz", - "integrity": "sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.3.tgz", + "integrity": "sha512-0yaU+rj2gKAyEk12ffdSbBfjnnj+b1zqTBv3OQCTn8yEB02bsPizwdBPrLJjHnK+cU9EMMcUnNv938XcZIkmdA==", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -2639,9 +2639,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/zwitch": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz", - "integrity": "sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2997,9 +2997,9 @@ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==" }, "longest-streak": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.0.1.tgz", - "integrity": "sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==" }, "lru-cache": { "version": "6.0.0", @@ -4178,9 +4178,9 @@ } }, "rollup": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.3.0.tgz", - "integrity": "sha512-wqOV/vUJCYEbWsXvwCkgGWvgaEnsbn4jxBQWKpN816CqsmCimDmCNJI83c6if7QVD4v/zlyRzxN7U2yDT5rfoA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.4.0.tgz", + "integrity": "sha512-4g8ZrEFK7UbDvy3JF+d5bLiC8UKkS3n/27/cnVeESwB1LVPl6MoPL32/6+SCQ1vHTp6Mvp2veIHtwELhi+uXEw==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -4405,9 +4405,9 @@ } }, "vfile": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.5.tgz", - "integrity": "sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ==", + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.6.tgz", + "integrity": "sha512-ADBsmerdGBs2WYckrLBEmuETSPyTD4TuLxTrw0DvjirxW1ra4ZwkbzG8ndsv3Q57smvHxo677MHaQrY9yxH8cA==", "requires": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -4425,9 +4425,9 @@ } }, "vfile-message": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz", - "integrity": "sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.3.tgz", + "integrity": "sha512-0yaU+rj2gKAyEk12ffdSbBfjnnj+b1zqTBv3OQCTn8yEB02bsPizwdBPrLJjHnK+cU9EMMcUnNv938XcZIkmdA==", "requires": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" @@ -4483,9 +4483,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "zwitch": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.2.tgz", - "integrity": "sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==" } } } diff --git a/tools/lint-md/package.json b/tools/lint-md/package.json index ef6cd10cdef9ec..694c654b4d6b3b 100644 --- a/tools/lint-md/package.json +++ b/tools/lint-md/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@rollup/plugin-commonjs": "^23.0.2", "@rollup/plugin-node-resolve": "^15.0.1", - "rollup": "^3.3.0", + "rollup": "^3.4.0", "rollup-plugin-cleanup": "^3.2.1" } }