From 263bef1de3e2c9114e5cf37d657c53bc4d8f4434 Mon Sep 17 00:00:00 2001 From: Rich Trott <rtrott@gmail.com> Date: Tue, 17 Aug 2021 19:22:41 -0700 Subject: [PATCH] tools: update rollup to latest version in markdown linter --- tools/lint-md.js | 35668 ++++------------ .../node-lint-md-cli-rollup/package-lock.json | 7189 ++-- .../node-lint-md-cli-rollup/rollup.config.js | 4 +- 3 files changed, 11567 insertions(+), 31294 deletions(-) diff --git a/tools/lint-md.js b/tools/lint-md.js index 44e2149d101ed7..1f865ab809a942 100644 --- a/tools/lint-md.js +++ b/tools/lint-md.js @@ -11,7 +11,7 @@ var require$$1 = require('tty'); var require$$0$8 = require('fs'); var require$$1$1 = require('module'); var require$$0$9 = require('events'); -var require$$6$1 = require('assert'); +var require$$5$2 = require('assert'); var url = require('url'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -44,7 +44,7 @@ var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1); var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$8); var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1); var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$9); -var require$$6__default = /*#__PURE__*/_interopDefaultLegacy(require$$6$1); +var require$$5__default = /*#__PURE__*/_interopDefaultLegacy(require$$5$2); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -118,20 +118,20 @@ function statistics$2(files) { } } -var slice$6 = [].slice; +var slice$4 = [].slice; -var wrap_1$1 = wrap$5; +var wrap_1 = wrap$3; // Wrap `fn`. // Can be sync or async; return a promise, receive a completion handler, return // new values and errors. -function wrap$5(fn, callback) { +function wrap$3(fn, callback) { var invoked; return wrapped function wrapped() { - var params = slice$6.call(arguments, 0); + var params = slice$4.call(arguments, 0); var callback = fn.length > params.length; var result; @@ -181,16 +181,16 @@ function wrap$5(fn, callback) { } } -var wrap$4 = wrap_1$1; +var wrap$2 = wrap_1; -var trough_1$1 = trough$5; +var trough_1 = trough$4; -trough$5.wrap = wrap$4; +trough$4.wrap = wrap$2; -var slice$5 = [].slice; +var slice$3 = [].slice; // Create new middleware. -function trough$5() { +function trough$4() { var fns = []; var middleware = {}; @@ -202,7 +202,7 @@ function trough$5() { // Run `fns`. Last argument must be a completion handler. function run() { var index = -1; - var input = slice$5.call(arguments, 0, -1); + var input = slice$3.call(arguments, 0, -1); var done = arguments[arguments.length - 1]; if (typeof done !== 'function') { @@ -214,7 +214,7 @@ function trough$5() { // Run the next `fn`, if any. function next(err) { var fn = fns[++index]; - var params = slice$5.call(arguments, 0); + var params = slice$3.call(arguments, 0); var values = params.slice(1); var length = input.length; var pos = -1; @@ -235,7 +235,7 @@ function trough$5() { // Next or done. if (fn) { - wrap$4(fn, next).apply(null, input); + wrap$2(fn, next).apply(null, input); } else { done.apply(null, [null].concat(input)); } @@ -4842,7 +4842,7 @@ for (var key$1 in cssKeywords$1) { } } -var convert$H = conversions$5.exports = { +var convert$6 = conversions$5.exports = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, @@ -4861,30 +4861,30 @@ var convert$H = conversions$5.exports = { }; // hide .channels and .labels properties -for (var model in convert$H) { - if (convert$H.hasOwnProperty(model)) { - if (!('channels' in convert$H[model])) { +for (var model in convert$6) { + if (convert$6.hasOwnProperty(model)) { + if (!('channels' in convert$6[model])) { throw new Error('missing channels property: ' + model); } - if (!('labels' in convert$H[model])) { + if (!('labels' in convert$6[model])) { throw new Error('missing channel labels property: ' + model); } - if (convert$H[model].labels.length !== convert$H[model].channels) { + if (convert$6[model].labels.length !== convert$6[model].channels) { throw new Error('channel and label counts mismatch: ' + model); } - var channels = convert$H[model].channels; - var labels$1 = convert$H[model].labels; - delete convert$H[model].channels; - delete convert$H[model].labels; - Object.defineProperty(convert$H[model], 'channels', {value: channels}); - Object.defineProperty(convert$H[model], 'labels', {value: labels$1}); + var channels = convert$6[model].channels; + var labels$1 = convert$6[model].labels; + delete convert$6[model].channels; + delete convert$6[model].labels; + Object.defineProperty(convert$6[model], 'channels', {value: channels}); + Object.defineProperty(convert$6[model], 'labels', {value: labels$1}); } } -convert$H.rgb.hsl = function (rgb) { +convert$6.rgb.hsl = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; @@ -4924,7 +4924,7 @@ convert$H.rgb.hsl = function (rgb) { return [h, s * 100, l * 100]; }; -convert$H.rgb.hsv = function (rgb) { +convert$6.rgb.hsv = function (rgb) { var rdif; var gdif; var bdif; @@ -4969,11 +4969,11 @@ convert$H.rgb.hsv = function (rgb) { ]; }; -convert$H.rgb.hwb = function (rgb) { +convert$6.rgb.hwb = function (rgb) { var r = rgb[0]; var g = rgb[1]; var b = rgb[2]; - var h = convert$H.rgb.hsl(rgb)[0]; + var h = convert$6.rgb.hsl(rgb)[0]; var w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); @@ -4981,7 +4981,7 @@ convert$H.rgb.hwb = function (rgb) { return [h, w * 100, b * 100]; }; -convert$H.rgb.cmyk = function (rgb) { +convert$6.rgb.cmyk = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; @@ -5009,7 +5009,7 @@ function comparativeDistance$1(x, y) { ); } -convert$H.rgb.keyword = function (rgb) { +convert$6.rgb.keyword = function (rgb) { var reversed = reverseKeywords$1[rgb]; if (reversed) { return reversed; @@ -5036,11 +5036,11 @@ convert$H.rgb.keyword = function (rgb) { return currentClosestKeyword; }; -convert$H.keyword.rgb = function (keyword) { +convert$6.keyword.rgb = function (keyword) { return cssKeywords$1[keyword]; }; -convert$H.rgb.xyz = function (rgb) { +convert$6.rgb.xyz = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; @@ -5057,8 +5057,8 @@ convert$H.rgb.xyz = function (rgb) { return [x * 100, y * 100, z * 100]; }; -convert$H.rgb.lab = function (rgb) { - var xyz = convert$H.rgb.xyz(rgb); +convert$6.rgb.lab = function (rgb) { + var xyz = convert$6.rgb.xyz(rgb); var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; @@ -5081,7 +5081,7 @@ convert$H.rgb.lab = function (rgb) { return [l, a, b]; }; -convert$H.hsl.rgb = function (hsl) { +convert$6.hsl.rgb = function (hsl) { var h = hsl[0] / 360; var s = hsl[1] / 100; var l = hsl[2] / 100; @@ -5130,7 +5130,7 @@ convert$H.hsl.rgb = function (hsl) { return rgb; }; -convert$H.hsl.hsv = function (hsl) { +convert$6.hsl.hsv = function (hsl) { var h = hsl[0]; var s = hsl[1] / 100; var l = hsl[2] / 100; @@ -5148,7 +5148,7 @@ convert$H.hsl.hsv = function (hsl) { return [h, sv * 100, v * 100]; }; -convert$H.hsv.rgb = function (hsv) { +convert$6.hsv.rgb = function (hsv) { var h = hsv[0] / 60; var s = hsv[1] / 100; var v = hsv[2] / 100; @@ -5176,7 +5176,7 @@ convert$H.hsv.rgb = function (hsv) { } }; -convert$H.hsv.hsl = function (hsv) { +convert$6.hsv.hsl = function (hsv) { var h = hsv[0]; var s = hsv[1] / 100; var v = hsv[2] / 100; @@ -5196,7 +5196,7 @@ convert$H.hsv.hsl = function (hsv) { }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert$H.hwb.rgb = function (hwb) { +convert$6.hwb.rgb = function (hwb) { var h = hwb[0] / 360; var wh = hwb[1] / 100; var bl = hwb[2] / 100; @@ -5239,7 +5239,7 @@ convert$H.hwb.rgb = function (hwb) { return [r * 255, g * 255, b * 255]; }; -convert$H.cmyk.rgb = function (cmyk) { +convert$6.cmyk.rgb = function (cmyk) { var c = cmyk[0] / 100; var m = cmyk[1] / 100; var y = cmyk[2] / 100; @@ -5255,7 +5255,7 @@ convert$H.cmyk.rgb = function (cmyk) { return [r * 255, g * 255, b * 255]; }; -convert$H.xyz.rgb = function (xyz) { +convert$6.xyz.rgb = function (xyz) { var x = xyz[0] / 100; var y = xyz[1] / 100; var z = xyz[2] / 100; @@ -5287,7 +5287,7 @@ convert$H.xyz.rgb = function (xyz) { return [r * 255, g * 255, b * 255]; }; -convert$H.xyz.lab = function (xyz) { +convert$6.xyz.lab = function (xyz) { var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; @@ -5310,7 +5310,7 @@ convert$H.xyz.lab = function (xyz) { return [l, a, b]; }; -convert$H.lab.xyz = function (lab) { +convert$6.lab.xyz = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; @@ -5336,7 +5336,7 @@ convert$H.lab.xyz = function (lab) { return [x, y, z]; }; -convert$H.lab.lch = function (lab) { +convert$6.lab.lch = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; @@ -5356,7 +5356,7 @@ convert$H.lab.lch = function (lab) { return [l, c, h]; }; -convert$H.lch.lab = function (lch) { +convert$6.lch.lab = function (lch) { var l = lch[0]; var c = lch[1]; var h = lch[2]; @@ -5371,11 +5371,11 @@ convert$H.lch.lab = function (lch) { return [l, a, b]; }; -convert$H.rgb.ansi16 = function (args) { +convert$6.rgb.ansi16 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; - var value = 1 in arguments ? arguments[1] : convert$H.rgb.hsv(args)[2]; // hsv -> ansi16 optimization + var value = 1 in arguments ? arguments[1] : convert$6.rgb.hsv(args)[2]; // hsv -> ansi16 optimization value = Math.round(value / 50); @@ -5395,13 +5395,13 @@ convert$H.rgb.ansi16 = function (args) { return ansi; }; -convert$H.hsv.ansi16 = function (args) { +convert$6.hsv.ansi16 = function (args) { // optimization here; we already know the value and don't need to get // it converted for us. - return convert$H.rgb.ansi16(convert$H.hsv.rgb(args), args[2]); + return convert$6.rgb.ansi16(convert$6.hsv.rgb(args), args[2]); }; -convert$H.rgb.ansi256 = function (args) { +convert$6.rgb.ansi256 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; @@ -5428,7 +5428,7 @@ convert$H.rgb.ansi256 = function (args) { return ansi; }; -convert$H.ansi16.rgb = function (args) { +convert$6.ansi16.rgb = function (args) { var color = args % 10; // handle greyscale @@ -5450,7 +5450,7 @@ convert$H.ansi16.rgb = function (args) { return [r, g, b]; }; -convert$H.ansi256.rgb = function (args) { +convert$6.ansi256.rgb = function (args) { // handle greyscale if (args >= 232) { var c = (args - 232) * 10 + 8; @@ -5467,7 +5467,7 @@ convert$H.ansi256.rgb = function (args) { return [r, g, b]; }; -convert$H.rgb.hex = function (args) { +convert$6.rgb.hex = function (args) { var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); @@ -5476,7 +5476,7 @@ convert$H.rgb.hex = function (args) { return '000000'.substring(string.length) + string; }; -convert$H.hex.rgb = function (args) { +convert$6.hex.rgb = function (args) { var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; @@ -5498,7 +5498,7 @@ convert$H.hex.rgb = function (args) { return [r, g, b]; }; -convert$H.rgb.hcg = function (rgb) { +convert$6.rgb.hcg = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; @@ -5532,7 +5532,7 @@ convert$H.rgb.hcg = function (rgb) { return [hue * 360, chroma * 100, grayscale * 100]; }; -convert$H.hsl.hcg = function (hsl) { +convert$6.hsl.hcg = function (hsl) { var s = hsl[1] / 100; var l = hsl[2] / 100; var c = 1; @@ -5551,7 +5551,7 @@ convert$H.hsl.hcg = function (hsl) { return [hsl[0], c * 100, f * 100]; }; -convert$H.hsv.hcg = function (hsv) { +convert$6.hsv.hcg = function (hsv) { var s = hsv[1] / 100; var v = hsv[2] / 100; @@ -5565,7 +5565,7 @@ convert$H.hsv.hcg = function (hsv) { return [hsv[0], c * 100, f * 100]; }; -convert$H.hcg.rgb = function (hcg) { +convert$6.hcg.rgb = function (hcg) { var h = hcg[0] / 360; var c = hcg[1] / 100; var g = hcg[2] / 100; @@ -5604,7 +5604,7 @@ convert$H.hcg.rgb = function (hcg) { ]; }; -convert$H.hcg.hsv = function (hcg) { +convert$6.hcg.hsv = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; @@ -5618,7 +5618,7 @@ convert$H.hcg.hsv = function (hcg) { return [hcg[0], f * 100, v * 100]; }; -convert$H.hcg.hsl = function (hcg) { +convert$6.hcg.hsl = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; @@ -5635,14 +5635,14 @@ convert$H.hcg.hsl = function (hcg) { return [hcg[0], s * 100, l * 100]; }; -convert$H.hcg.hwb = function (hcg) { +convert$6.hcg.hwb = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; -convert$H.hwb.hcg = function (hwb) { +convert$6.hwb.hcg = function (hwb) { var w = hwb[1] / 100; var b = hwb[2] / 100; var v = 1 - b; @@ -5656,35 +5656,35 @@ convert$H.hwb.hcg = function (hwb) { return [hwb[0], c * 100, g * 100]; }; -convert$H.apple.rgb = function (apple) { +convert$6.apple.rgb = function (apple) { return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; }; -convert$H.rgb.apple = function (rgb) { +convert$6.rgb.apple = function (rgb) { return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; }; -convert$H.gray.rgb = function (args) { +convert$6.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; -convert$H.gray.hsl = convert$H.gray.hsv = function (args) { +convert$6.gray.hsl = convert$6.gray.hsv = function (args) { return [0, 0, args[0]]; }; -convert$H.gray.hwb = function (gray) { +convert$6.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; -convert$H.gray.cmyk = function (gray) { +convert$6.gray.cmyk = function (gray) { return [0, 0, 0, gray[0]]; }; -convert$H.gray.lab = function (gray) { +convert$6.gray.lab = function (gray) { return [gray[0], 0, 0]; }; -convert$H.gray.hex = function (gray) { +convert$6.gray.hex = function (gray) { var val = Math.round(gray[0] / 100 * 255) & 0xFF; var integer = (val << 16) + (val << 8) + val; @@ -5692,7 +5692,7 @@ convert$H.gray.hex = function (gray) { return '000000'.substring(string.length) + string; }; -convert$H.rgb.gray = function (rgb) { +convert$6.rgb.gray = function (rgb) { var val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; @@ -5797,7 +5797,7 @@ var route$3 = function (fromModel) { var conversions$3 = conversions$5.exports; var route$2 = route$3; -var convert$G = {}; +var convert$5 = {}; var models$4 = Object.keys(conversions$3); @@ -5855,10 +5855,10 @@ function wrapRounded$1(fn) { } models$4.forEach(function (fromModel) { - convert$G[fromModel] = {}; + convert$5[fromModel] = {}; - Object.defineProperty(convert$G[fromModel], 'channels', {value: conversions$3[fromModel].channels}); - Object.defineProperty(convert$G[fromModel], 'labels', {value: conversions$3[fromModel].labels}); + Object.defineProperty(convert$5[fromModel], 'channels', {value: conversions$3[fromModel].channels}); + Object.defineProperty(convert$5[fromModel], 'labels', {value: conversions$3[fromModel].labels}); var routes = route$2(fromModel); var routeModels = Object.keys(routes); @@ -5866,12 +5866,12 @@ models$4.forEach(function (fromModel) { routeModels.forEach(function (toModel) { var fn = routes[toModel]; - convert$G[fromModel][toModel] = wrapRounded$1(fn); - convert$G[fromModel][toModel].raw = wrapRaw$1(fn); + convert$5[fromModel][toModel] = wrapRounded$1(fn); + convert$5[fromModel][toModel].raw = wrapRaw$1(fn); }); }); -var colorConvert$1 = convert$G; +var colorConvert$1 = convert$5; (function (module) { const colorConvert = colorConvert$1; @@ -8900,7 +8900,7 @@ function resolvePlugin(name, options) { return null } -var isPlainObj$1 = value => { +var isPlainObj = value => { if (Object.prototype.toString.call(value) !== '[object Object]') { return false; } @@ -9059,7 +9059,7 @@ var fs$f = require$$0__default$3['default']; var path$g = require$$0__default$2['default']; var fault$2 = fault_1; var debug$d = src.exports('unified-engine:find-up'); -var wrap$3 = wrap_1$1; +var wrap$1 = wrap_1; var findUp = FindUp$2; @@ -9126,7 +9126,7 @@ function load$4(filePath, callback) { result.syscall = error.syscall; loaded(result); } else { - wrap$3(self.create, onparse)(buf, self.givenFilePath); + wrap$1(self.create, onparse)(buf, self.givenFilePath); } function onparse(error, result) { @@ -9199,7 +9199,7 @@ function load$4(filePath, callback) { ) } - wrap$3(self.create, onparse)(buf, fp); + wrap$1(self.create, onparse)(buf, fp); function onparse(error, result) { if (error) { @@ -9254,13 +9254,13 @@ var yaml = jsYaml$1; var json$2 = parseJson_1; var debug$c = src.exports('unified-engine:configuration'); var loadPlugin = loadPlugin_1; -var plain$1 = isPlainObj$1; +var plain$1 = isPlainObj; var fault$1 = fault_1; var FindUp$1 = findUp; var configuration = Config; -var own$h = {}.hasOwnProperty; +var own$f = {}.hasOwnProperty; var loaders = { '.json': loadJson, @@ -9515,7 +9515,7 @@ function find$2(entries, plugin) { function failingModule(id, error) { var cache = failingModule.cache || (failingModule.cache = {}); - var submodule = own$h.call(cache, id) ? cache[id] : (cache[id] = fail); + var submodule = own$f.call(cache, id) ? cache[id] : (cache[id] = fail); return submodule function fail() { throw error @@ -10120,19 +10120,19 @@ class Ignore$2 { } } -const factory$4 = options => new Ignore$2(options); +const factory$5 = options => new Ignore$2(options); const returnFalse = () => false; const isPathValid = path => checkPath(path && checkPath.convert(path), path, returnFalse); -factory$4.isPathValid = isPathValid; +factory$5.isPathValid = isPathValid; // Fixes typescript -factory$4.default = factory$4; +factory$5.default = factory$5; -var ignore$2 = factory$4; +var ignore$2 = factory$5; // Windows // -------------------------------------------------------------- @@ -10541,7 +10541,7 @@ var origRealpath = fs$d.realpath; var origRealpathSync = fs$d.realpathSync; var version$2 = process.version; -var ok$D = /^v[0-5]\./.test(version$2); +var ok$2 = /^v[0-5]\./.test(version$2); var old = old$1; function newError (er) { @@ -10553,7 +10553,7 @@ function newError (er) { } function realpath$2 (p, cache, cb) { - if (ok$D) { + if (ok$2) { return origRealpath(p, cache, cb) } @@ -10571,7 +10571,7 @@ function realpath$2 (p, cache, cb) { } function realpathSync (p, cache) { - if (ok$D) { + if (ok$2) { return origRealpathSync(p, cache) } @@ -10639,6 +10639,9 @@ function range$3(a, b, str) { var i = ai; if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } begs = []; left = str.length; @@ -11855,8 +11858,6 @@ pathIsAbsolute.exports.win32 = win32; var common$3 = {}; -common$3.alphasort = alphasort; -common$3.alphasorti = alphasorti; common$3.setopts = setopts$2; common$3.ownProp = ownProp$2; common$3.makeAbs = makeAbs; @@ -11874,12 +11875,8 @@ var minimatch$2 = minimatch_1; var isAbsolute$2 = pathIsAbsolute.exports; var Minimatch = minimatch$2.Minimatch; -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - function alphasort (a, b) { - return a.localeCompare(b) + return a.localeCompare(b, 'en') } function setupIgnores (self, options) { @@ -12007,7 +12004,7 @@ function finish (self) { all = Object.keys(all); if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort); + all = all.sort(alphasort); // at *some* point we statted all of these if (self.mark) { @@ -12103,11 +12100,9 @@ var fs$c = require$$0__default$3['default']; var rp$1 = fs_realpath; var minimatch$1 = minimatch_1; var path$b = require$$0__default$2['default']; -var assert$1 = require$$6__default['default']; +var assert$1 = require$$5__default['default']; var isAbsolute$1 = pathIsAbsolute.exports; var common$2 = common$3; -common$2.alphasort; -common$2.alphasorti; var setopts$1 = common$2.setopts; var ownProp$1 = common$2.ownProp; var childrenIgnored$1 = common$2.childrenIgnored; @@ -12675,7 +12670,7 @@ function makeres (key) { return once$1(function RES () { var cbs = reqs[key]; var len = cbs.length; - var args = slice$4(arguments); + var args = slice$2(arguments); // XXX It's somewhat ambiguous whether a new callback added in this // pass should be queued for later execution if something in the @@ -12702,7 +12697,7 @@ function makeres (key) { }) } -function slice$4 (args) { +function slice$2 (args) { var length = args.length; var array = []; @@ -12758,12 +12753,10 @@ var minimatch = minimatch_1; var inherits$2 = inherits$3.exports; var EE = require$$0__default$4['default'].EventEmitter; var path$a = require$$0__default$2['default']; -var assert = require$$6__default['default']; +var assert = require$$5__default['default']; var isAbsolute = pathIsAbsolute.exports; var globSync = sync$3; var common$1 = common$3; -common$1.alphasort; -common$1.alphasorti; var setopts = common$1.setopts; var ownProp = common$1.ownProp; var inflight = inflight_1; @@ -13506,56 +13499,56 @@ var isBuffer = function isBuffer (obj) { typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) }; -var own$g = {}.hasOwnProperty; +var own$e = {}.hasOwnProperty; -var unistUtilStringifyPosition$3 = stringify$h; +var unistUtilStringifyPosition = stringify$e; -function stringify$h(value) { +function stringify$e(value) { // Nothing. if (!value || typeof value !== 'object') { return '' } // Node. - if (own$g.call(value, 'position') || own$g.call(value, 'type')) { - return position$6(value.position) + if (own$e.call(value, 'position') || own$e.call(value, 'type')) { + return position$4(value.position) } // Position. - if (own$g.call(value, 'start') || own$g.call(value, 'end')) { - return position$6(value) + if (own$e.call(value, 'start') || own$e.call(value, 'end')) { + return position$4(value) } // Point. - if (own$g.call(value, 'line') || own$g.call(value, 'column')) { - return point$v(value) + if (own$e.call(value, 'line') || own$e.call(value, 'column')) { + return point$3(value) } // ? return '' } -function point$v(point) { +function point$3(point) { if (!point || typeof point !== 'object') { point = {}; } - return index$4(point.line) + ':' + index$4(point.column) + return index$2(point.line) + ':' + index$2(point.column) } -function position$6(pos) { +function position$4(pos) { if (!pos || typeof pos !== 'object') { pos = {}; } - return point$v(pos.start) + '-' + point$v(pos.end) + return point$3(pos.start) + '-' + point$3(pos.end) } -function index$4(value) { +function index$2(value) { return value && typeof value === 'number' ? value : 1 } -var stringify$g = unistUtilStringifyPosition$3; +var stringify$d = unistUtilStringifyPosition; var vfileMessage$1 = VMessage$3; @@ -13592,7 +13585,7 @@ function VMessage$3(reason, position, origin) { } parts = parseOrigin$1(origin); - range = stringify$g(position) || '1:1'; + range = stringify$d(position) || '1:1'; location = { start: {line: null, column: null}, @@ -13658,7 +13651,7 @@ var buffer$5 = isBuffer; var core$3 = VFile$3; -var own$f = {}.hasOwnProperty; +var own$d = {}.hasOwnProperty; // Order of setting (least specific to most), we need this because otherwise // `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a @@ -13719,7 +13712,7 @@ function VFile$3(options) { while (++index < order$4.length) { prop = order$4[index]; - if (own$f.call(options, prop)) { + if (own$d.call(options, prop)) { this[prop] = options[prop]; } } @@ -15253,7 +15246,7 @@ function stdin$1(context, settings, next) { var events = require$$0__default$4['default']; var inherits = require$$0__default['default'].inherits; -var trough$4 = trough_1$1; +var trough$3 = trough_1; var vfile$2 = toVfile; var fileSet = FileSet$1; @@ -15268,7 +15261,7 @@ function FileSet$1() { self.expected = 0; self.actual = 0; - self.pipeline = trough$4(); + self.pipeline = trough$3(); self.plugins = []; events.init.call(self); @@ -15658,16 +15651,16 @@ function queue$1(context, file, fileSet, next) { var isEmpty = lib$5; // Detect color support. -var color$E = true; +var color$4 = true; try { - color$E = 'inspect' in require$$0__default['default']; + color$4 = 'inspect' in require$$0__default['default']; } catch (_) { /* istanbul ignore next - browser */ - color$E = false; + color$4 = false; } -var unistUtilInspect = color$E ? inspect$2 : /* istanbul ignore next */ noColor; +var unistUtilInspect = color$4 ? inspect$2 : /* istanbul ignore next */ noColor; inspect$2.color = inspect$2; noColor.color = inspect$2; @@ -15772,7 +15765,7 @@ function compile$2(pos) { } // Compile a location. -function stringify$f(start, end) { +function stringify$c(start, end) { var values = []; var positions = []; var offsets = []; @@ -15808,7 +15801,7 @@ function stringify$f(start, end) { function formatNode(node) { var log = node.type; var location = node.position || {}; - var position = stringify$f(location.start, location.end); + var position = stringify$c(location.start, location.end); var key; var values = []; var value; @@ -15864,10 +15857,10 @@ var buffer$3 = isBuffer; var stats$2 = vfileStatistics; var inspect$1 = unistUtilInspect; -var stringify_1 = stringify$e; +var stringify_1 = stringify$b; // Stringify a tree. -function stringify$e(context, file) { +function stringify$b(context, file) { var value; if (stats$2(file).fatal) { @@ -16039,23 +16032,23 @@ function fileSystem$2(context, file, fileSet, next) { fs$4.writeFile(destinationPath, file.toString(), next); } -var trough$3 = trough_1$1; +var trough$2 = trough_1; var read$1 = read_1; var configure$4 = configure_1$1; var parse$9 = parse_1$4; var transform$4 = transform_1$1; var queue = queue_1; -var stringify$d = stringify_1; +var stringify$a = stringify_1; var copy$3 = copy_1; var stdout = stdout_1; var fileSystem$1 = fileSystem_1; // This pipeline ensures each of the pipes always runs: even if the read pipe // fails, queue and write run. -var filePipeline$1 = trough$3() - .use(chunk(trough$3().use(read$1).use(configure$4).use(parse$9).use(transform$4))) - .use(chunk(trough$3().use(queue))) - .use(chunk(trough$3().use(stringify$d).use(copy$3).use(stdout).use(fileSystem$1))); +var filePipeline$1 = trough$2() + .use(chunk(trough$2().use(read$1).use(configure$4).use(parse$9).use(transform$4))) + .use(chunk(trough$2().use(queue))) + .use(chunk(trough$2().use(stringify$a).use(copy$3).use(stdout).use(fileSystem$1))); // Factory to run a pipe. // Wraps a pipe to trigger an error on the `file` in `context`, but still call @@ -16408,55 +16401,6 @@ stringWidth$1.exports = stringWidth; // TODO: remove this in the next major version stringWidth$1.exports.default = stringWidth; -var own$e = {}.hasOwnProperty; - -var unistUtilStringifyPosition$2 = stringify$c; - -function stringify$c(value) { - // Nothing. - if (!value || typeof value !== 'object') { - return '' - } - - // Node. - if (own$e.call(value, 'position') || own$e.call(value, 'type')) { - return position$5(value.position) - } - - // Position. - if (own$e.call(value, 'start') || own$e.call(value, 'end')) { - return position$5(value) - } - - // Point. - if (own$e.call(value, 'line') || own$e.call(value, 'column')) { - return point$u(value) - } - - // ? - return '' -} - -function point$u(point) { - if (!point || typeof point !== 'object') { - point = {}; - } - - return index$3(point.line) + ':' + index$3(point.column) -} - -function position$5(pos) { - if (!pos || typeof pos !== 'object') { - pos = {}; - } - - return point$u(pos.start) + '-' + point$u(pos.end) -} - -function index$3(value) { - return value && typeof value === 'number' ? value : 1 -} - /*! * repeat-string <https://github.com/jonschlinkert/repeat-string> * @@ -16562,7 +16506,7 @@ function compare$3(a, b, property) { var supported = supportsColor_1.stderr.hasBasic; var width = stringWidth$1.exports; -var stringify$b = unistUtilStringifyPosition$2; +var stringify$9 = unistUtilStringifyPosition; var repeat$6 = repeatString; var statistics$1 = vfileStatistics; var sort = vfileSort; @@ -16632,7 +16576,7 @@ function transform$2(files, options) { all.push(message); row = { - location: stringify$b( + location: stringify$9( message.location.end.line && message.location.end.column ? message.location : message.location.start @@ -16838,14 +16782,14 @@ function given(file) { return file.data.unifiedEngineGiven } -var trough$2 = trough_1$1; +var trough$1 = trough_1; var configure$3 = configure_1$2; var fileSystem = fileSystem_1$1; var stdin = stdin_1; var transform$1 = transform_1; var log = log_1; -var fileSetPipeline$1 = trough$2() +var fileSetPipeline$1 = trough$1() .use(configure$3) .use(fileSystem) .use(stdin) @@ -17169,7 +17113,7 @@ for (const key of Object.keys(cssKeywords)) { reverseKeywords[cssKeywords[key]] = key; } -const convert$F = { +const convert$4 = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, @@ -17187,30 +17131,30 @@ const convert$F = { gray: {channels: 1, labels: ['gray']} }; -var conversions$2 = convert$F; +var conversions$2 = convert$4; // Hide .channels and .labels properties -for (const model of Object.keys(convert$F)) { - if (!('channels' in convert$F[model])) { +for (const model of Object.keys(convert$4)) { + if (!('channels' in convert$4[model])) { throw new Error('missing channels property: ' + model); } - if (!('labels' in convert$F[model])) { + if (!('labels' in convert$4[model])) { throw new Error('missing channel labels property: ' + model); } - if (convert$F[model].labels.length !== convert$F[model].channels) { + if (convert$4[model].labels.length !== convert$4[model].channels) { throw new Error('channel and label counts mismatch: ' + model); } - const {channels, labels} = convert$F[model]; - delete convert$F[model].channels; - delete convert$F[model].labels; - Object.defineProperty(convert$F[model], 'channels', {value: channels}); - Object.defineProperty(convert$F[model], 'labels', {value: labels}); + const {channels, labels} = convert$4[model]; + delete convert$4[model].channels; + delete convert$4[model].labels; + Object.defineProperty(convert$4[model], 'channels', {value: channels}); + Object.defineProperty(convert$4[model], 'labels', {value: labels}); } -convert$F.rgb.hsl = function (rgb) { +convert$4.rgb.hsl = function (rgb) { const r = rgb[0] / 255; const g = rgb[1] / 255; const b = rgb[2] / 255; @@ -17249,7 +17193,7 @@ convert$F.rgb.hsl = function (rgb) { return [h, s * 100, l * 100]; }; -convert$F.rgb.hsv = function (rgb) { +convert$4.rgb.hsv = function (rgb) { let rdif; let gdif; let bdif; @@ -17296,11 +17240,11 @@ convert$F.rgb.hsv = function (rgb) { ]; }; -convert$F.rgb.hwb = function (rgb) { +convert$4.rgb.hwb = function (rgb) { const r = rgb[0]; const g = rgb[1]; let b = rgb[2]; - const h = convert$F.rgb.hsl(rgb)[0]; + const h = convert$4.rgb.hsl(rgb)[0]; const w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); @@ -17308,7 +17252,7 @@ convert$F.rgb.hwb = function (rgb) { return [h, w * 100, b * 100]; }; -convert$F.rgb.cmyk = function (rgb) { +convert$4.rgb.cmyk = function (rgb) { const r = rgb[0] / 255; const g = rgb[1] / 255; const b = rgb[2] / 255; @@ -17332,7 +17276,7 @@ function comparativeDistance(x, y) { ); } -convert$F.rgb.keyword = function (rgb) { +convert$4.rgb.keyword = function (rgb) { const reversed = reverseKeywords[rgb]; if (reversed) { return reversed; @@ -17357,11 +17301,11 @@ convert$F.rgb.keyword = function (rgb) { return currentClosestKeyword; }; -convert$F.keyword.rgb = function (keyword) { +convert$4.keyword.rgb = function (keyword) { return cssKeywords[keyword]; }; -convert$F.rgb.xyz = function (rgb) { +convert$4.rgb.xyz = function (rgb) { let r = rgb[0] / 255; let g = rgb[1] / 255; let b = rgb[2] / 255; @@ -17378,8 +17322,8 @@ convert$F.rgb.xyz = function (rgb) { return [x * 100, y * 100, z * 100]; }; -convert$F.rgb.lab = function (rgb) { - const xyz = convert$F.rgb.xyz(rgb); +convert$4.rgb.lab = function (rgb) { + const xyz = convert$4.rgb.xyz(rgb); let x = xyz[0]; let y = xyz[1]; let z = xyz[2]; @@ -17399,7 +17343,7 @@ convert$F.rgb.lab = function (rgb) { return [l, a, b]; }; -convert$F.hsl.rgb = function (hsl) { +convert$4.hsl.rgb = function (hsl) { const h = hsl[0] / 360; const s = hsl[1] / 100; const l = hsl[2] / 100; @@ -17447,7 +17391,7 @@ convert$F.hsl.rgb = function (hsl) { return rgb; }; -convert$F.hsl.hsv = function (hsl) { +convert$4.hsl.hsv = function (hsl) { const h = hsl[0]; let s = hsl[1] / 100; let l = hsl[2] / 100; @@ -17463,7 +17407,7 @@ convert$F.hsl.hsv = function (hsl) { return [h, sv * 100, v * 100]; }; -convert$F.hsv.rgb = function (hsv) { +convert$4.hsv.rgb = function (hsv) { const h = hsv[0] / 60; const s = hsv[1] / 100; let v = hsv[2] / 100; @@ -17491,7 +17435,7 @@ convert$F.hsv.rgb = function (hsv) { } }; -convert$F.hsv.hsl = function (hsv) { +convert$4.hsv.hsl = function (hsv) { const h = hsv[0]; const s = hsv[1] / 100; const v = hsv[2] / 100; @@ -17510,7 +17454,7 @@ convert$F.hsv.hsl = function (hsv) { }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert$F.hwb.rgb = function (hwb) { +convert$4.hwb.rgb = function (hwb) { const h = hwb[0] / 360; let wh = hwb[1] / 100; let bl = hwb[2] / 100; @@ -17552,7 +17496,7 @@ convert$F.hwb.rgb = function (hwb) { return [r * 255, g * 255, b * 255]; }; -convert$F.cmyk.rgb = function (cmyk) { +convert$4.cmyk.rgb = function (cmyk) { const c = cmyk[0] / 100; const m = cmyk[1] / 100; const y = cmyk[2] / 100; @@ -17565,7 +17509,7 @@ convert$F.cmyk.rgb = function (cmyk) { return [r * 255, g * 255, b * 255]; }; -convert$F.xyz.rgb = function (xyz) { +convert$4.xyz.rgb = function (xyz) { const x = xyz[0] / 100; const y = xyz[1] / 100; const z = xyz[2] / 100; @@ -17597,7 +17541,7 @@ convert$F.xyz.rgb = function (xyz) { return [r * 255, g * 255, b * 255]; }; -convert$F.xyz.lab = function (xyz) { +convert$4.xyz.lab = function (xyz) { let x = xyz[0]; let y = xyz[1]; let z = xyz[2]; @@ -17617,7 +17561,7 @@ convert$F.xyz.lab = function (xyz) { return [l, a, b]; }; -convert$F.lab.xyz = function (lab) { +convert$4.lab.xyz = function (lab) { const l = lab[0]; const a = lab[1]; const b = lab[2]; @@ -17643,7 +17587,7 @@ convert$F.lab.xyz = function (lab) { return [x, y, z]; }; -convert$F.lab.lch = function (lab) { +convert$4.lab.lch = function (lab) { const l = lab[0]; const a = lab[1]; const b = lab[2]; @@ -17661,7 +17605,7 @@ convert$F.lab.lch = function (lab) { return [l, c, h]; }; -convert$F.lch.lab = function (lch) { +convert$4.lch.lab = function (lch) { const l = lch[0]; const c = lch[1]; const h = lch[2]; @@ -17673,9 +17617,9 @@ convert$F.lch.lab = function (lch) { return [l, a, b]; }; -convert$F.rgb.ansi16 = function (args, saturation = null) { +convert$4.rgb.ansi16 = function (args, saturation = null) { const [r, g, b] = args; - let value = saturation === null ? convert$F.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization + let value = saturation === null ? convert$4.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization value = Math.round(value / 50); @@ -17695,13 +17639,13 @@ convert$F.rgb.ansi16 = function (args, saturation = null) { return ansi; }; -convert$F.hsv.ansi16 = function (args) { +convert$4.hsv.ansi16 = function (args) { // Optimization here; we already know the value and don't need to get // it converted for us. - return convert$F.rgb.ansi16(convert$F.hsv.rgb(args), args[2]); + return convert$4.rgb.ansi16(convert$4.hsv.rgb(args), args[2]); }; -convert$F.rgb.ansi256 = function (args) { +convert$4.rgb.ansi256 = function (args) { const r = args[0]; const g = args[1]; const b = args[2]; @@ -17728,7 +17672,7 @@ convert$F.rgb.ansi256 = function (args) { return ansi; }; -convert$F.ansi16.rgb = function (args) { +convert$4.ansi16.rgb = function (args) { let color = args % 10; // Handle greyscale @@ -17750,7 +17694,7 @@ convert$F.ansi16.rgb = function (args) { return [r, g, b]; }; -convert$F.ansi256.rgb = function (args) { +convert$4.ansi256.rgb = function (args) { // Handle greyscale if (args >= 232) { const c = (args - 232) * 10 + 8; @@ -17767,7 +17711,7 @@ convert$F.ansi256.rgb = function (args) { return [r, g, b]; }; -convert$F.rgb.hex = function (args) { +convert$4.rgb.hex = function (args) { const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); @@ -17776,7 +17720,7 @@ convert$F.rgb.hex = function (args) { return '000000'.substring(string.length) + string; }; -convert$F.hex.rgb = function (args) { +convert$4.hex.rgb = function (args) { const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; @@ -17798,7 +17742,7 @@ convert$F.hex.rgb = function (args) { return [r, g, b]; }; -convert$F.rgb.hcg = function (rgb) { +convert$4.rgb.hcg = function (rgb) { const r = rgb[0] / 255; const g = rgb[1] / 255; const b = rgb[2] / 255; @@ -17832,7 +17776,7 @@ convert$F.rgb.hcg = function (rgb) { return [hue * 360, chroma * 100, grayscale * 100]; }; -convert$F.hsl.hcg = function (hsl) { +convert$4.hsl.hcg = function (hsl) { const s = hsl[1] / 100; const l = hsl[2] / 100; @@ -17846,7 +17790,7 @@ convert$F.hsl.hcg = function (hsl) { return [hsl[0], c * 100, f * 100]; }; -convert$F.hsv.hcg = function (hsv) { +convert$4.hsv.hcg = function (hsv) { const s = hsv[1] / 100; const v = hsv[2] / 100; @@ -17860,7 +17804,7 @@ convert$F.hsv.hcg = function (hsv) { return [hsv[0], c * 100, f * 100]; }; -convert$F.hcg.rgb = function (hcg) { +convert$4.hcg.rgb = function (hcg) { const h = hcg[0] / 360; const c = hcg[1] / 100; const g = hcg[2] / 100; @@ -17901,7 +17845,7 @@ convert$F.hcg.rgb = function (hcg) { ]; }; -convert$F.hcg.hsv = function (hcg) { +convert$4.hcg.hsv = function (hcg) { const c = hcg[1] / 100; const g = hcg[2] / 100; @@ -17915,7 +17859,7 @@ convert$F.hcg.hsv = function (hcg) { return [hcg[0], f * 100, v * 100]; }; -convert$F.hcg.hsl = function (hcg) { +convert$4.hcg.hsl = function (hcg) { const c = hcg[1] / 100; const g = hcg[2] / 100; @@ -17932,14 +17876,14 @@ convert$F.hcg.hsl = function (hcg) { return [hcg[0], s * 100, l * 100]; }; -convert$F.hcg.hwb = function (hcg) { +convert$4.hcg.hwb = function (hcg) { const c = hcg[1] / 100; const g = hcg[2] / 100; const v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; -convert$F.hwb.hcg = function (hwb) { +convert$4.hwb.hcg = function (hwb) { const w = hwb[1] / 100; const b = hwb[2] / 100; const v = 1 - b; @@ -17953,37 +17897,37 @@ convert$F.hwb.hcg = function (hwb) { return [hwb[0], c * 100, g * 100]; }; -convert$F.apple.rgb = function (apple) { +convert$4.apple.rgb = function (apple) { return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; }; -convert$F.rgb.apple = function (rgb) { +convert$4.rgb.apple = function (rgb) { return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; }; -convert$F.gray.rgb = function (args) { +convert$4.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; -convert$F.gray.hsl = function (args) { +convert$4.gray.hsl = function (args) { return [0, 0, args[0]]; }; -convert$F.gray.hsv = convert$F.gray.hsl; +convert$4.gray.hsv = convert$4.gray.hsl; -convert$F.gray.hwb = function (gray) { +convert$4.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; -convert$F.gray.cmyk = function (gray) { +convert$4.gray.cmyk = function (gray) { return [0, 0, 0, gray[0]]; }; -convert$F.gray.lab = function (gray) { +convert$4.gray.lab = function (gray) { return [gray[0], 0, 0]; }; -convert$F.gray.hex = function (gray) { +convert$4.gray.hex = function (gray) { const val = Math.round(gray[0] / 100 * 255) & 0xFF; const integer = (val << 16) + (val << 8) + val; @@ -17991,7 +17935,7 @@ convert$F.gray.hex = function (gray) { return '000000'.substring(string.length) + string; }; -convert$F.rgb.gray = function (rgb) { +convert$4.rgb.gray = function (rgb) { const val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; @@ -18096,7 +18040,7 @@ var route$1 = function (fromModel) { const conversions = conversions$2; const route = route$1; -const convert$E = {}; +const convert$3 = {}; const models$3 = Object.keys(conversions); @@ -18157,10 +18101,10 @@ function wrapRounded(fn) { } models$3.forEach(fromModel => { - convert$E[fromModel] = {}; + convert$3[fromModel] = {}; - Object.defineProperty(convert$E[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert$E[fromModel], 'labels', {value: conversions[fromModel].labels}); + Object.defineProperty(convert$3[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert$3[fromModel], 'labels', {value: conversions[fromModel].labels}); const routes = route(fromModel); const routeModels = Object.keys(routes); @@ -18168,12 +18112,12 @@ models$3.forEach(fromModel => { routeModels.forEach(toModel => { const fn = routes[toModel]; - convert$E[fromModel][toModel] = wrapRounded(fn); - convert$E[fromModel][toModel].raw = wrapRaw(fn); + convert$3[fromModel][toModel] = wrapRounded(fn); + convert$3[fromModel][toModel].raw = wrapRaw(fn); }); }); -var colorConvert = convert$E; +var colorConvert = convert$3; (function (module) { @@ -19025,7 +18969,8 @@ const depth = token => { /** * Quickly scans a glob pattern and returns an object with a handful of * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), and `negated` (true if the path starts with `!`). + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). * * ```js * const pm = require('picomatch'); @@ -19059,6 +19004,7 @@ const scan$1 = (input, options) => { let braceEscaped = false; let backslashes = false; let negated = false; + let negatedExtglob = false; let finished = false; let braces = 0; let prev; @@ -19170,6 +19116,9 @@ const scan$1 = (input, options) => { isGlob = token.isGlob = true; isExtglob = token.isExtglob = true; finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } if (scanToEnd === true) { while (eos() !== true && (code = advance())) { @@ -19224,13 +19173,15 @@ const scan$1 = (input, options) => { isBracket = token.isBracket = true; isGlob = token.isGlob = true; finished = true; - - if (scanToEnd === true) { - continue; - } break; } } + + if (scanToEnd === true) { + continue; + } + + break; } if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { @@ -19321,7 +19272,8 @@ const scan$1 = (input, options) => { isGlob, isExtglob, isGlobstar, - negated + negated, + negatedExtglob }; if (opts.tokens === true) { @@ -19467,7 +19419,7 @@ const parse$8 = (input, options) => { START_ANCHOR } = PLATFORM_CHARS; - const globstar = (opts) => { + const globstar = opts => { return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; @@ -19517,12 +19469,13 @@ const parse$8 = (input, options) => { const eos = () => state.index === len - 1; const peek = state.peek = (n = 1) => input[state.index + n]; - const advance = state.advance = () => input[++state.index]; + const advance = state.advance = () => input[++state.index] || ''; const remaining = () => input.slice(state.index + 1); const consume = (value = '', num = 0) => { state.consumed += value; state.index += num; }; + const append = token => { state.output += token.output != null ? token.output : token.value; consume(token.value); @@ -19578,7 +19531,7 @@ const parse$8 = (input, options) => { } } - if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) { + if (extglobs.length && tok.type !== 'paren') { extglobs[extglobs.length - 1].inner += tok.value; } @@ -19610,6 +19563,7 @@ const parse$8 = (input, options) => { const extglobClose = token => { let output = token.close + (opts.capture ? ')' : ''); + let rest; if (token.type === 'negate') { let extglobStar = star; @@ -19622,7 +19576,11 @@ const parse$8 = (input, options) => { output = token.close = `)$))${extglobStar}`; } - if (token.prev.type === 'bos' && eos()) { + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + output = token.close = `)${rest})${extglobStar})`; + } + + if (token.prev.type === 'bos') { state.negatedExtglob = true; } } @@ -19731,9 +19689,9 @@ const parse$8 = (input, options) => { } if (opts.unescape === true) { - value = advance() || ''; + value = advance(); } else { - value += advance() || ''; + value += advance(); } if (state.brackets === 0) { @@ -20397,7 +20355,7 @@ parse$8.fastpaths = (input, options) => { star = `(${star})`; } - const globstar = (opts) => { + const globstar = opts => { if (opts.noglobstar === true) return star; return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; }; @@ -20683,68 +20641,71 @@ picomatch$3.parse = (pattern, options) => { picomatch$3.scan = (input, options) => scan(input, options); /** - * Create a regular expression from a parsed glob pattern. + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `state` * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} * @api public */ -picomatch$3.compileRe = (parsed, options, returnOutput = false, returnState = false) => { +picomatch$3.compileRe = (state, options, returnOutput = false, returnState = false) => { if (returnOutput === true) { - return parsed.output; + return state.output; } const opts = options || {}; const prepend = opts.contains ? '' : '^'; const append = opts.contains ? '' : '$'; - let source = `${prepend}(?:${parsed.output})${append}`; - if (parsed && parsed.negated === true) { + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { source = `^(?!${source}).*$`; } const regex = picomatch$3.toRegex(source, options); if (returnState === true) { - regex.state = parsed; + regex.state = state; } return regex; }; -picomatch$3.makeRe = (input, options, returnOutput = false, returnState = false) => { +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$3.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { if (!input || typeof input !== 'string') { throw new TypeError('Expected a non-empty string'); } - const opts = options || {}; let parsed = { negated: false, fastpaths: true }; - let prefix = ''; - let output; - if (input.startsWith('./')) { - input = input.slice(2); - prefix = parsed.prefix = './'; + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse$7.fastpaths(input, options); } - if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - output = parse$7.fastpaths(input, options); - } - - if (output === undefined) { + if (!parsed.output) { parsed = parse$7(input, options); - parsed.prefix = prefix + (parsed.prefix || ''); - } else { - parsed.output = output; } return picomatch$3.compileRe(parsed, options, returnOutput, returnState); @@ -21448,7 +21409,7 @@ exports.flatten = (...args) => { const utils$2 = utils$3; -var stringify$a = (ast, options = {}) => { +var stringify$8 = (ast, options = {}) => { let stringify = (node, parent = {}) => { let invalidBlock = options.escapeInvalid && utils$2.isInvalidBrace(parent); let invalidNode = node.invalid === true && options.escapeInvalid === true; @@ -21811,7 +21772,7 @@ const zeros = input => { return index > 0; }; -const stringify$9 = (start, end, options) => { +const stringify$7 = (start, end, options) => { if (typeof start === 'string' || typeof end === 'string') { return true; } @@ -21928,7 +21889,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => { let padded = zeros(startString) || zeros(endString) || zeros(stepString); let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify$9(start, end, options) === false; + let toNumber = padded === false && stringify$7(start, end, options) === false; let format = options.transform || transform(toNumber); if (options.toRegex && step === 1) { @@ -22085,7 +22046,7 @@ const compile$1 = (ast, options = {}) => { var compile_1 = compile$1; const fill = fillRange; -const stringify$8 = stringify$a; +const stringify$6 = stringify$8; const utils = utils$3; const append = (queue = '', stash = '', enclose = false) => { @@ -22129,7 +22090,7 @@ const expand$1 = (ast, options = {}) => { } if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify$8(node, options))); + q.push(append(q.pop(), stringify$6(node, options))); return; } @@ -22147,7 +22108,7 @@ const expand$1 = (ast, options = {}) => { let range = fill(...args, options); if (range.length === 0) { - range = stringify$8(node, options); + range = stringify$6(node, options); } q.push(append(q.pop(), range)); @@ -22252,7 +22213,7 @@ var constants$2 = { CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ }; -const stringify$7 = stringify$a; +const stringify$5 = stringify$8; /** * Constants @@ -22495,7 +22456,7 @@ const parse$6 = (input, options = {}) => { if (block.ranges > 0) { block.ranges = 0; let open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify$7(block) }]; + block.nodes = [open, { type: 'text', value: stringify$5(block) }]; } push({ type: 'comma', value }); @@ -22581,7 +22542,7 @@ const parse$6 = (input, options = {}) => { var parse_1$2 = parse$6; -const stringify$6 = stringify$a; +const stringify$4 = stringify$8; const compile = compile_1; const expand = expand_1; const parse$5 = parse_1$2; @@ -22654,9 +22615,9 @@ braces$1.parse = (input, options = {}) => parse$5(input, options); braces$1.stringify = (input, options = {}) => { if (typeof input === 'string') { - return stringify$6(braces$1.parse(input, options), options); + return stringify$4(braces$1.parse(input, options), options); } - return stringify$6(input, options); + return stringify$4(input, options); }; /** @@ -26761,7 +26722,7 @@ function syntaxError (message) { return err } -var stringify$5 = function stringify (value, replacer, space) { +var stringify$3 = function stringify (value, replacer, space) { const stack = []; let indent = ''; let propertyList; @@ -27023,7 +26984,7 @@ var stringify$5 = function stringify (value, replacer, space) { const JSON5 = { parse: parse$4, - stringify: stringify$5, + stringify: stringify$3, }; var lib$3 = JSON5; @@ -27279,7 +27240,7 @@ function options$1(flags, configuration) { silentlyIgnore: config.silentlyIgnore, detectIgnore: config.ignore, pluginPrefix: configuration.pluginPrefix, - plugins: plugins$1(config.use), + plugins: plugins(config.use), reporter: report[0], reporterOptions: report[1], color: config.color, @@ -27309,7 +27270,7 @@ function commaSeparated(value) { } // Parse `plugins`. -function plugins$1(value) { +function plugins(value) { var result = {}; normalize(value) @@ -27773,201 +27734,7 @@ var extend$2 = function extend() { return target; }; -var isPlainObj = value => { - if (Object.prototype.toString.call(value) !== '[object Object]') { - return false; - } - - const prototype = Object.getPrototypeOf(value); - return prototype === null || prototype === Object.prototype; -}; - -var slice$3 = [].slice; - -var wrap_1 = wrap$2; - -// Wrap `fn`. -// Can be sync or async; return a promise, receive a completion handler, return -// new values and errors. -function wrap$2(fn, callback) { - var invoked; - - return wrapped - - function wrapped() { - var params = slice$3.call(arguments, 0); - var callback = fn.length > params.length; - var result; - - if (callback) { - params.push(done); - } - - try { - result = fn.apply(null, params); - } catch (error) { - // Well, this is quite the pickle. - // `fn` received a callback and invoked it (thus continuing the pipeline), - // but later also threw an error. - // We’re not about to restart the pipeline again, so the only thing left - // to do is to throw the thing instead. - if (callback && invoked) { - throw error - } - - return done(error) - } - - if (!callback) { - if (result && typeof result.then === 'function') { - result.then(then, done); - } else if (result instanceof Error) { - done(result); - } else { - then(result); - } - } - } - - // Invoke `next`, only once. - function done() { - if (!invoked) { - invoked = true; - - callback.apply(null, arguments); - } - } - - // Invoke `done` with one value. - // Tracks if an error is passed, too. - function then(value) { - done(null, value); - } -} - -var wrap$1 = wrap_1; - -var trough_1 = trough$1; - -trough$1.wrap = wrap$1; - -var slice$2 = [].slice; - -// Create new middleware. -function trough$1() { - var fns = []; - var middleware = {}; - - middleware.run = run; - middleware.use = use; - - return middleware - - // Run `fns`. Last argument must be a completion handler. - function run() { - var index = -1; - var input = slice$2.call(arguments, 0, -1); - var done = arguments[arguments.length - 1]; - - if (typeof done !== 'function') { - throw new Error('Expected function as last argument, not ' + done) - } - - next.apply(null, [null].concat(input)); - - // Run the next `fn`, if any. - function next(err) { - var fn = fns[++index]; - var params = slice$2.call(arguments, 0); - var values = params.slice(1); - var length = input.length; - var pos = -1; - - if (err) { - done(err); - return - } - - // Copy non-nully input into values. - while (++pos < length) { - if (values[pos] === null || values[pos] === undefined) { - values[pos] = input[pos]; - } - } - - input = values; - - // Next or done. - if (fn) { - wrap$1(fn, next).apply(null, input); - } else { - done.apply(null, [null].concat(input)); - } - } - } - - // Add `fn` to the list. - function use(fn) { - if (typeof fn !== 'function') { - throw new Error('Expected `fn` to be a function, not ' + fn) - } - - fns.push(fn); - - return middleware - } -} - -var own$d = {}.hasOwnProperty; - -var unistUtilStringifyPosition$1 = stringify$4; - -function stringify$4(value) { - // Nothing. - if (!value || typeof value !== 'object') { - return '' - } - - // Node. - if (own$d.call(value, 'position') || own$d.call(value, 'type')) { - return position$4(value.position) - } - - // Position. - if (own$d.call(value, 'start') || own$d.call(value, 'end')) { - return position$4(value) - } - - // Point. - if (own$d.call(value, 'line') || own$d.call(value, 'column')) { - return point$t(value) - } - - // ? - return '' -} - -function point$t(point) { - if (!point || typeof point !== 'object') { - point = {}; - } - - return index$2(point.line) + ':' + index$2(point.column) -} - -function position$4(pos) { - if (!pos || typeof pos !== 'object') { - pos = {}; - } - - return point$t(pos.start) + '-' + point$t(pos.end) -} - -function index$2(value) { - return value && typeof value === 'number' ? value : 1 -} - -var stringify$3 = unistUtilStringifyPosition$1; +var stringify$2 = unistUtilStringifyPosition; var vfileMessage = VMessage$1; @@ -28004,7 +27771,7 @@ function VMessage$1(reason, position, origin) { } parts = parseOrigin(origin); - range = stringify$3(position) || '1:1'; + range = stringify$2(position) || '1:1'; location = { start: {line: null, column: null}, @@ -42891,69 +42658,20 @@ function decodeEntity$1(characters) { : false } -var own$7 = {}.hasOwnProperty; - -var unistUtilStringifyPosition = stringify$2; - -function stringify$2(value) { - // Nothing. - if (!value || typeof value !== 'object') { - return '' - } - - // Node. - if (own$7.call(value, 'position') || own$7.call(value, 'type')) { - return position$3(value.position) - } - - // Position. - if (own$7.call(value, 'start') || own$7.call(value, 'end')) { - return position$3(value) - } - - // Point. - if (own$7.call(value, 'line') || own$7.call(value, 'column')) { - return point$s(value) - } - - // ? - return '' -} - -function point$s(point) { - if (!point || typeof point !== 'object') { - point = {}; - } - - return index$1(point.line) + ':' + index$1(point.column) -} - -function position$3(pos) { - if (!pos || typeof pos !== 'object') { - pos = {}; - } - - return point$s(pos.start) + '-' + point$s(pos.end) -} - -function index$1(value) { - return value && typeof value === 'number' ? value : 1 -} - var dist = fromMarkdown$1; // These three are compiled away in the `dist/` var toString$4 = mdastUtilToString$1; var assign = assign_1; -var own$6 = hasOwnProperty$2; +var own$7 = hasOwnProperty$2; var normalizeIdentifier$1 = normalizeIdentifier_1; var safeFromInt = safeFromInt_1; var parser = parse_1$1; var preprocessor = preprocess_1; var postprocess = postprocess_1; var decode$1 = decodeEntity_1$1; -var stringifyPosition$1 = unistUtilStringifyPosition; +var stringifyPosition$2 = unistUtilStringifyPosition; function fromMarkdown$1(value, encoding, options) { if (typeof encoding !== 'string') { @@ -43127,7 +42845,7 @@ function compiler(options) { while (++index < events.length) { handler = config[events[index][0]]; - if (own$6.call(handler, events[index][1].type)) { + if (own$7.call(handler, events[index][1].type)) { handler[events[index][1].type].call( assign({sliceSerialize: events[index][2].sliceSerialize}, context), events[index][1] @@ -43140,7 +42858,7 @@ function compiler(options) { 'Cannot close document, a token (`' + tokenStack[tokenStack.length - 1].type + '`, ' + - stringifyPosition$1({ + stringifyPosition$2({ start: tokenStack[tokenStack.length - 1].start, end: tokenStack[tokenStack.length - 1].end }) + @@ -43348,7 +43066,7 @@ function compiler(options) { 'Cannot close `' + token.type + '` (' + - stringifyPosition$1({start: token.start, end: token.end}) + + stringifyPosition$2({start: token.start, end: token.end}) + '): it’s not open' ) } else if (open.type !== token.type) { @@ -43356,11 +43074,11 @@ function compiler(options) { 'Cannot close `' + token.type + '` (' + - stringifyPosition$1({start: token.start, end: token.end}) + + stringifyPosition$2({start: token.start, end: token.end}) + '): a different token (`' + open.type + '`, ' + - stringifyPosition$1({start: open.start, end: open.end}) + + stringifyPosition$2({start: open.start, end: open.end}) + ') is open' ) } @@ -43748,7 +43466,7 @@ function extension(config, extension) { var left; for (key in extension) { - left = own$6.call(config, key) ? config[key] : (config[key] = {}); + left = own$7.call(config, key) ? config[key] : (config[key] = {}); if (key === 'canContainEols' || key === 'transforms') { config[key] = [].concat(left, extension[key]); @@ -43783,21 +43501,21 @@ function parse$2(options) { } } -var zwitch$1 = factory$3; +var zwitch$1 = factory$4; var noop$1 = Function.prototype; -var own$5 = {}.hasOwnProperty; +var own$6 = {}.hasOwnProperty; // Handle values based on a property. -function factory$3(key, options) { +function factory$4(key, options) { var settings = options || {}; function one(value) { var fn = one.invalid; var handlers = one.handlers; - if (value && own$5.call(value, key)) { - fn = own$5.call(handlers, value[key]) ? handlers[value[key]] : one.unknown; + if (value && own$6.call(value, key)) { + fn = own$6.call(handlers, value[key]) ? handlers[value[key]] : one.unknown; } return (fn || noop$1).apply(this, arguments) @@ -48726,10 +48444,10 @@ var characterEntities = require$$0; var decodeEntity_1 = decodeEntity; -var own$4 = {}.hasOwnProperty; +var own$5 = {}.hasOwnProperty; function decodeEntity(characters) { - return own$4.call(characterEntities, characters) + return own$5.call(characterEntities, characters) ? characterEntities[characters] : false } @@ -49913,7 +49631,7 @@ var require$$4 = { * * @param {string|Uint8Array|VFile} file */ -function location$5(file) { +function location(file) { var value = String(file); /** @type {Array.<number>} */ var indices = []; @@ -49990,7 +49708,7 @@ function location$5(file) { * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test */ -const convert$D = +const convert$2 = /** * @type {( * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & @@ -50010,19 +49728,19 @@ const convert$D = */ function (test) { if (test === undefined || test === null) { - return ok$C + return ok$1 } if (typeof test === 'string') { - return typeFactory$C(test) + return typeFactory$1(test) } if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$C(test) : propsFactory$B(test) + return Array.isArray(test) ? anyFactory$1(test) : propsFactory(test) } if (typeof test === 'function') { - return castFactory$B(test) + return castFactory(test) } throw new Error('Expected function, string, or object as test') @@ -50032,16 +49750,16 @@ const convert$D = * @param {Array.<Type|Props|TestFunctionAnything>} tests * @returns {AssertAnything} */ -function anyFactory$C(tests) { +function anyFactory$1(tests) { /** @type {Array.<AssertAnything>} */ const checks = []; let index = -1; while (++index < tests.length) { - checks[index] = convert$D(tests[index]); + checks[index] = convert$2(tests[index]); } - return castFactory$B(any) + return castFactory(any) /** * @this {unknown} @@ -50066,8 +49784,8 @@ function anyFactory$C(tests) { * @param {Props} check * @returns {AssertAnything} */ -function propsFactory$B(check) { - return castFactory$B(all) +function propsFactory(check) { + return castFactory(all) /** * @param {Node} node @@ -50093,8 +49811,8 @@ function propsFactory$B(check) { * @param {Type} check * @returns {AssertAnything} */ -function typeFactory$C(check) { - return castFactory$B(type) +function typeFactory$1(check) { + return castFactory(type) /** * @param {Node} node @@ -50110,7 +49828,7 @@ function typeFactory$C(check) { * @param {TestFunctionAnything} check * @returns {AssertAnything} */ -function castFactory$B(check) { +function castFactory(check) { return assertion /** @@ -50125,7 +49843,7 @@ function castFactory$B(check) { } // Utility to return true. -function ok$C() { +function ok$1() { return true } @@ -50133,7 +49851,7 @@ function ok$C() { * @param {string} d * @returns {string} */ -function color$D(d) { +function color$3(d) { return '\u001B[33m' + d + '\u001B[39m' } @@ -50146,17 +49864,17 @@ function color$D(d) { /** * Continue traversing as normal */ -const CONTINUE$D = true; +const CONTINUE$3 = true; /** * Do not traverse this node’s children */ -const SKIP$D = 'skip'; +const SKIP$3 = 'skip'; /** * Stop traversing immediately */ -const EXIT$D = false; +const EXIT$3 = false; -const visitParents$D = +const visitParents$3 = /** * @type {( * (<T extends Node>(tree: Node, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>, visitor: Visitor<T>, reverse?: boolean) => void) & @@ -50181,7 +49899,7 @@ const visitParents$D = test = null; } - var is = convert$D(test); + var is = convert$2(test); var step = reverse ? -1 : 1; factory(tree, null, [])(); @@ -50208,7 +49926,7 @@ const visitParents$D = Object.defineProperty(visit, 'name', { value: 'node (' + - color$D(value.type + (name ? '<' + name + '>' : '')) + + color$3(value.type + (name ? '<' + name + '>' : '')) + ')' }); } @@ -50226,14 +49944,14 @@ const visitParents$D = var grandparents; if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$C(visitor(node, parents)); + result = toResult$2(visitor(node, parents)); - if (result[0] === EXIT$D) { + if (result[0] === EXIT$3) { return result } } - if (node.children && result[0] !== SKIP$D) { + if (node.children && result[0] !== SKIP$3) { // @ts-ignore looks like a parent. offset = (reverse ? node.children.length : -1) + step; // @ts-ignore looks like a parent. @@ -50243,7 +49961,7 @@ const visitParents$D = while (offset > -1 && offset < node.children.length) { subresult = factory(node.children[offset], offset, grandparents)(); - if (subresult[0] === EXIT$D) { + if (subresult[0] === EXIT$3) { return subresult } @@ -50262,13 +49980,13 @@ const visitParents$D = * @param {VisitorResult} value * @returns {ActionTuple} */ -function toResult$C(value) { +function toResult$2(value) { if (Array.isArray(value)) { return value } if (typeof value === 'number') { - return [CONTINUE$D, value] + return [CONTINUE$3, value] } return [value] @@ -50281,7 +49999,7 @@ function toResult$C(value) { * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult */ -const visit$C = +const visit$3 = /** * @type {( * (<T extends Node>(tree: Node, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>, visitor: Visitor<T>, reverse?: boolean) => void) & @@ -50305,7 +50023,7 @@ const visit$C = test = null; } - visitParents$D(tree, test, overload, reverse); + visitParents$3(tree, test, overload, reverse); /** * @param {Node} node @@ -50395,7 +50113,7 @@ const visit$C = * @property {boolean} state */ -const own$3 = {}.hasOwnProperty; +const own$4 = {}.hasOwnProperty; /** * @type {import('unified').Plugin<[Options]>} @@ -50429,7 +50147,7 @@ function messageControl(options) { * @param {VFile} file */ function transformer(tree, file) { - const toOffset = location$5(file).toOffset; + const toOffset = location(file).toOffset; const initial = !reset; const gaps = detectGaps(tree, file); /** @type {Record<string, Mark[]>} */ @@ -50437,7 +50155,7 @@ function messageControl(options) { /** @type {Mark[]} */ const globals = []; - visit$C(tree, options.test, visitor); + visit$3(tree, options.test, visitor); file.messages = file.messages.filter((m) => filter(m)); @@ -50605,7 +50323,7 @@ function messageControl(options) { // Toggle all known rules. if (!ruleId) { for (ruleId in scope) { - if (own$3.call(scope, ruleId)) { + if (own$4.call(scope, ruleId)) { toggle(point, state, ruleId); } } @@ -50672,7 +50390,7 @@ function detectGaps(tree, file) { let gap; // Find all gaps. - visit$C(tree, one); + visit$3(tree, one); // Get the end of the document. // This detects if the last node was the last node. @@ -50990,13 +50708,13 @@ function wrap(middleware, callback) { * @returns {void} */ -const primitives$F = new Set(['string', 'number', 'boolean']); +const primitives = new Set(['string', 'number', 'boolean']); /** * @param {string} id * @param {Rule} rule */ -function lintRule$F(id, rule) { +function lintRule(id, rule) { const parts = id.split(':'); // Possibly useful if externalised later. /* c8 ignore next */ @@ -51009,7 +50727,7 @@ function lintRule$F(id, rule) { /** @type {import('unified').Plugin<[unknown]|void[]>} */ function plugin(raw) { - const [severity, options] = coerce$G(ruleId, raw); + const [severity, options] = coerce$2(ruleId, raw); if (!severity) return @@ -51048,7 +50766,7 @@ function lintRule$F(id, rule) { * @param {unknown} value * @returns {SeverityTuple} */ -function coerce$G(name, value) { +function coerce$2(name, value) { /** @type {unknown[]} */ let result; @@ -51060,7 +50778,7 @@ function coerce$G(name, value) { Array.isArray(value) && // `isArray(unknown)` is turned into `any[]`: // type-coverage:ignore-next-line - primitives$F.has(typeof value[0]) + primitives.has(typeof value[0]) ) { // `isArray(unknown)` is turned into `any[]`: // type-coverage:ignore-next-line @@ -51155,7 +50873,7 @@ function coerce$G(name, value) { * ``` */ -const remarkLintFinalNewline = lintRule$F( +const remarkLintFinalNewline = lintRule( 'remark-lint:final-newline', /** @type {import('unified-lint-rule').Rule<Root, void>} */ (_, file) => { @@ -51168,133 +50886,7 @@ const remarkLintFinalNewline = lintRule$F( } ); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$E = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$E(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$F(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$F(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$E.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} +var remarkLintFinalNewline$1 = remarkLintFinalNewline; var pluralize = {exports: {}}; @@ -51801,160 +51393,11 @@ var pluralize = {exports: {}}; var plural = pluralize.exports; -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$C = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$B - } - - if (typeof test === 'string') { - return typeFactory$B(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$B(test) : propsFactory$A(test) - } - - if (typeof test === 'function') { - return castFactory$A(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$B(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$C(tests[index]); - } - - return castFactory$A(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$A(check) { - return castFactory$A(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$B(check) { - return castFactory$A(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$A(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$B() { - return true -} - /** * @param {string} d * @returns {string} */ -function color$C(d) { +function color$2(d) { return '\u001B[33m' + d + '\u001B[39m' } @@ -51967,15 +51410,15 @@ function color$C(d) { /** * Continue traversing as normal */ -const CONTINUE$C = true; +const CONTINUE$2 = true; /** * Do not traverse this node’s children */ -const SKIP$C = 'skip'; +const SKIP$2 = 'skip'; /** * Stop traversing immediately */ -const EXIT$C = false; +const EXIT$2 = false; /** * Visit children of tree which pass a test @@ -51985,7 +51428,7 @@ const EXIT$C = false; * @param visitor Function to run for each node * @param reverse Visit the tree in reverse order, defaults to false */ -const visitParents$C = +const visitParents$2 = /** * @type {( * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & @@ -52007,7 +51450,7 @@ const visitParents$C = test = null; } - const is = convert$C(test); + const is = convert$2(test); const step = reverse ? -1 : 1; factory(tree, null, [])(); @@ -52035,7 +51478,7 @@ const visitParents$C = Object.defineProperty(visit, 'name', { value: 'node (' + - color$C(value.type + (name ? '<' + name + '>' : '')) + + color$2(value.type + (name ? '<' + name + '>' : '')) + ')' }); } @@ -52053,15 +51496,15 @@ const visitParents$C = let grandparents; if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$B(visitor(node, parents)); + result = toResult$1(visitor(node, parents)); - if (result[0] === EXIT$C) { + if (result[0] === EXIT$2) { return result } } // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$C) { + if (node.children && result[0] !== SKIP$2) { // @ts-expect-error looks like a parent. offset = (reverse ? node.children.length : -1) + step; // @ts-expect-error looks like a parent. @@ -52072,7 +51515,7 @@ const visitParents$C = // @ts-expect-error looks like a parent. subresult = factory(node.children[offset], offset, grandparents)(); - if (subresult[0] === EXIT$C) { + if (subresult[0] === EXIT$2) { return subresult } @@ -52091,13 +51534,13 @@ const visitParents$C = * @param {VisitorResult} value * @returns {ActionTuple} */ -function toResult$B(value) { +function toResult$1(value) { if (Array.isArray(value)) { return value } if (typeof value === 'number') { - return [CONTINUE$C, value] + return [CONTINUE$2, value] } return [value] @@ -52118,7 +51561,7 @@ function toResult$B(value) { * @param visitor Function to run for each node * @param reverse Fisit the tree in reverse, defaults to false */ -const visit$B = +const visit$2 = /** * @type {( * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & @@ -52139,7 +51582,7 @@ const visit$B = test = null; } - visitParents$C(tree, test, overload, reverse); + visitParents$2(tree, test, overload, reverse); /** * @param {Node} node @@ -52195,11 +51638,11 @@ const visit$B = * 4:2: Incorrect indentation before bullet: remove 1 space */ -const remarkLintListItemBulletIndent = lintRule$E( +const remarkLintListItemBulletIndent = lintRule( 'remark-lint:list-item-bullet-indent', /** @type {import('unified-lint-rule').Rule<Root, void>} */ (tree, file) => { - visit$B(tree, 'list', (list, _, grandparent) => { + visit$2(tree, 'list', (list, _, grandparent) => { let index = -1; while (++index < list.children.length) { @@ -52231,488 +51674,7 @@ const remarkLintListItemBulletIndent = lintRule$E( } ); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$D = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$D(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$E(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$E(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$D.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$B = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$A - } - - if (typeof test === 'string') { - return typeFactory$A(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$A(test) : propsFactory$z(test) - } - - if (typeof test === 'function') { - return castFactory$z(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$A(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$B(tests[index]); - } - - return castFactory$z(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$z(check) { - return castFactory$z(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$A(check) { - return castFactory$z(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$z(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$A() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$B(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$B = true; -/** - * Do not traverse this node’s children - */ -const SKIP$B = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$B = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$B = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$B(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$B(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$A(visitor(node, parents)); - - if (result[0] === EXIT$B) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$B) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$B) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$A(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$B, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$A = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$B(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); +var remarkLintListItemBulletIndent$1 = remarkLintListItemBulletIndent; /** * @typedef {import('unist').Position} Position @@ -52728,14 +51690,15 @@ const visit$A = * @property {PositionLike} [position] */ -var pointStart$q = point$r('start'); +var pointStart = point$2('start'); +var pointEnd = point$2('end'); /** * Get the positional info of `node`. * * @param {'start'|'end'} type */ -function point$r(type) { +function point$2(type) { return point /** @@ -52905,7 +51868,7 @@ function generated(node) { * 1:1: Incorrect list-item indent style `💩`: use either `'tab-size'`, `'space'`, or `'mixed'` */ -const remarkLintListItemIndent = lintRule$D( +const remarkLintListItemIndent = lintRule( 'remark-lint:list-item-indent', /** @type {import('unified-lint-rule').Rule<Root, Options>} */ (tree, file, option = 'tab-size') => { @@ -52919,7 +51882,7 @@ const remarkLintListItemIndent = lintRule$D( ); } - visit$A(tree, 'list', (node) => { + visit$2(tree, 'list', (node) => { if (generated(node)) return const spread = node.spread; @@ -52928,10 +51891,10 @@ const remarkLintListItemIndent = lintRule$D( while (++index < node.children.length) { const item = node.children[index]; const head = item.children[0]; - const final = pointStart$q(head); + const final = pointStart(head); const marker = value - .slice(pointStart$q(item).offset, final.offset) + .slice(pointStart(item).offset, final.offset) .replace(/\[[x ]?]\s*$/i, ''); const bulletSize = marker.replace(/\s+$/, '').length; @@ -52960,571 +51923,46 @@ const remarkLintListItemIndent = lintRule$D( } ); +var remarkLintListItemIndent$1 = remarkLintListItemIndent; + /** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} + * @typedef Options + * @property {boolean} [includeImageAlt=true] */ -const primitives$C = new Set(['string', 'number', 'boolean']); +/** + * Get the text content of a node. + * Prefer the node’s plain-text fields, otherwise serialize its children, + * and if the given value is an array, serialize the nodes in it. + * + * @param {unknown} node + * @param {Options} [options] + * @returns {string} + */ +function toString(node, options) { + var {includeImageAlt = true} = options || {}; + return one(node, includeImageAlt) +} /** - * @param {string} id - * @param {Rule} rule + * @param {unknown} node + * @param {boolean} includeImageAlt + * @returns {string} */ -function lintRule$C(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$D(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$D(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$C.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$A = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$z - } - - if (typeof test === 'string') { - return typeFactory$z(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$z(test) : propsFactory$y(test) - } - - if (typeof test === 'function') { - return castFactory$y(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$z(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$A(tests[index]); - } - - return castFactory$y(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$y(check) { - return castFactory$y(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$z(check) { - return castFactory$y(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$y(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$z() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$A(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$A = true; -/** - * Do not traverse this node’s children - */ -const SKIP$A = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$A = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$A = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$A(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$A(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$z(visitor(node, parents)); - - if (result[0] === EXIT$A) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$A) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$A) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$z(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$A, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$z = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$A(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$p = point$q('start'); -var pointEnd$e = point$q('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$q(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @typedef Options - * @property {boolean} [includeImageAlt=true] - */ - -/** - * Get the text content of a node. - * Prefer the node’s plain-text fields, otherwise serialize its children, - * and if the given value is an array, serialize the nodes in it. - * - * @param {unknown} node - * @param {Options} [options] - * @returns {string} - */ -function toString(node, options) { - var {includeImageAlt = true} = options || {}; - return one(node, includeImageAlt) -} - -/** - * @param {unknown} node - * @param {boolean} includeImageAlt - * @returns {string} - */ -function one(node, includeImageAlt) { - return ( - (node && - typeof node === 'object' && - // @ts-ignore looks like a literal. - (node.value || - // @ts-ignore looks like an image. - (includeImageAlt ? node.alt : '') || - // @ts-ignore looks like a parent. - ('children' in node && all(node.children, includeImageAlt)) || - (Array.isArray(node) && all(node, includeImageAlt)))) || - '' - ) -} +function one(node, includeImageAlt) { + return ( + (node && + typeof node === 'object' && + // @ts-ignore looks like a literal. + (node.value || + // @ts-ignore looks like an image. + (includeImageAlt ? node.alt : '') || + // @ts-ignore looks like a parent. + ('children' in node && all(node.children, includeImageAlt)) || + (Array.isArray(node) && all(node, includeImageAlt)))) || + '' + ) +} /** * @param {Array.<unknown>} values @@ -53585,16 +52023,16 @@ function all(values, includeImageAlt) { // See: <https://en.wikipedia.org/wiki/URI_scheme#Generic_syntax>. const protocol = /^[a-z][a-z+.-]+:\/?/i; -const remarkLintNoAutoLinkWithoutProtocol = lintRule$C( +const remarkLintNoAutoLinkWithoutProtocol = lintRule( 'remark-lint:no-auto-link-without-protocol', /** @type {import('unified-lint-rule').Rule<Root, void>} */ (tree, file) => { - visit$z(tree, 'link', (node) => { + visit$2(tree, 'link', (node) => { if ( !generated(node) && - pointStart$p(node).column === pointStart$p(node.children[0]).column - 1 && - pointEnd$e(node).column === - pointEnd$e(node.children[node.children.length - 1]).column + 1 && + pointStart(node).column === pointStart(node.children[0]).column - 1 && + pointEnd(node).column === + pointEnd(node.children[node.children.length - 1]).column + 1 && !protocol.test(toString(node)) ) { file.message('All automatic links must start with a protocol', node); @@ -53603,627 +52041,509 @@ const remarkLintNoAutoLinkWithoutProtocol = lintRule$C( } ); +var remarkLintNoAutoLinkWithoutProtocol$1 = remarkLintNoAutoLinkWithoutProtocol; + /** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-blockquote-without-marker + * @fileoverview + * Warn when blank lines without `>` (greater than) markers are found in a + * block quote. * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple + * ## Fix * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$B = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * adds markers to every line in a block quote. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * > Foo… + * > …bar… + * > …baz. + * + * @example + * {"name": "ok-tabs.md"} + * + * >»Foo… + * >»…bar… + * >»…baz. + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * > Foo… + * …bar… + * > …baz. + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 2:1: Missing marker in block quote + * + * @example + * {"name": "not-ok-tabs.md", "label": "input"} + * + * >»Foo… + * »…bar… + * …baz. + * + * @example + * {"name": "not-ok-tabs.md", "label": "output"} + * + * 2:1: Missing marker in block quote + * 3:1: Missing marker in block quote */ -function lintRule$B(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$C(ruleId, raw); +const remarkLintNoBlockquoteWithoutMarker = lintRule( + 'remark-lint:no-blockquote-without-marker', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + const value = String(file); + const loc = location(file); - if (!severity) return + visit$2(tree, 'blockquote', (node) => { + let index = -1; - const fatal = severity === 2; + while (++index < node.children.length) { + const child = node.children[index]; - return (tree, file, next) => { - let index = file.messages.length - 1; + if (child.type === 'paragraph' && !generated(child)) { + const end = pointEnd(child).line; + const column = pointStart(child).column; + let line = pointStart(child).line; - wrap(rule, (error) => { - const messages = file.messages; + // Skip past the first line. + while (++line <= end) { + const offset = loc.toOffset({line, column}); - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } + if (/>[\t ]+$/.test(value.slice(offset - 5, offset))) { + continue + } - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); + // Roughly here. + file.message('Missing marker in block quote', { + line, + column: column - 2 + }); + } } - - next(); - })(tree, file, options); - } + } + }); } -} +); + +var remarkLintNoBlockquoteWithoutMarker$1 = remarkLintNoBlockquoteWithoutMarker; /** - * Coerce a value to a severity--options tuple. + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-literal-urls + * @fileoverview + * Warn for literal URLs in text. + * URLs are treated as links in some Markdown vendors, but not in others. + * To make sure they are always linked, wrap them in `<` (less than) and `>` + * (greater than). * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * never creates literal URLs and always uses `<` (less than) and `>` + * (greater than). + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * <http://foo.bar/baz> + * + * @example + * {"name": "not-ok.md", "label": "input", "gfm": true} + * + * http://foo.bar/baz + * + * @example + * {"name": "not-ok.md", "label": "output", "gfm": true} + * + * 1:1-1:19: Don’t use literal URLs without angle brackets */ -function coerce$C(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$B.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } +const remarkLintNoLiteralUrls = lintRule( + 'remark-lint:no-literal-urls', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + visit$2(tree, 'link', (node) => { + const value = toString(node); - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) + if ( + !generated(node) && + pointStart(node).column === pointStart(node.children[0]).column && + pointEnd(node).column === + pointEnd(node.children[node.children.length - 1]).column && + (node.url === 'mailto:' + value || node.url === value) + ) { + file.message('Don’t use literal URLs without angle brackets', node); + } + }); } +); - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} +var remarkLintNoLiteralUrls$1 = remarkLintNoLiteralUrls; /** - * @typedef {import('unist').Point} Point - * @typedef {import('vfile').VFile} VFile + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module ordered-list-marker-style + * @fileoverview + * Warn when the list item marker style of ordered lists violate a given style. * - * @typedef {Pick<Point, 'line'|'column'>} PositionalPoint - * @typedef {Required<Point>} FullPoint - * @typedef {NonNullable<Point['offset']>} Offset - */ - -/** - * Get transform functions for the given `document`. + * Options: `'consistent'`, `'.'`, or `')'`, default: `'consistent'`. * - * @param {string|Uint8Array|VFile} file + * `'consistent'` detects the first used list style and warns when subsequent + * lists use different styles. + * + * @example + * {"name": "ok.md"} + * + * 1. Foo + * + * + * 1. Bar + * + * Unordered lists are not affected by this rule. + * + * * Foo + * + * @example + * {"name": "ok.md", "setting": "."} + * + * 1. Foo + * + * 2. Bar + * + * @example + * {"name": "ok.md", "setting": ")"} + * + * 1) Foo + * + * 2) Bar + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * 1. Foo + * + * 2) Bar + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 3:1-3:8: Marker style should be `.` + * + * @example + * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true} + * + * 1:1: Incorrect ordered list item marker style `💩`: use either `'.'` or `')'` */ -function location$4(file) { - var value = String(file); - /** @type {Array.<number>} */ - var indices = []; - var search = /\r?\n|\r/g; - while (search.test(value)) { - indices.push(search.lastIndex); - } +const remarkLintOrderedListMarkerStyle = lintRule( + 'remark-lint:ordered-list-marker-style', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + const value = String(file); - indices.push(value.length + 1); + if (option !== 'consistent' && option !== '.' && option !== ')') { + file.fail( + 'Incorrect ordered list item marker style `' + + option + + "`: use either `'.'` or `')'`" + ); + } - return {toPoint, toOffset} + visit$2(tree, 'list', (node) => { + let index = -1; - /** - * Get the line and column-based `point` for `offset` in the bound indices. - * Returns a point with `undefined` values when given invalid or out of bounds - * input. - * - * @param {Offset} offset - * @returns {FullPoint} - */ - function toPoint(offset) { - var index = -1; + if (!node.ordered) return - if (offset > -1 && offset < indices[indices.length - 1]) { - while (++index < indices.length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset + while (++index < node.children.length) { + const child = node.children[index]; + + if (!generated(child)) { + const marker = /** @type {Marker} */ ( + value + .slice( + pointStart(child).offset, + pointStart(child.children[0]).offset + ) + .replace(/\s|\d/g, '') + .replace(/\[[x ]?]\s*$/i, '') + ); + + if (option === 'consistent') { + option = marker; + } else if (marker !== option) { + file.message('Marker style should be `' + option + '`', child); } } } - } - - return {line: undefined, column: undefined, offset: undefined} + }); } +); - /** - * Get the `offset` for a line and column-based `point` in the bound indices. - * Returns `-1` when given invalid or out of bounds input. - * - * @param {PositionalPoint} point - * @returns {Offset} - */ - function toOffset(point) { - var line = point && point.line; - var column = point && point.column; - /** @type {number} */ - var offset; - - if ( - typeof line === 'number' && - typeof column === 'number' && - !Number.isNaN(line) && - !Number.isNaN(column) && - line - 1 in indices - ) { - offset = (indices[line - 2] || 0) + column - 1 || 0; - } - - return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 - } -} +var remarkLintOrderedListMarkerStyle$1 = remarkLintOrderedListMarkerStyle; /** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module hard-break-spaces + * @fileoverview + * Warn when too many spaces are used to create a hard break. * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * @example + * {"name": "ok.md"} * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test + * Lorem ipsum·· + * dolor sit amet + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * Lorem ipsum··· + * dolor sit amet. + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:12-2:1: Use two spaces for hard line breaks */ -const convert$z = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$y - } - - if (typeof test === 'string') { - return typeFactory$y(test) - } +const remarkLintHardBreakSpaces = lintRule( + 'remark-lint:hard-break-spaces', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + const value = String(file); - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$y(test) : propsFactory$x(test) - } + visit$2(tree, 'break', (node) => { + if (!generated(node)) { + const slice = value + .slice(pointStart(node).offset, pointEnd(node).offset) + .split('\n', 1)[0] + .replace(/\r$/, ''); - if (typeof test === 'function') { - return castFactory$x(test) + if (slice.length > 2) { + file.message('Use two spaces for hard line breaks', node); + } } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$y(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$z(tests[index]); + }); } +); - return castFactory$x(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; +var remarkLintHardBreakSpaces$1 = remarkLintHardBreakSpaces; - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } +var own$3 = {}.hasOwnProperty; - return false - } -} +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Position} Position + * @typedef {import('unist').Point} Point + */ /** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. + * Stringify one point, a position (start and end points), or a node’s + * positional information. * - * @param {Props} check - * @returns {AssertAnything} + * @param {Node|Position|Point} [value] + * @returns {string} */ -function propsFactory$x(check) { - return castFactory$x(all) +function stringifyPosition$1(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' + } - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; + // Node. + if (own$3.call(value, 'position') || own$3.call(value, 'type')) { + // @ts-ignore looks like a node. + return position$3(value.position) + } - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } + // Position. + if (own$3.call(value, 'start') || own$3.call(value, 'end')) { + // @ts-ignore looks like a position. + return position$3(value) + } - return true + // Point. + if (own$3.call(value, 'line') || own$3.call(value, 'column')) { + // @ts-ignore looks like a point. + return point$1(value) } + + // ? + return '' } /** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} + * @param {Point} point + * @returns {string} */ -function typeFactory$y(check) { - return castFactory$x(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } +function point$1(point) { + return index$1(point && point.line) + ':' + index$1(point && point.column) } /** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$x(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$y() { - return true -} - -/** - * @param {string} d + * @param {Position} pos * @returns {string} */ -function color$z(d) { - return '\u001B[33m' + d + '\u001B[39m' +function position$3(pos) { + return point$1(pos && pos.start) + '-' + point$1(pos && pos.end) } /** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$z = true; -/** - * Do not traverse this node’s children - */ -const SKIP$z = 'skip'; -/** - * Stop traversing immediately + * @param {number} value + * @returns {number} */ -const EXIT$z = false; +function index$1(value) { + return value && typeof value === 'number' ? value : 1 +} /** - * Visit children of tree which pass a test + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-duplicate-definitions + * @fileoverview + * Warn when duplicate definitions are found. * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false + * @example + * {"name": "ok.md"} + * + * [foo]: bar + * [baz]: qux + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * [foo]: bar + * [foo]: qux + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 2:1-2:11: Do not use definitions with the same identifier (1:1) */ -const visitParents$z = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$z(test); - const step = reverse ? -1 : 1; - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; +const remarkLintNoDuplicateDefinitions = lintRule( + 'remark-lint:no-duplicate-definitions', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + /** @type {Record<string, string>} */ + const map = Object.create(null); - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + visit$2(tree, (node) => { + if ( + (node.type === 'definition' || node.type === 'footnoteDefinition') && + !generated(node) + ) { + const identifier = node.identifier; + const duplicate = map[identifier]; - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$z(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); + if (duplicate) { + file.message( + 'Do not use definitions with the same identifier (' + + duplicate + + ')', + node + ); } - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$y(visitor(node, parents)); - - if (result[0] === EXIT$z) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$z) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$z) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } + map[identifier] = stringifyPosition$1(pointStart(node)); } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$y(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$z, value] + }); } +); - return [value] -} +var remarkLintNoDuplicateDefinitions$1 = remarkLintNoDuplicateDefinitions; /** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult + * @typedef {import('mdast').Heading} Heading + * @typedef {'atx'|'atx-closed'|'setext'} Style */ /** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false + * @param {Heading} node + * @param {Style} [relative] + * @returns {Style|null} */ -const visit$y = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } +function headingStyle(node, relative) { + var last = node.children[node.children.length - 1]; + var depth = node.depth; + var pos = node && node.position && node.position.end; + var final = last && last.position && last.position.end; - visitParents$z(tree, test, overload, reverse); + if (!pos) { + return null + } - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } + // This can only occur for `'atx'` and `'atx-closed'` headings. + // This might incorrectly match `'atx'` headings with lots of trailing white + // space as an `'atx-closed'` heading. + if (!last) { + if (pos.column - 1 <= depth * 2) { + return consolidate(depth, relative) } - ); -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ + return 'atx-closed' + } + + if (final.line + 1 === pos.line) { + return 'setext' + } + + if (final.column + depth < pos.column) { + return 'atx-closed' + } -var pointStart$o = point$p('start'); -var pointEnd$d = point$p('end'); + return consolidate(depth, relative) +} /** - * Get the positional info of `node`. + * Get the probable style of an atx-heading, depending on preferred style. * - * @param {'start'|'end'} type + * @param {number} depth + * @param {Style} relative + * @returns {Style|null} */ -function point$p(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } +function consolidate(depth, relative) { + return depth < 3 + ? 'atx' + : relative === 'atx' || relative === 'setext' + ? relative + : null } /** * @author Titus Wormer * @copyright 2015 Titus Wormer * @license MIT - * @module no-blockquote-without-marker + * @module no-heading-content-indent * @fileoverview - * Warn when blank lines without `>` (greater than) markers are found in a - * block quote. + * Warn when content of headings is indented. * * ## Fix * * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * adds markers to every line in a block quote. + * removes all unneeded padding around content in headings. * * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) * on how to automatically fix warnings for this rule. @@ -54231,21170 +52551,4886 @@ function point$p(type) { * @example * {"name": "ok.md"} * - * > Foo… - * > …bar… - * > …baz. + * #·Foo * - * @example - * {"name": "ok-tabs.md"} + * ## Bar·## * - * >»Foo… - * >»…bar… - * >»…baz. + * ##·Baz + * + * Setext headings are not affected. + * + * Baz + * === * * @example * {"name": "not-ok.md", "label": "input"} * - * > Foo… - * …bar… - * > …baz. + * #··Foo * - * @example - * {"name": "not-ok.md", "label": "output"} + * ## Bar··## * - * 2:1: Missing marker in block quote + * ##··Baz * * @example - * {"name": "not-ok-tabs.md", "label": "input"} + * {"name": "not-ok.md", "label": "output"} * - * >»Foo… - * »…bar… - * …baz. + * 1:4: Remove 1 space before this heading’s content + * 3:7: Remove 1 space after this heading’s content + * 5:7: Remove 1 space before this heading’s content * * @example - * {"name": "not-ok-tabs.md", "label": "output"} + * {"name": "empty-heading.md"} * - * 2:1: Missing marker in block quote - * 3:1: Missing marker in block quote + * #·· */ -const remarkLintNoBlockquoteWithoutMarker = lintRule$B( - 'remark-lint:no-blockquote-without-marker', +const remarkLintNoHeadingContentIndent = lintRule( + 'remark-lint:no-heading-content-indent', /** @type {import('unified-lint-rule').Rule<Root, void>} */ (tree, file) => { - const value = String(file); - const loc = location$4(file); + visit$2(tree, 'heading', (node) => { + if (generated(node)) { + return + } - visit$y(tree, 'blockquote', (node) => { - let index = -1; + const type = headingStyle(node, 'atx'); - while (++index < node.children.length) { - const child = node.children[index]; + if (type === 'atx' || type === 'atx-closed') { + const head = pointStart(node.children[0]).column; - if (child.type === 'paragraph' && !generated(child)) { - const end = pointEnd$d(child).line; - const column = pointStart$o(child).column; - let line = pointStart$o(child).line; + // Ignore empty headings. + if (!head) { + return + } - // Skip past the first line. - while (++line <= end) { - const offset = loc.toOffset({line, column}); + const diff = head - pointStart(node).column - 1 - node.depth; - if (/>[\t ]+$/.test(value.slice(offset - 5, offset))) { - continue - } + if (diff) { + file.message( + 'Remove ' + + Math.abs(diff) + + ' ' + + plural('space', Math.abs(diff)) + + ' before this heading’s content', + pointStart(node.children[0]) + ); + } + } - // Roughly here. - file.message('Missing marker in block quote', { - line, - column: column - 2 - }); - } + // Closed ATX headings always must have a space between their content and + // the final hashes, thus, there is no `add x spaces`. + if (type === 'atx-closed') { + const final = pointEnd(node.children[node.children.length - 1]); + const diff = pointEnd(node).column - final.column - 1 - node.depth; + + if (diff) { + file.message( + 'Remove ' + + diff + + ' ' + + plural('space', diff) + + ' after this heading’s content', + final + ); } } }); } ); +var remarkLintNoHeadingContentIndent$1 = remarkLintNoHeadingContentIndent; + /** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-inline-padding + * @fileoverview + * Warn when phrasing content is padded with spaces between their markers and + * content. * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple + * Warns for emphasis, strong, delete, image, and link. * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$A = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule + * @example + * {"name": "ok.md"} + * + * Alpha [bravo](http://echo.fox/trot) + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * Alpha [ bravo ](http://echo.fox/trot) + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:7-1:38: Don’t pad `link` with inner spaces */ -function lintRule$A(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$B(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } +const remarkLintNoInlinePadding = lintRule( + 'remark-lint:no-inline-padding', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + // Note: `emphasis`, `strong`, `delete` (GFM) can’t have padding anymore + // since CM. + visit$2(tree, (node) => { + if ( + (node.type === 'link' || node.type === 'linkReference') && + !generated(node) + ) { + const value = toString(node); - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); + if (value.charAt(0) === ' ' || value.charAt(value.length - 1) === ' ') { + file.message('Don’t pad `' + node.type + '` with inner spaces', node); } - - next(); - })(tree, file, options); - } + } + }); } -} +); + +var remarkLintNoInlinePadding$1 = remarkLintNoInlinePadding; /** - * Coerce a value to a severity--options tuple. + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-shortcut-reference-image + * @fileoverview + * Warn when shortcut reference images are used. * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$B(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$A.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; + * Shortcut references render as images when a definition is found, and as + * plain text without definition. + * Sometimes, you don’t intend to create an image from the reference, but this + * rule still warns anyway. + * In that case, you can escape the reference like so: `!\[foo]`. + * + * @example + * {"name": "ok.md"} + * + * ![foo][] + * + * [foo]: http://foo.bar/baz.png + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * ![foo] + * + * [foo]: http://foo.bar/baz.png + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:7: Use the trailing [] on reference images + */ + +const remarkLintNoShortcutReferenceImage = lintRule( + 'remark-lint:no-shortcut-reference-image', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + visit$2(tree, 'imageReference', (node) => { + if (!generated(node) && node.referenceType === 'shortcut') { + file.message('Use the trailing [] on reference images', node); + } + }); } +); - let level = result[0]; +var remarkLintNoShortcutReferenceImage$1 = remarkLintNoShortcutReferenceImage; - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-shortcut-reference-link + * @fileoverview + * Warn when shortcut reference links are used. + * + * Shortcut references render as links when a definition is found, and as + * plain text without definition. + * Sometimes, you don’t intend to create a link from the reference, but this + * rule still warns anyway. + * In that case, you can escape the reference like so: `\[foo]`. + * + * @example + * {"name": "ok.md"} + * + * [foo][] + * + * [foo]: http://foo.bar/baz + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * [foo] + * + * [foo]: http://foo.bar/baz + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:6: Use the trailing `[]` on reference links + */ - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) +const remarkLintNoShortcutReferenceLink = lintRule( + 'remark-lint:no-shortcut-reference-link', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + visit$2(tree, 'linkReference', (node) => { + if (!generated(node) && node.referenceType === 'shortcut') { + file.message('Use the trailing `[]` on reference links', node); + } + }); } +); - result[0] = level; +var remarkLintNoShortcutReferenceLink$1 = remarkLintNoShortcutReferenceLink; - // @ts-expect-error: it’s now a valid tuple. - return result +/** + * Normalize an identifier (such as used in definitions). + * + * @param {string} value + * @returns {string} + */ +function normalizeIdentifier(value) { + return ( + value // Collapse Markdown whitespace. + .replace(/[\t\n\r ]+/g, ' ') // Trim. + .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase + // counterpart is uppercased will result in a different uppercase + // character. + // Hence, to get that form, we perform both lower- and uppercase. + // Upper case makes sure keys will not interact with default prototypal + // methods: no method is uppercase. + .toLowerCase() + .toUpperCase() + ) } /** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module no-undefined-references + * @fileoverview + * Warn when references to undefined definitions are found. * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * Options: `Object`, optional. * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test + * The object can have an `allow` field, set to an array of strings that may + * appear between `[` and `]`, but that should not be treated as link + * identifiers. + * + * @example + * {"name": "ok.md"} + * + * [foo][] + * + * Just a [ bracket. + * + * Typically, you’d want to use escapes (with a backslash: \\) to escape what + * could turn into a \[reference otherwise]. + * + * Just two braces can’t link: []. + * + * [foo]: https://example.com + * + * @example + * {"name": "ok-allow.md", "setting": {"allow": ["...", "…"]}} + * + * > Eliding a portion of a quoted passage […] is acceptable. + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * [bar] + * + * [baz][] + * + * [text][qux] + * + * Spread [over + * lines][] + * + * > in [a + * > block quote][] + * + * [asd][a + * + * Can include [*emphasis*]. + * + * Multiple pairs: [a][b][c]. + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:6: Found reference to undefined definition + * 3:1-3:8: Found reference to undefined definition + * 5:1-5:12: Found reference to undefined definition + * 7:8-8:9: Found reference to undefined definition + * 10:6-11:17: Found reference to undefined definition + * 13:1-13:6: Found reference to undefined definition + * 15:13-15:25: Found reference to undefined definition + * 17:17-17:23: Found reference to undefined definition + * 17:23-17:26: Found reference to undefined definition */ -const convert$y = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$x - } +const remarkLintNoUndefinedReferences = lintRule( + 'remark-lint:no-undefined-references', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = {}) => { + const contents = String(file); + const loc = location(file); + const lineEnding = /(\r?\n|\r)[\t ]*(>[\t ]*)*/g; + const allow = new Set( + (option.allow || []).map((d) => normalizeIdentifier(d)) + ); + /** @type {Record<string, boolean>} */ + const map = Object.create(null); - if (typeof test === 'string') { - return typeFactory$x(test) + visit$2(tree, (node) => { + if ( + (node.type === 'definition' || node.type === 'footnoteDefinition') && + !generated(node) + ) { + map[normalizeIdentifier(node.identifier)] = true; } + }); - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$x(test) : propsFactory$w(test) + visit$2(tree, (node) => { + // CM specifiers that references only form when defined. + // Still, they could be added by plugins, so let’s keep it. + /* c8 ignore next 10 */ + if ( + (node.type === 'imageReference' || + node.type === 'linkReference' || + node.type === 'footnoteReference') && + !generated(node) && + !(normalizeIdentifier(node.identifier) in map) && + !allow.has(normalizeIdentifier(node.identifier)) + ) { + file.message('Found reference to undefined definition', node); } - if (typeof test === 'function') { - return castFactory$w(test) + if (node.type === 'paragraph' || node.type === 'heading') { + findInPhrasing(node); } + }); - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$x(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; + /** + * @param {Heading|Paragraph} node + */ + function findInPhrasing(node) { + /** @type {Range[]} */ + let ranges = []; - while (++index < tests.length) { - checks[index] = convert$y(tests[index]); - } + visit$2(node, (child) => { + // Ignore the node itself. + if (child === node) return - return castFactory$w(any) + // Can’t have links in links, so reset ranges. + if (child.type === 'link' || child.type === 'linkReference') { + ranges = []; + return SKIP$2 + } - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; + // Enter non-text. + if (child.type !== 'text') return - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } + const start = pointStart(child).offset; + const end = pointEnd(child).offset; - return false - } -} + // Bail if there’s no positional info. + if (typeof start !== 'number' || typeof end !== 'number') { + return EXIT$2 + } -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$w(check) { - return castFactory$w(all) + const source = contents.slice(start, end); + /** @type {Array.<[number, string]>} */ + const lines = [[start, '']]; + let last = 0; - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; + lineEnding.lastIndex = 0; + let match = lineEnding.exec(source); - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } + while (match) { + const index = match.index; + lines[lines.length - 1][1] = source.slice(last, index); + last = index + match[0].length; + lines.push([start + last, '']); + match = lineEnding.exec(source); + } - return true - } -} + lines[lines.length - 1][1] = source.slice(last); + let lineIndex = -1; -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$x(check) { - return castFactory$w(type) + while (++lineIndex < lines.length) { + const line = lines[lineIndex][1]; + let index = 0; - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} + while (index < line.length) { + const code = line.charCodeAt(index); -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$w(check) { - return assertion + // Skip past escaped brackets. + if (code === 92) { + const next = line.charCodeAt(index + 1); + index++; - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} + if (next === 91 || next === 93) { + index++; + } + } + // Opening bracket. + else if (code === 91) { + ranges.push([lines[lineIndex][0] + index]); + index++; + } + // Close bracket. + else if (code === 93) { + // No opening. + if (ranges.length === 0) { + index++; + } else if (line.charCodeAt(index + 1) === 91) { + index++; -// Utility to return true. -function ok$x() { - return true -} + // Collapsed or full. + let range = ranges.pop(); -/** - * @param {string} d - * @returns {string} - */ -function color$y(d) { - return '\u001B[33m' + d + '\u001B[39m' -} + // Range should always exist. + // eslint-disable-next-line max-depth + if (range) { + range.push(lines[lineIndex][0] + index); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ + // This is the end of a reference already. + // eslint-disable-next-line max-depth + if (range.length === 4) { + handleRange(range); + range = []; + } -/** - * Continue traversing as normal - */ -const CONTINUE$y = true; -/** - * Do not traverse this node’s children - */ -const SKIP$y = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$y = false; + range.push(lines[lineIndex][0] + index); + ranges.push(range); + index++; + } + } else { + index++; -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$y = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } + // Shortcut or typical end of a reference. + const range = ranges.pop(); - const is = convert$y(test); - const step = reverse ? -1 : 1; + // Range should always exist. + // eslint-disable-next-line max-depth + if (range) { + range.push(lines[lineIndex][0] + index); + handleRange(range); + } + } + } + // Anything else. + else { + index++; + } + } + } + }); - factory(tree, null, [])(); + let index = -1; + + while (++index < ranges.length) { + handleRange(ranges[index]); + } + + return SKIP$2 /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents + * @param {Range} range */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + function handleRange(range) { + if (range.length === 1) return + if (range.length === 3) range.length = 2; - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$y(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } + // No need to warn for just `[]`. + if (range.length === 2 && range[0] + 2 === range[1]) return - return visit + const offset = range.length === 4 && range[2] + 2 !== range[3] ? 2 : 0; + const id = contents + .slice(range[0 + offset] + 1, range[1 + offset] - 1) + .replace(lineEnding, ' '); + const pos = { + start: loc.toPoint(range[0]), + end: loc.toPoint(range[range.length - 1]) + }; - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; + if ( + !generated({position: pos}) && + !(normalizeIdentifier(id) in map) && + !allow.has(normalizeIdentifier(id)) + ) { + file.message('Found reference to undefined definition', pos); + } + } + } + } +); - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$x(visitor(node, parents)); +var remarkLintNoUndefinedReferences$1 = remarkLintNoUndefinedReferences; - if (result[0] === EXIT$y) { - return result - } - } +/** + * @author Titus Wormer + * @copyright 2016 Titus Wormer + * @license MIT + * @module no-unused-definitions + * @fileoverview + * Warn when unused definitions are found. + * + * @example + * {"name": "ok.md"} + * + * [foo][] + * + * [foo]: https://example.com + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * [bar]: https://example.com + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:27: Found unused definition + */ - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$y) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); +const own$2 = {}.hasOwnProperty; - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); +const remarkLintNoUnusedDefinitions = lintRule( + 'remark-lint:no-unused-definitions', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + /** @type {Record<string, {node: DefinitionContent, used: boolean}>} */ + const map = Object.create(null); - if (subresult[0] === EXIT$y) { - return subresult - } + visit$2(tree, (node) => { + if ( + (node.type === 'definition' || node.type === 'footnoteDefinition') && + !generated(node) + ) { + map[node.identifier.toUpperCase()] = {node, used: false}; + } + }); - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } + visit$2(tree, (node) => { + if ( + node.type === 'imageReference' || + node.type === 'linkReference' || + node.type === 'footnoteReference' + ) { + const info = map[node.identifier.toUpperCase()]; - return result + if (!generated(node) && info) { + info.used = true; } } - } - ); + }); -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$x(value) { - if (Array.isArray(value)) { - return value - } + /** @type {string} */ + let identifier; - if (typeof value === 'number') { - return [CONTINUE$y, value] - } + for (identifier in map) { + if (own$2.call(map, identifier)) { + const entry = map[identifier]; - return [value] -} + if (!entry.used) { + file.message('Found unused definition', entry.node); + } + } + } + } +); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ +var remarkLintNoUnusedDefinitions$1 = remarkLintNoUnusedDefinitions; /** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false + * @fileoverview + * remark preset to configure `remark-lint` with settings that prevent + * mistakes or stuff that fails across vendors. */ -const visit$x = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - visitParents$y(tree, test, overload, reverse); +/** @type {Preset} */ +const remarkPresetLintRecommended = { + plugins: [ + remarkLint, + // Unix compatibility. + remarkLintFinalNewline$1, + // Rendering across vendors differs greatly if using other styles. + remarkLintListItemBulletIndent$1, + [remarkLintListItemIndent$1, 'tab-size'], + // Differs or unsupported across vendors. + remarkLintNoAutoLinkWithoutProtocol$1, + remarkLintNoBlockquoteWithoutMarker$1, + remarkLintNoLiteralUrls$1, + [remarkLintOrderedListMarkerStyle$1, '.'], + // Mistakes. + remarkLintHardBreakSpaces$1, + remarkLintNoDuplicateDefinitions$1, + remarkLintNoHeadingContentIndent$1, + remarkLintNoInlinePadding$1, + remarkLintNoShortcutReferenceImage$1, + remarkLintNoShortcutReferenceLink$1, + remarkLintNoUndefinedReferences$1, + remarkLintNoUnusedDefinitions$1 + ] +}; - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); +var remarkPresetLintRecommended$1 = remarkPresetLintRecommended; /** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module blockquote-indentation + * @fileoverview + * Warn when block quotes are indented too much or too little. * - * @typedef {Partial<Point>} PointLike + * Options: `number` or `'consistent'`, default: `'consistent'`. * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] + * `'consistent'` detects the first used indentation and will warn when + * other block quotes use a different indentation. * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] + * @example + * {"name": "ok.md", "setting": 4} + * + * > Hello + * + * Paragraph. + * + * > World + * @example + * {"name": "ok.md", "setting": 2} + * + * > Hello + * + * Paragraph. + * + * > World + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * > Hello + * + * Paragraph. + * + * > World + * + * Paragraph. + * + * > World + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 5:5: Remove 1 space between block quote and content + * 9:3: Add 1 space between block quote and content */ -var pointStart$n = point$o('start'); -var pointEnd$c = point$o('end'); +const remarkLintBlockquoteIndentation = lintRule( + 'remark-lint:blockquote-indentation', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + visit$2(tree, 'blockquote', (node) => { + if (generated(node) || node.children.length === 0) { + return + } -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$o(type) { - return point + if (option === 'consistent') { + option = check(node); + } else { + const diff = option - check(node); - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; + if (diff !== 0) { + const abs = Math.abs(diff); - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } + file.message( + (diff > 0 ? 'Add' : 'Remove') + + ' ' + + abs + + ' ' + + plural('space', abs) + + ' between block quote and content', + pointStart(node.children[0]) + ); + } + } + }); } +); + +var remarkLintBlockquoteIndentation$1 = remarkLintBlockquoteIndentation; + +/** + * @param {Blockquote} node + * @returns {number} + */ +function check(node) { + return pointStart(node.children[0]).column - pointStart(node).column } /** * @author Titus Wormer * @copyright 2015 Titus Wormer * @license MIT - * @module no-literal-urls + * @module checkbox-character-style * @fileoverview - * Warn for literal URLs in text. - * URLs are treated as links in some Markdown vendors, but not in others. - * To make sure they are always linked, wrap them in `<` (less than) and `>` - * (greater than). + * Warn when list item checkboxes violate a given style. + * + * Options: `Object` or `'consistent'`, default: `'consistent'`. + * + * `'consistent'` detects the first used checked and unchecked checkbox + * styles and warns when subsequent checkboxes use different styles. + * + * Styles can also be passed in like so: + * + * ```js + * {checked: 'x', unchecked: ' '} + * ``` * * ## Fix * * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * never creates literal URLs and always uses `<` (less than) and `>` - * (greater than). + * formats checked checkboxes using `x` (lowercase X) and unchecked checkboxes + * as `·` (a single space). * * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) * on how to automatically fix warnings for this rule. * * @example - * {"name": "ok.md"} + * {"name": "ok.md", "setting": {"checked": "x"}, "gfm": true} * - * <http://foo.bar/baz> + * - [x] List item + * - [x] List item + * + * @example + * {"name": "ok.md", "setting": {"checked": "X"}, "gfm": true} + * + * - [X] List item + * - [X] List item + * + * @example + * {"name": "ok.md", "setting": {"unchecked": " "}, "gfm": true} + * + * - [ ] List item + * - [ ] List item + * - [ ]·· + * - [ ] + * + * @example + * {"name": "ok.md", "setting": {"unchecked": "\t"}, "gfm": true} + * + * - [»] List item + * - [»] List item * * @example * {"name": "not-ok.md", "label": "input", "gfm": true} * - * http://foo.bar/baz + * - [x] List item + * - [X] List item + * - [ ] List item + * - [»] List item * * @example * {"name": "not-ok.md", "label": "output", "gfm": true} * - * 1:1-1:19: Don’t use literal URLs without angle brackets + * 2:5: Checked checkboxes should use `x` as a marker + * 4:5: Unchecked checkboxes should use ` ` as a marker + * + * @example + * {"setting": {"unchecked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true} + * + * 1:1: Incorrect unchecked checkbox marker `💩`: use either `'\t'`, or `' '` + * + * @example + * {"setting": {"checked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true} + * + * 1:1: Incorrect checked checkbox marker `💩`: use either `'x'`, or `'X'` */ -const remarkLintNoLiteralUrls = lintRule$A( - 'remark-lint:no-literal-urls', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$x(tree, 'link', (node) => { - const value = toString(node); +const remarkLintCheckboxCharacterStyle = lintRule( + 'remark-lint:checkbox-character-style', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + const value = String(file); + /** @type {'x'|'X'|'consistent'} */ + let checked = 'consistent'; + /** @type {' '|'\x09'|'consistent'} */ + let unchecked = 'consistent'; + + if (typeof option === 'object') { + checked = option.checked || 'consistent'; + unchecked = option.unchecked || 'consistent'; + } + + if (unchecked !== 'consistent' && unchecked !== ' ' && unchecked !== '\t') { + file.fail( + 'Incorrect unchecked checkbox marker `' + + unchecked + + "`: use either `'\\t'`, or `' '`" + ); + } + + if (checked !== 'consistent' && checked !== 'x' && checked !== 'X') { + file.fail( + 'Incorrect checked checkbox marker `' + + checked + + "`: use either `'x'`, or `'X'`" + ); + } + + visit$2(tree, 'listItem', (node) => { + const head = node.children[0]; + const point = pointStart(head); + // Exit early for items without checkbox. + // A list item cannot be checked and empty, according to GFM. if ( - !generated(node) && - pointStart$n(node).column === pointStart$n(node.children[0]).column && - pointEnd$c(node).column === - pointEnd$c(node.children[node.children.length - 1]).column && - (node.url === 'mailto:' + value || node.url === value) + typeof node.checked !== 'boolean' || + !head || + typeof point.offset !== 'number' ) { - file.message('Don’t use literal URLs without angle brackets', node); + return + } + + // Move back to before `] `. + point.offset -= 2; + point.column -= 2; + + // Assume we start with a checkbox, because well, `checked` is set. + const match = /\[([\t Xx])]/.exec( + value.slice(point.offset - 2, point.offset + 1) + ); + + // Failsafe to make sure we don‘t crash if there actually isn’t a checkbox. + /* c8 ignore next */ + if (!match) return + + const style = node.checked ? checked : unchecked; + + if (style === 'consistent') { + if (node.checked) { + // @ts-expect-error: valid marker. + checked = match[1]; + } else { + // @ts-expect-error: valid marker. + unchecked = match[1]; + } + } else if (match[1] !== style) { + file.message( + (node.checked ? 'Checked' : 'Unchecked') + + ' checkboxes should use `' + + style + + '` as a marker', + point + ); } }); } ); +var remarkLintCheckboxCharacterStyle$1 = remarkLintCheckboxCharacterStyle; + /** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module checkbox-content-indent + * @fileoverview + * Warn when list item checkboxes are followed by too much whitespace. * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple + * @example + * {"name": "ok.md", "gfm": true} * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} + * - [ ] List item + * + [x] List Item + * * [X] List item + * - [ ] List item + * + * @example + * {"name": "not-ok.md", "label": "input", "gfm": true} + * + * - [ ] List item + * + [x] List item + * * [X] List item + * - [ ] List item + * + * @example + * {"name": "not-ok.md", "label": "output", "gfm": true} + * + * 2:7-2:8: Checkboxes should be followed by a single character + * 3:7-3:9: Checkboxes should be followed by a single character + * 4:7-4:10: Checkboxes should be followed by a single character */ -const primitives$z = new Set(['string', 'number', 'boolean']); +const remarkLintCheckboxContentIndent = lintRule( + 'remark-lint:checkbox-content-indent', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + const value = String(file); + const loc = location(file); -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$z(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; + visit$2(tree, 'listItem', (node) => { + const head = node.children[0]; + const point = pointStart(head); - Object.defineProperty(plugin, 'name', {value: id}); + // Exit early for items without checkbox. + // A list item cannot be checked and empty, according to GFM. + if ( + typeof node.checked !== 'boolean' || + !head || + typeof point.offset !== 'number' + ) { + return + } - return plugin + // Assume we start with a checkbox, because well, `checked` is set. + const match = /\[([\t xX])]/.exec( + value.slice(point.offset - 4, point.offset + 1) + ); - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$A(ruleId, raw); + // Failsafe to make sure we don‘t crash if there actually isn’t a checkbox. + /* c8 ignore next */ + if (!match) return - if (!severity) return + // Move past checkbox. + const initial = point.offset; + let final = initial; - const fatal = severity === 2; + while (/[\t ]/.test(value.charAt(final))) final++; - return (tree, file, next) => { - let index = file.messages.length - 1; + if (final - initial > 0) { + file.message('Checkboxes should be followed by a single character', { + start: loc.toPoint(initial), + end: loc.toPoint(final) + }); + } + }); + } +); - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} +var remarkLintCheckboxContentIndent$1 = remarkLintCheckboxContentIndent; /** - * Coerce a value to a severity--options tuple. + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module code-block-style + * @fileoverview + * Warn when code blocks do not adhere to a given style. * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} + * Options: `'consistent'`, `'fenced'`, or `'indented'`, default: `'consistent'`. + * + * `'consistent'` detects the first used code block style and warns when + * subsequent code blocks uses different styles. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * formats code blocks using a fence if they have a language flag and + * indentation if not. + * Pass + * [`fences: true`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsfences) + * to always use fences for code blocks. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"setting": "indented", "name": "ok.md"} + * + * alpha() + * + * Paragraph. + * + * bravo() + * + * @example + * {"setting": "indented", "name": "not-ok.md", "label": "input"} + * + * ``` + * alpha() + * ``` + * + * Paragraph. + * + * ``` + * bravo() + * ``` + * + * @example + * {"setting": "indented", "name": "not-ok.md", "label": "output"} + * + * 1:1-3:4: Code blocks should be indented + * 7:1-9:4: Code blocks should be indented + * + * @example + * {"setting": "fenced", "name": "ok.md"} + * + * ``` + * alpha() + * ``` + * + * Paragraph. + * + * ``` + * bravo() + * ``` + * + * @example + * {"setting": "fenced", "name": "not-ok-fenced.md", "label": "input"} + * + * alpha() + * + * Paragraph. + * + * bravo() + * + * @example + * {"setting": "fenced", "name": "not-ok-fenced.md", "label": "output"} + * + * 1:1-1:12: Code blocks should be fenced + * 5:1-5:12: Code blocks should be fenced + * + * @example + * {"name": "not-ok-consistent.md", "label": "input"} + * + * alpha() + * + * Paragraph. + * + * ``` + * bravo() + * ``` + * + * @example + * {"name": "not-ok-consistent.md", "label": "output"} + * + * 5:1-7:4: Code blocks should be indented + * + * @example + * {"setting": "💩", "name": "not-ok-incorrect.md", "label": "output", "positionless": true} + * + * 1:1: Incorrect code block style `💩`: use either `'consistent'`, `'fenced'`, or `'indented'` */ -function coerce$A(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$z.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - let level = result[0]; +const remarkLintCodeBlockStyle = lintRule( + 'remark-lint:code-block-style', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + const value = String(file); - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; + if ( + option !== 'consistent' && + option !== 'fenced' && + option !== 'indented' + ) { + file.fail( + 'Incorrect code block style `' + + option + + "`: use either `'consistent'`, `'fenced'`, or `'indented'`" + ); } - } - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } + visit$2(tree, 'code', (node) => { + if (generated(node)) { + return + } - result[0] = level; + const initial = pointStart(node).offset; + const final = pointEnd(node).offset; - // @ts-expect-error: it’s now a valid tuple. - return result -} + const current = + node.lang || /^\s*([~`])\1{2,}/.test(value.slice(initial, final)) + ? 'fenced' + : 'indented'; + + if (option === 'consistent') { + option = current; + } else if (option !== current) { + file.message('Code blocks should be ' + option, node); + } + }); + } +); + +var remarkLintCodeBlockStyle$1 = remarkLintCodeBlockStyle; /** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module definition-spacing + * @fileoverview + * Warn when consecutive whitespace is used in a definition. * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * @example + * {"name": "ok.md"} * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test + * [example domain]: http://example.com "Example Domain" + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * [example····domain]: http://example.com "Example Domain" + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:57: Do not use consecutive whitespace in definition labels */ -const convert$x = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$w - } +const label = /^\s*\[((?:\\[\s\S]|[^[\]])+)]/; - if (typeof test === 'string') { - return typeFactory$w(test) - } +const remarkLintDefinitionSpacing = lintRule( + 'remark-lint:definition-spacing', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + const value = String(file); - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$w(test) : propsFactory$v(test) - } + visit$2(tree, (node) => { + if (node.type === 'definition' || node.type === 'footnoteDefinition') { + const start = pointStart(node).offset; + const end = pointEnd(node).offset; - if (typeof test === 'function') { - return castFactory$v(test) + if (typeof start === 'number' && typeof end === 'number') { + const match = value.slice(start, end).match(label); + + if (match && /[ \t\n]{2,}/.test(match[1])) { + file.message( + 'Do not use consecutive whitespace in definition labels', + node + ); + } + } } + }); + } +); + +var remarkLintDefinitionSpacing$1 = remarkLintDefinitionSpacing; - throw new Error('Expected function, string, or object as test') - } - ); /** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module fenced-code-flag + * @fileoverview + * Check fenced code block flags. + * + * Options: `Array.<string>` or `Object`, optional. + * + * Providing an array is as passing `{flags: Array}`. + * + * The object can have an array of `'flags'` which are allowed: other flags + * will not be allowed. + * An `allowEmpty` field (`boolean`, default: `false`) can be set to allow + * code blocks without language flags. + * + * @example + * {"name": "ok.md"} + * + * ```alpha + * bravo() + * ``` + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * ``` + * alpha() + * ``` + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-3:4: Missing code language flag + * + * @example + * {"name": "ok.md", "setting": {"allowEmpty": true}} + * + * ``` + * alpha() + * ``` + * + * @example + * {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "input"} + * + * ``` + * alpha() + * ``` + * + * @example + * {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "output"} + * + * 1:1-3:4: Missing code language flag + * + * @example + * {"name": "ok.md", "setting": ["alpha"]} + * + * ```alpha + * bravo() + * ``` + * + * @example + * {"name": "ok.md", "setting": {"flags":["alpha"]}} + * + * ```alpha + * bravo() + * ``` + * + * @example + * {"name": "not-ok.md", "setting": ["charlie"], "label": "input"} + * + * ```alpha + * bravo() + * ``` + * + * @example + * {"name": "not-ok.md", "setting": ["charlie"], "label": "output"} + * + * 1:1-3:4: Incorrect code language flag */ -function anyFactory$w(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - while (++index < tests.length) { - checks[index] = convert$x(tests[index]); - } +const fence = /^ {0,3}([~`])\1{2,}/; - return castFactory$v(any) +const remarkLintFencedCodeFlag = lintRule( + 'remark-lint:fenced-code-flag', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option) => { + const value = String(file); + let allowEmpty = false; + /** @type {string[]} */ + let allowed = []; - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; + if (typeof option === 'object') { + if (Array.isArray(option)) { + allowed = option; + } else { + allowEmpty = Boolean(option.allowEmpty); - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true + if (option.flags) { + allowed = option.flags; + } + } } - return false + visit$2(tree, 'code', (node) => { + if (!generated(node)) { + if (node.lang) { + if (allowed.length > 0 && !allowed.includes(node.lang)) { + file.message('Incorrect code language flag', node); + } + } else { + const slice = value.slice( + pointStart(node).offset, + pointEnd(node).offset + ); + + if (!allowEmpty && fence.test(slice)) { + file.message('Missing code language flag', node); + } + } + } + }); } -} +); + +var remarkLintFencedCodeFlag$1 = remarkLintFencedCodeFlag; /** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module fenced-code-marker + * @fileoverview + * Warn for violating fenced code markers. * - * @param {Props} check - * @returns {AssertAnything} + * Options: `` '`' ``, `'~'`, or `'consistent'`, default: `'consistent'`. + * + * `'consistent'` detects the first used fenced code marker style and warns + * when subsequent fenced code blocks use different styles. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * formats fences using ``'`'`` (grave accent) by default. + * Pass + * [`fence: '~'`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsfence) + * to use `~` (tilde) instead. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * Indented code blocks are not affected by this rule: + * + * bravo() + * + * @example + * {"name": "ok.md", "setting": "`"} + * + * ```alpha + * bravo() + * ``` + * + * ``` + * charlie() + * ``` + * + * @example + * {"name": "ok.md", "setting": "~"} + * + * ~~~alpha + * bravo() + * ~~~ + * + * ~~~ + * charlie() + * ~~~ + * + * @example + * {"name": "not-ok-consistent-tick.md", "label": "input"} + * + * ```alpha + * bravo() + * ``` + * + * ~~~ + * charlie() + * ~~~ + * + * @example + * {"name": "not-ok-consistent-tick.md", "label": "output"} + * + * 5:1-7:4: Fenced code should use `` ` `` as a marker + * + * @example + * {"name": "not-ok-consistent-tilde.md", "label": "input"} + * + * ~~~alpha + * bravo() + * ~~~ + * + * ``` + * charlie() + * ``` + * + * @example + * {"name": "not-ok-consistent-tilde.md", "label": "output"} + * + * 5:1-7:4: Fenced code should use `~` as a marker + * + * @example + * {"name": "not-ok-incorrect.md", "setting": "💩", "label": "output", "positionless": true} + * + * 1:1: Incorrect fenced code marker `💩`: use either `'consistent'`, `` '`' ``, or `'~'` */ -function propsFactory$v(check) { - return castFactory$v(all) - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; +const remarkLintFencedCodeMarker = lintRule( + 'remark-lint:fenced-code-marker', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + const contents = String(file); - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false + if (option !== 'consistent' && option !== '~' && option !== '`') { + file.fail( + 'Incorrect fenced code marker `' + + option + + "`: use either `'consistent'`, `` '`' ``, or `'~'`" + ); } - return true - } -} + visit$2(tree, 'code', (node) => { + const start = pointStart(node).offset; -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$w(check) { - return castFactory$v(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$v(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$w() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$x(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$x = true; -/** - * Do not traverse this node’s children - */ -const SKIP$x = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$x = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$x = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$x(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$x(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$w(visitor(node, parents)); - - if (result[0] === EXIT$x) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$x) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$x) { - return subresult - } + if (typeof start === 'number') { + const marker = contents + .slice(start, start + 4) + .replace(/^\s+/, '') + .charAt(0); - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } + // Ignore unfenced code blocks. + if (marker === '~' || marker === '`') { + if (option === 'consistent') { + option = marker; + } else if (marker !== option) { + file.message( + 'Fenced code should use `' + + (option === '~' ? option : '` ` `') + + '` as a marker', + node + ); } - - return result } } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$w(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$x, value] + }); } +); - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ +var remarkLintFencedCodeMarker$1 = remarkLintFencedCodeMarker; /** - * Visit children of tree which pass a test + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module file-extension + * @fileoverview + * Warn when the file extension differ from the preferred extension. * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false + * Does not warn when given documents have no file extensions (such as + * `AUTHORS` or `LICENSE`). + * + * Options: `string`, default: `'md'` — Expected file extension. + * + * @example + * {"name": "readme.md"} + * + * @example + * {"name": "readme"} + * + * @example + * {"name": "readme.mkd", "label": "output", "positionless": true} + * + * 1:1: Incorrect extension: use `md` + * + * @example + * {"name": "readme.mkd", "setting": "mkd"} */ -const visit$w = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - visitParents$x(tree, test, overload, reverse); +const remarkLintFileExtension = lintRule( + 'remark-lint:file-extension', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (_, file, option = 'md') => { + const ext = file.extname; - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } + if (ext && ext.slice(1) !== option) { + file.message('Incorrect extension: use `' + option + '`'); } - ); + } +); + +var remarkLintFileExtension$1 = remarkLintFileExtension; /** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module final-definition + * @fileoverview + * Warn when definitions are placed somewhere other than at the end of + * the file. * - * @typedef {Partial<Point>} PointLike + * @example + * {"name": "ok.md"} * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] + * Paragraph. * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] + * [example]: http://example.com "Example Domain" + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * Paragraph. + * + * [example]: http://example.com "Example Domain" + * + * Another paragraph. + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 3:1-3:47: Move definitions to the end of the file (after the node at line `5`) + * + * @example + * {"name": "ok-comments.md"} + * + * Paragraph. + * + * [example-1]: http://example.com/one/ + * + * <!-- Comments are fine between and after definitions --> + * + * [example-2]: http://example.com/two/ */ -var pointStart$m = point$n('start'); +const remarkLintFinalDefinition = lintRule( + 'remark-lint:final-definition', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + let last = 0; -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$n(type) { - return point + visit$2( + tree, + (node) => { + // Ignore generated and HTML comment nodes. + if ( + node.type === 'root' || + generated(node) || + (node.type === 'html' && /^\s*<!--/.test(node.value)) + ) { + return + } - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; + const line = pointStart(node).line; - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } + if (node.type === 'definition') { + if (last && last > line) { + file.message( + 'Move definitions to the end of the file (after the node at line `' + + last + + '`)', + node + ); + } + } else if (last === 0) { + last = line; + } + }, + true + ); } -} +); + +var remarkLintFinalDefinition$1 = remarkLintFinalDefinition; /** * @author Titus Wormer * @copyright 2015 Titus Wormer * @license MIT - * @module ordered-list-marker-style + * @module first-heading-level * @fileoverview - * Warn when the list item marker style of ordered lists violate a given style. - * - * Options: `'consistent'`, `'.'`, or `')'`, default: `'consistent'`. + * Warn when the first heading has a level other than a specified value. * - * `'consistent'` detects the first used list style and warns when subsequent - * lists use different styles. + * Options: `number`, default: `1`. * * @example * {"name": "ok.md"} * - * 1. Foo + * # The default is to expect a level one heading + * + * @example + * {"name": "ok-html.md"} * + * <h1>An HTML heading is also seen by this rule.</h1> * - * 1. Bar + * @example + * {"name": "ok-delayed.md"} * - * Unordered lists are not affected by this rule. + * You can use markdown content before the heading. * - * * Foo + * <div>Or non-heading HTML</div> + * + * <h1>So the first heading, be it HTML or markdown, is checked</h1> * * @example - * {"name": "ok.md", "setting": "."} + * {"name": "not-ok.md", "label": "input"} * - * 1. Foo + * ## Bravo * - * 2. Bar + * Paragraph. * * @example - * {"name": "ok.md", "setting": ")"} + * {"name": "not-ok.md", "label": "output"} * - * 1) Foo + * 1:1-1:9: First heading level should be `1` * - * 2) Bar + * @example + * {"name": "not-ok-html.md", "label": "input"} + * + * <h2>Charlie</h2> + * + * Paragraph. * * @example - * {"name": "not-ok.md", "label": "input"} + * {"name": "not-ok-html.md", "label": "output"} * - * 1. Foo + * 1:1-1:17: First heading level should be `1` * - * 2) Bar + * @example + * {"name": "ok.md", "setting": 2} + * + * ## Delta + * + * Paragraph. * * @example - * {"name": "not-ok.md", "label": "output"} + * {"name": "ok-html.md", "setting": 2} * - * 3:1-3:8: Marker style should be `.` + * <h2>Echo</h2> + * + * Paragraph. * * @example - * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true} + * {"name": "not-ok.md", "setting": 2, "label": "input"} * - * 1:1: Incorrect ordered list item marker style `💩`: use either `'.'` or `')'` + * # Foxtrot + * + * Paragraph. + * + * @example + * {"name": "not-ok.md", "setting": 2, "label": "output"} + * + * 1:1-1:10: First heading level should be `2` + * + * @example + * {"name": "not-ok-html.md", "setting": 2, "label": "input"} + * + * <h1>Golf</h1> + * + * Paragraph. + * + * @example + * {"name": "not-ok-html.md", "setting": 2, "label": "output"} + * + * 1:1-1:14: First heading level should be `2` */ -const remarkLintOrderedListMarkerStyle = lintRule$z( - 'remark-lint:ordered-list-marker-style', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - const value = String(file); - - if (option !== 'consistent' && option !== '.' && option !== ')') { - file.fail( - 'Incorrect ordered list item marker style `' + - option + - "`: use either `'.'` or `')'`" - ); - } - - visit$w(tree, 'list', (node) => { - let index = -1; - - if (!node.ordered) return +const re$3 = /<h([1-6])/; - while (++index < node.children.length) { - const child = node.children[index]; +const remarkLintFirstHeadingLevel = lintRule( + 'remark-lint:first-heading-level', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 1) => { + visit$2(tree, (node) => { + if (!generated(node)) { + /** @type {Depth|undefined} */ + let rank; - if (!generated(child)) { - const marker = /** @type {Marker} */ ( - value - .slice( - pointStart$m(child).offset, - pointStart$m(child.children[0]).offset - ) - .replace(/\s|\d/g, '') - .replace(/\[[x ]?]\s*$/i, '') - ); + if (node.type === 'heading') { + rank = node.depth; + } else if (node.type === 'html') { + rank = infer(node); + } - if (option === 'consistent') { - option = marker; - } else if (marker !== option) { - file.message('Marker style should be `' + option + '`', child); + if (rank !== undefined) { + if (rank !== option) { + file.message('First heading level should be `' + option + '`', node); } + + return EXIT$2 } } }); } ); +var remarkLintFirstHeadingLevel$1 = remarkLintFirstHeadingLevel; + /** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} + * @param {HTML} node + * @returns {Depth|undefined} */ - -const primitives$y = new Set(['string', 'number', 'boolean']); +function infer(node) { + const results = node.value.match(re$3); + // @ts-expect-error: can be castes fine. + return results ? Number(results[1]) : undefined +} /** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$y(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$z(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module heading-style + * @fileoverview + * Warn when a heading does not conform to a given style. * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$z(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$y.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * Options: `'consistent'`, `'atx'`, `'atx-closed'`, or `'setext'`, + * default: `'consistent'`. * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * `'consistent'` detects the first used heading style and warns when + * subsequent headings use different styles. * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$w = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$v - } - - if (typeof test === 'string') { - return typeFactory$v(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$v(test) : propsFactory$u(test) - } - - if (typeof test === 'function') { - return castFactory$u(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$v(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$w(tests[index]); - } - - return castFactory$u(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. + * ## Fix * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$u(check) { - return castFactory$u(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * formats headings as ATX by default. + * This can be configured with the + * [`setext`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionssetext) + * and + * [`closeAtx`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionscloseatx) + * options. * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$v(check) { - return castFactory$u(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$u(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$v() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$w(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$w = true; -/** - * Do not traverse this node’s children - */ -const SKIP$w = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$w = false; - -/** - * Visit children of tree which pass a test + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$w = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$w(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$w(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$v(visitor(node, parents)); - - if (result[0] === EXIT$w) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$w) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$w) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$v(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$w, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test + * @example + * {"name": "ok.md", "setting": "atx"} * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$v = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$w(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point + * # Alpha * - * @typedef {Partial<Point>} PointLike + * ## Bravo * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] + * ### Charlie * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$l = point$m('start'); -var pointEnd$b = point$m('end'); - -/** - * Get the positional info of `node`. + * @example + * {"name": "ok.md", "setting": "atx-closed"} * - * @param {'start'|'end'} type - */ -function point$m(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module hard-break-spaces - * @fileoverview - * Warn when too many spaces are used to create a hard break. + * # Delta ## * - * @example - * {"name": "ok.md"} + * ## Echo ## * - * Lorem ipsum·· - * dolor sit amet + * ### Foxtrot ### * * @example - * {"name": "not-ok.md", "label": "input"} + * {"name": "ok.md", "setting": "setext"} * - * Lorem ipsum··· - * dolor sit amet. + * Golf + * ==== * - * @example - * {"name": "not-ok.md", "label": "output"} + * Hotel + * ----- * - * 1:12-2:1: Use two spaces for hard line breaks + * ### India + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * Juliett + * ======= + * + * ## Kilo + * + * ### Lima ### + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 4:1-4:8: Headings should use setext + * 6:1-6:13: Headings should use setext + * + * @example + * {"name": "not-ok.md", "setting": "💩", "label": "output", "positionless": true} + * + * 1:1: Incorrect heading style type `💩`: use either `'consistent'`, `'atx'`, `'atx-closed'`, or `'setext'` */ -const remarkLintHardBreakSpaces = lintRule$y( - 'remark-lint:hard-break-spaces', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - const value = String(file); +const remarkLintHeadingStyle = lintRule( + 'remark-lint:heading-style', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + if ( + option !== 'consistent' && + option !== 'atx' && + option !== 'atx-closed' && + option !== 'setext' + ) { + file.fail( + 'Incorrect heading style type `' + + option + + "`: use either `'consistent'`, `'atx'`, `'atx-closed'`, or `'setext'`" + ); + } - visit$v(tree, 'break', (node) => { + visit$2(tree, 'heading', (node) => { if (!generated(node)) { - const slice = value - .slice(pointStart$l(node).offset, pointEnd$b(node).offset) - .split('\n', 1)[0] - .replace(/\r$/, ''); - - if (slice.length > 2) { - file.message('Use two spaces for hard line breaks', node); + if (option === 'consistent') { + // Funky nodes perhaps cannot be detected. + /* c8 ignore next */ + option = headingStyle(node) || 'consistent'; + } else if (headingStyle(node, option) !== option) { + file.message('Headings should use ' + option, node); } } }); } ); +var remarkLintHeadingStyle$1 = remarkLintHeadingStyle; + /** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module maximum-line-length + * @fileoverview + * Warn when lines are too long. * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple + * Options: `number`, default: `80`. * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$x = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$x(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$y(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. + * Ignores nodes that cannot be wrapped, such as headings, tables, code, + * definitions, HTML, and JSX. * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$y(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$x.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point + * Ignores images, links, and inline code if they start before the wrap, end + * after the wrap, and there’s no whitespace after them. * - * @typedef {Partial<Point>} PointLike + * @example + * {"name": "ok.md", "positionless": true, "gfm": true} * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] + * This line is simply not toooooooooooooooooooooooooooooooooooooooooooo + * long. * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$k = point$l('start'); - -/** - * Get the positional info of `node`. + * This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?query=variables> * - * @param {'start'|'end'} type - */ -function point$l(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -var own$2 = {}.hasOwnProperty; - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - */ - -/** - * Stringify one point, a position (start and end points), or a node’s - * positional information. + * <http://this-link-is-fine.com> * - * @param {Node|Position|Point} [value] - * @returns {string} - */ -function stringifyPosition(value) { - // Nothing. - if (!value || typeof value !== 'object') { - return '' - } - - // Node. - if (own$2.call(value, 'position') || own$2.call(value, 'type')) { - // @ts-ignore looks like a node. - return position$2(value.position) - } - - // Position. - if (own$2.call(value, 'start') || own$2.call(value, 'end')) { - // @ts-ignore looks like a position. - return position$2(value) - } - - // Point. - if (own$2.call(value, 'line') || own$2.call(value, 'column')) { - // @ts-ignore looks like a point. - return point$k(value) - } - - // ? - return '' -} - -/** - * @param {Point} point - * @returns {string} - */ -function point$k(point) { - return index(point && point.line) + ':' + index(point && point.column) -} - -/** - * @param {Position} pos - * @returns {string} - */ -function position$2(pos) { - return point$k(pos && pos.start) + '-' + point$k(pos && pos.end) -} - -/** - * @param {number} value - * @returns {number} - */ -function index(value) { - return value && typeof value === 'number' ? value : 1 -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * `alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscarPapaQuebec.romeo()` * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * [foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$v = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$u - } - - if (typeof test === 'string') { - return typeFactory$u(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$u(test) : propsFactory$t(test) - } - - if (typeof test === 'function') { - return castFactory$t(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$u(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$v(tests[index]); - } - - return castFactory$t(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. + * <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$t(check) { - return castFactory$t(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. + *  * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$u(check) { - return castFactory$t(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$t(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$u() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$v(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$v = true; -/** - * Do not traverse this node’s children - */ -const SKIP$v = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$v = false; - -/** - * Visit children of tree which pass a test + * | An | exception | is | line | length | in | long | tables | because | those | can’t | just | + * | -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- | + * | be | helped | | | | | | | | | | . | * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$v = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$v(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$v(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$u(visitor(node, parents)); - - if (result[0] === EXIT$v) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$v) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$v) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$u(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$v, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test + * <a><b><i><p><q><s><u>alpha bravo charlie delta echo foxtrot golf</u></s></q></p></i></b></a> * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$u = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$v(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-duplicate-definitions - * @fileoverview - * Warn when duplicate definitions are found. + * The following is also fine, because there is no whitespace. * - * @example - * {"name": "ok.md"} + * <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>. * - * [foo]: bar - * [baz]: qux + * In addition, definitions are also fine: + * + * [foo]: <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> * * @example - * {"name": "not-ok.md", "label": "input"} + * {"name": "not-ok.md", "setting": 80, "label": "input", "positionless": true} * - * [foo]: bar - * [foo]: qux + * This line is simply not tooooooooooooooooooooooooooooooooooooooooooooooooooooooo + * long. * - * @example - * {"name": "not-ok.md", "label": "output"} + * Just like thiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis one. * - * 2:1-2:11: Do not use definitions with the same identifier (1:1) - */ - -const remarkLintNoDuplicateDefinitions = lintRule$x( - 'remark-lint:no-duplicate-definitions', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - /** @type {Record<string, string>} */ - const map = Object.create(null); - - visit$u(tree, (node) => { - if ( - (node.type === 'definition' || node.type === 'footnoteDefinition') && - !generated(node) - ) { - const identifier = node.identifier; - const duplicate = map[identifier]; - - if (duplicate) { - file.message( - 'Do not use definitions with the same identifier (' + - duplicate + - ')', - node - ); - } - - map[identifier] = stringifyPosition(pointStart$k(node)); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile + * And this one is also very wrong: because the link starts aaaaaaafter the column: <http://line.com> * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple + * <http://this-long-url-with-a-long-domain-is-not-ok.co.uk/a-long-path?query=variables> and such. * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$w = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$w(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$x(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. + * And this one is also very wrong: because the code starts aaaaaaafter the column: `alpha.bravo()` * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$x(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$w.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * `alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscar.papa()` and such. * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * @example + * {"name": "not-ok.md", "setting": 80, "label": "output", "positionless": true} * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$u = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$t - } - - if (typeof test === 'string') { - return typeFactory$t(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$t(test) : propsFactory$s(test) - } - - if (typeof test === 'function') { - return castFactory$s(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$t(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$u(tests[index]); - } - - return castFactory$s(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. + * 4:86: Line must be at most 80 characters + * 6:99: Line must be at most 80 characters + * 8:96: Line must be at most 80 characters + * 10:97: Line must be at most 80 characters + * 12:99: Line must be at most 80 characters * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$s(check) { - return castFactory$s(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. + * @example + * {"name": "ok-mixed-line-endings.md", "setting": 10, "positionless": true} * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$t(check) { - return castFactory$s(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$s(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$t() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$u(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$u = true; -/** - * Do not traverse this node’s children - */ -const SKIP$u = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$u = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$u = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$u(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$u(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$t(visitor(node, parents)); - - if (result[0] === EXIT$u) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$u) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$u) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$t(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$u, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$t = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$u(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('mdast').Heading} Heading - * @typedef {'atx'|'atx-closed'|'setext'} Style - */ - -/** - * @param {Heading} node - * @param {Style} [relative] - * @returns {Style|null} - */ -function headingStyle(node, relative) { - var last = node.children[node.children.length - 1]; - var depth = node.depth; - var pos = node && node.position && node.position.end; - var final = last && last.position && last.position.end; - - if (!pos) { - return null - } - - // This can only occur for `'atx'` and `'atx-closed'` headings. - // This might incorrectly match `'atx'` headings with lots of trailing white - // space as an `'atx-closed'` heading. - if (!last) { - if (pos.column - 1 <= depth * 2) { - return consolidate(depth, relative) - } - - return 'atx-closed' - } - - if (final.line + 1 === pos.line) { - return 'setext' - } - - if (final.column + depth < pos.column) { - return 'atx-closed' - } - - return consolidate(depth, relative) -} - -/** - * Get the probable style of an atx-heading, depending on preferred style. - * - * @param {number} depth - * @param {Style} relative - * @returns {Style|null} - */ -function consolidate(depth, relative) { - return depth < 3 - ? 'atx' - : relative === 'atx' || relative === 'setext' - ? relative - : null -} - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$j = point$j('start'); -var pointEnd$a = point$j('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$j(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-heading-content-indent - * @fileoverview - * Warn when content of headings is indented. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * removes all unneeded padding around content in headings. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md"} - * - * #·Foo - * - * ## Bar·## - * - * ##·Baz - * - * Setext headings are not affected. - * - * Baz - * === - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * #··Foo - * - * ## Bar··## - * - * ##··Baz + * 0123456789␍␊ + * 0123456789␊ + * 01234␍␊ + * 01234␊ * * @example - * {"name": "not-ok.md", "label": "output"} + * {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "input", "positionless": true} * - * 1:4: Remove 1 space before this heading’s content - * 3:7: Remove 1 space after this heading’s content - * 5:7: Remove 1 space before this heading’s content + * 012345678901␍␊ + * 012345678901␊ + * 01234567890␍␊ + * 01234567890␊ * * @example - * {"name": "empty-heading.md"} - * - * #·· - */ - -const remarkLintNoHeadingContentIndent = lintRule$w( - 'remark-lint:no-heading-content-indent', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$t(tree, 'heading', (node) => { - if (generated(node)) { - return - } - - const type = headingStyle(node, 'atx'); - - if (type === 'atx' || type === 'atx-closed') { - const head = pointStart$j(node.children[0]).column; - - // Ignore empty headings. - if (!head) { - return - } - - const diff = head - pointStart$j(node).column - 1 - node.depth; - - if (diff) { - file.message( - 'Remove ' + - Math.abs(diff) + - ' ' + - plural('space', Math.abs(diff)) + - ' before this heading’s content', - pointStart$j(node.children[0]) - ); - } - } - - // Closed ATX headings always must have a space between their content and - // the final hashes, thus, there is no `add x spaces`. - if (type === 'atx-closed') { - const final = pointEnd$a(node.children[node.children.length - 1]); - const diff = pointEnd$a(node).column - final.column - 1 - node.depth; - - if (diff) { - file.message( - 'Remove ' + - diff + - ' ' + - plural('space', diff) + - ' after this heading’s content', - final - ); - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$v = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$v(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$w(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$w(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$v.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$t = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$s - } - - if (typeof test === 'string') { - return typeFactory$s(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$s(test) : propsFactory$r(test) - } - - if (typeof test === 'function') { - return castFactory$r(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$s(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$t(tests[index]); - } - - return castFactory$r(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$r(check) { - return castFactory$r(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$s(check) { - return castFactory$r(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$r(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$s() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$t(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$t = true; -/** - * Do not traverse this node’s children - */ -const SKIP$t = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$t = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$t = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$t(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$t(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$s(visitor(node, parents)); - - if (result[0] === EXIT$t) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$t) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$t) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$s(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$t, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$s = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$t(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-inline-padding - * @fileoverview - * Warn when phrasing content is padded with spaces between their markers and - * content. - * - * Warns for emphasis, strong, delete, image, and link. - * - * @example - * {"name": "ok.md"} - * - * Alpha [bravo](http://echo.fox/trot) - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * Alpha [ bravo ](http://echo.fox/trot) - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:7-1:38: Don’t pad `link` with inner spaces - */ - -const remarkLintNoInlinePadding = lintRule$v( - 'remark-lint:no-inline-padding', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - // Note: `emphasis`, `strong`, `delete` (GFM) can’t have padding anymore - // since CM. - visit$s(tree, (node) => { - if ( - (node.type === 'link' || node.type === 'linkReference') && - !generated(node) - ) { - const value = toString(node); - - if (value.charAt(0) === ' ' || value.charAt(value.length - 1) === ' ') { - file.message('Don’t pad `' + node.type + '` with inner spaces', node); - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$u = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$u(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$v(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$v(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$u.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$s = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$r - } - - if (typeof test === 'string') { - return typeFactory$r(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$r(test) : propsFactory$q(test) - } - - if (typeof test === 'function') { - return castFactory$q(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$r(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$s(tests[index]); - } - - return castFactory$q(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$q(check) { - return castFactory$q(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$r(check) { - return castFactory$q(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$q(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$r() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$s(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$s = true; -/** - * Do not traverse this node’s children - */ -const SKIP$s = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$s = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$s = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$s(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$s(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$r(visitor(node, parents)); - - if (result[0] === EXIT$s) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$s) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$s) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$r(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$s, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$r = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$s(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-shortcut-reference-image - * @fileoverview - * Warn when shortcut reference images are used. - * - * Shortcut references render as images when a definition is found, and as - * plain text without definition. - * Sometimes, you don’t intend to create an image from the reference, but this - * rule still warns anyway. - * In that case, you can escape the reference like so: `!\[foo]`. - * - * @example - * {"name": "ok.md"} - * - * ![foo][] - * - * [foo]: http://foo.bar/baz.png - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * ![foo] - * - * [foo]: http://foo.bar/baz.png - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:7: Use the trailing [] on reference images - */ - -const remarkLintNoShortcutReferenceImage = lintRule$u( - 'remark-lint:no-shortcut-reference-image', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$r(tree, 'imageReference', (node) => { - if (!generated(node) && node.referenceType === 'shortcut') { - file.message('Use the trailing [] on reference images', node); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$t = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$t(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$u(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$u(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$t.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$r = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$q - } - - if (typeof test === 'string') { - return typeFactory$q(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$q(test) : propsFactory$p(test) - } - - if (typeof test === 'function') { - return castFactory$p(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$q(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$r(tests[index]); - } - - return castFactory$p(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$p(check) { - return castFactory$p(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$q(check) { - return castFactory$p(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$p(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$q() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$r(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$r = true; -/** - * Do not traverse this node’s children - */ -const SKIP$r = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$r = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$r = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$r(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$r(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$q(visitor(node, parents)); - - if (result[0] === EXIT$r) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$r) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$r) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$q(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$r, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$q = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$r(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-shortcut-reference-link - * @fileoverview - * Warn when shortcut reference links are used. - * - * Shortcut references render as links when a definition is found, and as - * plain text without definition. - * Sometimes, you don’t intend to create a link from the reference, but this - * rule still warns anyway. - * In that case, you can escape the reference like so: `\[foo]`. - * - * @example - * {"name": "ok.md"} - * - * [foo][] - * - * [foo]: http://foo.bar/baz - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * [foo] - * - * [foo]: http://foo.bar/baz - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:6: Use the trailing `[]` on reference links - */ - -const remarkLintNoShortcutReferenceLink = lintRule$t( - 'remark-lint:no-shortcut-reference-link', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$q(tree, 'linkReference', (node) => { - if (!generated(node) && node.referenceType === 'shortcut') { - file.message('Use the trailing `[]` on reference links', node); - } - }); - } -); - -/** - * Normalize an identifier (such as used in definitions). - * - * @param {string} value - * @returns {string} - */ -function normalizeIdentifier(value) { - return ( - value // Collapse Markdown whitespace. - .replace(/[\t\n\r ]+/g, ' ') // Trim. - .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase - // counterpart is uppercased will result in a different uppercase - // character. - // Hence, to get that form, we perform both lower- and uppercase. - // Upper case makes sure keys will not interact with default prototypal - // methods: no method is uppercase. - .toLowerCase() - .toUpperCase() - ) -} - -/** - * @typedef {import('unist').Point} Point - * @typedef {import('vfile').VFile} VFile - * - * @typedef {Pick<Point, 'line'|'column'>} PositionalPoint - * @typedef {Required<Point>} FullPoint - * @typedef {NonNullable<Point['offset']>} Offset - */ - -/** - * Get transform functions for the given `document`. - * - * @param {string|Uint8Array|VFile} file - */ -function location$3(file) { - var value = String(file); - /** @type {Array.<number>} */ - var indices = []; - var search = /\r?\n|\r/g; - - while (search.test(value)) { - indices.push(search.lastIndex); - } - - indices.push(value.length + 1); - - return {toPoint, toOffset} - - /** - * Get the line and column-based `point` for `offset` in the bound indices. - * Returns a point with `undefined` values when given invalid or out of bounds - * input. - * - * @param {Offset} offset - * @returns {FullPoint} - */ - function toPoint(offset) { - var index = -1; - - if (offset > -1 && offset < indices[indices.length - 1]) { - while (++index < indices.length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset - } - } - } - } - - return {line: undefined, column: undefined, offset: undefined} - } - - /** - * Get the `offset` for a line and column-based `point` in the bound indices. - * Returns `-1` when given invalid or out of bounds input. - * - * @param {PositionalPoint} point - * @returns {Offset} - */ - function toOffset(point) { - var line = point && point.line; - var column = point && point.column; - /** @type {number} */ - var offset; - - if ( - typeof line === 'number' && - typeof column === 'number' && - !Number.isNaN(line) && - !Number.isNaN(column) && - line - 1 in indices - ) { - offset = (indices[line - 2] || 0) + column - 1 || 0; - } - - return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 - } -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$s = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$s(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$t(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$t(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$s.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$i = point$i('start'); -var pointEnd$9 = point$i('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$i(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$q = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$p - } - - if (typeof test === 'string') { - return typeFactory$p(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$p(test) : propsFactory$o(test) - } - - if (typeof test === 'function') { - return castFactory$o(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$p(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$q(tests[index]); - } - - return castFactory$o(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$o(check) { - return castFactory$o(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$p(check) { - return castFactory$o(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$o(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$p() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$q(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$q = true; -/** - * Do not traverse this node’s children - */ -const SKIP$q = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$q = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$q = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$q(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$q(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$p(visitor(node, parents)); - - if (result[0] === EXIT$q) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$q) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$q) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$p(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$q, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$p = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$q(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2016 Titus Wormer - * @license MIT - * @module no-undefined-references - * @fileoverview - * Warn when references to undefined definitions are found. - * - * Options: `Object`, optional. - * - * The object can have an `allow` field, set to an array of strings that may - * appear between `[` and `]`, but that should not be treated as link - * identifiers. - * - * @example - * {"name": "ok.md"} - * - * [foo][] - * - * Just a [ bracket. - * - * Typically, you’d want to use escapes (with a backslash: \\) to escape what - * could turn into a \[reference otherwise]. - * - * Just two braces can’t link: []. - * - * [foo]: https://example.com - * - * @example - * {"name": "ok-allow.md", "setting": {"allow": ["...", "…"]}} - * - * > Eliding a portion of a quoted passage […] is acceptable. - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * [bar] - * - * [baz][] - * - * [text][qux] - * - * Spread [over - * lines][] - * - * > in [a - * > block quote][] - * - * [asd][a - * - * Can include [*emphasis*]. - * - * Multiple pairs: [a][b][c]. - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:6: Found reference to undefined definition - * 3:1-3:8: Found reference to undefined definition - * 5:1-5:12: Found reference to undefined definition - * 7:8-8:9: Found reference to undefined definition - * 10:6-11:17: Found reference to undefined definition - * 13:1-13:6: Found reference to undefined definition - * 15:13-15:25: Found reference to undefined definition - * 17:17-17:23: Found reference to undefined definition - * 17:23-17:26: Found reference to undefined definition - */ - -const remarkLintNoUndefinedReferences = lintRule$s( - 'remark-lint:no-undefined-references', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = {}) => { - const contents = String(file); - const loc = location$3(file); - const lineEnding = /(\r?\n|\r)[\t ]*(>[\t ]*)*/g; - const allow = new Set( - (option.allow || []).map((d) => normalizeIdentifier(d)) - ); - /** @type {Record<string, boolean>} */ - const map = Object.create(null); - - visit$p(tree, (node) => { - if ( - (node.type === 'definition' || node.type === 'footnoteDefinition') && - !generated(node) - ) { - map[normalizeIdentifier(node.identifier)] = true; - } - }); - - visit$p(tree, (node) => { - // CM specifiers that references only form when defined. - // Still, they could be added by plugins, so let’s keep it. - /* c8 ignore next 10 */ - if ( - (node.type === 'imageReference' || - node.type === 'linkReference' || - node.type === 'footnoteReference') && - !generated(node) && - !(normalizeIdentifier(node.identifier) in map) && - !allow.has(normalizeIdentifier(node.identifier)) - ) { - file.message('Found reference to undefined definition', node); - } - - if (node.type === 'paragraph' || node.type === 'heading') { - findInPhrasing(node); - } - }); - - /** - * @param {Heading|Paragraph} node - */ - function findInPhrasing(node) { - /** @type {Range[]} */ - let ranges = []; - - visit$p(node, (child) => { - // Ignore the node itself. - if (child === node) return - - // Can’t have links in links, so reset ranges. - if (child.type === 'link' || child.type === 'linkReference') { - ranges = []; - return SKIP$q - } - - // Enter non-text. - if (child.type !== 'text') return - - const start = pointStart$i(child).offset; - const end = pointEnd$9(child).offset; - - // Bail if there’s no positional info. - if (typeof start !== 'number' || typeof end !== 'number') { - return EXIT$q - } - - const source = contents.slice(start, end); - /** @type {Array.<[number, string]>} */ - const lines = [[start, '']]; - let last = 0; - - lineEnding.lastIndex = 0; - let match = lineEnding.exec(source); - - while (match) { - const index = match.index; - lines[lines.length - 1][1] = source.slice(last, index); - last = index + match[0].length; - lines.push([start + last, '']); - match = lineEnding.exec(source); - } - - lines[lines.length - 1][1] = source.slice(last); - let lineIndex = -1; - - while (++lineIndex < lines.length) { - const line = lines[lineIndex][1]; - let index = 0; - - while (index < line.length) { - const code = line.charCodeAt(index); - - // Skip past escaped brackets. - if (code === 92) { - const next = line.charCodeAt(index + 1); - index++; - - if (next === 91 || next === 93) { - index++; - } - } - // Opening bracket. - else if (code === 91) { - ranges.push([lines[lineIndex][0] + index]); - index++; - } - // Close bracket. - else if (code === 93) { - // No opening. - if (ranges.length === 0) { - index++; - } else if (line.charCodeAt(index + 1) === 91) { - index++; - - // Collapsed or full. - let range = ranges.pop(); - - // Range should always exist. - // eslint-disable-next-line max-depth - if (range) { - range.push(lines[lineIndex][0] + index); - - // This is the end of a reference already. - // eslint-disable-next-line max-depth - if (range.length === 4) { - handleRange(range); - range = []; - } - - range.push(lines[lineIndex][0] + index); - ranges.push(range); - index++; - } - } else { - index++; - - // Shortcut or typical end of a reference. - const range = ranges.pop(); - - // Range should always exist. - // eslint-disable-next-line max-depth - if (range) { - range.push(lines[lineIndex][0] + index); - handleRange(range); - } - } - } - // Anything else. - else { - index++; - } - } - } - }); - - let index = -1; - - while (++index < ranges.length) { - handleRange(ranges[index]); - } - - return SKIP$q - - /** - * @param {Range} range - */ - function handleRange(range) { - if (range.length === 1) return - if (range.length === 3) range.length = 2; - - // No need to warn for just `[]`. - if (range.length === 2 && range[0] + 2 === range[1]) return - - const offset = range.length === 4 && range[2] + 2 !== range[3] ? 2 : 0; - const id = contents - .slice(range[0 + offset] + 1, range[1 + offset] - 1) - .replace(lineEnding, ' '); - const pos = { - start: loc.toPoint(range[0]), - end: loc.toPoint(range[range.length - 1]) - }; - - if ( - !generated({position: pos}) && - !(normalizeIdentifier(id) in map) && - !allow.has(normalizeIdentifier(id)) - ) { - file.message('Found reference to undefined definition', pos); - } - } - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$r = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$r(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$s(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$s(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$r.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$p = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$o - } - - if (typeof test === 'string') { - return typeFactory$o(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$o(test) : propsFactory$n(test) - } - - if (typeof test === 'function') { - return castFactory$n(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$o(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$p(tests[index]); - } - - return castFactory$n(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$n(check) { - return castFactory$n(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$o(check) { - return castFactory$n(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$n(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$o() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$p(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$p = true; -/** - * Do not traverse this node’s children - */ -const SKIP$p = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$p = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$p = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$p(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$p(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$o(visitor(node, parents)); - - if (result[0] === EXIT$p) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$p) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$p) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$o(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$p, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$o = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$p(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2016 Titus Wormer - * @license MIT - * @module no-unused-definitions - * @fileoverview - * Warn when unused definitions are found. - * - * @example - * {"name": "ok.md"} - * - * [foo][] - * - * [foo]: https://example.com - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * [bar]: https://example.com - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:27: Found unused definition - */ - -const own$1 = {}.hasOwnProperty; - -const remarkLintNoUnusedDefinitions = lintRule$r( - 'remark-lint:no-unused-definitions', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - /** @type {Record<string, {node: DefinitionContent, used: boolean}>} */ - const map = Object.create(null); - - visit$o(tree, (node) => { - if ( - (node.type === 'definition' || node.type === 'footnoteDefinition') && - !generated(node) - ) { - map[node.identifier.toUpperCase()] = {node, used: false}; - } - }); - - visit$o(tree, (node) => { - if ( - node.type === 'imageReference' || - node.type === 'linkReference' || - node.type === 'footnoteReference' - ) { - const info = map[node.identifier.toUpperCase()]; - - if (!generated(node) && info) { - info.used = true; - } - } - }); - - /** @type {string} */ - let identifier; - - for (identifier in map) { - if (own$1.call(map, identifier)) { - const entry = map[identifier]; - - if (!entry.used) { - file.message('Found unused definition', entry.node); - } - } - } - } -); - -/** - * @fileoverview - * remark preset to configure `remark-lint` with settings that prevent - * mistakes or stuff that fails across vendors. - */ - -const plugins = [ - remarkLint, - // Unix compatibility. - remarkLintFinalNewline, - // Rendering across vendors differs greatly if using other styles. - remarkLintListItemBulletIndent, - [remarkLintListItemIndent, 'tab-size'], - // Differs or unsupported across vendors. - remarkLintNoAutoLinkWithoutProtocol, - remarkLintNoBlockquoteWithoutMarker, - remarkLintNoLiteralUrls, - [remarkLintOrderedListMarkerStyle, '.'], - // Mistakes. - remarkLintHardBreakSpaces, - remarkLintNoDuplicateDefinitions, - remarkLintNoHeadingContentIndent, - remarkLintNoInlinePadding, - remarkLintNoShortcutReferenceImage, - remarkLintNoShortcutReferenceLink, - remarkLintNoUndefinedReferences, - remarkLintNoUnusedDefinitions -]; - -const remarkPresetLintRecommended = {plugins}; - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$q = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$q(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$r(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$r(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$q.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$o = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$n - } - - if (typeof test === 'string') { - return typeFactory$n(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$n(test) : propsFactory$m(test) - } - - if (typeof test === 'function') { - return castFactory$m(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$n(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$o(tests[index]); - } - - return castFactory$m(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$m(check) { - return castFactory$m(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$n(check) { - return castFactory$m(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$m(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$n() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$o(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$o = true; -/** - * Do not traverse this node’s children - */ -const SKIP$o = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$o = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$o = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$o(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$o(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$n(visitor(node, parents)); - - if (result[0] === EXIT$o) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$o) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$o) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$n(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$o, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$n = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$o(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$h = point$h('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$h(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module blockquote-indentation - * @fileoverview - * Warn when block quotes are indented too much or too little. - * - * Options: `number` or `'consistent'`, default: `'consistent'`. - * - * `'consistent'` detects the first used indentation and will warn when - * other block quotes use a different indentation. - * - * @example - * {"name": "ok.md", "setting": 4} - * - * > Hello - * - * Paragraph. - * - * > World - * @example - * {"name": "ok.md", "setting": 2} - * - * > Hello - * - * Paragraph. - * - * > World - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * > Hello - * - * Paragraph. - * - * > World - * - * Paragraph. - * - * > World - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 5:5: Remove 1 space between block quote and content - * 9:3: Add 1 space between block quote and content - */ - -const remarkLintBlockquoteIndentation = lintRule$q( - 'remark-lint:blockquote-indentation', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - visit$n(tree, 'blockquote', (node) => { - if (generated(node) || node.children.length === 0) { - return - } - - if (option === 'consistent') { - option = check(node); - } else { - const diff = option - check(node); - - if (diff !== 0) { - const abs = Math.abs(diff); - - file.message( - (diff > 0 ? 'Add' : 'Remove') + - ' ' + - abs + - ' ' + - plural('space', abs) + - ' between block quote and content', - pointStart$h(node.children[0]) - ); - } - } - }); - } -); - -/** - * @param {Blockquote} node - * @returns {number} - */ -function check(node) { - return pointStart$h(node.children[0]).column - pointStart$h(node).column -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$p = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$p(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$q(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$q(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$p.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$n = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$m - } - - if (typeof test === 'string') { - return typeFactory$m(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$m(test) : propsFactory$l(test) - } - - if (typeof test === 'function') { - return castFactory$l(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$m(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$n(tests[index]); - } - - return castFactory$l(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$l(check) { - return castFactory$l(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$m(check) { - return castFactory$l(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$l(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$m() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$n(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$n = true; -/** - * Do not traverse this node’s children - */ -const SKIP$n = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$n = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$n = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$n(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$n(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$m(visitor(node, parents)); - - if (result[0] === EXIT$n) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$n) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$n) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$m(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$n, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$m = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$n(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$g = point$g('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$g(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module checkbox-character-style - * @fileoverview - * Warn when list item checkboxes violate a given style. - * - * Options: `Object` or `'consistent'`, default: `'consistent'`. - * - * `'consistent'` detects the first used checked and unchecked checkbox - * styles and warns when subsequent checkboxes use different styles. - * - * Styles can also be passed in like so: - * - * ```js - * {checked: 'x', unchecked: ' '} - * ``` - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * formats checked checkboxes using `x` (lowercase X) and unchecked checkboxes - * as `·` (a single space). - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md", "setting": {"checked": "x"}, "gfm": true} - * - * - [x] List item - * - [x] List item - * - * @example - * {"name": "ok.md", "setting": {"checked": "X"}, "gfm": true} - * - * - [X] List item - * - [X] List item - * - * @example - * {"name": "ok.md", "setting": {"unchecked": " "}, "gfm": true} - * - * - [ ] List item - * - [ ] List item - * - [ ]·· - * - [ ] - * - * @example - * {"name": "ok.md", "setting": {"unchecked": "\t"}, "gfm": true} - * - * - [»] List item - * - [»] List item - * - * @example - * {"name": "not-ok.md", "label": "input", "gfm": true} - * - * - [x] List item - * - [X] List item - * - [ ] List item - * - [»] List item - * - * @example - * {"name": "not-ok.md", "label": "output", "gfm": true} - * - * 2:5: Checked checkboxes should use `x` as a marker - * 4:5: Unchecked checkboxes should use ` ` as a marker - * - * @example - * {"setting": {"unchecked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true} - * - * 1:1: Incorrect unchecked checkbox marker `💩`: use either `'\t'`, or `' '` - * - * @example - * {"setting": {"checked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true} - * - * 1:1: Incorrect checked checkbox marker `💩`: use either `'x'`, or `'X'` - */ - -const remarkLintCheckboxCharacterStyle = lintRule$p( - 'remark-lint:checkbox-character-style', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - const value = String(file); - /** @type {'x'|'X'|'consistent'} */ - let checked = 'consistent'; - /** @type {' '|'\x09'|'consistent'} */ - let unchecked = 'consistent'; - - if (typeof option === 'object') { - checked = option.checked || 'consistent'; - unchecked = option.unchecked || 'consistent'; - } - - if (unchecked !== 'consistent' && unchecked !== ' ' && unchecked !== '\t') { - file.fail( - 'Incorrect unchecked checkbox marker `' + - unchecked + - "`: use either `'\\t'`, or `' '`" - ); - } - - if (checked !== 'consistent' && checked !== 'x' && checked !== 'X') { - file.fail( - 'Incorrect checked checkbox marker `' + - checked + - "`: use either `'x'`, or `'X'`" - ); - } - - visit$m(tree, 'listItem', (node) => { - const head = node.children[0]; - const point = pointStart$g(head); - - // Exit early for items without checkbox. - // A list item cannot be checked and empty, according to GFM. - if ( - typeof node.checked !== 'boolean' || - !head || - typeof point.offset !== 'number' - ) { - return - } - - // Move back to before `] `. - point.offset -= 2; - point.column -= 2; - - // Assume we start with a checkbox, because well, `checked` is set. - const match = /\[([\t Xx])]/.exec( - value.slice(point.offset - 2, point.offset + 1) - ); - - // Failsafe to make sure we don‘t crash if there actually isn’t a checkbox. - /* c8 ignore next */ - if (!match) return - - const style = node.checked ? checked : unchecked; - - if (style === 'consistent') { - if (node.checked) { - // @ts-expect-error: valid marker. - checked = match[1]; - } else { - // @ts-expect-error: valid marker. - unchecked = match[1]; - } - } else if (match[1] !== style) { - file.message( - (node.checked ? 'Checked' : 'Unchecked') + - ' checkboxes should use `' + - style + - '` as a marker', - point - ); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$o = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$o(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$p(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$p(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$o.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Point} Point - * @typedef {import('vfile').VFile} VFile - * - * @typedef {Pick<Point, 'line'|'column'>} PositionalPoint - * @typedef {Required<Point>} FullPoint - * @typedef {NonNullable<Point['offset']>} Offset - */ - -/** - * Get transform functions for the given `document`. - * - * @param {string|Uint8Array|VFile} file - */ -function location$2(file) { - var value = String(file); - /** @type {Array.<number>} */ - var indices = []; - var search = /\r?\n|\r/g; - - while (search.test(value)) { - indices.push(search.lastIndex); - } - - indices.push(value.length + 1); - - return {toPoint, toOffset} - - /** - * Get the line and column-based `point` for `offset` in the bound indices. - * Returns a point with `undefined` values when given invalid or out of bounds - * input. - * - * @param {Offset} offset - * @returns {FullPoint} - */ - function toPoint(offset) { - var index = -1; - - if (offset > -1 && offset < indices[indices.length - 1]) { - while (++index < indices.length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset - } - } - } - } - - return {line: undefined, column: undefined, offset: undefined} - } - - /** - * Get the `offset` for a line and column-based `point` in the bound indices. - * Returns `-1` when given invalid or out of bounds input. - * - * @param {PositionalPoint} point - * @returns {Offset} - */ - function toOffset(point) { - var line = point && point.line; - var column = point && point.column; - /** @type {number} */ - var offset; - - if ( - typeof line === 'number' && - typeof column === 'number' && - !Number.isNaN(line) && - !Number.isNaN(column) && - line - 1 in indices - ) { - offset = (indices[line - 2] || 0) + column - 1 || 0; - } - - return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 - } -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$m = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$l - } - - if (typeof test === 'string') { - return typeFactory$l(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$l(test) : propsFactory$k(test) - } - - if (typeof test === 'function') { - return castFactory$k(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$l(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$m(tests[index]); - } - - return castFactory$k(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$k(check) { - return castFactory$k(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$l(check) { - return castFactory$k(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$k(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$l() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$m(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$m = true; -/** - * Do not traverse this node’s children - */ -const SKIP$m = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$m = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$m = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$m(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$m(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$l(visitor(node, parents)); - - if (result[0] === EXIT$m) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$m) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$m) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$l(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$m, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$l = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$m(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$f = point$f('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$f(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module checkbox-content-indent - * @fileoverview - * Warn when list item checkboxes are followed by too much whitespace. - * - * @example - * {"name": "ok.md", "gfm": true} - * - * - [ ] List item - * + [x] List Item - * * [X] List item - * - [ ] List item - * - * @example - * {"name": "not-ok.md", "label": "input", "gfm": true} - * - * - [ ] List item - * + [x] List item - * * [X] List item - * - [ ] List item - * - * @example - * {"name": "not-ok.md", "label": "output", "gfm": true} - * - * 2:7-2:8: Checkboxes should be followed by a single character - * 3:7-3:9: Checkboxes should be followed by a single character - * 4:7-4:10: Checkboxes should be followed by a single character - */ - -const remarkLintCheckboxContentIndent = lintRule$o( - 'remark-lint:checkbox-content-indent', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - const value = String(file); - const loc = location$2(file); - - visit$l(tree, 'listItem', (node) => { - const head = node.children[0]; - const point = pointStart$f(head); - - // Exit early for items without checkbox. - // A list item cannot be checked and empty, according to GFM. - if ( - typeof node.checked !== 'boolean' || - !head || - typeof point.offset !== 'number' - ) { - return - } - - // Assume we start with a checkbox, because well, `checked` is set. - const match = /\[([\t xX])]/.exec( - value.slice(point.offset - 4, point.offset + 1) - ); - - // Failsafe to make sure we don‘t crash if there actually isn’t a checkbox. - /* c8 ignore next */ - if (!match) return - - // Move past checkbox. - const initial = point.offset; - let final = initial; - - while (/[\t ]/.test(value.charAt(final))) final++; - - if (final - initial > 0) { - file.message('Checkboxes should be followed by a single character', { - start: loc.toPoint(initial), - end: loc.toPoint(final) - }); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$n = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$n(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$o(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$o(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$n.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$l = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$k - } - - if (typeof test === 'string') { - return typeFactory$k(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$k(test) : propsFactory$j(test) - } - - if (typeof test === 'function') { - return castFactory$j(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$k(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$l(tests[index]); - } - - return castFactory$j(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$j(check) { - return castFactory$j(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$k(check) { - return castFactory$j(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$j(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$k() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$l(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$l = true; -/** - * Do not traverse this node’s children - */ -const SKIP$l = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$l = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$l = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$l(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$l(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$k(visitor(node, parents)); - - if (result[0] === EXIT$l) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$l) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$l) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$k(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$l, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$k = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$l(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$e = point$e('start'); -var pointEnd$8 = point$e('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$e(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module code-block-style - * @fileoverview - * Warn when code blocks do not adhere to a given style. - * - * Options: `'consistent'`, `'fenced'`, or `'indented'`, default: `'consistent'`. - * - * `'consistent'` detects the first used code block style and warns when - * subsequent code blocks uses different styles. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * formats code blocks using a fence if they have a language flag and - * indentation if not. - * Pass - * [`fences: true`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsfences) - * to always use fences for code blocks. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"setting": "indented", "name": "ok.md"} - * - * alpha() - * - * Paragraph. - * - * bravo() - * - * @example - * {"setting": "indented", "name": "not-ok.md", "label": "input"} - * - * ``` - * alpha() - * ``` - * - * Paragraph. - * - * ``` - * bravo() - * ``` - * - * @example - * {"setting": "indented", "name": "not-ok.md", "label": "output"} - * - * 1:1-3:4: Code blocks should be indented - * 7:1-9:4: Code blocks should be indented - * - * @example - * {"setting": "fenced", "name": "ok.md"} - * - * ``` - * alpha() - * ``` - * - * Paragraph. - * - * ``` - * bravo() - * ``` - * - * @example - * {"setting": "fenced", "name": "not-ok-fenced.md", "label": "input"} - * - * alpha() - * - * Paragraph. - * - * bravo() - * - * @example - * {"setting": "fenced", "name": "not-ok-fenced.md", "label": "output"} - * - * 1:1-1:12: Code blocks should be fenced - * 5:1-5:12: Code blocks should be fenced - * - * @example - * {"name": "not-ok-consistent.md", "label": "input"} - * - * alpha() - * - * Paragraph. - * - * ``` - * bravo() - * ``` - * - * @example - * {"name": "not-ok-consistent.md", "label": "output"} - * - * 5:1-7:4: Code blocks should be indented - * - * @example - * {"setting": "💩", "name": "not-ok-incorrect.md", "label": "output", "positionless": true} - * - * 1:1: Incorrect code block style `💩`: use either `'consistent'`, `'fenced'`, or `'indented'` - */ - -const remarkLintCodeBlockStyle = lintRule$n( - 'remark-lint:code-block-style', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - const value = String(file); - - if ( - option !== 'consistent' && - option !== 'fenced' && - option !== 'indented' - ) { - file.fail( - 'Incorrect code block style `' + - option + - "`: use either `'consistent'`, `'fenced'`, or `'indented'`" - ); - } - - visit$k(tree, 'code', (node) => { - if (generated(node)) { - return - } - - const initial = pointStart$e(node).offset; - const final = pointEnd$8(node).offset; - - const current = - node.lang || /^\s*([~`])\1{2,}/.test(value.slice(initial, final)) - ? 'fenced' - : 'indented'; - - if (option === 'consistent') { - option = current; - } else if (option !== current) { - file.message('Code blocks should be ' + option, node); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$m = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$m(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$n(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$n(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$m.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$k = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$j - } - - if (typeof test === 'string') { - return typeFactory$j(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$j(test) : propsFactory$i(test) - } - - if (typeof test === 'function') { - return castFactory$i(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$j(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$k(tests[index]); - } - - return castFactory$i(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$i(check) { - return castFactory$i(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$j(check) { - return castFactory$i(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$i(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$j() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$k(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$k = true; -/** - * Do not traverse this node’s children - */ -const SKIP$k = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$k = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$k = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$k(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$k(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$j(visitor(node, parents)); - - if (result[0] === EXIT$k) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$k) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$k) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$j(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$k, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$j = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$k(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$d = point$d('start'); -var pointEnd$7 = point$d('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$d(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module definition-spacing - * @fileoverview - * Warn when consecutive whitespace is used in a definition. - * - * @example - * {"name": "ok.md"} - * - * [example domain]: http://example.com "Example Domain" - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * [example····domain]: http://example.com "Example Domain" - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:57: Do not use consecutive whitespace in definition labels - */ - -const label = /^\s*\[((?:\\[\s\S]|[^[\]])+)]/; - -const remarkLintDefinitionSpacing = lintRule$m( - 'remark-lint:definition-spacing', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - const value = String(file); - - visit$j(tree, (node) => { - if (node.type === 'definition' || node.type === 'footnoteDefinition') { - const start = pointStart$d(node).offset; - const end = pointEnd$7(node).offset; - - if (typeof start === 'number' && typeof end === 'number') { - const match = value.slice(start, end).match(label); - - if (match && /[ \t\n]{2,}/.test(match[1])) { - file.message( - 'Do not use consecutive whitespace in definition labels', - node - ); - } - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$l = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$l(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$m(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$m(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$l.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$j = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$i - } - - if (typeof test === 'string') { - return typeFactory$i(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$i(test) : propsFactory$h(test) - } - - if (typeof test === 'function') { - return castFactory$h(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$i(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$j(tests[index]); - } - - return castFactory$h(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$h(check) { - return castFactory$h(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$i(check) { - return castFactory$h(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$h(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$i() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$j(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$j = true; -/** - * Do not traverse this node’s children - */ -const SKIP$j = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$j = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$j = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$j(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$j(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$i(visitor(node, parents)); - - if (result[0] === EXIT$j) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$j) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$j) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$i(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$j, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$i = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$j(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$c = point$c('start'); -var pointEnd$6 = point$c('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$c(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module fenced-code-flag - * @fileoverview - * Check fenced code block flags. - * - * Options: `Array.<string>` or `Object`, optional. - * - * Providing an array is as passing `{flags: Array}`. - * - * The object can have an array of `'flags'` which are allowed: other flags - * will not be allowed. - * An `allowEmpty` field (`boolean`, default: `false`) can be set to allow - * code blocks without language flags. - * - * @example - * {"name": "ok.md"} - * - * ```alpha - * bravo() - * ``` - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * ``` - * alpha() - * ``` - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-3:4: Missing code language flag - * - * @example - * {"name": "ok.md", "setting": {"allowEmpty": true}} - * - * ``` - * alpha() - * ``` - * - * @example - * {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "input"} - * - * ``` - * alpha() - * ``` - * - * @example - * {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "output"} - * - * 1:1-3:4: Missing code language flag - * - * @example - * {"name": "ok.md", "setting": ["alpha"]} - * - * ```alpha - * bravo() - * ``` - * - * @example - * {"name": "ok.md", "setting": {"flags":["alpha"]}} - * - * ```alpha - * bravo() - * ``` - * - * @example - * {"name": "not-ok.md", "setting": ["charlie"], "label": "input"} - * - * ```alpha - * bravo() - * ``` - * - * @example - * {"name": "not-ok.md", "setting": ["charlie"], "label": "output"} - * - * 1:1-3:4: Incorrect code language flag - */ - -const fence = /^ {0,3}([~`])\1{2,}/; - -const remarkLintFencedCodeFlag = lintRule$l( - 'remark-lint:fenced-code-flag', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option) => { - const value = String(file); - let allowEmpty = false; - /** @type {string[]} */ - let allowed = []; - - if (typeof option === 'object') { - if (Array.isArray(option)) { - allowed = option; - } else { - allowEmpty = Boolean(option.allowEmpty); - - if (option.flags) { - allowed = option.flags; - } - } - } - - visit$i(tree, 'code', (node) => { - if (!generated(node)) { - if (node.lang) { - if (allowed.length > 0 && !allowed.includes(node.lang)) { - file.message('Incorrect code language flag', node); - } - } else { - const slice = value.slice( - pointStart$c(node).offset, - pointEnd$6(node).offset - ); - - if (!allowEmpty && fence.test(slice)) { - file.message('Missing code language flag', node); - } - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$k = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$k(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$l(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$l(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$k.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$i = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$h - } - - if (typeof test === 'string') { - return typeFactory$h(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$h(test) : propsFactory$g(test) - } - - if (typeof test === 'function') { - return castFactory$g(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$h(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$i(tests[index]); - } - - return castFactory$g(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$g(check) { - return castFactory$g(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$h(check) { - return castFactory$g(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$g(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$h() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$i(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$i = true; -/** - * Do not traverse this node’s children - */ -const SKIP$i = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$i = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$i = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$i(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$i(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$h(visitor(node, parents)); - - if (result[0] === EXIT$i) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$i) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$i) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$h(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$i, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$h = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$i(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$b = point$b('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$b(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module fenced-code-marker - * @fileoverview - * Warn for violating fenced code markers. - * - * Options: `` '`' ``, `'~'`, or `'consistent'`, default: `'consistent'`. - * - * `'consistent'` detects the first used fenced code marker style and warns - * when subsequent fenced code blocks use different styles. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * formats fences using ``'`'`` (grave accent) by default. - * Pass - * [`fence: '~'`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsfence) - * to use `~` (tilde) instead. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md"} - * - * Indented code blocks are not affected by this rule: - * - * bravo() - * - * @example - * {"name": "ok.md", "setting": "`"} - * - * ```alpha - * bravo() - * ``` - * - * ``` - * charlie() - * ``` - * - * @example - * {"name": "ok.md", "setting": "~"} - * - * ~~~alpha - * bravo() - * ~~~ - * - * ~~~ - * charlie() - * ~~~ - * - * @example - * {"name": "not-ok-consistent-tick.md", "label": "input"} - * - * ```alpha - * bravo() - * ``` - * - * ~~~ - * charlie() - * ~~~ - * - * @example - * {"name": "not-ok-consistent-tick.md", "label": "output"} - * - * 5:1-7:4: Fenced code should use `` ` `` as a marker - * - * @example - * {"name": "not-ok-consistent-tilde.md", "label": "input"} - * - * ~~~alpha - * bravo() - * ~~~ - * - * ``` - * charlie() - * ``` - * - * @example - * {"name": "not-ok-consistent-tilde.md", "label": "output"} - * - * 5:1-7:4: Fenced code should use `~` as a marker - * - * @example - * {"name": "not-ok-incorrect.md", "setting": "💩", "label": "output", "positionless": true} - * - * 1:1: Incorrect fenced code marker `💩`: use either `'consistent'`, `` '`' ``, or `'~'` - */ - -const remarkLintFencedCodeMarker = lintRule$k( - 'remark-lint:fenced-code-marker', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - const contents = String(file); - - if (option !== 'consistent' && option !== '~' && option !== '`') { - file.fail( - 'Incorrect fenced code marker `' + - option + - "`: use either `'consistent'`, `` '`' ``, or `'~'`" - ); - } - - visit$h(tree, 'code', (node) => { - const start = pointStart$b(node).offset; - - if (typeof start === 'number') { - const marker = contents - .slice(start, start + 4) - .replace(/^\s+/, '') - .charAt(0); - - // Ignore unfenced code blocks. - if (marker === '~' || marker === '`') { - if (option === 'consistent') { - option = marker; - } else if (marker !== option) { - file.message( - 'Fenced code should use `' + - (option === '~' ? option : '` ` `') + - '` as a marker', - node - ); - } - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$j = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$j(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$k(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$k(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$j.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module file-extension - * @fileoverview - * Warn when the file extension differ from the preferred extension. - * - * Does not warn when given documents have no file extensions (such as - * `AUTHORS` or `LICENSE`). - * - * Options: `string`, default: `'md'` — Expected file extension. - * - * @example - * {"name": "readme.md"} - * - * @example - * {"name": "readme"} - * - * @example - * {"name": "readme.mkd", "label": "output", "positionless": true} - * - * 1:1: Incorrect extension: use `md` - * - * @example - * {"name": "readme.mkd", "setting": "mkd"} - */ - -const remarkLintFileExtension = lintRule$j( - 'remark-lint:file-extension', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (_, file, option = 'md') => { - const ext = file.extname; - - if (ext && ext.slice(1) !== option) { - file.message('Incorrect extension: use `' + option + '`'); - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$i = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$i(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$j(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$j(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$i.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$h = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$g - } - - if (typeof test === 'string') { - return typeFactory$g(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$g(test) : propsFactory$f(test) - } - - if (typeof test === 'function') { - return castFactory$f(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$g(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$h(tests[index]); - } - - return castFactory$f(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$f(check) { - return castFactory$f(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$g(check) { - return castFactory$f(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$f(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$g() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$h(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$h = true; -/** - * Do not traverse this node’s children - */ -const SKIP$h = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$h = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$h = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$h(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$h(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$g(visitor(node, parents)); - - if (result[0] === EXIT$h) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$h) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$h) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$g(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$h, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$g = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$h(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$a = point$a('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$a(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module final-definition - * @fileoverview - * Warn when definitions are placed somewhere other than at the end of - * the file. - * - * @example - * {"name": "ok.md"} - * - * Paragraph. - * - * [example]: http://example.com "Example Domain" - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * Paragraph. - * - * [example]: http://example.com "Example Domain" - * - * Another paragraph. - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 3:1-3:47: Move definitions to the end of the file (after the node at line `5`) - * - * @example - * {"name": "ok-comments.md"} - * - * Paragraph. - * - * [example-1]: http://example.com/one/ - * - * <!-- Comments are fine between and after definitions --> - * - * [example-2]: http://example.com/two/ - */ - -const remarkLintFinalDefinition = lintRule$i( - 'remark-lint:final-definition', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - let last = 0; - - visit$g( - tree, - (node) => { - // Ignore generated and HTML comment nodes. - if ( - node.type === 'root' || - generated(node) || - (node.type === 'html' && /^\s*<!--/.test(node.value)) - ) { - return - } - - const line = pointStart$a(node).line; - - if (node.type === 'definition') { - if (last && last > line) { - file.message( - 'Move definitions to the end of the file (after the node at line `' + - last + - '`)', - node - ); - } - } else if (last === 0) { - last = line; - } - }, - true - ); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$h = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$h(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$i(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$i(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$h.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$g = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$f - } - - if (typeof test === 'string') { - return typeFactory$f(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$f(test) : propsFactory$e(test) - } - - if (typeof test === 'function') { - return castFactory$e(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$f(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$g(tests[index]); - } - - return castFactory$e(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$e(check) { - return castFactory$e(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$f(check) { - return castFactory$e(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$e(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$f() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$g(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$g = true; -/** - * Do not traverse this node’s children - */ -const SKIP$g = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$g = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$g = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$g(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$g(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$f(visitor(node, parents)); - - if (result[0] === EXIT$g) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$g) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$g) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$f(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$g, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$f = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$g(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module first-heading-level - * @fileoverview - * Warn when the first heading has a level other than a specified value. - * - * Options: `number`, default: `1`. - * - * @example - * {"name": "ok.md"} - * - * # The default is to expect a level one heading - * - * @example - * {"name": "ok-html.md"} - * - * <h1>An HTML heading is also seen by this rule.</h1> - * - * @example - * {"name": "ok-delayed.md"} - * - * You can use markdown content before the heading. - * - * <div>Or non-heading HTML</div> - * - * <h1>So the first heading, be it HTML or markdown, is checked</h1> - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * ## Bravo - * - * Paragraph. - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:9: First heading level should be `1` - * - * @example - * {"name": "not-ok-html.md", "label": "input"} - * - * <h2>Charlie</h2> - * - * Paragraph. - * - * @example - * {"name": "not-ok-html.md", "label": "output"} - * - * 1:1-1:17: First heading level should be `1` - * - * @example - * {"name": "ok.md", "setting": 2} - * - * ## Delta - * - * Paragraph. - * - * @example - * {"name": "ok-html.md", "setting": 2} - * - * <h2>Echo</h2> - * - * Paragraph. - * - * @example - * {"name": "not-ok.md", "setting": 2, "label": "input"} - * - * # Foxtrot - * - * Paragraph. - * - * @example - * {"name": "not-ok.md", "setting": 2, "label": "output"} - * - * 1:1-1:10: First heading level should be `2` - * - * @example - * {"name": "not-ok-html.md", "setting": 2, "label": "input"} - * - * <h1>Golf</h1> - * - * Paragraph. - * - * @example - * {"name": "not-ok-html.md", "setting": 2, "label": "output"} - * - * 1:1-1:14: First heading level should be `2` - */ - -const re$3 = /<h([1-6])/; - -const remarkLintFirstHeadingLevel = lintRule$h( - 'remark-lint:first-heading-level', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 1) => { - visit$f(tree, (node) => { - if (!generated(node)) { - /** @type {Depth|undefined} */ - let rank; - - if (node.type === 'heading') { - rank = node.depth; - } else if (node.type === 'html') { - rank = infer(node); - } - - if (rank !== undefined) { - if (rank !== option) { - file.message('First heading level should be `' + option + '`', node); - } - - return EXIT$g - } - } - }); - } -); - -/** - * @param {HTML} node - * @returns {Depth|undefined} - */ -function infer(node) { - const results = node.value.match(re$3); - // @ts-expect-error: can be castes fine. - return results ? Number(results[1]) : undefined -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$g = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$g(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$h(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$h(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$g.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$f = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$e - } - - if (typeof test === 'string') { - return typeFactory$e(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$e(test) : propsFactory$d(test) - } - - if (typeof test === 'function') { - return castFactory$d(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$e(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$f(tests[index]); - } - - return castFactory$d(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$d(check) { - return castFactory$d(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$e(check) { - return castFactory$d(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$d(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$e() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$f(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$f = true; -/** - * Do not traverse this node’s children - */ -const SKIP$f = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$f = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$f = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$f(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$f(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$e(visitor(node, parents)); - - if (result[0] === EXIT$f) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$f) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$f) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$e(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$f, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$e = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$f(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module heading-style - * @fileoverview - * Warn when a heading does not conform to a given style. - * - * Options: `'consistent'`, `'atx'`, `'atx-closed'`, or `'setext'`, - * default: `'consistent'`. - * - * `'consistent'` detects the first used heading style and warns when - * subsequent headings use different styles. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * formats headings as ATX by default. - * This can be configured with the - * [`setext`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionssetext) - * and - * [`closeAtx`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionscloseatx) - * options. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md", "setting": "atx"} - * - * # Alpha - * - * ## Bravo - * - * ### Charlie - * - * @example - * {"name": "ok.md", "setting": "atx-closed"} - * - * # Delta ## - * - * ## Echo ## - * - * ### Foxtrot ### - * - * @example - * {"name": "ok.md", "setting": "setext"} - * - * Golf - * ==== - * - * Hotel - * ----- - * - * ### India - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * Juliett - * ======= - * - * ## Kilo - * - * ### Lima ### - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 4:1-4:8: Headings should use setext - * 6:1-6:13: Headings should use setext - * - * @example - * {"name": "not-ok.md", "setting": "💩", "label": "output", "positionless": true} - * - * 1:1: Incorrect heading style type `💩`: use either `'consistent'`, `'atx'`, `'atx-closed'`, or `'setext'` - */ - -const remarkLintHeadingStyle = lintRule$g( - 'remark-lint:heading-style', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - if ( - option !== 'consistent' && - option !== 'atx' && - option !== 'atx-closed' && - option !== 'setext' - ) { - file.fail( - 'Incorrect heading style type `' + - option + - "`: use either `'consistent'`, `'atx'`, `'atx-closed'`, or `'setext'`" - ); - } - - visit$e(tree, 'heading', (node) => { - if (!generated(node)) { - if (option === 'consistent') { - // Funky nodes perhaps cannot be detected. - /* c8 ignore next */ - option = headingStyle(node) || 'consistent'; - } else if (headingStyle(node, option) !== option) { - file.message('Headings should use ' + option, node); - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$f = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$f(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$g(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$g(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$f.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$e = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$d - } - - if (typeof test === 'string') { - return typeFactory$d(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$d(test) : propsFactory$c(test) - } - - if (typeof test === 'function') { - return castFactory$c(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$d(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$e(tests[index]); - } - - return castFactory$c(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$c(check) { - return castFactory$c(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$d(check) { - return castFactory$c(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$c(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$d() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$e(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$e = true; -/** - * Do not traverse this node’s children - */ -const SKIP$e = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$e = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$e = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$e(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$e(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$d(visitor(node, parents)); - - if (result[0] === EXIT$e) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$e) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$e) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$d(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$e, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$d = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$e(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$9 = point$9('start'); -var pointEnd$5 = point$9('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$9(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module maximum-line-length - * @fileoverview - * Warn when lines are too long. - * - * Options: `number`, default: `80`. - * - * Ignores nodes that cannot be wrapped, such as headings, tables, code, - * definitions, HTML, and JSX. - * - * Ignores images, links, and inline code if they start before the wrap, end - * after the wrap, and there’s no whitespace after them. - * - * @example - * {"name": "ok.md", "positionless": true, "gfm": true} - * - * This line is simply not toooooooooooooooooooooooooooooooooooooooooooo - * long. - * - * This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?query=variables> - * - * <http://this-link-is-fine.com> - * - * `alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscarPapaQuebec.romeo()` - * - * [foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) - * - * <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> - * - *  - * - * | An | exception | is | line | length | in | long | tables | because | those | can’t | just | - * | -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- | - * | be | helped | | | | | | | | | | . | - * - * <a><b><i><p><q><s><u>alpha bravo charlie delta echo foxtrot golf</u></s></q></p></i></b></a> - * - * The following is also fine, because there is no whitespace. - * - * <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>. - * - * In addition, definitions are also fine: - * - * [foo]: <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> - * - * @example - * {"name": "not-ok.md", "setting": 80, "label": "input", "positionless": true} - * - * This line is simply not tooooooooooooooooooooooooooooooooooooooooooooooooooooooo - * long. - * - * Just like thiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis one. - * - * And this one is also very wrong: because the link starts aaaaaaafter the column: <http://line.com> - * - * <http://this-long-url-with-a-long-domain-is-not-ok.co.uk/a-long-path?query=variables> and such. - * - * And this one is also very wrong: because the code starts aaaaaaafter the column: `alpha.bravo()` - * - * `alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscar.papa()` and such. - * - * @example - * {"name": "not-ok.md", "setting": 80, "label": "output", "positionless": true} - * - * 4:86: Line must be at most 80 characters - * 6:99: Line must be at most 80 characters - * 8:96: Line must be at most 80 characters - * 10:97: Line must be at most 80 characters - * 12:99: Line must be at most 80 characters - * - * @example - * {"name": "ok-mixed-line-endings.md", "setting": 10, "positionless": true} - * - * 0123456789␍␊ - * 0123456789␊ - * 01234␍␊ - * 01234␊ - * - * @example - * {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "input", "positionless": true} - * - * 012345678901␍␊ - * 012345678901␊ - * 01234567890␍␊ - * 01234567890␊ - * - * @example - * {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "output", "positionless": true} - * - * 1:13: Line must be at most 10 characters - * 2:13: Line must be at most 10 characters - * 3:12: Line must be at most 10 characters - * 4:12: Line must be at most 10 characters - */ - -const remarkLintMaximumLineLength = lintRule$f( - 'remark-lint:maximum-line-length', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 80) => { - const value = String(file); - const lines = value.split(/\r?\n/); - - visit$d(tree, (node) => { - if ( - (node.type === 'heading' || - node.type === 'table' || - node.type === 'code' || - node.type === 'definition' || - node.type === 'html' || - // @ts-expect-error: JSX is from MDX: <https://github.com/mdx-js/specification>. - node.type === 'jsx' || - node.type === 'yaml' || - // @ts-expect-error: TOML is from frontmatter. - node.type === 'toml') && - !generated(node) - ) { - allowList(pointStart$9(node).line - 1, pointEnd$5(node).line); - } - }); - - // Finally, allow some inline spans, but only if they occur at or after - // the wrap. - // However, when they do, and there’s whitespace after it, they are not - // allowed. - visit$d(tree, (node, pos, parent_) => { - const parent = /** @type {Parent} */ (parent_); - - if ( - (node.type === 'link' || - node.type === 'image' || - node.type === 'inlineCode') && - !generated(node) && - parent && - typeof pos === 'number' - ) { - const initial = pointStart$9(node); - const final = pointEnd$5(node); - - // Not allowing when starting after the border, or ending before it. - if (initial.column > option || final.column < option) { - return - } - - const next = parent.children[pos + 1]; - - // Not allowing when there’s whitespace after the link. - if ( - next && - pointStart$9(next).line === initial.line && - (!('value' in next) || /^(.+?[ \t].+?)/.test(next.value)) - ) { - return - } - - allowList(initial.line - 1, final.line); - } - }); - - // Iterate over every line, and warn for violating lines. - let index = -1; - - while (++index < lines.length) { - const lineLength = lines[index].length; - - if (lineLength > option) { - file.message('Line must be at most ' + option + ' characters', { - line: index + 1, - column: lineLength + 1 - }); - } - } - - /** - * Allowlist from `initial` to `final`, zero-based. - * - * @param {number} initial - * @param {number} final - */ - function allowList(initial, final) { - while (initial < final) { - lines[initial++] = ''; - } - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$e = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$e(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$f(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$f(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$e.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$d = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$c - } - - if (typeof test === 'string') { - return typeFactory$c(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$c(test) : propsFactory$b(test) - } - - if (typeof test === 'function') { - return castFactory$b(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$c(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$d(tests[index]); - } - - return castFactory$b(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$b(check) { - return castFactory$b(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$c(check) { - return castFactory$b(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$b(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$c() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$d(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$d = true; -/** - * Do not traverse this node’s children - */ -const SKIP$d = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$d = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$d = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$d(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$d(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$c(visitor(node, parents)); - - if (result[0] === EXIT$d) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$d) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$d) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$c(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$d, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$c = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$d(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$8 = point$8('start'); -var pointEnd$4 = point$8('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$8(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-consecutive-blank-lines - * @fileoverview - * Warn for too many consecutive blank lines. - * Knows about the extra line needed between a list and indented code, and two - * lists. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * always uses one blank line between blocks if possible, or two lines when - * needed. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md"} - * - * Foo… - * ␊ - * …Bar. - * - * @example - * {"name": "empty-document.md"} - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * Foo… - * ␊ - * ␊ - * …Bar - * ␊ - * ␊ - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 4:1: Remove 1 line before node - * 4:5: Remove 2 lines after node - */ - -const remarkLintNoConsecutiveBlankLines = lintRule$e( - 'remark-lint:no-consecutive-blank-lines', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$c(tree, (node) => { - if (!generated(node) && 'children' in node) { - const head = node.children[0]; - - if (head && !generated(head)) { - // Compare parent and first child. - compare(pointStart$8(node), pointStart$8(head), 0); - - // Compare between each child. - let index = -1; - - while (++index < node.children.length) { - const previous = node.children[index - 1]; - const child = node.children[index]; - - if (previous && !generated(previous) && !generated(child)) { - compare(pointEnd$4(previous), pointStart$8(child), 2); - } - } - - const tail = node.children[node.children.length - 1]; - - // Compare parent and last child. - if (tail !== head && !generated(tail)) { - compare(pointEnd$4(node), pointEnd$4(tail), 1); - } - } - } - }); - - /** - * Compare the difference between `start` and `end`, and warn when that - * difference exceeds `max`. - * - * @param {Point} start - * @param {Point} end - * @param {0|1|2} max - */ - function compare(start, end, max) { - const diff = end.line - start.line; - const lines = Math.abs(diff) - max; - - if (lines > 0) { - file.message( - 'Remove ' + - lines + - ' ' + - plural('line', Math.abs(lines)) + - ' ' + - (diff > 0 ? 'before' : 'after') + - ' node', - end - ); - } - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$d = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$d(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$e(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$e(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$d.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-file-name-articles - * @fileoverview - * Warn when file names start with an article. - * - * @example - * {"name": "title.md"} - * - * @example - * {"name": "a-title.md", "label": "output", "positionless": true} - * - * 1:1: Do not start file names with `a` - * - * @example - * {"name": "the-title.md", "label": "output", "positionless": true} - * - * 1:1: Do not start file names with `the` - * - * @example - * {"name": "teh-title.md", "label": "output", "positionless": true} - * - * 1:1: Do not start file names with `teh` - * - * @example - * {"name": "an-article.md", "label": "output", "positionless": true} - * - * 1:1: Do not start file names with `an` - */ - -const remarkLintNoFileNameArticles = lintRule$d( - 'remark-lint:no-file-name-articles', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (_, file) => { - const match = file.stem && file.stem.match(/^(the|teh|an?)\b/i); - - if (match) { - file.message('Do not start file names with `' + match[0] + '`'); - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$c = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$c(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$d(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$d(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$c.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-file-name-consecutive-dashes - * @fileoverview - * Warn when file names contain consecutive dashes. - * - * @example - * {"name": "plug-ins.md"} - * - * @example - * {"name": "plug--ins.md", "label": "output", "positionless": true} - * - * 1:1: Do not use consecutive dashes in a file name - */ - -const remarkLintNoFileNameConsecutiveDashes = lintRule$c( - 'remark-lint:no-file-name-consecutive-dashes', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (_, file) => { - if (file.stem && /-{2,}/.test(file.stem)) { - file.message('Do not use consecutive dashes in a file name'); - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$b = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$b(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$c(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$c(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$b.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-file-name-outer-dashes - * @fileoverview - * Warn when file names contain initial or final dashes (hyphen-minus, `-`). - * - * @example - * {"name": "readme.md"} - * - * @example - * {"name": "-readme.md", "label": "output", "positionless": true} - * - * 1:1: Do not use initial or final dashes in a file name - * - * @example - * {"name": "readme-.md", "label": "output", "positionless": true} - * - * 1:1: Do not use initial or final dashes in a file name - */ - -const remarkLintNofileNameOuterDashes = lintRule$b( - 'remark-lint:no-file-name-outer-dashes', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (_, file) => { - if (file.stem && /^-|-$/.test(file.stem)) { - file.message('Do not use initial or final dashes in a file name'); - } - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$a = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$a(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$b(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$b(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$a.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$c = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$b - } - - if (typeof test === 'string') { - return typeFactory$b(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$b(test) : propsFactory$a(test) - } - - if (typeof test === 'function') { - return castFactory$a(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$b(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$c(tests[index]); - } - - return castFactory$a(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$a(check) { - return castFactory$a(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$b(check) { - return castFactory$a(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$a(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$b() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$c(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$c = true; -/** - * Do not traverse this node’s children - */ -const SKIP$c = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$c = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$c = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$c(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$c(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$b(visitor(node, parents)); - - if (result[0] === EXIT$c) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$c) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$c) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$b(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$c, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$b = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$c(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$7 = point$7('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$7(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-heading-indent - * @fileoverview - * Warn when a heading is indented. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * removes all unneeded indentation before headings. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md"} - * - * #·Hello world - * - * Foo - * ----- - * - * #·Hello world·# - * - * Bar - * ===== - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * ···# Hello world - * - * ·Foo - * ----- - * - * ·# Hello world # - * - * ···Bar - * ===== - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:4: Remove 3 spaces before this heading - * 3:2: Remove 1 space before this heading - * 6:2: Remove 1 space before this heading - * 8:4: Remove 3 spaces before this heading - */ - -const remarkLintNoHeadingIndent = lintRule$a( - 'remark-lint:no-heading-indent', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$b(tree, 'heading', (node, _, parent) => { - // Note: it’s rather complex to detect what the expected indent is in block - // quotes and lists, so let’s only do directly in root for now. - if (generated(node) || (parent && parent.type !== 'root')) { - return - } - - const diff = pointStart$7(node).column - 1; - - if (diff) { - file.message( - 'Remove ' + - diff + - ' ' + - plural('space', diff) + - ' before this heading', - pointStart$7(node) - ); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$9 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$9(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$a(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$a(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$9.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$b = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$a - } - - if (typeof test === 'string') { - return typeFactory$a(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$a(test) : propsFactory$9(test) - } - - if (typeof test === 'function') { - return castFactory$9(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$a(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$b(tests[index]); - } - - return castFactory$9(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$9(check) { - return castFactory$9(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$a(check) { - return castFactory$9(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$9(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$a() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$b(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$b = true; -/** - * Do not traverse this node’s children - */ -const SKIP$b = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$b = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$b = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$b(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$b(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$a(visitor(node, parents)); - - if (result[0] === EXIT$b) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$b) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$b) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$a(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$b, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$a = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$b(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$6 = point$6('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$6(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-multiple-toplevel-headings - * @fileoverview - * Warn when multiple top level headings are used. - * - * Options: `number`, default: `1`. - * - * @example - * {"name": "ok.md", "setting": 1} - * - * # Foo - * - * ## Bar - * - * @example - * {"name": "not-ok.md", "setting": 1, "label": "input"} - * - * # Foo - * - * # Bar - * - * @example - * {"name": "not-ok.md", "setting": 1, "label": "output"} - * - * 3:1-3:6: Don’t use multiple top level headings (1:1) - */ - -const remarkLintNoMultipleToplevelHeadings = lintRule$9( - 'remark-lint:no-multiple-toplevel-headings', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 1) => { - /** @type {string|undefined} */ - let duplicate; - - visit$a(tree, 'heading', (node) => { - if (!generated(node) && node.depth === option) { - if (duplicate) { - file.message( - 'Don’t use multiple top level headings (' + duplicate + ')', - node - ); - } else { - duplicate = stringifyPosition(pointStart$6(node)); - } - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$8 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$8(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$9(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$9(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$8.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$a = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$9 - } - - if (typeof test === 'string') { - return typeFactory$9(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$9(test) : propsFactory$8(test) - } - - if (typeof test === 'function') { - return castFactory$8(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$9(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$a(tests[index]); - } - - return castFactory$8(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$8(check) { - return castFactory$8(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$9(check) { - return castFactory$8(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$8(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$9() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$a(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$a = true; -/** - * Do not traverse this node’s children - */ -const SKIP$a = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$a = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$a = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$a(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$a(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$9(visitor(node, parents)); - - if (result[0] === EXIT$a) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$a) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$a) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$9(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$a, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$9 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$a(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-shell-dollars - * @fileoverview - * Warn when shell code is prefixed by `$` (dollar sign) characters. - * - * Ignores indented code blocks and fenced code blocks without language flag. - * - * @example - * {"name": "ok.md"} - * - * ```bash - * echo a - * ``` - * - * ```sh - * echo a - * echo a > file - * ``` - * - * ```zsh - * $ echo a - * a - * $ echo a > file - * ``` - * - * Some empty code: - * - * ```command - * ``` - * - * It’s fine to use dollars in non-shell code. - * - * ```js - * $('div').remove() - * ``` - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * ```sh - * $ echo a - * ``` - * - * ```bash - * $ echo a - * $ echo a > file - * ``` - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-3:4: Do not use dollar signs before shell commands - * 5:1-8:4: Do not use dollar signs before shell commands - */ - -// List of shell script file extensions (also used as code flags for syntax -// highlighting on GitHub): -// See: <https://github.com/github/linguist/blob/40992ba/lib/linguist/languages.yml#L4984> -const flags = new Set([ - 'sh', - 'bash', - 'bats', - 'cgi', - 'command', - 'fcgi', - 'ksh', - 'tmux', - 'tool', - 'zsh' -]); - -const remarkLintNoShellDollars = lintRule$8( - 'remark-lint:no-shell-dollars', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - visit$9(tree, 'code', (node) => { - // Check both known shell code and unknown code. - if (!generated(node) && node.lang && flags.has(node.lang)) { - const lines = node.value - .split('\n') - .filter((line) => line.trim().length > 0); - let index = -1; - - if (lines.length === 0) { - return - } - - while (++index < lines.length) { - const line = lines[index]; - - if (line.trim() && !/^\s*\$\s*/.test(line)) { - return - } - } - - file.message('Do not use dollar signs before shell commands', node); - } - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$7 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$7(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$8(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$8(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$7.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$9 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$8 - } - - if (typeof test === 'string') { - return typeFactory$8(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$8(test) : propsFactory$7(test) - } - - if (typeof test === 'function') { - return castFactory$7(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$8(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$9(tests[index]); - } - - return castFactory$7(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$7(check) { - return castFactory$7(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$8(check) { - return castFactory$7(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$7(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$8() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$9(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$9 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$9 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$9 = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$9 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$9(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$9(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$8(visitor(node, parents)); - - if (result[0] === EXIT$9) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$9) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$9) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$8(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$9, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$8 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$9(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$5 = point$5('start'); -var pointEnd$3 = point$5('end'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$5(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} - -/** - * @typedef {import('unist').Point} Point - * @typedef {import('vfile').VFile} VFile - * - * @typedef {Pick<Point, 'line'|'column'>} PositionalPoint - * @typedef {Required<Point>} FullPoint - * @typedef {NonNullable<Point['offset']>} Offset - */ - -/** - * Get transform functions for the given `document`. - * - * @param {string|Uint8Array|VFile} file - */ -function location$1(file) { - var value = String(file); - /** @type {Array.<number>} */ - var indices = []; - var search = /\r?\n|\r/g; - - while (search.test(value)) { - indices.push(search.lastIndex); - } - - indices.push(value.length + 1); - - return {toPoint, toOffset} - - /** - * Get the line and column-based `point` for `offset` in the bound indices. - * Returns a point with `undefined` values when given invalid or out of bounds - * input. - * - * @param {Offset} offset - * @returns {FullPoint} - */ - function toPoint(offset) { - var index = -1; - - if (offset > -1 && offset < indices[indices.length - 1]) { - while (++index < indices.length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset - } - } - } - } - - return {line: undefined, column: undefined, offset: undefined} - } - - /** - * Get the `offset` for a line and column-based `point` in the bound indices. - * Returns `-1` when given invalid or out of bounds input. - * - * @param {PositionalPoint} point - * @returns {Offset} - */ - function toOffset(point) { - var line = point && point.line; - var column = point && point.column; - /** @type {number} */ - var offset; - - if ( - typeof line === 'number' && - typeof column === 'number' && - !Number.isNaN(line) && - !Number.isNaN(column) && - line - 1 in indices - ) { - offset = (indices[line - 2] || 0) + column - 1 || 0; - } - - return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-table-indentation - * @fileoverview - * Warn when tables are indented. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * removes all unneeded indentation before tables. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md", "gfm": true} - * - * Paragraph. - * - * | A | B | - * | ----- | ----- | - * | Alpha | Bravo | - * - * @example - * {"name": "not-ok.md", "label": "input", "gfm": true} - * - * Paragraph. - * - * ···| A | B | - * ···| ----- | ----- | - * ···| Alpha | Bravo | - * - * @example - * {"name": "not-ok.md", "label": "output", "gfm": true} - * - * 3:4: Do not indent table rows - * 4:4: Do not indent table rows - * 5:4: Do not indent table rows - * - * @example - * {"name": "not-ok-blockquote.md", "label": "input", "gfm": true} - * - * >··| A | - * >·| - | - * - * @example - * {"name": "not-ok-blockquote.md", "label": "output", "gfm": true} - * - * 1:4: Do not indent table rows - * - * @example - * {"name": "not-ok-list.md", "label": "input", "gfm": true} - * - * -···paragraph - * - * ·····| A | - * ····| - | - * - * @example - * {"name": "not-ok-list.md", "label": "output", "gfm": true} - * - * 3:6: Do not indent table rows - */ - -const remarkLintNoTableIndentation = lintRule$7( - 'remark-lint:no-table-indentation', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (tree, file) => { - const value = String(file); - const loc = location$1(value); - - visit$8(tree, 'table', (node, _, parent) => { - const end = pointEnd$3(node).line; - let line = pointStart$5(node).line; - let column = 0; - - if (parent && parent.type === 'root') { - column = 1; - } else if (parent && parent.type === 'blockquote') { - column = pointStart$5(parent).column + 2; - } else if (parent && parent.type === 'listItem') { - column = pointStart$5(parent.children[0]).column; - - // Skip past the first line if we’re the first child of a list item. - /* c8 ignore next 3 */ - if (parent.children[0] === node) { - line++; - } - } - - // In a parent we don’t know, exit. - if (!column || !line) { - return - } - - while (line <= end) { - let offset = loc.toOffset({line, column}); - const lineColumn = offset; - - while (/[ \t]/.test(value.charAt(offset - 1))) { - offset--; - } - - if (!offset || /[\r\n>]/.test(value.charAt(offset - 1))) { - offset = lineColumn; - - while (/[ \t]/.test(value.charAt(offset))) { - offset++; - } - - if (lineColumn !== offset) { - file.message('Do not indent table rows', loc.toPoint(offset)); - } - } - - line++; - } - - return SKIP$9 - }); - } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$6 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$6(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$7(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$7(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$6.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Point} Point - * @typedef {import('vfile').VFile} VFile - * - * @typedef {Pick<Point, 'line'|'column'>} PositionalPoint - * @typedef {Required<Point>} FullPoint - * @typedef {NonNullable<Point['offset']>} Offset - */ - -/** - * Get transform functions for the given `document`. - * - * @param {string|Uint8Array|VFile} file - */ -function location(file) { - var value = String(file); - /** @type {Array.<number>} */ - var indices = []; - var search = /\r?\n|\r/g; - - while (search.test(value)) { - indices.push(search.lastIndex); - } - - indices.push(value.length + 1); - - return {toPoint, toOffset} - - /** - * Get the line and column-based `point` for `offset` in the bound indices. - * Returns a point with `undefined` values when given invalid or out of bounds - * input. - * - * @param {Offset} offset - * @returns {FullPoint} - */ - function toPoint(offset) { - var index = -1; - - if (offset > -1 && offset < indices[indices.length - 1]) { - while (++index < indices.length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset - } - } - } - } - - return {line: undefined, column: undefined, offset: undefined} - } - - /** - * Get the `offset` for a line and column-based `point` in the bound indices. - * Returns `-1` when given invalid or out of bounds input. - * - * @param {PositionalPoint} point - * @returns {Offset} - */ - function toOffset(point) { - var line = point && point.line; - var column = point && point.column; - /** @type {number} */ - var offset; - - if ( - typeof line === 'number' && - typeof column === 'number' && - !Number.isNaN(line) && - !Number.isNaN(column) && - line - 1 in indices - ) { - offset = (indices[line - 2] || 0) + column - 1 || 0; - } - - return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 - } -} - -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module no-tabs - * @fileoverview - * Warn when hard tabs (`\t`) are used instead of spaces. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * uses spaces where tabs are used for indentation, but retains tabs used in - * content. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md"} - * - * Foo Bar - * - * ····Foo - * - * @example - * {"name": "not-ok.md", "label": "input", "positionless": true} - * - * »Here's one before a code block. - * - * Here's a tab:», and here is another:». - * - * And this is in `inline»code`. - * - * >»This is in a block quote. - * - * *»And… - * - * »1.»in a list. - * - * And this is a tab as the last character.» - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1: Use spaces instead of tabs - * 3:14: Use spaces instead of tabs - * 3:37: Use spaces instead of tabs - * 5:23: Use spaces instead of tabs - * 7:2: Use spaces instead of tabs - * 9:2: Use spaces instead of tabs - * 11:1: Use spaces instead of tabs - * 11:4: Use spaces instead of tabs - * 13:41: Use spaces instead of tabs - */ - -const remarkLintNoTabs = lintRule$6( - 'remark-lint:no-tabs', - /** @type {import('unified-lint-rule').Rule<Root, void>} */ - (_, file) => { - const value = String(file); - const toPoint = location(file).toPoint; - let index = value.indexOf('\t'); - - while (index !== -1) { - file.message('Use spaces instead of tabs', toPoint(index)); - index = value.indexOf('\t', index + 1); - } - } -); - -/** - * An Array.prototype.slice.call(arguments) alternative - * - * @param {Object} args something with a length - * @param {Number} slice - * @param {Number} sliceEnd - * @api public - */ - -var sliced$1 = function (args, slice, sliceEnd) { - var ret = []; - var len = args.length; - - if (0 === len) return ret; - - var start = slice < 0 - ? Math.max(0, slice + len) - : slice || 0; - - if (sliceEnd !== undefined) { - len = sliceEnd < 0 - ? sliceEnd + len - : sliceEnd; - } - - while (len-- > start) { - ret[len - start] = args[len]; - } - - return ret; -}; - -/** - * slice() reference. - */ - -var slice = Array.prototype.slice; - -/** - * Expose `co`. - */ - -var co_1 = co$1; - -/** - * Wrap the given generator `fn` and - * return a thunk. - * - * @param {Function} fn - * @return {Function} - * @api public - */ - -function co$1(fn) { - var isGenFun = isGeneratorFunction(fn); - - return function (done) { - var ctx = this; - - // in toThunk() below we invoke co() - // with a generator, so optimize for - // this case - var gen = fn; - - // we only need to parse the arguments - // if gen is a generator function. - if (isGenFun) { - var args = slice.call(arguments), len = args.length; - var hasCallback = len && 'function' == typeof args[len - 1]; - done = hasCallback ? args.pop() : error; - gen = fn.apply(this, args); - } else { - done = done || error; - } - - next(); - - // #92 - // wrap the callback in a setImmediate - // so that any of its errors aren't caught by `co` - function exit(err, res) { - setImmediate(function(){ - done.call(ctx, err, res); - }); - } - - function next(err, res) { - var ret; - - // multiple args - if (arguments.length > 2) res = slice.call(arguments, 1); - - // error - if (err) { - try { - ret = gen.throw(err); - } catch (e) { - return exit(e); - } - } - - // ok - if (!err) { - try { - ret = gen.next(res); - } catch (e) { - return exit(e); - } - } - - // done - if (ret.done) return exit(null, ret.value); - - // normalize - ret.value = toThunk(ret.value, ctx); - - // run - if ('function' == typeof ret.value) { - var called = false; - try { - ret.value.call(ctx, function(){ - if (called) return; - called = true; - next.apply(ctx, arguments); - }); - } catch (e) { - setImmediate(function(){ - if (called) return; - called = true; - next(e); - }); - } - return; - } - - // invalid - next(new TypeError('You may only yield a function, promise, generator, array, or object, ' - + 'but the following was passed: "' + String(ret.value) + '"')); - } - } -} - -/** - * Convert `obj` into a normalized thunk. - * - * @param {Mixed} obj - * @param {Mixed} ctx - * @return {Function} - * @api private - */ - -function toThunk(obj, ctx) { - - if (isGeneratorFunction(obj)) { - return co$1(obj.call(ctx)); - } - - if (isGenerator(obj)) { - return co$1(obj); - } - - if (isPromise(obj)) { - return promiseToThunk(obj); - } - - if ('function' == typeof obj) { - return obj; - } - - if (isObject$1(obj) || Array.isArray(obj)) { - return objectToThunk.call(ctx, obj); - } - - return obj; -} - -/** - * Convert an object of yieldables to a thunk. - * - * @param {Object} obj - * @return {Function} - * @api private - */ - -function objectToThunk(obj){ - var ctx = this; - var isArray = Array.isArray(obj); - - return function(done){ - var keys = Object.keys(obj); - var pending = keys.length; - var results = isArray - ? new Array(pending) // predefine the array length - : new obj.constructor(); - var finished; - - if (!pending) { - setImmediate(function(){ - done(null, results); - }); - return; - } - - // prepopulate object keys to preserve key ordering - if (!isArray) { - for (var i = 0; i < pending; i++) { - results[keys[i]] = undefined; - } - } - - for (var i = 0; i < keys.length; i++) { - run(obj[keys[i]], keys[i]); - } - - function run(fn, key) { - if (finished) return; - try { - fn = toThunk(fn, ctx); - - if ('function' != typeof fn) { - results[key] = fn; - return --pending || done(null, results); - } - - fn.call(ctx, function(err, res){ - if (finished) return; - - if (err) { - finished = true; - return done(err); - } - - results[key] = res; - --pending || done(null, results); - }); - } catch (err) { - finished = true; - done(err); - } - } - } -} - -/** - * Convert `promise` to a thunk. - * - * @param {Object} promise - * @return {Function} - * @api private - */ - -function promiseToThunk(promise) { - return function(fn){ - promise.then(function(res) { - fn(null, res); - }, fn); - } -} - -/** - * Check if `obj` is a promise. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ - -function isPromise(obj) { - return obj && 'function' == typeof obj.then; -} - -/** - * Check if `obj` is a generator. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ - -function isGenerator(obj) { - return obj && 'function' == typeof obj.next && 'function' == typeof obj.throw; -} - -/** - * Check if `obj` is a generator function. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ - -function isGeneratorFunction(obj) { - return obj && obj.constructor && 'GeneratorFunction' == obj.constructor.name; -} - -/** - * Check for plain object. - * - * @param {Mixed} val - * @return {Boolean} - * @api private - */ - -function isObject$1(val) { - return val && Object == val.constructor; -} - -/** - * Throw `err` in a new stack. - * - * This is used when co() is invoked - * without supplying a callback, which - * should only be for demonstrational - * purposes. - * - * @param {Error} err - * @api private - */ - -function error(err) { - if (!err) return; - setImmediate(function(){ - throw err; - }); -} - -/** - * Module Dependencies - */ - -var sliced = sliced$1; -var noop = function(){}; -var co = co_1; - -/** - * Export `wrapped` - */ - -var wrapped_1 = wrapped$1; - -/** - * Wrap a function to support - * sync, async, and gen functions. - * - * @param {Function} fn - * @return {Function} - * @api public - */ - -function wrapped$1(fn) { - function wrap() { - var args = sliced(arguments); - var last = args[args.length - 1]; - var ctx = this; - - // done - var done = typeof last == 'function' ? args.pop() : noop; - - // nothing - if (!fn) { - return done.apply(ctx, [null].concat(args)); - } - - // generator - if (generator(fn)) { - return co(fn).apply(ctx, args.concat(done)); - } - - // async - if (fn.length > args.length) { - // NOTE: this only handles uncaught synchronous errors - try { - return fn.apply(ctx, args.concat(done)); - } catch (e) { - return done(e); - } - } - - // sync - return sync(fn, done).apply(ctx, args); - } - - return wrap; -} - -/** - * Wrap a synchronous function execution. - * - * @param {Function} fn - * @param {Function} done - * @return {Function} - * @api private - */ - -function sync(fn, done) { - return function () { - var ret; - - try { - ret = fn.apply(this, arguments); - } catch (err) { - return done(err); - } - - if (promise(ret)) { - ret.then(function (value) { done(null, value); }, done); - } else { - ret instanceof Error ? done(ret) : done(null, ret); - } - } -} - -/** - * Is `value` a generator? - * - * @param {Mixed} value - * @return {Boolean} - * @api private - */ - -function generator(value) { - return value - && value.constructor - && 'GeneratorFunction' == value.constructor.name; -} - - -/** - * Is `value` a promise? - * - * @param {Mixed} value - * @return {Boolean} - * @api private - */ - -function promise(value) { - return value && 'function' == typeof value.then; -} - -var wrapped = wrapped_1; - -var unifiedLintRule = factory$2; - -function factory$2(id, rule) { - var parts = id.split(':'); - var source = parts[0]; - var ruleId = parts[1]; - var fn = wrapped(rule); - - /* istanbul ignore if - possibly useful if externalised later. */ - if (!ruleId) { - ruleId = source; - source = null; - } - - attacher.displayName = id; - - return attacher - - function attacher(raw) { - var config = coerce$6(ruleId, raw); - var severity = config[0]; - var options = config[1]; - var fatal = severity === 2; - - return severity ? transformer : undefined - - function transformer(tree, file, next) { - var index = file.messages.length; - - fn(tree, file, options, done); - - function done(err) { - var messages = file.messages; - var message; - - // Add the error, if not already properly added. - /* istanbul ignore if - only happens for incorrect plugins */ - if (err && messages.indexOf(err) === -1) { - try { - file.fail(err); - } catch (_) {} - } - - while (index < messages.length) { - message = messages[index]; - message.ruleId = ruleId; - message.source = source; - message.fatal = fatal; - - index++; - } - - next(); - } - } - } -} - -// Coerce a value to a severity--options tuple. -function coerce$6(name, value) { - var def = 1; - var result; - var level; - - /* istanbul ignore if - Handled by unified in v6.0.0 */ - if (typeof value === 'boolean') { - result = [value]; - } else if (value == null) { - result = [def]; - } else if ( - typeof value === 'object' && - (typeof value[0] === 'number' || - typeof value[0] === 'boolean' || - typeof value[0] === 'string') - ) { - result = value.concat(); - } else { - result = [1, value]; - } - - level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - return result -} - -var rule$1 = unifiedLintRule; - -var remarkLintNoTrailingSpaces = rule$1('remark-lint:no-trailing-spaces', noTrailingSpaces); - -/** - * Lines that are just space characters are not present in - * the AST, which is why we loop through lines manually. - */ - -function noTrailingSpaces(ast, file) { - var lines = file.toString().split(/\r?\n/); - for (var i = 0; i < lines.length; i++) { - var currentLine = lines[i]; - var lineIndex = i + 1; - if (/\s$/.test(currentLine)) { - file.message('Remove trailing whitespace', { - position: { - start: { line: lineIndex, column: currentLine.length + 1 }, - end: { line: lineIndex } - } - }); - } - } -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$5 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$5(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$5(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$5(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$5.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -function* getLinksRecursively(node) { - if (node.url) { - yield node; - } - for (const child of node.children || []) { - yield* getLinksRecursively(child); - } -} - -function validateLinks(tree, vfile) { - const currentFileURL = url.pathToFileURL(require$$0__default$2['default'].join(vfile.cwd, vfile.path)); - let previousDefinitionLabel; - for (const node of getLinksRecursively(tree)) { - if (node.url[0] !== "#") { - const targetURL = new URL(node.url, currentFileURL); - if (targetURL.protocol === "file:" && !require$$0__default$3['default'].existsSync(targetURL)) { - vfile.message("Broken link", node); - } else if (targetURL.pathname === currentFileURL.pathname) { - const expected = node.url.includes("#") - ? node.url.slice(node.url.indexOf("#")) - : "#"; - vfile.message( - `Self-reference must start with hash (expected "${expected}", got "${node.url}")`, - node - ); - } - } - if (node.type === "definition") { - if (previousDefinitionLabel && previousDefinitionLabel > node.label) { - vfile.message( - `Unordered reference ("${node.label}" should be before "${previousDefinitionLabel}")`, - node - ); - } - previousDefinitionLabel = node.label; - } - } -} - -const remarkLintNodejsLinks = lintRule$5( - "remark-lint:nodejs-links", - validateLinks -); - -/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ -function isNothing(subject) { - return (typeof subject === 'undefined') || (subject === null); -} - - -function isObject(subject) { - return (typeof subject === 'object') && (subject !== null); -} - - -function toArray(sequence) { - if (Array.isArray(sequence)) return sequence; - else if (isNothing(sequence)) return []; - - return [ sequence ]; -} - - -function extend(target, source) { - var index, length, key, sourceKeys; - - if (source) { - sourceKeys = Object.keys(source); - - for (index = 0, length = sourceKeys.length; index < length; index += 1) { - key = sourceKeys[index]; - target[key] = source[key]; - } - } - - return target; -} - - -function repeat(string, count) { - var result = '', cycle; - - for (cycle = 0; cycle < count; cycle += 1) { - result += string; - } - - return result; -} - - -function isNegativeZero(number) { - return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); -} - - -var isNothing_1 = isNothing; -var isObject_1 = isObject; -var toArray_1 = toArray; -var repeat_1 = repeat; -var isNegativeZero_1 = isNegativeZero; -var extend_1 = extend; - -var common = { - isNothing: isNothing_1, - isObject: isObject_1, - toArray: toArray_1, - repeat: repeat_1, - isNegativeZero: isNegativeZero_1, - extend: extend_1 -}; - -// YAML error class. http://stackoverflow.com/questions/8458984 - - -function formatError(exception, compact) { - var where = '', message = exception.reason || '(unknown reason)'; - - if (!exception.mark) return message; - - if (exception.mark.name) { - where += 'in "' + exception.mark.name + '" '; - } - - where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; - - if (!compact && exception.mark.snippet) { - where += '\n\n' + exception.mark.snippet; - } - - return message + ' ' + where; -} - - -function YAMLException$1(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = formatError(this, false); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException$1.prototype = Object.create(Error.prototype); -YAMLException$1.prototype.constructor = YAMLException$1; - - -YAMLException$1.prototype.toString = function toString(compact) { - return this.name + ': ' + formatError(this, compact); -}; - - -var exception = YAMLException$1; - -// get snippet for a single line, respecting maxLength -function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { - var head = ''; - var tail = ''; - var maxHalfLength = Math.floor(maxLineLength / 2) - 1; - - if (position - lineStart > maxHalfLength) { - head = ' ... '; - lineStart = position - maxHalfLength + head.length; - } - - if (lineEnd - position > maxHalfLength) { - tail = ' ...'; - lineEnd = position + maxHalfLength - tail.length; - } - - return { - str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, - pos: position - lineStart + head.length // relative position - }; -} - - -function padStart(string, max) { - return common.repeat(' ', max - string.length) + string; -} - - -function makeSnippet(mark, options) { - options = Object.create(options || null); - - if (!mark.buffer) return null; - - if (!options.maxLength) options.maxLength = 79; - if (typeof options.indent !== 'number') options.indent = 1; - if (typeof options.linesBefore !== 'number') options.linesBefore = 3; - if (typeof options.linesAfter !== 'number') options.linesAfter = 2; - - var re = /\r?\n|\r|\0/g; - var lineStarts = [ 0 ]; - var lineEnds = []; - var match; - var foundLineNo = -1; - - while ((match = re.exec(mark.buffer))) { - lineEnds.push(match.index); - lineStarts.push(match.index + match[0].length); - - if (mark.position <= match.index && foundLineNo < 0) { - foundLineNo = lineStarts.length - 2; - } - } - - if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; - - var result = '', i, line; - var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; - var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); - - for (i = 1; i <= options.linesBefore; i++) { - if (foundLineNo - i < 0) break; - line = getLine( - mark.buffer, - lineStarts[foundLineNo - i], - lineEnds[foundLineNo - i], - mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), - maxLineLength - ); - result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + - ' | ' + line.str + '\n' + result; - } - - line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); - result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + - ' | ' + line.str + '\n'; - result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; - - for (i = 1; i <= options.linesAfter; i++) { - if (foundLineNo + i >= lineEnds.length) break; - line = getLine( - mark.buffer, - lineStarts[foundLineNo + i], - lineEnds[foundLineNo + i], - mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), - maxLineLength - ); - result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + - ' | ' + line.str + '\n'; - } - - return result.replace(/\n$/, ''); -} - - -var snippet = makeSnippet; - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'multi', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'representName', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type$1(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.options = options; // keep original options in case user wants to extend this type later - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.representName = options['representName'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.multi = options['multi'] || false; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -var type = Type$1; - -/*eslint-disable max-len*/ - - - - - -function compileList(schema, name) { - var result = []; - - schema[name].forEach(function (currentType) { - var newIndex = result.length; - - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && - previousType.kind === currentType.kind && - previousType.multi === currentType.multi) { - - newIndex = previousIndex; - } - }); - - result[newIndex] = currentType; - }); - - return result; -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {}, - multi: { - scalar: [], - sequence: [], - mapping: [], - fallback: [] - } - }, index, length; - - function collectType(type) { - if (type.multi) { - result.multi[type.kind].push(type); - result.multi['fallback'].push(type); - } else { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema$1(definition) { - return this.extend(definition); -} - - -Schema$1.prototype.extend = function extend(definition) { - var implicit = []; - var explicit = []; - - if (definition instanceof type) { - // Schema.extend(type) - explicit.push(definition); - - } else if (Array.isArray(definition)) { - // Schema.extend([ type1, type2, ... ]) - explicit = explicit.concat(definition); - - } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { - // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) - if (definition.implicit) implicit = implicit.concat(definition.implicit); - if (definition.explicit) explicit = explicit.concat(definition.explicit); - - } else { - throw new exception('Schema.extend argument should be a Type, [ Type ], ' + - 'or a schema definition ({ implicit: [...], explicit: [...] })'); - } - - implicit.forEach(function (type$1) { - if (!(type$1 instanceof type)) { - throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - if (type$1.loadKind && type$1.loadKind !== 'scalar') { - throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - - if (type$1.multi) { - throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); - } - }); - - explicit.forEach(function (type$1) { - if (!(type$1 instanceof type)) { - throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - }); - - var result = Object.create(Schema$1.prototype); - - result.implicit = (this.implicit || []).concat(implicit); - result.explicit = (this.explicit || []).concat(explicit); - - result.compiledImplicit = compileList(result, 'implicit'); - result.compiledExplicit = compileList(result, 'explicit'); - result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); - - return result; -}; - - -var schema = Schema$1; - -var str = new type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); - -var seq = new type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); - -var map = new type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); - -var failsafe = new schema({ - explicit: [ - str, - seq, - map - ] -}); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -var _null = new type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; }, - empty: function () { return ''; } - }, - defaultStyle: 'lowercase' -}); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -var bool = new type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; + * {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "output", "positionless": true} + * + * 1:13: Line must be at most 10 characters + * 2:13: Line must be at most 10 characters + * 3:12: Line must be at most 10 characters + * 4:12: Line must be at most 10 characters + */ - var max = data.length, - index = 0, - hasDigits = false, - ch; +const remarkLintMaximumLineLength = lintRule( + 'remark-lint:maximum-line-length', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 80) => { + const value = String(file); + const lines = value.split(/\r?\n/); - if (!max) return false; + visit$2(tree, (node) => { + if ( + (node.type === 'heading' || + node.type === 'table' || + node.type === 'code' || + node.type === 'definition' || + node.type === 'html' || + // @ts-expect-error: JSX is from MDX: <https://github.com/mdx-js/specification>. + node.type === 'jsx' || + node.type === 'yaml' || + // @ts-expect-error: TOML is from frontmatter. + node.type === 'toml') && + !generated(node) + ) { + allowList(pointStart(node).line - 1, pointEnd(node).line); + } + }); - ch = data[index]; + // Finally, allow some inline spans, but only if they occur at or after + // the wrap. + // However, when they do, and there’s whitespace after it, they are not + // allowed. + visit$2(tree, (node, pos, parent_) => { + const parent = /** @type {Parent} */ (parent_); - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } + if ( + (node.type === 'link' || + node.type === 'image' || + node.type === 'inlineCode') && + !generated(node) && + parent && + typeof pos === 'number' + ) { + const initial = pointStart(node); + const final = pointEnd(node); - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; + // Not allowing when starting after the border, or ending before it. + if (initial.column > option || final.column < option) { + return + } - // base 2, base 8, base 16 + const next = parent.children[pos + 1]; - if (ch === 'b') { - // base 2 - index++; + // Not allowing when there’s whitespace after the link. + if ( + next && + pointStart(next).line === initial.line && + (!('value' in next) || /^(.+?[ \t].+?)/.test(next.value)) + ) { + return + } - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; + allowList(initial.line - 1, final.line); } - return hasDigits && ch !== '_'; - } + }); + // Iterate over every line, and warn for violating lines. + let index = -1; - if (ch === 'x') { - // base 16 - index++; + while (++index < lines.length) { + const lineLength = lines[index].length; - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; + if (lineLength > option) { + file.message('Line must be at most ' + option + ' characters', { + line: index + 1, + column: lineLength + 1 + }); } - return hasDigits && ch !== '_'; } - - if (ch === 'o') { - // base 8 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; + /** + * Allowlist from `initial` to `final`, zero-based. + * + * @param {number} initial + * @param {number} final + */ + function allowList(initial, final) { + while (initial < final) { + lines[initial++] = ''; } - return hasDigits && ch !== '_'; } } +); - // base 10 (except 0) +var remarkLintMaximumLineLength$1 = remarkLintMaximumLineLength; - // value should not start with `_`; - if (ch === '_') return false; +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-consecutive-blank-lines + * @fileoverview + * Warn for too many consecutive blank lines. + * Knows about the extra line needed between a list and indented code, and two + * lists. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * always uses one blank line between blocks if possible, or two lines when + * needed. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * Foo… + * ␊ + * …Bar. + * + * @example + * {"name": "empty-document.md"} + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * Foo… + * ␊ + * ␊ + * …Bar + * ␊ + * ␊ + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 4:1: Remove 1 line before node + * 4:5: Remove 2 lines after node + */ - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } +const remarkLintNoConsecutiveBlankLines = lintRule( + 'remark-lint:no-consecutive-blank-lines', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + visit$2(tree, (node) => { + if (!generated(node) && 'children' in node) { + const head = node.children[0]; - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; + if (head && !generated(head)) { + // Compare parent and first child. + compare(pointStart(node), pointStart(head), 0); - return true; -} + // Compare between each child. + let index = -1; -function constructYamlInteger(data) { - var value = data, sign = 1, ch; + while (++index < node.children.length) { + const previous = node.children[index - 1]; + const child = node.children[index]; - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } + if (previous && !generated(previous) && !generated(child)) { + compare(pointEnd(previous), pointStart(child), 2); + } + } - ch = value[0]; + const tail = node.children[node.children.length - 1]; - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } + // Compare parent and last child. + if (tail !== head && !generated(tail)) { + compare(pointEnd(node), pointEnd(tail), 1); + } + } + } + }); - if (value === '0') return 0; + /** + * Compare the difference between `start` and `end`, and warn when that + * difference exceeds `max`. + * + * @param {Point} start + * @param {Point} end + * @param {0|1|2} max + */ + function compare(start, end, max) { + const diff = end.line - start.line; + const lines = Math.abs(diff) - max; - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); - if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + if (lines > 0) { + file.message( + 'Remove ' + + lines + + ' ' + + plural('line', Math.abs(lines)) + + ' ' + + (diff > 0 ? 'before' : 'after') + + ' node', + end + ); + } + } } +); - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -var int = new type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); +var remarkLintNoConsecutiveBlankLines$1 = remarkLintNoConsecutiveBlankLines; -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-file-name-articles + * @fileoverview + * Warn when file names start with an article. + * + * @example + * {"name": "title.md"} + * + * @example + * {"name": "a-title.md", "label": "output", "positionless": true} + * + * 1:1: Do not start file names with `a` + * + * @example + * {"name": "the-title.md", "label": "output", "positionless": true} + * + * 1:1: Do not start file names with `the` + * + * @example + * {"name": "teh-title.md", "label": "output", "positionless": true} + * + * 1:1: Do not start file names with `teh` + * + * @example + * {"name": "an-article.md", "label": "output", "positionless": true} + * + * 1:1: Do not start file names with `an` + */ -function resolveYamlFloat(data) { - if (data === null) return false; +const remarkLintNoFileNameArticles = lintRule( + 'remark-lint:no-file-name-articles', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (_, file) => { + const match = file.stem && file.stem.match(/^(the|teh|an?)\b/i); - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; + if (match) { + file.message('Do not start file names with `' + match[0] + '`'); + } } +); - return true; -} - -function constructYamlFloat(data) { - var value, sign; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } +var remarkLintNoFileNameArticles$1 = remarkLintNoFileNameArticles; - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-file-name-consecutive-dashes + * @fileoverview + * Warn when file names contain consecutive dashes. + * + * @example + * {"name": "plug-ins.md"} + * + * @example + * {"name": "plug--ins.md", "label": "output", "positionless": true} + * + * 1:1: Do not use consecutive dashes in a file name + */ - } else if (value === '.nan') { - return NaN; +const remarkLintNoFileNameConsecutiveDashes = lintRule( + 'remark-lint:no-file-name-consecutive-dashes', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (_, file) => { + if (file.stem && /-{2,}/.test(file.stem)) { + file.message('Do not use consecutive dashes in a file name'); + } } - return sign * parseFloat(value, 10); -} - +); -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; +var remarkLintNoFileNameConsecutiveDashes$1 = remarkLintNoFileNameConsecutiveDashes; -function representYamlFloat(object, style) { - var res; +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-file-name-outer-dashes + * @fileoverview + * Warn when file names contain initial or final dashes (hyphen-minus, `-`). + * + * @example + * {"name": "readme.md"} + * + * @example + * {"name": "-readme.md", "label": "output", "positionless": true} + * + * 1:1: Do not use initial or final dashes in a file name + * + * @example + * {"name": "readme-.md", "label": "output", "positionless": true} + * + * 1:1: Do not use initial or final dashes in a file name + */ - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; +const remarkLintNofileNameOuterDashes = lintRule( + 'remark-lint:no-file-name-outer-dashes', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (_, file) => { + if (file.stem && /^-|-$/.test(file.stem)) { + file.message('Do not use initial or final dashes in a file name'); } - } else if (common.isNegativeZero(object)) { - return '-0.0'; } +); - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -var float = new type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); - -var json = failsafe.extend({ - implicit: [ - _null, - bool, - int, - float - ] -}); - -var core = json; - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day +var remarkLintNofileNameOuterDashes$1 = remarkLintNofileNameOuterDashes; -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-heading-indent + * @fileoverview + * Warn when a heading is indented. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * removes all unneeded indentation before headings. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * #·Hello world + * + * Foo + * ----- + * + * #·Hello world·# + * + * Bar + * ===== + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * ···# Hello world + * + * ·Foo + * ----- + * + * ·# Hello world # + * + * ···Bar + * ===== + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:4: Remove 3 spaces before this heading + * 3:2: Remove 1 space before this heading + * 6:2: Remove 1 space before this heading + * 8:4: Remove 3 spaces before this heading + */ -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} +const remarkLintNoHeadingIndent = lintRule( + 'remark-lint:no-heading-indent', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + visit$2(tree, 'heading', (node, _, parent) => { + // Note: it’s rather complex to detect what the expected indent is in block + // quotes and lists, so let’s only do directly in root for now. + if (generated(node) || (parent && parent.type !== 'root')) { + return + } -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; + const diff = pointStart(node).column - 1; - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + if (diff) { + file.message( + 'Remove ' + + diff + + ' ' + + plural('space', diff) + + ' before this heading', + pointStart(node) + ); + } + }); + } +); - if (match === null) throw new Error('Date resolve error'); +var remarkLintNoHeadingIndent$1 = remarkLintNoHeadingIndent; - // match: [1] year [2] month [3] day +var own$1 = {}.hasOwnProperty; - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Position} Position + * @typedef {import('unist').Point} Point + */ - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); +/** + * Stringify one point, a position (start and end points), or a node’s + * positional information. + * + * @param {Node|Position|Point} [value] + * @returns {string} + */ +function stringifyPosition(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' } - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; + // Node. + if (own$1.call(value, 'position') || own$1.call(value, 'type')) { + // @ts-ignore looks like a node. + return position$2(value.position) } - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; + // Position. + if (own$1.call(value, 'start') || own$1.call(value, 'end')) { + // @ts-ignore looks like a position. + return position$2(value) } - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); + // Point. + if (own$1.call(value, 'line') || own$1.call(value, 'column')) { + // @ts-ignore looks like a point. + return point(value) + } - return date; + // ? + return '' } -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); +/** + * @param {Point} point + * @returns {string} + */ +function point(point) { + return index(point && point.line) + ':' + index(point && point.column) } -var timestamp = new type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; +/** + * @param {Position} pos + * @returns {string} + */ +function position$2(pos) { + return point(pos && pos.start) + '-' + point(pos && pos.end) } -var merge = new type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); - -/*eslint-disable no-bitwise*/ - +/** + * @param {number} value + * @returns {number} + */ +function index(value) { + return value && typeof value === 'number' ? value : 1 +} +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-multiple-toplevel-headings + * @fileoverview + * Warn when multiple top level headings are used. + * + * Options: `number`, default: `1`. + * + * @example + * {"name": "ok.md", "setting": 1} + * + * # Foo + * + * ## Bar + * + * @example + * {"name": "not-ok.md", "setting": 1, "label": "input"} + * + * # Foo + * + * # Bar + * + * @example + * {"name": "not-ok.md", "setting": 1, "label": "output"} + * + * 3:1-3:6: Don’t use multiple top level headings (1:1) + */ +const remarkLintNoMultipleToplevelHeadings = lintRule( + 'remark-lint:no-multiple-toplevel-headings', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 1) => { + /** @type {string|undefined} */ + let duplicate; + visit$2(tree, 'heading', (node) => { + if (!generated(node) && node.depth === option) { + if (duplicate) { + file.message( + 'Don’t use multiple top level headings (' + duplicate + ')', + node + ); + } else { + duplicate = stringifyPosition(pointStart(node)); + } + } + }); + } +); -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; +var remarkLintNoMultipleToplevelHeadings$1 = remarkLintNoMultipleToplevelHeadings; +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-shell-dollars + * @fileoverview + * Warn when shell code is prefixed by `$` (dollar sign) characters. + * + * Ignores indented code blocks and fenced code blocks without language flag. + * + * @example + * {"name": "ok.md"} + * + * ```bash + * echo a + * ``` + * + * ```sh + * echo a + * echo a > file + * ``` + * + * ```zsh + * $ echo a + * a + * $ echo a > file + * ``` + * + * Some empty code: + * + * ```command + * ``` + * + * It’s fine to use dollars in non-shell code. + * + * ```js + * $('div').remove() + * ``` + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * ```sh + * $ echo a + * ``` + * + * ```bash + * $ echo a + * $ echo a > file + * ``` + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1-3:4: Do not use dollar signs before shell commands + * 5:1-8:4: Do not use dollar signs before shell commands + */ -function resolveYamlBinary(data) { - if (data === null) return false; +// List of shell script file extensions (also used as code flags for syntax +// highlighting on GitHub): +// See: <https://github.com/github/linguist/blob/40992ba/lib/linguist/languages.yml#L4984> +const flags = new Set([ + 'sh', + 'bash', + 'bats', + 'cgi', + 'command', + 'fcgi', + 'ksh', + 'tmux', + 'tool', + 'zsh' +]); - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; +const remarkLintNoShellDollars = lintRule( + 'remark-lint:no-shell-dollars', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + visit$2(tree, 'code', (node) => { + // Check both known shell code and unknown code. + if (!generated(node) && node.lang && flags.has(node.lang)) { + const lines = node.value + .split('\n') + .filter((line) => line.trim().length > 0); + let index = -1; - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); + if (lines.length === 0) { + return + } - // Skip CR/LF - if (code > 64) continue; + while (++index < lines.length) { + const line = lines[index]; - // Fail on illegal characters - if (code < 0) return false; + if (line.trim() && !/^\s*\$\s*/.test(line)) { + return + } + } - bitlen += 6; + file.message('Do not use dollar signs before shell commands', node); + } + }); } +); - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) +var remarkLintNoShellDollars$1 = remarkLintNoShellDollars; - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-table-indentation + * @fileoverview + * Warn when tables are indented. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * removes all unneeded indentation before tables. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md", "gfm": true} + * + * Paragraph. + * + * | A | B | + * | ----- | ----- | + * | Alpha | Bravo | + * + * @example + * {"name": "not-ok.md", "label": "input", "gfm": true} + * + * Paragraph. + * + * ···| A | B | + * ···| ----- | ----- | + * ···| Alpha | Bravo | + * + * @example + * {"name": "not-ok.md", "label": "output", "gfm": true} + * + * 3:4: Do not indent table rows + * 4:4: Do not indent table rows + * 5:4: Do not indent table rows + * + * @example + * {"name": "not-ok-blockquote.md", "label": "input", "gfm": true} + * + * >··| A | + * >·| - | + * + * @example + * {"name": "not-ok-blockquote.md", "label": "output", "gfm": true} + * + * 1:4: Do not indent table rows + * + * @example + * {"name": "not-ok-list.md", "label": "input", "gfm": true} + * + * -···paragraph + * + * ·····| A | + * ····| - | + * + * @example + * {"name": "not-ok-list.md", "label": "output", "gfm": true} + * + * 3:6: Do not indent table rows + */ - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } +const remarkLintNoTableIndentation = lintRule( + 'remark-lint:no-table-indentation', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (tree, file) => { + const value = String(file); + const loc = location(value); - // Dump tail + visit$2(tree, 'table', (node, _, parent) => { + const end = pointEnd(node).line; + let line = pointStart(node).line; + let column = 0; - tailbits = (max % 4) * 6; + if (parent && parent.type === 'root') { + column = 1; + } else if (parent && parent.type === 'blockquote') { + column = pointStart(parent).column + 2; + } else if (parent && parent.type === 'listItem') { + column = pointStart(parent.children[0]).column; - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } + // Skip past the first line if we’re the first child of a list item. + /* c8 ignore next 3 */ + if (parent.children[0] === node) { + line++; + } + } - return new Uint8Array(result); -} + // In a parent we don’t know, exit. + if (!column || !line) { + return + } -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; + while (line <= end) { + let offset = loc.toOffset({line, column}); + const lineColumn = offset; - // Convert every three bytes to 4 ASCII characters. + while (/[ \t]/.test(value.charAt(offset - 1))) { + offset--; + } - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } + if (!offset || /[\r\n>]/.test(value.charAt(offset - 1))) { + offset = lineColumn; - bits = (bits << 8) + object[idx]; - } + while (/[ \t]/.test(value.charAt(offset))) { + offset++; + } - // Dump tail + if (lineColumn !== offset) { + file.message('Do not indent table rows', loc.toPoint(offset)); + } + } - tail = max % 3; + line++; + } - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; + return SKIP$2 + }); } +); - return result; -} - -function isBinary(obj) { - return Object.prototype.toString.call(obj) === '[object Uint8Array]'; -} - -var binary = new type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); - -var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; -var _toString$2 = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; +var remarkLintNoTableIndentation$1 = remarkLintNoTableIndentation; - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-tabs + * @fileoverview + * Warn when hard tabs (`\t`) are used instead of spaces. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * uses spaces where tabs are used for indentation, but retains tabs used in + * content. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * Foo Bar + * + * ····Foo + * + * @example + * {"name": "not-ok.md", "label": "input", "positionless": true} + * + * »Here's one before a code block. + * + * Here's a tab:», and here is another:». + * + * And this is in `inline»code`. + * + * >»This is in a block quote. + * + * *»And… + * + * »1.»in a list. + * + * And this is a tab as the last character.» + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:1: Use spaces instead of tabs + * 3:14: Use spaces instead of tabs + * 3:37: Use spaces instead of tabs + * 5:23: Use spaces instead of tabs + * 7:2: Use spaces instead of tabs + * 9:2: Use spaces instead of tabs + * 11:1: Use spaces instead of tabs + * 11:4: Use spaces instead of tabs + * 13:41: Use spaces instead of tabs + */ - if (_toString$2.call(pair) !== '[object Object]') return false; +const remarkLintNoTabs = lintRule( + 'remark-lint:no-tabs', + /** @type {import('unified-lint-rule').Rule<Root, void>} */ + (_, file) => { + const value = String(file); + const toPoint = location(file).toPoint; + let index = value.indexOf('\t'); - for (pairKey in pair) { - if (_hasOwnProperty$3.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } + while (index !== -1) { + file.message('Use spaces instead of tabs', toPoint(index)); + index = value.indexOf('\t', index + 1); } + } +); - if (!pairHasKey) return false; +var remarkLintNoTabs$1 = remarkLintNoTabs; - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } +/** + * An Array.prototype.slice.call(arguments) alternative + * + * @param {Object} args something with a length + * @param {Number} slice + * @param {Number} sliceEnd + * @api public + */ - return true; -} +var sliced$1 = function (args, slice, sliceEnd) { + var ret = []; + var len = args.length; -function constructYamlOmap(data) { - return data !== null ? data : []; -} + if (0 === len) return ret; -var omap = new type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); + var start = slice < 0 + ? Math.max(0, slice + len) + : slice || 0; -var _toString$1 = Object.prototype.toString; + if (sliceEnd !== undefined) { + len = sliceEnd < 0 + ? sliceEnd + len + : sliceEnd; + } -function resolveYamlPairs(data) { - if (data === null) return true; + while (len-- > start) { + ret[len - start] = args[len]; + } - var index, length, pair, keys, result, - object = data; + return ret; +}; - result = new Array(object.length); +/** + * slice() reference. + */ - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; +var slice = Array.prototype.slice; - if (_toString$1.call(pair) !== '[object Object]') return false; +/** + * Expose `co`. + */ - keys = Object.keys(pair); +var co_1 = co$1; - if (keys.length !== 1) return false; +/** + * Wrap the given generator `fn` and + * return a thunk. + * + * @param {Function} fn + * @return {Function} + * @api public + */ - result[index] = [ keys[0], pair[keys[0]] ]; - } +function co$1(fn) { + var isGenFun = isGeneratorFunction(fn); - return true; -} + return function (done) { + var ctx = this; -function constructYamlPairs(data) { - if (data === null) return []; + // in toThunk() below we invoke co() + // with a generator, so optimize for + // this case + var gen = fn; - var index, length, pair, keys, result, - object = data; + // we only need to parse the arguments + // if gen is a generator function. + if (isGenFun) { + var args = slice.call(arguments), len = args.length; + var hasCallback = len && 'function' == typeof args[len - 1]; + done = hasCallback ? args.pop() : error; + gen = fn.apply(this, args); + } else { + done = done || error; + } - result = new Array(object.length); + next(); - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; + // #92 + // wrap the callback in a setImmediate + // so that any of its errors aren't caught by `co` + function exit(err, res) { + setImmediate(function(){ + done.call(ctx, err, res); + }); + } - keys = Object.keys(pair); + function next(err, res) { + var ret; - result[index] = [ keys[0], pair[keys[0]] ]; - } + // multiple args + if (arguments.length > 2) res = slice.call(arguments, 1); - return result; -} + // error + if (err) { + try { + ret = gen.throw(err); + } catch (e) { + return exit(e); + } + } -var pairs = new type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); + // ok + if (!err) { + try { + ret = gen.next(res); + } catch (e) { + return exit(e); + } + } -var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; + // done + if (ret.done) return exit(null, ret.value); -function resolveYamlSet(data) { - if (data === null) return true; + // normalize + ret.value = toThunk(ret.value, ctx); - var key, object = data; + // run + if ('function' == typeof ret.value) { + var called = false; + try { + ret.value.call(ctx, function(){ + if (called) return; + called = true; + next.apply(ctx, arguments); + }); + } catch (e) { + setImmediate(function(){ + if (called) return; + called = true; + next(e); + }); + } + return; + } - for (key in object) { - if (_hasOwnProperty$2.call(object, key)) { - if (object[key] !== null) return false; + // invalid + next(new TypeError('You may only yield a function, promise, generator, array, or object, ' + + 'but the following was passed: "' + String(ret.value) + '"')); } } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; } -var set = new type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); - -var _default = core.extend({ - implicit: [ - timestamp, - merge - ], - explicit: [ - binary, - omap, - pairs, - set - ] -}); +/** + * Convert `obj` into a normalized thunk. + * + * @param {Mixed} obj + * @param {Mixed} ctx + * @return {Function} + * @api private + */ -/*eslint-disable max-len,no-use-before-define*/ +function toThunk(obj, ctx) { + if (isGeneratorFunction(obj)) { + return co$1(obj.call(ctx)); + } + if (isGenerator(obj)) { + return co$1(obj); + } + if (isPromise(obj)) { + return promiseToThunk(obj); + } + if ('function' == typeof obj) { + return obj; + } + if (isObject$1(obj) || Array.isArray(obj)) { + return objectToThunk.call(ctx, obj); + } + return obj; +} -var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; +/** + * Convert an object of yieldables to a thunk. + * + * @param {Object} obj + * @return {Function} + * @api private + */ +function objectToThunk(obj){ + var ctx = this; + var isArray = Array.isArray(obj); -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; + return function(done){ + var keys = Object.keys(obj); + var pending = keys.length; + var results = isArray + ? new Array(pending) // predefine the array length + : new obj.constructor(); + var finished; + if (!pending) { + setImmediate(function(){ + done(null, results); + }); + return; + } -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; + // prepopulate object keys to preserve key ordering + if (!isArray) { + for (var i = 0; i < pending; i++) { + results[keys[i]] = undefined; + } + } + for (var i = 0; i < keys.length; i++) { + run(obj[keys[i]], keys[i]); + } -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function run(fn, key) { + if (finished) return; + try { + fn = toThunk(fn, ctx); + if ('function' != typeof fn) { + results[key] = fn; + return --pending || done(null, results); + } -function _class(obj) { return Object.prototype.toString.call(obj); } + fn.call(ctx, function(err, res){ + if (finished) return; -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} + if (err) { + finished = true; + return done(err); + } -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); + results[key] = res; + --pending || done(null, results); + }); + } catch (err) { + finished = true; + done(err); + } + } + } } -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} +/** + * Convert `promise` to a thunk. + * + * @param {Object} promise + * @return {Function} + * @api private + */ -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; +function promiseToThunk(promise) { + return function(fn){ + promise.then(function(res) { + fn(null, res); + }, fn); + } } -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ - /*eslint-disable no-bitwise*/ - lc = c | 0x20; +function isPromise(obj) { + return obj && 'function' == typeof obj.then; +} - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ - return -1; +function isGenerator(obj) { + return obj && 'function' == typeof obj.next && 'function' == typeof obj.throw; } -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGeneratorFunction(obj) { + return obj && obj.constructor && 'GeneratorFunction' == obj.constructor.name; } -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ - return -1; +function isObject$1(val) { + return val && Object == val.constructor; } -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} +/** + * Throw `err` in a new stack. + * + * This is used when co() is invoked + * without supplying a callback, which + * should only be for demonstrational + * purposes. + * + * @param {Error} err + * @api private + */ -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); +function error(err) { + if (!err) return; + setImmediate(function(){ + throw err; + }); } -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} +/** + * Module Dependencies + */ +var sliced = sliced$1; +var noop = function(){}; +var co = co_1; -function State$1(input, options) { - this.input = input; +/** + * Export `wrapped` + */ - this.filename = options['filename'] || null; - this.schema = options['schema'] || _default; - this.onWarning = options['onWarning'] || null; - // (Hidden) Remove? makes the loader to expect YAML 1.1 documents - // if such documents have no explicit %YAML directive - this.legacy = options['legacy'] || false; +var wrapped_1 = wrapped$2; - this.json = options['json'] || false; - this.listener = options['listener'] || null; +/** + * Wrap a function to support + * sync, async, and gen functions. + * + * @param {Function} fn + * @return {Function} + * @api public + */ - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; +function wrapped$2(fn) { + function wrap() { + var args = sliced(arguments); + var last = args[args.length - 1]; + var ctx = this; - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; + // done + var done = typeof last == 'function' ? args.pop() : noop; - // position of first leading tab in the current line, - // used to make sure there are no tabs in the indentation - this.firstTabInLine = -1; + // nothing + if (!fn) { + return done.apply(ctx, [null].concat(args)); + } + + // generator + if (generator(fn)) { + return co(fn).apply(ctx, args.concat(done)); + } - this.documents = []; + // async + if (fn.length > args.length) { + // NOTE: this only handles uncaught synchronous errors + try { + return fn.apply(ctx, args.concat(done)); + } catch (e) { + return done(e); + } + } - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ + // sync + return sync(fn, done).apply(ctx, args); + } + return wrap; } +/** + * Wrap a synchronous function execution. + * + * @param {Function} fn + * @param {Function} done + * @return {Function} + * @api private + */ -function generateError(state, message) { - var mark = { - name: state.filename, - buffer: state.input.slice(0, -1), // omit trailing \0 - position: state.position, - line: state.line, - column: state.position - state.lineStart - }; +function sync(fn, done) { + return function () { + var ret; - mark.snippet = snippet(mark); + try { + ret = fn.apply(this, arguments); + } catch (err) { + return done(err); + } - return new exception(message, mark); + if (promise(ret)) { + ret.then(function (value) { done(null, value); }, done); + } else { + ret instanceof Error ? done(ret) : done(null, ret); + } + } } -function throwError(state, message) { - throw generateError(state, message); -} +/** + * Is `value` a generator? + * + * @param {Mixed} value + * @return {Boolean} + * @api private + */ -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } +function generator(value) { + return value + && value.constructor + && 'GeneratorFunction' == value.constructor.name; } -var directiveHandlers = { +/** + * Is `value` a promise? + * + * @param {Mixed} value + * @return {Boolean} + * @api private + */ - YAML: function handleYamlDirective(state, name, args) { +function promise(value) { + return value && 'function' == typeof value.then; +} - var match, major, minor; +var wrapped$1 = wrapped_1; - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } +var unifiedLintRule$1 = factory$3; - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } +function factory$3(id, rule) { + var parts = id.split(':'); + var source = parts[0]; + var ruleId = parts[1]; + var fn = wrapped$1(rule); - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + /* istanbul ignore if - possibly useful if externalised later. */ + if (!ruleId) { + ruleId = source; + source = null; + } - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } + attacher.displayName = id; - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); + return attacher - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } + function attacher(raw) { + var config = coerce$1(ruleId, raw); + var severity = config[0]; + var options = config[1]; + var fatal = severity === 2; - state.version = args[0]; - state.checkLineBreaks = (minor < 2); + return severity ? transformer : undefined - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, + function transformer(tree, file, next) { + var index = file.messages.length; - TAG: function handleTagDirective(state, name, args) { + fn(tree, file, options, done); - var handle, prefix; + function done(err) { + var messages = file.messages; + var message; - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } + // Add the error, if not already properly added. + /* istanbul ignore if - only happens for incorrect plugins */ + if (err && messages.indexOf(err) === -1) { + try { + file.fail(err); + } catch (_) {} + } - handle = args[0]; - prefix = args[1]; + while (index < messages.length) { + message = messages[index]; + message.ruleId = ruleId; + message.source = source; + message.fatal = fatal; - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } + index++; + } - if (_hasOwnProperty$1.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + next(); + } } + } +} - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } +// Coerce a value to a severity--options tuple. +function coerce$1(name, value) { + var def = 1; + var result; + var level; - try { - prefix = decodeURIComponent(prefix); - } catch (err) { - throwError(state, 'tag prefix is malformed: ' + prefix); + /* istanbul ignore if - Handled by unified in v6.0.0 */ + if (typeof value === 'boolean') { + result = [value]; + } else if (value == null) { + result = [def]; + } else if ( + typeof value === 'object' && + (typeof value[0] === 'number' || + typeof value[0] === 'boolean' || + typeof value[0] === 'string') + ) { + result = value.concat(); + } else { + result = [1, value]; + } + + level = result[0]; + + if (typeof level === 'boolean') { + level = level ? 1 : 0; + } else if (typeof level === 'string') { + if (level === 'off') { + level = 0; + } else if (level === 'on' || level === 'warn') { + level = 1; + } else if (level === 'error') { + level = 2; + } else { + level = 1; + result = [level, result]; } + } - state.tagMap[handle] = prefix; + if (level < 0 || level > 2) { + throw new Error( + 'Incorrect severity `' + + level + + '` for `' + + name + + '`, ' + + 'expected 0, 1, or 2' + ) } -}; + result[0] = level; -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; + return result +} - if (start < end) { - _result = state.input.slice(start, end); +var rule$1 = unifiedLintRule$1; - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); +var remarkLintNoTrailingSpaces = rule$1('remark-lint:no-trailing-spaces', noTrailingSpaces); + +/** + * Lines that are just space characters are not present in + * the AST, which is why we loop through lines manually. + */ + +function noTrailingSpaces(ast, file) { + var lines = file.toString().split(/\r?\n/); + for (var i = 0; i < lines.length; i++) { + var currentLine = lines[i]; + var lineIndex = i + 1; + if (/\s$/.test(currentLine)) { + file.message('Remove trailing whitespace', { + position: { + start: { line: lineIndex, column: currentLine.length + 1 }, + end: { line: lineIndex } } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); + }); } - - state.result += _result; } } -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); +function* getLinksRecursively(node) { + if (node.url) { + yield node; } + for (const child of node.children || []) { + yield* getLinksRecursively(child); + } +} - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; +function validateLinks(tree, vfile) { + const currentFileURL = url.pathToFileURL(require$$0__default$2['default'].join(vfile.cwd, vfile.path)); + let previousDefinitionLabel; + for (const node of getLinksRecursively(tree)) { + if (node.url[0] !== "#") { + const targetURL = new URL(node.url, currentFileURL); + if (targetURL.protocol === "file:" && !require$$0__default$3['default'].existsSync(targetURL)) { + vfile.message("Broken link", node); + } else if (targetURL.pathname === currentFileURL.pathname) { + const expected = node.url.includes("#") + ? node.url.slice(node.url.indexOf("#")) + : "#"; + vfile.message( + `Self-reference must start with hash (expected "${expected}", got "${node.url}")`, + node + ); + } + } + if (node.type === "definition") { + if (previousDefinitionLabel && previousDefinitionLabel > node.label) { + vfile.message( + `Unordered reference ("${node.label}" should be before "${previousDefinitionLabel}")`, + node + ); + } + previousDefinitionLabel = node.label; } } } -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, - startLine, startLineStart, startPos) { +const remarkLintNodejsLinks = lintRule( + "remark-lint:nodejs-links", + validateLinks +); - var index, quantity; +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} - // The output is a plain object here, so keys can only be strings. - // We need to convert keyNode to a string, but doing so can hang the process - // (deeply nested arrays that explode exponentially using aliases). - if (Array.isArray(keyNode)) { - keyNode = Array.prototype.slice.call(keyNode); - for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { - if (Array.isArray(keyNode[index])) { - throwError(state, 'nested arrays are not supported inside keys'); - } +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} - if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { - keyNode[index] = '[object Object]'; - } - } - } - // Avoid code execution in load() via toString property - // (still use its own toString for arrays, timestamps, - // and whatever user schema extensions happen to have @@toStringTag) - if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { - keyNode = '[object Object]'; - } +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + return [ sequence ]; +} - keyNode = String(keyNode); - if (_result === null) { - _result = {}; - } +function extend(target, source) { + var index, length, key, sourceKeys; - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty$1.call(overridableKeys, keyNode) && - _hasOwnProperty$1.call(_result, keyNode)) { - state.line = startLine || state.line; - state.lineStart = startLineStart || state.lineStart; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } + if (source) { + sourceKeys = Object.keys(source); - // used for this specific key only because Object.defineProperty is slow - if (keyNode === '__proto__') { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; } - delete overridableKeys[keyNode]; } - return _result; + return target; } -function readLineBreak(state) { - var ch; - ch = state.input.charCodeAt(state.position); +function repeat(string, count) { + var result = '', cycle; - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); + for (cycle = 0; cycle < count; cycle += 1) { + result += string; } - state.line += 1; - state.lineStart = state.position; - state.firstTabInLine = -1; + return result; } -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { - state.firstTabInLine = state.position; - } - ch = state.input.charCodeAt(++state.position); - } +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - if (is_EOL(ch)) { - readLineBreak(state); +var isNothing_1 = isNothing; +var isObject_1 = isObject; +var toArray_1 = toArray; +var repeat_1 = repeat; +var isNegativeZero_1 = isNegativeZero; +var extend_1 = extend; - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; +var common = { + isNothing: isNothing_1, + isObject: isObject_1, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 +}; - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } +// YAML error class. http://stackoverflow.com/questions/8458984 + + +function formatError(exception, compact) { + var where = '', message = exception.reason || '(unknown reason)'; + + if (!exception.mark) return message; + + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; } - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; } - return lineBreaks; + return message + ' ' + where; } -function testDocumentSeparator(state) { - var _position = state.position, - ch; - ch = state.input.charCodeAt(_position); +function YAMLException$1(reason, mark) { + // Super constructor + Error.call(this); - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); - _position += 3; + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} - ch = state.input.charCodeAt(_position); - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } +// Inherit from Error +YAMLException$1.prototype = Object.create(Error.prototype); +YAMLException$1.prototype.constructor = YAMLException$1; + + +YAMLException$1.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); +}; + + +var exception = YAMLException$1; + +// get snippet for a single line, respecting maxLength +function getLine(buffer, lineStart, lineEnd, position, maxLineLength) { + var head = ''; + var tail = ''; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } + + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; } - return false; + return { + str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail, + pos: position - lineStart + head.length // relative position + }; } -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } + +function padStart(string, max) { + return common.repeat(' ', max - string.length) + string; } -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; +function makeSnippet(mark, options) { + options = Object.create(options || null); - ch = state.input.charCodeAt(state.position); + if (!mark.buffer) return null; - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } + if (!options.maxLength) options.maxLength = 79; + if (typeof options.indent !== 'number') options.indent = 1; + if (typeof options.linesBefore !== 'number') options.linesBefore = 3; + if (typeof options.linesAfter !== 'number') options.linesAfter = 2; - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); + var re = /\r?\n|\r|\0/g; + var lineStarts = [ 0 ]; + var lineEnds = []; + var match; + var foundLineNo = -1; - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; + while ((match = re.exec(mark.buffer))) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; } } - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); + if (foundLineNo < 0) foundLineNo = lineStarts.length - 1; - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } + var result = '', i, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); + for (i = 1; i <= options.linesBefore; i++) { + if (foundLineNo - i < 0) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i], + lineEnds[foundLineNo - i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), + maxLineLength + ); + result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n' + result; + } - if (is_WS_OR_EOL(preceding)) { - break; - } + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'; - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; + for (i = 1; i <= options.linesAfter; i++) { + if (foundLineNo + i >= lineEnds.length) break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i], + lineEnds[foundLineNo + i], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), + maxLineLength + ); + result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + + ' | ' + line.str + '\n'; + } - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); + return result.replace(/\n$/, ''); +} - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } +var snippet = makeSnippet; - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'multi', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'representName', + 'defaultStyle', + 'styleAliases' +]; - ch = state.input.charCodeAt(++state.position); - } +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; - captureSegment(state, captureStart, captureEnd, false); +function compileStyleAliases(map) { + var result = {}; - if (state.result) { - return true; + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); } - state.kind = _kind; - state.result = _result; - return false; + return result; } -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; +function Type$1(tag, options) { + options = options || {}; - ch = state.input.charCodeAt(state.position); + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); - if (ch !== 0x27/* ' */) { - return false; + // TODO: Add tag format check. + this.options = options; // keep original options in case user wants to extend this type later + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.representName = options['representName'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.multi = options['multi'] || false; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } +} - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; +var type = Type$1; - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); +/*eslint-disable max-len*/ - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - } else { - state.position++; - captureEnd = state.position; - } - } - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} +function compileList(schema, name) { + var result = []; -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; + schema[name].forEach(function (currentType) { + var newIndex = result.length; - ch = state.input.charCodeAt(state.position); + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && + previousType.kind === currentType.kind && + previousType.multi === currentType.multi) { - if (ch !== 0x22/* " */) { - return false; - } + newIndex = previousIndex; + } + }); - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; + result[newIndex] = currentType; + }); - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; + return result; +} - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); + } else { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + } - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; +function Schema$1(definition) { + return this.extend(definition); +} - } else { - throwError(state, 'expected hexadecimal character'); - } - } - state.result += charFromCodepoint(hexResult); +Schema$1.prototype.extend = function extend(definition) { + var implicit = []; + var explicit = []; - state.position++; + if (definition instanceof type) { + // Schema.extend(type) + explicit.push(definition); - } else { - throwError(state, 'unknown escape sequence'); - } + } else if (Array.isArray(definition)) { + // Schema.extend([ type1, type2, ... ]) + explicit = explicit.concat(definition); - captureStart = captureEnd = state.position; + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] }) + if (definition.implicit) implicit = implicit.concat(definition.implicit); + if (definition.explicit) explicit = explicit.concat(definition.explicit); - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; + } else { + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); + } - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); + implicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } - } else { - state.position++; - captureEnd = state.position; + if (type$1.loadKind && type$1.loadKind !== 'scalar') { + throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } - } - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} + if (type$1.multi) { + throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.'); + } + }); -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _lineStart, - _pos, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = Object.create(null), - keyNode, - keyTag, - valueNode, - ch; + explicit.forEach(function (type$1) { + if (!(type$1 instanceof type)) { + throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + }); - ch = state.input.charCodeAt(state.position); + var result = Object.create(Schema$1.prototype); - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } + result.implicit = (this.implicit || []).concat(implicit); + result.explicit = (this.explicit || []).concat(explicit); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } + result.compiledImplicit = compileList(result, 'implicit'); + result.compiledExplicit = compileList(result, 'explicit'); + result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit); - ch = state.input.charCodeAt(++state.position); + return result; +}; - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - ch = state.input.charCodeAt(state.position); +var schema = Schema$1; - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } else if (ch === 0x2C/* , */) { - // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 - throwError(state, "expected the node content, but found ','"); - } +var str = new type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; +var seq = new type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); +var map = new type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } +var failsafe = new schema({ + explicit: [ + str, + seq, + map + ] +}); - _line = state.line; // Save the current line. - _lineStart = state.lineStart; - _pos = state.position; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); +function resolveYamlNull(data) { + if (data === null) return true; - ch = state.input.charCodeAt(state.position); + var max = data.length; - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); - } else { - _result.push(keyNode); - } +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +var _null = new type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; }, + empty: function () { return ''; } + }, + defaultStyle: 'lowercase' +}); - skipSeparationSpace(state, true, nodeIndent); +function resolveYamlBoolean(data) { + if (data === null) return false; - ch = state.input.charCodeAt(state.position); + var max = data.length; - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} - throwError(state, 'unexpected end of the stream within a flow collection'); +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; } -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} - ch = state.input.charCodeAt(state.position); +var bool = new type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} - state.kind = 'scalar'; - state.result = ''; +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } +function resolveYamlInteger(data) { + if (data === null) return false; - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } + var max = data.length, + index = 0, + hasDigits = false, + ch; - } else { - break; - } - } + if (!max) return false; - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); + ch = data[index]; - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; } - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; - ch = state.input.charCodeAt(state.position); + // base 2, base 8, base 16 - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } + if (ch === 'b') { + // base 2 + index++; - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; } - if (is_EOL(ch)) { - emptyLines++; - continue; - } - // End of the scalar. - if (state.lineIndent < textIndent) { + if (ch === 'x') { + // base 16 + index++; - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; } - - // Break this `while` cycle and go to the funciton's epilogue. - break; + return hasDigits && ch !== '_'; } - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } + if (ch === 'o') { + // base 8 + index++; - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + return hasDigits && ch !== '_'; } + } - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; + // base 10 (except 0) - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } + // value should not start with `_`; + if (ch === '_') return false; - captureSegment(state, captureStart, state.position, false); + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; } + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + return true; } -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - // there is a leading tab before this token, so it can't be a block sequence/mapping; - // it can still be flow sequence/mapping or a scalar - if (state.firstTabInLine !== -1) return false; +function constructYamlInteger(data) { + var value = data, sign = 1, ch; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); } - ch = state.input.charCodeAt(state.position); + ch = value[0]; - while (ch !== 0) { - if (state.firstTabInLine !== -1) { - state.position = state.firstTabInLine; - throwError(state, 'tab characters must not be used in indentation'); - } + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } - if (ch !== 0x2D/* - */) { - break; - } + if (value === '0') return 0; - following = state.input.charCodeAt(state.position + 1); + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value.slice(2), 16); + if (value[1] === 'o') return sign * parseInt(value.slice(2), 8); + } - if (!is_WS_OR_EOL(following)) { - break; - } + return sign * parseInt(value, 10); +} - detected = true; - state.position++; +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } +var int = new type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); - ch = state.input.charCodeAt(state.position); +function resolveYamlFloat(data) { + if (data === null) return false; - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; } - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; + return true; } -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _keyLine, - _keyLineStart, - _keyPos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = Object.create(null), - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; +function constructYamlFloat(data) { + var value, sign; - // there is a leading tab before this token, so it can't be a block sequence/mapping; - // it can still be flow sequence/mapping or a scalar - if (state.firstTabInLine !== -1) return false; + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); } - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - if (!atExplicitKey && state.firstTabInLine !== -1) { - state.position = state.firstTabInLine; - throwError(state, 'tab characters must not be used in indentation'); - } + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. + } else if (value === '.nan') { + return NaN; + } + return sign * parseFloat(value, 10); +} - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - detected = true; - atExplicitKey = true; - allowCompact = true; +function representYamlFloat(object, style) { + var res; - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } + res = object.toString(10); - state.position += 1; - ch = following; + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else { - _keyLine = state.line; - _keyLineStart = state.lineStart; - _keyPos = state.position; + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} - if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - // Neither implicit nor explicit notation. - // Reading is done. Go to the epilogue. - break; - } +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); +var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } +var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] +}); - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); +var core = json; - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + if (match === null) throw new Error('Date resolve error'); - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - } + // match: [1] year [2] month [3] day - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (atExplicitKey) { - _keyLine = state.line; - _keyLineStart = state.lineStart; - _keyPos = state.position; - } + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); - keyTag = keyNode = valueNode = null; - } + // match: [4] hour [5] minute [6] second [7] fraction - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; } + fraction = +fraction; } - // - // Epilogue. - // + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; } - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - return detected; + if (delta) date.setTime(date.getTime() - delta); + + return date; } -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} - ch = state.input.charCodeAt(state.position); +var timestamp = new type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); - if (ch !== 0x21/* ! */) return false; +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } +var merge = new type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); - ch = state.input.charCodeAt(++state.position); +/*eslint-disable no-bitwise*/ - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - } else { - tagHandle = '!'; - } - _position = state.position; - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); +function resolveYamlBinary(data) { + if (data === null) return false; - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); - ch = state.input.charCodeAt(++state.position); - } + // Skip CR/LF + if (code > 64) continue; - tagName = state.input.slice(_position, state.position); + // Fail on illegal characters + if (code < 0) return false; - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } + bitlen += 6; } - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} - try { - tagName = decodeURIComponent(tagName); - } catch (err) { - throwError(state, 'tag name is malformed: ' + tagName); - } +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; - if (isVerbatim) { - state.tag = tagName; + // Collect by 6*4 bits (3 bytes) - } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } - } else if (tagHandle === '!') { - state.tag = '!' + tagName; + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; + // Dump tail - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); } - return true; + return new Uint8Array(result); } -function readAnchorProperty(state) { - var _position, - ch; +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; - ch = state.input.charCodeAt(state.position); + // Convert every three bytes to 4 ASCII characters. - if (ch !== 0x26/* & */) return false; + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); + bits = (bits << 8) + object[idx]; } - ch = state.input.charCodeAt(++state.position); - _position = state.position; + // Dump tail - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } + tail = max % 3; - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; } - state.anchor = state.input.slice(_position, state.position); - return true; + return result; } -function readAlias(state) { - var _position, alias, - ch; +function isBinary(obj) { + return Object.prototype.toString.call(obj) === '[object Uint8Array]'; +} - ch = state.input.charCodeAt(state.position); +var binary = new type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); - if (ch !== 0x2A/* * */) return false; +var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; +var _toString$2 = Object.prototype.toString; - ch = state.input.charCodeAt(++state.position); - _position = state.position; +function resolveYamlOmap(data) { + if (data === null) return true; - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; - alias = state.input.slice(_position, state.position); + if (_toString$2.call(pair) !== '[object Object]') return false; - if (!_hasOwnProperty$1.call(state.anchorMap, alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); + for (pairKey in pair) { + if (_hasOwnProperty$3.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; } - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); return true; } -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent - atNewLine = false, - hasContent = false, - typeIndex, - typeQuantity, - typeList, - type, - flowIndent, - blockIndent; +function constructYamlOmap(data) { + return data !== null ? data : []; +} - if (state.listener !== null) { - state.listener('open', state); - } +var omap = new type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); - state.tag = null; - state.anchor = null; - state.kind = null; - state.result = null; +var _toString$1 = Object.prototype.toString; - allowBlockStyles = allowBlockScalars = allowBlockCollections = - CONTEXT_BLOCK_OUT === nodeContext || - CONTEXT_BLOCK_IN === nodeContext; +function resolveYamlPairs(data) { + if (data === null) return true; - if (allowToSeek) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; + var index, length, pair, keys, result, + object = data; - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } + result = new Array(object.length); - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } + if (_toString$1.call(pair) !== '[object Object]') return false; - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } + keys = Object.keys(pair); - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } + if (keys.length !== 1) return false; - blockIndent = state.position - state.lineStart; + result[index] = [ keys[0], pair[keys[0]] ]; + } - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; + return true; +} - } else if (readAlias(state)) { - hasContent = true; +function constructYamlPairs(data) { + if (data === null) return []; - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } + var index, length, pair, keys, result, + object = data; - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; + result = new Array(object.length); - if (state.tag === null) { - state.tag = '?'; - } - } + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; } - if (state.tag === null) { - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } + return result; +} - } else if (state.tag === '?') { - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only automatically assigned to plain scalars. - // - // We only need to check kind conformity in case user explicitly assigns '?' - // tag, for example like this: "!<?> [0]" - // - if (state.result !== null && state.kind !== 'scalar') { - throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"'); - } +var pairs = new type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; +var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (state.tag !== '!') { - if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - } else { - // looking for multi type - type = null; - typeList = state.typeMap.multi[state.kind || 'fallback']; +function resolveYamlSet(data) { + if (data === null) return true; - for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { - if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { - type = typeList[typeIndex]; - break; - } - } - } + var key, object = data; - if (!type) { - throwError(state, 'unknown tag !<' + state.tag + '>'); + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) return false; } + } - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +var set = new type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +var _default = core.extend({ + implicit: [ + timestamp, + merge + ], + explicit: [ + binary, + omap, + pairs, + set + ] +}); - if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result, state.tag); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } +/*eslint-disable max-len,no-use-before-define*/ - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = Object.create(null); - state.anchorMap = Object.create(null); - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; +var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - if (is_EOL(ch)) break; +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - _position = state.position; - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } +function _class(obj) { return Object.prototype.toString.call(obj); } - directiveArgs.push(state.input.slice(_position, state.position)); - } +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} - if (ch !== 0) readLineBreak(state); +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} - if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} - skipSeparationSpace(state, true, -1); +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); +function fromHexCode(c) { + var lc; - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; } - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); + /*eslint-disable no-bitwise*/ + lc = c | 0x20; - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; } - state.documents.push(state.result); + return -1; +} - if (state.position === state.lineStart && testDocumentSeparator(state)) { +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; } - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } + return -1; } +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} -function loadDocuments(input, options) { - input = String(input); - options = options || {}; +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} - if (input.length !== 0) { +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } +function State$1(input, options) { + this.input = input; - var state = new State$1(input, options); + this.filename = options['filename'] || null; + this.schema = options['schema'] || _default; + this.onWarning = options['onWarning'] || null; + // (Hidden) Remove? makes the loader to expect YAML 1.1 documents + // if such documents have no explicit %YAML directive + this.legacy = options['legacy'] || false; - var nullpos = input.indexOf('\0'); + this.json = options['json'] || false; + this.listener = options['listener'] || null; - if (nullpos !== -1) { - state.position = nullpos; - throwError(state, 'null byte is not allowed in input'); - } + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } + // position of first leading tab in the current line, + // used to make sure there are no tabs in the indentation + this.firstTabInLine = -1; - while (state.position < (state.length - 1)) { - readDocument(state); - } + this.documents = []; - return state.documents; -} + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ +} -function loadAll$1(input, iterator, options) { - if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - var documents = loadDocuments(input, options); +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; - if (typeof iterator !== 'function') { - return documents; - } + mark.snippet = snippet(mark); - for (var index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } + return new exception(message, mark); } +function throwError(state, message) { + throw generateError(state, message); +} -function load$1(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); } - throw new exception('expected a single document in the stream, but found more'); } -var loadAll_1 = loadAll$1; -var load_1 = load$1; +var directiveHandlers = { -var loader = { - loadAll: loadAll_1, - load: load_1 -}; + YAML: function handleYamlDirective(state, name, args) { -/*eslint-disable no-use-before-define*/ + var match, major, minor; + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } -var _toString = Object.prototype.toString; -var _hasOwnProperty = Object.prototype.hasOwnProperty; + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); -var CHAR_BOM = 0xFEFF; -var CHAR_TAB = 0x09; /* Tab */ -var CHAR_LINE_FEED = 0x0A; /* LF */ -var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ -var CHAR_SPACE = 0x20; /* Space */ -var CHAR_EXCLAMATION = 0x21; /* ! */ -var CHAR_DOUBLE_QUOTE = 0x22; /* " */ -var CHAR_SHARP = 0x23; /* # */ -var CHAR_PERCENT = 0x25; /* % */ -var CHAR_AMPERSAND = 0x26; /* & */ -var CHAR_SINGLE_QUOTE = 0x27; /* ' */ -var CHAR_ASTERISK = 0x2A; /* * */ -var CHAR_COMMA = 0x2C; /* , */ -var CHAR_MINUS = 0x2D; /* - */ -var CHAR_COLON = 0x3A; /* : */ -var CHAR_EQUALS = 0x3D; /* = */ -var CHAR_GREATER_THAN = 0x3E; /* > */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } -var ESCAPE_SEQUENCES = {}; + state.version = args[0]; + state.checkLineBreaks = (minor < 2); -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; + TAG: function handleTagDirective(state, name, args) { -var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + var handle, prefix; -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } - if (map === null) return {}; + handle = args[0]; + prefix = args[1]; - result = {}; - keys = Object.keys(map); + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); + if (_hasOwnProperty$1.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } - type = schema.compiledTypeMap['fallback'][tag]; - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, 'tag prefix is malformed: ' + prefix); } - result[tag] = style; + state.tagMap[handle] = prefix; } +}; - return result; + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } } -function encodeHex(character) { - var string, handle, length; +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; - string = character.toString(16).toUpperCase(); + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty$1.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, + startLine, startLineStart, startPos) { + + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } } else { - throw new exception('code point within a string may not be greater than 0xFFFFFFFF'); + if (!state.json && + !_hasOwnProperty$1.call(overridableKeys, keyNode) && + _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + + // used for this specific key only because Object.defineProperty is slow + if (keyNode === '__proto__') { + Object.defineProperty(_result, keyNode, { + configurable: true, + enumerable: true, + writable: true, + value: valueNode + }); + } else { + _result[keyNode] = valueNode; + } + delete overridableKeys[keyNode]; } - return '\\' + handle + common.repeat('0', length - string.length) + string; + return _result; } +function readLineBreak(state) { + var ch; -var QUOTING_TYPE_SINGLE = 1, - QUOTING_TYPE_DOUBLE = 2; + ch = state.input.charCodeAt(state.position); -function State(options) { - this.schema = options['schema'] || _default; - this.indent = Math.max(1, (options['indent'] || 2)); - this.noArrayIndent = options['noArrayIndent'] || false; - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; - this.forceQuotes = options['forceQuotes'] || false; - this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; +} - this.tag = null; - this.result = ''; +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); - this.duplicates = []; - this.usedDuplicates = null; -} + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } } else { - line = string.slice(position, next + 1); - position = next + 1; + break; } + } - if (line.length && line !== '\n') result += ind; - - result += line; + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); } - return result; + return lineBreaks; } -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} +function testDocumentSeparator(state) { + var _position = state.position, + ch; -function testImplicitResolving(state, str) { - var index, length, type; + ch = state.input.charCodeAt(_position); - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { - if (type.resolve(str)) { + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { return true; } } @@ -75402,3724 +57438,3242 @@ function testImplicitResolving(state, str) { return false; } -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } } -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) - || (0x10000 <= c && c <= 0x10FFFF); -} -// [34] ns-char ::= nb-char - s-white -// [27] nb-char ::= c-printable - b-char - c-byte-order-mark -// [26] b-char ::= b-line-feed | b-carriage-return -// Including s-white (for some reason, examples doesn't match specs in this aspect) -// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark -function isNsCharOrWhitespace(c) { - return isPrintable(c) - && c !== CHAR_BOM - // - b-char - && c !== CHAR_CARRIAGE_RETURN - && c !== CHAR_LINE_FEED; -} +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; -// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out -// c = flow-in ⇒ ns-plain-safe-in -// c = block-key ⇒ ns-plain-safe-out -// c = flow-key ⇒ ns-plain-safe-in -// [128] ns-plain-safe-out ::= ns-char -// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator -// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) -// | ( /* An ns-char preceding */ “#” ) -// | ( “:” /* Followed by an ns-plain-safe(c) */ ) -function isPlainSafe(c, prev, inblock) { - var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); - var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); - return ( - // ns-plain-safe - inblock ? // c = flow-in - cIsNsCharOrWhitespace - : cIsNsCharOrWhitespace - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - ) - // ns-plain-char - && c !== CHAR_SHARP // false on '#' - && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' - || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' - || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' -} + ch = state.input.charCodeAt(state.position); -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part - return isPrintable(c) && c !== CHAR_BOM - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_EQUALS - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } -// Simplified test for values allowed as the last character in plain style. -function isPlainSafeLast(c) { - // just not whitespace or colon, it will be checked to be plain character later - return !isWhitespace(c) && c !== CHAR_COLON; -} + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); -// Same as 'string'.codePointAt(pos), but works in older browsers. -function codePointAt(string, pos) { - var first = string.charCodeAt(pos), second; - if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { - second = string.charCodeAt(pos + 1); - if (second >= 0xDC00 && second <= 0xDFFF) { - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; } } - return first; -} -// Determines whether block indentation indicator is required. -function needIndentIndicator(string) { - var leadingSpaceRe = /^\n* /; - return leadingSpaceRe.test(string); -} + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, - testAmbiguousType, quotingType, forceQuotes, inblock) { + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } - var i; - var char = 0; - var prevChar = null; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(codePointAt(string, 0)) - && isPlainSafeLast(codePointAt(string, string.length - 1)); + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); - if (singleLineOnly || forceQuotes) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { - char = codePointAt(string, i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - plain = plain && isPlainSafe(char, prevChar, inblock); - prevChar = char; - } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { - char = codePointAt(string, i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; - } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; + if (is_WS_OR_EOL(preceding)) { + break; } - plain = plain && isPlainSafe(char, prevChar, inblock); - prevChar = char; - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - if (plain && !forceQuotes && !testAmbiguousType(string)) { - return STYLE_PLAIN; - } - return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (indentPerLevel > 9 && needIndentIndicator(string)) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - if (!forceQuotes) { - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; - } - return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; -} -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey, inblock) { - state.dump = (function () { - if (string.length === 0) { - return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; - } - if (!state.noCompatMode) { - if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { - return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); - } - } + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } } - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, - testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { - - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string) + '"'; - default: - throw new exception('impossible error: invalid scalar style'); + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; - } - - return result; -} - -// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line, width) { - if (line === '' || line[0] === ' ') return line; - - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; } - curr = next; + + ch = state.input.charCodeAt(++state.position); } - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; } - return result.slice(1); // drop extra \n joiner + state.kind = _kind; + state.result = _result; + return false; } -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char = 0; - var escapeSeq; +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; - for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { - char = codePointAt(string, i); - escapeSeq = ESCAPE_SEQUENCES[char]; + ch = state.input.charCodeAt(state.position); - if (!escapeSeq && isPrintable(char)) { - result += string[i]; - if (char >= 0x10000) result += string[i + 1]; - } else { - result += escapeSeq || encodeHex(char); - } + if (ch !== 0x27/* ' */) { + return false; } - return result; -} + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length, - value; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); - for (index = 0, length = object.length; index < length; index += 1) { - value = object[index]; + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } - if (state.replacer) { - value = state.replacer.call(object, String(index), value); - } + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; - // Write only valid elements, put null instead of invalid elements. - if (writeNode(state, level, value, false, false) || - (typeof value === 'undefined' && - writeNode(state, level, null, false, false))) { + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); - if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; + } else { + state.position++; + captureEnd = state.position; } } - state.tag = _tag; - state.dump = '[' + _result + ']'; + throwError(state, 'unexpected end of the stream within a single quoted scalar'); } -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length, - value; - - for (index = 0, length = object.length; index < length; index += 1) { - value = object[index]; +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; - if (state.replacer) { - value = state.replacer.call(object, String(index), value); - } + ch = state.input.charCodeAt(state.position); - // Write only valid elements, put null instead of invalid elements. - if (writeNode(state, level + 1, value, true, true, false, true) || - (typeof value === 'undefined' && - writeNode(state, level + 1, null, true, true, false, true))) { + if (ch !== 0x22/* " */) { + return false; + } - if (!compact || _result !== '') { - _result += generateNextLine(state, level); - } + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; - } else { - _result += '- '; - } + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; - _result += state.dump; - } - } + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; - for (index = 0, length = objectKeyList.length; index < length; index += 1) { + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; - pairBuffer = ''; - if (_result !== '') pairBuffer += ', '; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); - if (state.condenseFlow) pairBuffer += '"'; + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; + } else { + throwError(state, 'expected hexadecimal character'); + } + } - if (state.replacer) { - objectValue = state.replacer.call(object, objectKey, objectValue); - } + state.result += charFromCodepoint(hexResult); - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } + state.position++; - if (state.dump.length > 1024) pairBuffer += '? '; + } else { + throwError(state, 'unknown escape sequence'); + } - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + captureStart = captureEnd = state.position; - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; - pairBuffer += state.dump; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); - // Both key and value are valid. - _result += pairBuffer; + } else { + state.position++; + captureEnd = state.position; + } } - state.tag = _tag; - state.dump = '{' + _result + '}'; + throwError(state, 'unexpected end of the stream within a double quoted scalar'); } -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _lineStart, + _pos, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = Object.create(null), + keyNode, + keyTag, + valueNode, + ch; - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new exception('sortKeys must be a boolean or a function'); + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; } - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } - if (!compact || _result !== '') { - pairBuffer += generateNextLine(state, level); - } + ch = state.input.charCodeAt(++state.position); - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); - if (state.replacer) { - objectValue = state.replacer.call(object, objectKey, objectValue); - } + ch = state.input.charCodeAt(state.position); - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } else if (ch === 0x2C/* , */) { + // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4 + throwError(state, "expected the node content, but found ','"); } - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); } } - pairBuffer += state.dump; + _line = state.line; // Save the current line. + _lineStart = state.lineStart; + _pos = state.position; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } + ch = state.input.charCodeAt(state.position); - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; } - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); } else { - pairBuffer += ': '; + _result.push(keyNode); } - pairBuffer += state.dump; + skipSeparationSpace(state, true, nodeIndent); - // Both key and value are valid. - _result += pairBuffer; + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } } - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. + throwError(state, 'unexpected end of the stream within a flow collection'); } -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; - typeList = explicit ? state.explicitTypes : state.implicitTypes; + ch = state.input.charCodeAt(state.position); - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { + state.kind = 'scalar'; + state.result = ''; - if (explicit) { - if (type.multi && type.representName) { - state.tag = type.representName(object); - } else { - state.tag = type.tag; - } + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; } else { - state.tag = '?'; + throwError(state, 'repeat of a chomping mode identifier'); } - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if (_toString.call(type.represent) === '[object Function]') { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); } - return true; + } else { + break; } } - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey, isblockseq) { - state.tag = null; - state.dump = object; + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); - if (!detectType(state, object, false)) { - detectType(state, object, true); + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } } - var type = _toString.call(state.dump); - var inblock = block; - var tagStr; - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; + ch = state.input.charCodeAt(state.position); - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; + if (is_EOL(ch)) { + emptyLines++; + continue; } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; } } - } else if (type === '[object Array]') { - if (block && (state.dump.length !== 0)) { - if (state.noArrayIndent && !isblockseq && level > 0) { - writeBlockSequence(state, level - 1, state.dump, compact); - } else { - writeBlockSequence(state, level, state.dump, compact); - } - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; } + + // Several line breaks - perceive as different lines. } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey, inblock); + state.result += common.repeat('\n', emptyLines); } - } else if (type === '[object Undefined]') { - return false; + + // Literal style: just add exact number of line breaks between content lines. } else { - if (state.skipInvalid) return false; - throw new exception('unacceptable kind of an object to dump ' + type); + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } - if (state.tag !== null && state.tag !== '?') { - // Need to encode all characters except those allowed by the spec: - // - // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ - // [36] ns-hex-digit ::= ns-dec-digit - // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ - // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ - // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” - // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” - // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” - // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” - // - // Also need to encode '!' because it has special meaning (end of tag prefix). - // - tagStr = encodeURI( - state.tag[0] === '!' ? state.tag.slice(1) : state.tag - ).replace(/!/g, '%21'); - - if (state.tag[0] === '!') { - tagStr = '!' + tagStr; - } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { - tagStr = '!!' + tagStr.slice(18); - } else { - tagStr = '!<' + tagStr + '>'; - } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; - state.dump = tagStr + ' ' + state.dump; + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); } + + captureSegment(state, captureStart, state.position, false); } return true; } -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; - inspectNode(object, objects, duplicatesIndexes); + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; } - state.usedDuplicates = new Array(length); -} -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; + ch = state.input.charCodeAt(state.position); - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); + if (ch !== 0x2D/* - */) { + break; + } - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; } - } -} -function dump$1(input, options) { - options = options || {}; + detected = true; + state.position++; - var state = new State(options); + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } - if (!state.noRefs) getDuplicateReferences(input, state); + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); - var value = input; + ch = state.input.charCodeAt(state.position); - if (state.replacer) { - value = state.replacer.call({ '': value }, '', value); + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } } - if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; - - return ''; + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; } -var dump_1 = dump$1; +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _keyLine, + _keyLineStart, + _keyPos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = Object.create(null), + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; -var dumper = { - dump: dump_1 -}; + // there is a leading tab before this token, so it can't be a block sequence/mapping; + // it can still be flow sequence/mapping or a scalar + if (state.firstTabInLine !== -1) return false; -function renamed(from, to) { - return function () { - throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + - 'Use yaml.' + to + ' instead, which is now safe by default.'); - }; -} + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); -var Type = type; -var Schema = schema; -var FAILSAFE_SCHEMA = failsafe; -var JSON_SCHEMA = json; -var CORE_SCHEMA = core; -var DEFAULT_SCHEMA = _default; -var load = loader.load; -var loadAll = loader.loadAll; -var dump = dumper.dump; -var YAMLException = exception; + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, 'tab characters must not be used in indentation'); + } -// Re-export all types in case user wants to create custom schema -var types = { - binary: binary, - float: float, - map: map, - null: _null, - pairs: pairs, - set: set, - timestamp: timestamp, - bool: bool, - int: int, - merge: merge, - omap: omap, - seq: seq, - str: str -}; + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. -// Removed functions from JS-YAML 3.0.x -var safeLoad = renamed('safeLoad', 'load'); -var safeLoadAll = renamed('safeLoadAll', 'loadAll'); -var safeDump = renamed('safeDump', 'dump'); + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { -var jsYaml = { - Type: Type, - Schema: Schema, - FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, - JSON_SCHEMA: JSON_SCHEMA, - CORE_SCHEMA: CORE_SCHEMA, - DEFAULT_SCHEMA: DEFAULT_SCHEMA, - load: load, - loadAll: loadAll, - dump: dump, - YAMLException: YAMLException, - types: types, - safeLoad: safeLoad, - safeLoadAll: safeLoadAll, - safeDump: safeDump -}; + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ + detected = true; + atExplicitKey = true; + allowCompact = true; -const convert$8 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$7 - } + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; - if (typeof test === 'string') { - return typeFactory$7(test) + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); } - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$7(test) : propsFactory$6(test) - } + state.position += 1; + ch = following; - if (typeof test === 'function') { - return castFactory$6(test) + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + + if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + // Neither implicit nor explicit notation. + // Reading is done. Go to the epilogue. + break; } - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$7(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); - while (++index < tests.length) { - checks[index] = convert$8(tests[index]); - } + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } - return castFactory$6(any) + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } - return false - } -} + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$6(check) { - return castFactory$6(all) + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } } - return true - } -} + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$7(check) { - return castFactory$6(type) + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$6(check) { - return assertion + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } } -} - -// Utility to return true. -function ok$7() { - return true -} -/** - * @param {string} d - * @returns {string} - */ -function color$8(d) { - return '\u001B[33m' + d + '\u001B[39m' -} + // + // Epilogue. + // -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } -/** - * Continue traversing as normal - */ -const CONTINUE$8 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$8 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$8 = false; + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$8 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } + return detected; +} - const is = convert$8(test); - const step = reverse ? -1 : 1; +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; - factory(tree, null, [])(); + ch = state.input.charCodeAt(state.position); - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; + if (ch !== 0x21/* ! */) return false; - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$8(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } + ch = state.input.charCodeAt(++state.position); - return visit + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$7(visitor(node, parents)); + } else { + tagHandle = '!'; + } - if (result[0] === EXIT$8) { - return result - } - } + _position = state.position; - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$8) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { - if (subresult[0] === EXIT$8) { - return subresult - } + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); } - return result + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); } } + + ch = state.input.charCodeAt(++state.position); } - ); -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$7(value) { - if (Array.isArray(value)) { - return value + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } } - if (typeof value === 'number') { - return [CONTINUE$8, value] + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); } - return [value] + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, 'tag name is malformed: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ +function readAnchorProperty(state) { + var _position, + ch; -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$7 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } + ch = state.input.charCodeAt(state.position); - visitParents$8(tree, test, overload, reverse); + if (ch !== 0x26/* & */) return false; - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0'; + ch = state.input.charCodeAt(++state.position); + _position = state.position; -const MAX_LENGTH$2 = 256; -const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16; + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } -var constants = { - SEMVER_SPEC_VERSION, - MAX_LENGTH: MAX_LENGTH$2, - MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1, - MAX_SAFE_COMPONENT_LENGTH -}; + state.anchor = state.input.slice(_position, state.position); + return true; +} -var re$2 = {exports: {}}; +function readAlias(state) { + var _position, alias, + ch; -const debug$1 = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {}; + ch = state.input.charCodeAt(state.position); -var debug_1 = debug$1; + if (ch !== 0x2A/* * */) return false; -(function (module, exports) { -const { MAX_SAFE_COMPONENT_LENGTH } = constants; -const debug = debug_1; -exports = module.exports = {}; + ch = state.input.charCodeAt(++state.position); + _position = state.position; -// The actual regexps go on exports.re -const re = exports.re = []; -const src = exports.src = []; -const t = exports.t = {}; -let R = 0; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } -const createToken = (name, value, isGlobal) => { - const index = R++; - debug(index, value); - t[name] = index; - src[index] = value; - re[index] = new RegExp(value, isGlobal ? 'g' : undefined); -}; + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. + alias = state.input.slice(_position, state.position); -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. + if (!_hasOwnProperty$1.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*'); -createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+'); + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent + atNewLine = false, + hasContent = false, + typeIndex, + typeQuantity, + typeList, + type, + flowIndent, + blockIndent; -createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*'); + if (state.listener !== null) { + state.listener('open', state); + } -// ## Main Version -// Three dot-separated numeric identifiers. + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`); + allowBlockStyles = allowBlockScalars = allowBlockCollections = + CONTEXT_BLOCK_OUT === nodeContext || + CONTEXT_BLOCK_IN === nodeContext; -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`); + if (allowToSeek) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`); + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`); + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + blockIndent = state.position - state.lineStart; -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; -createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+'); + } else if (readAlias(state)) { + hasContent = true; -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + if (state.tag === null) { + state.tag = '?'; + } + } -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`); + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } -createToken('FULL', `^${src[t.FULLPLAIN]}$`); + } else if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "!<?> [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"'); + } -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`); + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`); + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== '!') { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + } else { + // looking for multi type + type = null; + typeList = state.typeMap.multi[state.kind || 'fallback']; -createToken('GTLT', '((?:<|>)?=?)'); + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type = typeList[typeIndex]; + break; + } + } + } -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + if (!type) { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`); + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`); + if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCE', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:$|[^\\d])`); -createToken('COERCERTL', src[t.COERCE], true); +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)'); + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = Object.create(null); + state.anchorMap = Object.create(null); -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true); -exports.tildeTrimReplace = '$1~'; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + ch = state.input.charCodeAt(state.position); -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)'); + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true); -exports.caretTrimReplace = '$1^'; + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); -exports.comparatorTrimReplace = '$1$2$3'; + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`); + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*'); -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$'); -createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$'); -}(re$2, re$2.exports)); + if (is_EOL(ch)) break; -// parse out just the options we care about so we always get a consistent -// obj with keys in a consistent order. -const opts = ['includePrerelease', 'loose', 'rtl']; -const parseOptions$2 = options => - !options ? {} - : typeof options !== 'object' ? { loose: true } - : opts.filter(k => options[k]).reduce((options, k) => { - options[k] = true; - return options - }, {}); -var parseOptions_1 = parseOptions$2; + _position = state.position; -const numeric = /^[0-9]+$/; -const compareIdentifiers$1 = (a, b) => { - const anum = numeric.test(a); - const bnum = numeric.test(b); + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } - if (anum && bnum) { - a = +a; - b = +b; - } + directiveArgs.push(state.input.slice(_position, state.position)); + } - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -}; + if (ch !== 0) readLineBreak(state); -const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a); + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } -var identifiers = { - compareIdentifiers: compareIdentifiers$1, - rcompareIdentifiers -}; + skipSeparationSpace(state, true, -1); -const debug = debug_1; -const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER } = constants; -const { re: re$1, t: t$1 } = re$2.exports; + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); -const parseOptions$1 = parseOptions_1; -const { compareIdentifiers } = identifiers; -class SemVer$2 { - constructor (version, options) { - options = parseOptions$1(options); + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } - if (version instanceof SemVer$2) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version; - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid Version: ${version}`) - } + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); - if (version.length > MAX_LENGTH$1) { - throw new TypeError( - `version is longer than ${MAX_LENGTH$1} characters` - ) - } + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } - debug('SemVer', version, options); - this.options = options; - this.loose = !!options.loose; - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease; + state.documents.push(state.result); - const m = version.trim().match(options.loose ? re$1[t$1.LOOSE] : re$1[t$1.FULL]); + if (state.position === state.lineStart && testDocumentSeparator(state)) { - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); } + return; + } - this.raw = version; + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } +function loadDocuments(input, options) { + input = String(input); + options = options || {}; - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } + if (input.length !== 0) { - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; } - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }); + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); } + } - this.build = m[5] ? m[5].split('.') : []; - this.format(); + var state = new State$1(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); } - format () { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}`; - } - return this.version + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; } - toString () { - return this.version + while (state.position < (state.length - 1)) { + readDocument(state); } - compare (other) { - debug('SemVer.compare', this.version, this.options, other); - if (!(other instanceof SemVer$2)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer$2(other, this.options); - } + return state.documents; +} - if (other.version === this.version) { - return 0 - } - return this.compareMain(other) || this.comparePre(other) +function loadAll$1(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; } - compareMain (other) { - if (!(other instanceof SemVer$2)) { - other = new SemVer$2(other, this.options); - } + var documents = loadDocuments(input, options); - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) + if (typeof iterator !== 'function') { + return documents; } - comparePre (other) { - if (!(other instanceof SemVer$2)) { - other = new SemVer$2(other, this.options); - } + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - let i = 0; - do { - const a = this.prerelease[i]; - const b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) +function load$1(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; } + throw new exception('expected a single document in the stream, but found more'); +} - compareBuild (other) { - if (!(other instanceof SemVer$2)) { - other = new SemVer$2(other, this.options); - } - let i = 0; - do { - const a = this.build[i]; - const b = other.build[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } +var loadAll_1 = loadAll$1; +var load_1 = load$1; - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier); - } - this.inc('pre', identifier); - break +var loader = { + loadAll: loadAll_1, + load: load_1 +}; - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0]; - } else { - let i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0); - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; - } - } - break +/*eslint-disable no-use-before-define*/ - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.format(); - this.raw = this.version; - return this - } -} -var semver = SemVer$2; -const {MAX_LENGTH} = constants; -const { re, t } = re$2.exports; -const SemVer$1 = semver; -const parseOptions = parseOptions_1; -const parse = (version, options) => { - options = parseOptions(options); - if (version instanceof SemVer$1) { - return version +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +var CHAR_BOM = 0xFEFF; +var CHAR_TAB = 0x09; /* Tab */ +var CHAR_LINE_FEED = 0x0A; /* LF */ +var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ +var CHAR_SPACE = 0x20; /* Space */ +var CHAR_EXCLAMATION = 0x21; /* ! */ +var CHAR_DOUBLE_QUOTE = 0x22; /* " */ +var CHAR_SHARP = 0x23; /* # */ +var CHAR_PERCENT = 0x25; /* % */ +var CHAR_AMPERSAND = 0x26; /* & */ +var CHAR_SINGLE_QUOTE = 0x27; /* ' */ +var CHAR_ASTERISK = 0x2A; /* * */ +var CHAR_COMMA = 0x2C; /* , */ +var CHAR_MINUS = 0x2D; /* - */ +var CHAR_COLON = 0x3A; /* : */ +var CHAR_EQUALS = 0x3D; /* = */ +var CHAR_GREATER_THAN = 0x3E; /* > */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; } - if (typeof version !== 'string') { - return null - } + return result; +} - if (version.length > MAX_LENGTH) { - return null - } +function encodeHex(character) { + var string, handle, length; - const r = options.loose ? re[t.LOOSE] : re[t.FULL]; - if (!r.test(version)) { - return null - } + string = character.toString(16).toUpperCase(); - try { - return new SemVer$1(version, options) - } catch (er) { - return null + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new exception('code point within a string may not be greater than 0xFFFFFFFF'); } -}; -var parse_1 = parse; + return '\\' + handle + common.repeat('0', length - string.length) + string; +} -const SemVer = semver; -const compare$1 = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)); -var compare_1 = compare$1; +var QUOTING_TYPE_SINGLE = 1, + QUOTING_TYPE_DOUBLE = 2; -const compare = compare_1; -const lt = (a, b, loose) => compare(a, b, loose) < 0; -var lt_1 = lt; +function State(options) { + this.schema = options['schema'] || _default; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options['forceQuotes'] || false; + this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null; -const allowedKeys = [ - "added", - "napiVersion", - "deprecated", - "removed", - "changes", -]; -const changesExpectedKeys = ["version", "pr-url", "description"]; -const VERSION_PLACEHOLDER = "REPLACEME"; -const MAX_SAFE_SEMVER_VERSION = parse_1( - Array.from({ length: 3 }, () => Number.MAX_SAFE_INTEGER).join(".") -); -const validVersionNumberRegex = /^v\d+\.\d+\.\d+$/; -const prUrlRegex = new RegExp("^https://github.com/nodejs/node/pull/\\d+$"); -const privatePRUrl = "https://github.com/nodejs-private/node-private/pull/"; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; -let releasedVersions; -let invalidVersionMessage = "version(s) must respect the pattern `vx.x.x` or"; -if (process.env.NODE_RELEASED_VERSIONS) { - console.log("Using release list from env..."); - releasedVersions = process.env.NODE_RELEASED_VERSIONS.split(",").map( - (v) => `v${v}` - ); - invalidVersionMessage = `version not listed in the changelogs, `; + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; } -invalidVersionMessage += `use the placeholder \`${VERSION_PLACEHOLDER}\``; -const kContainsIllegalKey = Symbol("illegal key"); -const kWrongKeyOrder = Symbol("Wrong key order"); -function unorderedKeys(meta) { - const keys = Object.keys(meta); - let previousKeyIndex = -1; - for (const key of keys) { - const keyIndex = allowedKeys.indexOf(key); - if (keyIndex <= previousKeyIndex) { - return keyIndex === -1 ? kContainsIllegalKey : kWrongKeyOrder; +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; } - previousKeyIndex = keyIndex; - } -} -function containsInvalidVersionNumber(version) { - if (Array.isArray(version)) { - return version.some(containsInvalidVersionNumber); - } + if (line.length && line !== '\n') result += ind; - if (version === undefined || version === VERSION_PLACEHOLDER) return false; + result += line; + } - if ( - releasedVersions && - // Always ignore 0.0.x and 0.1.x release numbers: - (version[1] !== "0" || (version[3] !== "0" && version[3] !== "1")) - ) - return !releasedVersions.includes(version); + return result; +} - return !validVersionNumberRegex.test(version); +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); } -const getValidSemver = (version) => - version === VERSION_PLACEHOLDER ? MAX_SAFE_SEMVER_VERSION : version; -function areVersionsUnordered(versions) { - if (!Array.isArray(versions)) return false; - for (let index = 1; index < versions.length; index++) { - if ( - lt_1( - getValidSemver(versions[index - 1]), - getValidSemver(versions[index]) - ) - ) { +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { return true; } } -} -function invalidChangesKeys(change) { - const keys = Object.keys(change); - const { length } = keys; - if (length !== changesExpectedKeys.length) return true; - for (let index = 0; index < length; index++) { - if (keys[index] !== changesExpectedKeys[index]) return true; - } + return false; } -function validateSecurityChange(file, node, change, index) { - if ("commit" in change) { - if (typeof change.commit !== "string" || isNaN(`0x${change.commit}`)) { - file.message( - `changes[${index}]: Ill-formed security change commit ID`, - node - ); - } - if (Object.keys(change)[1] === "commit") { - change = { ...change }; - delete change.commit; - } - } - if (invalidChangesKeys(change)) { - const securityChangeExpectedKeys = [...changesExpectedKeys]; - securityChangeExpectedKeys[0] += "[, commit]"; - file.message( - `changes[${index}]: Invalid keys. Expected keys are: ` + - securityChangeExpectedKeys.join(", "), - node - ); - } +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; } -function validateChanges(file, node, changes) { - if (!Array.isArray(changes)) - return file.message("`changes` must be a YAML list", node); - const changesVersions = []; - for (let index = 0; index < changes.length; index++) { - const change = changes[index]; +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM) + || (0x10000 <= c && c <= 0x10FFFF); +} - const isAncient = - typeof change.version === "string" && change.version.startsWith("v0."); - const isSecurityChange = - !isAncient && - typeof change["pr-url"] === "string" && - change["pr-url"].startsWith(privatePRUrl); +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// Including s-white (for some reason, examples doesn't match specs in this aspect) +// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark +function isNsCharOrWhitespace(c) { + return isPrintable(c) + && c !== CHAR_BOM + // - b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} - if (isSecurityChange) { - validateSecurityChange(file, node, change, index); - } else if (!isAncient && invalidChangesKeys(change)) { - file.message( - `changes[${index}]: Invalid keys. Expected keys are: ` + - changesExpectedKeys.join(", "), - node - ); - } +// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out +// c = flow-in ⇒ ns-plain-safe-in +// c = block-key ⇒ ns-plain-safe-out +// c = flow-key ⇒ ns-plain-safe-in +// [128] ns-plain-safe-out ::= ns-char +// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator +// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” ) +// | ( /* An ns-char preceding */ “#” ) +// | ( “:” /* Followed by an ns-plain-safe(c) */ ) +function isPlainSafe(c, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c); + return ( + // ns-plain-safe + inblock ? // c = flow-in + cIsNsCharOrWhitespace + : cIsNsCharOrWhitespace + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + ) + // ns-plain-char + && c !== CHAR_SHARP // false on '#' + && !(prev === CHAR_COLON && !cIsNsChar) // false on ': ' + || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#' + || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]' +} - if (containsInvalidVersionNumber(change.version)) { - file.message(`changes[${index}]: ${invalidVersionMessage}`, node); - } else if (areVersionsUnordered(change.version)) { - file.message(`changes[${index}]: list of versions is not in order`, node); - } +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part + return isPrintable(c) && c !== CHAR_BOM + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} - if (!isAncient && !isSecurityChange && !prUrlRegex.test(change["pr-url"])) { - file.message( - `changes[${index}]: PR-URL does not match the expected pattern`, - node - ); - } +// Simplified test for values allowed as the last character in plain style. +function isPlainSafeLast(c) { + // just not whitespace or colon, it will be checked to be plain character later + return !isWhitespace(c) && c !== CHAR_COLON; +} - if (typeof change.description !== "string" || !change.description.length) { - file.message( - `changes[${index}]: must contain a non-empty description`, - node - ); - } else if (!change.description.endsWith(".")) { - file.message( - `changes[${index}]: description must end with a period`, - node - ); +// Same as 'string'.codePointAt(pos), but works in older browsers. +function codePointAt(string, pos) { + var first = string.charCodeAt(pos), second; + if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) { + second = string.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } - - changesVersions.push( - Array.isArray(change.version) ? change.version[0] : change.version - ); } + return first; +} - if (areVersionsUnordered(changesVersions)) { - file.message("Items in `changes` list are not in order", node); - } +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); } -function validateMeta(node, file, meta) { - switch (unorderedKeys(meta)) { - case kContainsIllegalKey: - file.message( - "YAML dictionary contains illegal keys. Accepted values are: " + - allowedKeys.join(", "), - node - ); - break; +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; - case kWrongKeyOrder: - file.message( - "YAML dictionary keys should be in this order: " + - allowedKeys.join(", "), - node - ); - break; - } +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, + testAmbiguousType, quotingType, forceQuotes, inblock) { - if (containsInvalidVersionNumber(meta.added)) { - file.message(`Invalid \`added\` value: ${invalidVersionMessage}`, node); - } else if (areVersionsUnordered(meta.added)) { - file.message("Versions in `added` list are not in order", node); - } + var i; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(codePointAt(string, 0)) + && isPlainSafeLast(codePointAt(string, string.length - 1)); - if (containsInvalidVersionNumber(meta.deprecated)) { - file.message( - `Invalid \`deprecated\` value: ${invalidVersionMessage}`, - node - ); - } else if (areVersionsUnordered(meta.deprecated)) { - file.message("Versions in `deprecated` list are not in order", node); + if (singleLineOnly || forceQuotes) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); } - - if (containsInvalidVersionNumber(meta.removed)) { - file.message(`Invalid \`removed\` value: ${invalidVersionMessage}`, node); - } else if (areVersionsUnordered(meta.removed)) { - file.message("Versions in `removed` list are not in order", node); + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + if (plain && !forceQuotes && !testAmbiguousType(string)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; } - - if ("changes" in meta) { - validateChanges(file, node, meta.changes); + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; } -function validateYAMLComments(tree, file) { - visit$7(tree, "html", function visitor(node) { - if (node.value.startsWith("<!--YAML\n")) - file.message( - "Expected `<!-- YAML`, found `<!--YAML`. Please add a space", - node - ); - if (!node.value.startsWith("<!-- YAML\n")) return; - try { - const meta = jsYaml.load("#" + node.value.slice(0, -"-->".length)); - - validateMeta(node, file, meta); - } catch (e) { - file.message(e, node); +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey, inblock) { + state.dump = (function () { + if (string.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'"); + } } - }); -} -const remarkLintNodejsYamlComments = lintRule$5( - "remark-lint:nodejs-yaml-comments", - validateYAMLComments -); + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); -var escapeStringRegexp$2 = string => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } - // Escape characters with special meaning either inside or outside character sets. - // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. - return string - .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') - .replace(/-/g, '\\x2d'); -}; + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, + testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) { -var start$2 = factory$1('start'); -var end = factory$1('end'); + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string) + '"'; + default: + throw new exception('impossible error: invalid scalar style'); + } + }()); +} -var unistUtilPosition = position$1; +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; -position$1.start = start$2; -position$1.end = end; + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); -function position$1(node) { - return {start: start$2(node), end: end(node)} + return indentIndicator + chomp + '\n'; } -function factory$1(type) { - point.displayName = type; +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} - return point +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; - function point(node) { - var point = (node && node.position && node.position[type]) || {}; + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; - return { - line: point.line || null, - column: point.column || null, - offset: isNaN(point.offset) ? null : point.offset - } + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; } -} -var convert_1 = convert$7; + return result; +} -function convert$7(test) { - if (test == null) { - return ok$6 - } +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; - if (typeof test === 'string') { - return typeFactory$6(test) - } + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; - if (typeof test === 'object') { - return 'length' in test ? anyFactory$6(test) : allFactory(test) + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; } - if (typeof test === 'function') { - return test + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); } - throw new Error('Expected function, string, or object as test') + return result.slice(1); // drop extra \n joiner } -// Utility assert each property in `test` is represented in `node`, and each -// values are strictly equal. -function allFactory(test) { - return all +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; - function all(node) { - var key; + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; - for (key in test) { - if (node[key] !== test[key]) return false + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); } - - return true } -} -function anyFactory$6(tests) { - var checks = []; - var index = -1; - - while (++index < tests.length) { - checks[index] = convert$7(tests[index]); - } + return result; +} - return any +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; - function any() { - var index = -1; + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; - while (++index < checks.length) { - if (checks[index].apply(this, arguments)) { - return true - } + if (state.replacer) { + value = state.replacer.call(object, String(index), value); } - return false - } -} - -// Utility to convert a string into a function which checks a given node’s type -// for said string. -function typeFactory$6(test) { - return type + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level, value, false, false) || + (typeof value === 'undefined' && + writeNode(state, level, null, false, false))) { - function type(node) { - return Boolean(node && node.type === test) + if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } } -} -// Utility to return true. -function ok$6() { - return true + state.tag = _tag; + state.dump = '[' + _result + ']'; } -var color_1 = color$7; -function color$7(d) { - return '\u001B[33m' + d + '\u001B[39m' -} +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; -var unistUtilVisitParents = visitParents$7; + for (index = 0, length = object.length; index < length; index += 1) { + value = object[index]; -var convert$6 = convert_1; -var color$6 = color_1; + if (state.replacer) { + value = state.replacer.call(object, String(index), value); + } -var CONTINUE$7 = true; -var SKIP$7 = 'skip'; -var EXIT$7 = false; + // Write only valid elements, put null instead of invalid elements. + if (writeNode(state, level + 1, value, true, true, false, true) || + (typeof value === 'undefined' && + writeNode(state, level + 1, null, true, true, false, true))) { -visitParents$7.CONTINUE = CONTINUE$7; -visitParents$7.SKIP = SKIP$7; -visitParents$7.EXIT = EXIT$7; + if (!compact || _result !== '') { + _result += generateNextLine(state, level); + } -function visitParents$7(tree, test, visitor, reverse) { - var step; - var is; + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; + _result += state.dump; + } } - is = convert$6(test); - step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - function factory(node, index, parents) { - var value = typeof node === 'object' && node !== null ? node : {}; - var name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} - visit.displayName = - 'node (' + color$6(value.type + (name ? '<' + name + '>' : '')) + ')'; - } +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; - return visit + for (index = 0, length = objectKeyList.length; index < length; index += 1) { - function visit() { - var grandparents = parents.concat(node); - var result = []; - var subresult; - var offset; + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$6(visitor(node, parents)); + if (state.condenseFlow) pairBuffer += '"'; - if (result[0] === EXIT$7) { - return result - } - } + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; - if (node.children && result[0] !== SKIP$7) { - offset = (reverse ? node.children.length : -1) + step; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } - while (offset > -1 && offset < node.children.length) { - subresult = factory(node.children[offset], offset, grandparents)(); + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } - if (subresult[0] === EXIT$7) { - return subresult - } + if (state.dump.length > 1024) pairBuffer += '? '; - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - return result + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. } - } -} -function toResult$6(value) { - if (value !== null && typeof value === 'object' && 'length' in value) { - return value - } + pairBuffer += state.dump; - if (typeof value === 'number') { - return [CONTINUE$7, value] + // Both key and value are valid. + _result += pairBuffer; } - return [value] + state.tag = _tag; + state.dump = '{' + _result + '}'; } -var unistUtilVisit = visit$6; - -var visitParents$6 = unistUtilVisitParents; - -var CONTINUE$6 = visitParents$6.CONTINUE; -var SKIP$6 = visitParents$6.SKIP; -var EXIT$6 = visitParents$6.EXIT; - -visit$6.CONTINUE = CONTINUE$6; -visit$6.SKIP = SKIP$6; -visit$6.EXIT = EXIT$6; - -function visit$6(tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$6(tree, test, overload, reverse); +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; - function overload(node, parents) { - var parent = parents[parents.length - 1]; - var index = parent ? parent.children.indexOf(node) : null; - return visitor(node, index, parent) + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new exception('sortKeys must be a boolean or a function'); } -} -var vfileLocation$1 = factory; + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; -function factory(file) { - var value = String(file); - var indices = []; - var search = /\r?\n|\r/g; + if (!compact || _result !== '') { + pairBuffer += generateNextLine(state, level); + } - while (search.exec(value)) { - indices.push(search.lastIndex); - } + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; - indices.push(value.length + 1); + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } - return { - toPoint: offsetToPoint, - toPosition: offsetToPoint, - toOffset: pointToOffset - } + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } - // Get the line and column-based `point` for `offset` in the bound indices. - function offsetToPoint(offset) { - var index = -1; + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); - if (offset > -1 && offset < indices[indices.length - 1]) { - while (++index < indices.length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset: offset - } - } + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; } } - return {} - } + pairBuffer += state.dump; - // Get the `offset` for a line and column-based `point` in the bound - // indices. - function pointToOffset(point) { - var line = point && point.line; - var column = point && point.column; - var offset; + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } - if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { - offset = (indices[line - 2] || 0) + column - 1 || 0; + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. } - return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; } -} -const escapeStringRegexp$1 = escapeStringRegexp$2; -const position = unistUtilPosition; -const rule = unifiedLintRule; -const visit$5 = unistUtilVisit; -const vfileLocation = vfileLocation$1; + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} -const start$1 = position.start; +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; -var remarkLintProhibitedStrings = rule('remark-lint:prohibited-strings', prohibitedStrings); + typeList = explicit ? state.explicitTypes : state.implicitTypes; -function testProhibited (val, content) { - let regexpFlags = 'g'; - let no = val.no; + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; - if (!no) { - no = escapeStringRegexp$1(val.yes); - regexpFlags += 'i'; - } + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { - let regexpString = '(?<!\\.|@[a-zA-Z0-9/-]*)'; + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } - const ignoreNextTo = val.ignoreNextTo ? escapeStringRegexp$1(val.ignoreNextTo) : ''; + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; - // If it starts with a letter, make sure it is a word break. - if (/^\b/.test(no)) { - regexpString += '\\b'; - } - if (ignoreNextTo) { - regexpString += `(?<!${ignoreNextTo})`; - } + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } - regexpString += `(${no})`; + state.dump = _result; + } - if (ignoreNextTo) { - regexpString += `(?!${ignoreNextTo})`; + return true; + } } - // If it ends with a letter, make sure it is a word break. - if (/\b$/.test(no)) { - regexpString += '\\b'; - } - regexpString += '(?!\\.\\w)'; - const re = new RegExp(regexpString, regexpFlags); + return false; +} - const results = []; - let result = re.exec(content); - while (result) { - if (result[1] !== val.yes) { - results.push({ result: result[1], index: result.index }); - } - result = re.exec(content); +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey, isblockseq) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); } - return results -} + var type = _toString.call(state.dump); + var inblock = block; + var tagStr; -function prohibitedStrings (ast, file, strings) { - const location = vfileLocation(file); + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } - visit$5(ast, 'text', checkText); + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; - function checkText (node) { - const content = node.value; - const initial = start$1(node).offset; + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } - strings.forEach((val) => { - const results = testProhibited(val, content); - if (results.length) { - results.forEach(({ result, index }) => { - const message = val.yes ? `Use "${val.yes}" instead of "${result}"` : `Do not use "${result}"`; - file.message(message, { - start: location.toPoint(initial + index), - end: location.toPoint(initial + index + [...result].length) - }); - }); - } - }); + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; } -} -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact); + } else { + writeBlockSequence(state, level, state.dump, compact); + } + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type === '[object Undefined]') { + return false; + } else { + if (state.skipInvalid) return false; + throw new exception('unacceptable kind of an object to dump ' + type); + } -const primitives$4 = new Set(['string', 'number', 'boolean']); + if (state.tag !== null && state.tag !== '?') { + // Need to encode all characters except those allowed by the spec: + // + // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */ + // [36] ns-hex-digit ::= ns-dec-digit + // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */ + // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */ + // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-” + // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#” + // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,” + // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]” + // + // Also need to encode '!' because it has special meaning (end of tag prefix). + // + tagStr = encodeURI( + state.tag[0] === '!' ? state.tag.slice(1) : state.tag + ).replace(/!/g, '%21'); -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$4(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; + if (state.tag[0] === '!') { + tagStr = '!' + tagStr; + } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') { + tagStr = '!!' + tagStr.slice(18); + } else { + tagStr = '!<' + tagStr + '>'; + } - Object.defineProperty(plugin, 'name', {value: id}); + state.dump = tagStr + ' ' + state.dump; + } + } - return plugin + return true; +} - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$4(ruleId, raw); +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; - if (!severity) return + inspectNode(object, objects, duplicatesIndexes); - const fatal = severity === 2; + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} - return (tree, file, next) => { - let index = file.messages.length - 1; +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; - wrap(rule, (error) => { - const messages = file.messages; + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); } + } else { + objectKeyList = Object.keys(object); - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); } - - next(); - })(tree, file, options); + } } } } -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$4(name, value) { - /** @type {unknown[]} */ - let result; +function dump$1(input, options) { + options = options || {}; - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$4.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } + var state = new State(options); - let level = result[0]; + if (!state.noRefs) getDuplicateReferences(input, state); - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } + var value = input; - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); } - result[0] = level; + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; - // @ts-expect-error: it’s now a valid tuple. - return result + return ''; } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ +var dump_1 = dump$1; -const convert$5 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$5 - } +var dumper = { + dump: dump_1 +}; - if (typeof test === 'string') { - return typeFactory$5(test) - } +function renamed(from, to) { + return function () { + throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' + + 'Use yaml.' + to + ' instead, which is now safe by default.'); + }; +} - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$5(test) : propsFactory$5(test) - } - if (typeof test === 'function') { - return castFactory$5(test) - } +var Type = type; +var Schema = schema; +var FAILSAFE_SCHEMA = failsafe; +var JSON_SCHEMA = json; +var CORE_SCHEMA = core; +var DEFAULT_SCHEMA = _default; +var load = loader.load; +var loadAll = loader.loadAll; +var dump = dumper.dump; +var YAMLException = exception; - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$5(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; +// Re-export all types in case user wants to create custom schema +var types = { + binary: binary, + float: float, + map: map, + null: _null, + pairs: pairs, + set: set, + timestamp: timestamp, + bool: bool, + int: int, + merge: merge, + omap: omap, + seq: seq, + str: str +}; - while (++index < tests.length) { - checks[index] = convert$5(tests[index]); - } +// Removed functions from JS-YAML 3.0.x +var safeLoad = renamed('safeLoad', 'load'); +var safeLoadAll = renamed('safeLoadAll', 'loadAll'); +var safeDump = renamed('safeDump', 'dump'); - return castFactory$5(any) +var jsYaml = { + Type: Type, + Schema: Schema, + FAILSAFE_SCHEMA: FAILSAFE_SCHEMA, + JSON_SCHEMA: JSON_SCHEMA, + CORE_SCHEMA: CORE_SCHEMA, + DEFAULT_SCHEMA: DEFAULT_SCHEMA, + load: load, + loadAll: loadAll, + dump: dump, + YAMLException: YAMLException, + types: types, + safeLoad: safeLoad, + safeLoadAll: safeLoadAll, + safeDump: safeDump +}; - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0'; - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } +const MAX_LENGTH$2 = 256; +const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991; - return false - } -} +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16; -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$5(check) { - return castFactory$5(all) +var constants = { + SEMVER_SPEC_VERSION, + MAX_LENGTH: MAX_LENGTH$2, + MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1, + MAX_SAFE_COMPONENT_LENGTH +}; - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; +var re$2 = {exports: {}}; - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } +const debug$1 = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {}; - return true - } -} +var debug_1 = debug$1; -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$5(check) { - return castFactory$5(type) +(function (module, exports) { +const { MAX_SAFE_COMPONENT_LENGTH } = constants; +const debug = debug_1; +exports = module.exports = {}; - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} +// The actual regexps go on exports.re +const re = exports.re = []; +const src = exports.src = []; +const t = exports.t = {}; +let R = 0; -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$5(check) { - return assertion +const createToken = (name, value, isGlobal) => { + const index = R++; + debug(index, value); + t[name] = index; + src[index] = value; + re[index] = new RegExp(value, isGlobal ? 'g' : undefined); +}; - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. -// Utility to return true. -function ok$5() { - return true -} +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. -/** - * @param {string} d - * @returns {string} - */ -function color$5(d) { - return '\u001B[33m' + d + '\u001B[39m' -} +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*'); +createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+'); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. -/** - * Continue traversing as normal - */ -const CONTINUE$5 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$5 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$5 = false; +createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*'); -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$5 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } +// ## Main Version +// Three dot-separated numeric identifiers. - const is = convert$5(test); - const step = reverse ? -1 : 1; +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`); - factory(tree, null, [])(); +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`); - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`); - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$5(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`); - return visit +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$5(visitor(node, parents)); +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); - if (result[0] === EXIT$5) { - return result - } - } +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$5) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); +createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+'); - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. - if (subresult[0] === EXIT$5) { - return subresult - } +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. - return result - } - } - } - ); +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$5(value) { - if (Array.isArray(value)) { - return value - } +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`); - if (typeof value === 'number') { - return [CONTINUE$5, value] - } +createToken('FULL', `^${src[t.FULLPLAIN]}$`); - return [value] -} +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`); -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$4 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } +createToken('GTLT', '((?:<|>)?=?)'); - visitParents$5(tree, test, overload, reverse); +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`); -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`); -var pointStart$4 = point$4('start'); -var pointEnd$2 = point$4('end'); +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$4(type) { - return point +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`); +createToken('COERCERTL', src[t.COERCE], true); - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)'); - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true); +exports.tildeTrimReplace = '$1~'; -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module rule-style - * @fileoverview - * Warn when the thematic breaks (horizontal rules) violate a given or - * detected style. - * - * Options: `string`, either a corect thematic breaks such as `***`, or - * `'consistent'`, default: `'consistent'`. - * - * `'consistent'` detects the first used thematic break style and warns when - * subsequent rules use different styles. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * has three settings that define how rules are created: - * - * * [`rule`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsrule) - * (default: `*`) — Marker to use - * * [`ruleRepetition`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsrulerepetition) - * (default: `3`) — Number of markers to use - * * [`ruleSpaces`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsrulespaces) - * (default: `true`) — Whether to pad markers with spaces - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md", "setting": "* * *"} - * - * * * * - * - * * * * - * - * @example - * {"name": "ok.md", "setting": "_______"} - * - * _______ - * - * _______ - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * *** - * - * * * * - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 3:1-3:6: Rules should use `***` - * - * @example - * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true} - * - * 1:1: Incorrect preferred rule style: provide a correct markdown rule or `'consistent'` - */ +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); -const remarkLintRuleStyle = lintRule$4( - 'remark-lint:rule-style', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - const value = String(file); +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)'); - if (option !== 'consistent' && /[^-_* ]/.test(option)) { - file.fail( - "Incorrect preferred rule style: provide a correct markdown rule or `'consistent'`" - ); - } +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true); +exports.caretTrimReplace = '$1^'; - visit$4(tree, 'thematicBreak', (node) => { - const initial = pointStart$4(node).offset; - const final = pointEnd$2(node).offset; +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); - if (typeof initial === 'number' && typeof final === 'number') { - const rule = value.slice(initial, final); +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); - if (option === 'consistent') { - option = rule; - } else if (rule !== option) { - file.message('Rules should use `' + option + '`', node); - } - } - }); +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); +exports.comparatorTrimReplace = '$1$2$3'; + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`); + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`); + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*'); +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$'); +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$'); +}(re$2, re$2.exports)); + +// parse out just the options we care about so we always get a consistent +// obj with keys in a consistent order. +const opts = ['includePrerelease', 'loose', 'rtl']; +const parseOptions$2 = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true; + return options + }, {}); +var parseOptions_1 = parseOptions$2; + +const numeric = /^[0-9]+$/; +const compareIdentifiers$1 = (a, b) => { + const anum = numeric.test(a); + const bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; } -); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +}; -const primitives$3 = new Set(['string', 'number', 'boolean']); +const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a); -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$3(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; +var identifiers = { + compareIdentifiers: compareIdentifiers$1, + rcompareIdentifiers +}; - Object.defineProperty(plugin, 'name', {value: id}); +const debug = debug_1; +const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER } = constants; +const { re: re$1, t: t$1 } = re$2.exports; - return plugin +const parseOptions$1 = parseOptions_1; +const { compareIdentifiers } = identifiers; +class SemVer$2 { + constructor (version, options) { + options = parseOptions$1(options); - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$3(ruleId, raw); + if (version instanceof SemVer$2) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version; + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid Version: ${version}`) + } - if (!severity) return + if (version.length > MAX_LENGTH$1) { + throw new TypeError( + `version is longer than ${MAX_LENGTH$1} characters` + ) + } - const fatal = severity === 2; + debug('SemVer', version, options); + this.options = options; + this.loose = !!options.loose; + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease; - return (tree, file, next) => { - let index = file.messages.length - 1; + const m = version.trim().match(options.loose ? re$1[t$1.LOOSE] : re$1[t$1.FULL]); - wrap(rule, (error) => { - const messages = file.messages; + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } + this.raw = version; - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; - next(); - })(tree, file, options); + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') } - } -} -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$3(name, value) { - /** @type {unknown[]} */ - let result; + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$3.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }); + } - let level = result[0]; + this.build = m[5] ? m[5].split('.') : []; + this.format(); + } - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; + format () { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}`; } + return this.version } - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) + toString () { + return this.version } - result[0] = level; + compare (other) { + debug('SemVer.compare', this.version, this.options, other); + if (!(other instanceof SemVer$2)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer$2(other, this.options); + } - // @ts-expect-error: it’s now a valid tuple. - return result -} + if (other.version === this.version) { + return 0 + } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ + return this.compareMain(other) || this.comparePre(other) + } -const convert$4 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$4 - } + compareMain (other) { + if (!(other instanceof SemVer$2)) { + other = new SemVer$2(other, this.options); + } - if (typeof test === 'string') { - return typeFactory$4(test) - } + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$4(test) : propsFactory$4(test) - } + comparePre (other) { + if (!(other instanceof SemVer$2)) { + other = new SemVer$2(other, this.options); + } - if (typeof test === 'function') { - return castFactory$4(test) + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) } + } while (++i) + } - throw new Error('Expected function, string, or object as test') + compareBuild (other) { + if (!(other instanceof SemVer$2)) { + other = new SemVer$2(other, this.options); } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$4(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - while (++index < tests.length) { - checks[index] = convert$4(tests[index]); + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } - return castFactory$4(any) + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier); + } + this.inc('pre', identifier); + break - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0); + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0]; + } + } else { + this.prerelease = [identifier, 0]; + } + } + break - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true + default: + throw new Error(`invalid increment argument: ${release}`) } - - return false + this.format(); + this.raw = this.version; + return this } } -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$4(check) { - return castFactory$4(all) +var semver = SemVer$2; - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; +const {MAX_LENGTH} = constants; +const { re, t } = re$2.exports; +const SemVer$1 = semver; - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } +const parseOptions = parseOptions_1; +const parse = (version, options) => { + options = parseOptions(options); - return true + if (version instanceof SemVer$1) { + return version } -} -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$4(check) { - return castFactory$4(type) + if (typeof version !== 'string') { + return null + } - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check + if (version.length > MAX_LENGTH) { + return null } -} -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$4(check) { - return assertion + const r = options.loose ? re[t.LOOSE] : re[t.FULL]; + if (!r.test(version)) { + return null + } - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) + try { + return new SemVer$1(version, options) + } catch (er) { + return null } -} +}; -// Utility to return true. -function ok$4() { - return true +var parse_1 = parse; + +const SemVer = semver; +const compare$1 = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)); + +var compare_1 = compare$1; + +const compare = compare_1; +const lt = (a, b, loose) => compare(a, b, loose) < 0; +var lt_1 = lt; + +const allowedKeys = [ + "added", + "napiVersion", + "deprecated", + "removed", + "changes", +]; +const changesExpectedKeys = ["version", "pr-url", "description"]; +const VERSION_PLACEHOLDER = "REPLACEME"; +const MAX_SAFE_SEMVER_VERSION = parse_1( + Array.from({ length: 3 }, () => Number.MAX_SAFE_INTEGER).join(".") +); +const validVersionNumberRegex = /^v\d+\.\d+\.\d+$/; +const prUrlRegex = new RegExp("^https://github.com/nodejs/node/pull/\\d+$"); +const privatePRUrl = "https://github.com/nodejs-private/node-private/pull/"; + +let releasedVersions; +let invalidVersionMessage = "version(s) must respect the pattern `vx.x.x` or"; +if (process.env.NODE_RELEASED_VERSIONS) { + console.log("Using release list from env..."); + releasedVersions = process.env.NODE_RELEASED_VERSIONS.split(",").map( + (v) => `v${v}` + ); + invalidVersionMessage = `version not listed in the changelogs, `; } +invalidVersionMessage += `use the placeholder \`${VERSION_PLACEHOLDER}\``; -/** - * @param {string} d - * @returns {string} - */ -function color$4(d) { - return '\u001B[33m' + d + '\u001B[39m' +const kContainsIllegalKey = Symbol("illegal key"); +const kWrongKeyOrder = Symbol("Wrong key order"); +function unorderedKeys(meta) { + const keys = Object.keys(meta); + let previousKeyIndex = -1; + for (const key of keys) { + const keyIndex = allowedKeys.indexOf(key); + if (keyIndex <= previousKeyIndex) { + return keyIndex === -1 ? kContainsIllegalKey : kWrongKeyOrder; + } + previousKeyIndex = keyIndex; + } } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ +function containsInvalidVersionNumber(version) { + if (Array.isArray(version)) { + return version.some(containsInvalidVersionNumber); + } -/** - * Continue traversing as normal - */ -const CONTINUE$4 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$4 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$4 = false; + if (version === undefined || version === VERSION_PLACEHOLDER) return false; -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$4 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } + if ( + releasedVersions && + // Always ignore 0.0.x and 0.1.x release numbers: + (version[1] !== "0" || (version[3] !== "0" && version[3] !== "1")) + ) + return !releasedVersions.includes(version); - const is = convert$4(test); - const step = reverse ? -1 : 1; + return !validVersionNumberRegex.test(version); +} +const getValidSemver = (version) => + version === VERSION_PLACEHOLDER ? MAX_SAFE_SEMVER_VERSION : version; +function areVersionsUnordered(versions) { + if (!Array.isArray(versions)) return false; - factory(tree, null, [])(); + for (let index = 1; index < versions.length; index++) { + if ( + lt_1( + getValidSemver(versions[index - 1]), + getValidSemver(versions[index]) + ) + ) { + return true; + } + } +} - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; +function invalidChangesKeys(change) { + const keys = Object.keys(change); + const { length } = keys; + if (length !== changesExpectedKeys.length) return true; + for (let index = 0; index < length; index++) { + if (keys[index] !== changesExpectedKeys[index]) return true; + } +} +function validateSecurityChange(file, node, change, index) { + if ("commit" in change) { + if (typeof change.commit !== "string" || isNaN(`0x${change.commit}`)) { + file.message( + `changes[${index}]: Ill-formed security change commit ID`, + node + ); + } + + if (Object.keys(change)[1] === "commit") { + change = { ...change }; + delete change.commit; + } + } + if (invalidChangesKeys(change)) { + const securityChangeExpectedKeys = [...changesExpectedKeys]; + securityChangeExpectedKeys[0] += "[, commit]"; + file.message( + `changes[${index}]: Invalid keys. Expected keys are: ` + + securityChangeExpectedKeys.join(", "), + node + ); + } +} +function validateChanges(file, node, changes) { + if (!Array.isArray(changes)) + return file.message("`changes` must be a YAML list", node); - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + const changesVersions = []; + for (let index = 0; index < changes.length; index++) { + const change = changes[index]; - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$4(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } + const isAncient = + typeof change.version === "string" && change.version.startsWith("v0."); + const isSecurityChange = + !isAncient && + typeof change["pr-url"] === "string" && + change["pr-url"].startsWith(privatePRUrl); - return visit + if (isSecurityChange) { + validateSecurityChange(file, node, change, index); + } else if (!isAncient && invalidChangesKeys(change)) { + file.message( + `changes[${index}]: Invalid keys. Expected keys are: ` + + changesExpectedKeys.join(", "), + node + ); + } - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; + if (containsInvalidVersionNumber(change.version)) { + file.message(`changes[${index}]: ${invalidVersionMessage}`, node); + } else if (areVersionsUnordered(change.version)) { + file.message(`changes[${index}]: list of versions is not in order`, node); + } - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$4(visitor(node, parents)); + if (!isAncient && !isSecurityChange && !prUrlRegex.test(change["pr-url"])) { + file.message( + `changes[${index}]: PR-URL does not match the expected pattern`, + node + ); + } - if (result[0] === EXIT$4) { - return result - } - } + if (typeof change.description !== "string" || !change.description.length) { + file.message( + `changes[${index}]: must contain a non-empty description`, + node + ); + } else if (!change.description.endsWith(".")) { + file.message( + `changes[${index}]: description must end with a period`, + node + ); + } - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$4) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); + changesVersions.push( + Array.isArray(change.version) ? change.version[0] : change.version + ); + } - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); + if (areVersionsUnordered(changesVersions)) { + file.message("Items in `changes` list are not in order", node); + } +} - if (subresult[0] === EXIT$4) { - return subresult - } +function validateMeta(node, file, meta) { + switch (unorderedKeys(meta)) { + case kContainsIllegalKey: + file.message( + "YAML dictionary contains illegal keys. Accepted values are: " + + allowedKeys.join(", "), + node + ); + break; - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } + case kWrongKeyOrder: + file.message( + "YAML dictionary keys should be in this order: " + + allowedKeys.join(", "), + node + ); + break; + } - return result - } - } - } - ); + if (containsInvalidVersionNumber(meta.added)) { + file.message(`Invalid \`added\` value: ${invalidVersionMessage}`, node); + } else if (areVersionsUnordered(meta.added)) { + file.message("Versions in `added` list are not in order", node); + } -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$4(value) { - if (Array.isArray(value)) { - return value + if (containsInvalidVersionNumber(meta.deprecated)) { + file.message( + `Invalid \`deprecated\` value: ${invalidVersionMessage}`, + node + ); + } else if (areVersionsUnordered(meta.deprecated)) { + file.message("Versions in `deprecated` list are not in order", node); } - if (typeof value === 'number') { - return [CONTINUE$4, value] + if (containsInvalidVersionNumber(meta.removed)) { + file.message(`Invalid \`removed\` value: ${invalidVersionMessage}`, node); + } else if (areVersionsUnordered(meta.removed)) { + file.message("Versions in `removed` list are not in order", node); } - return [value] + if ("changes" in meta) { + validateChanges(file, node, meta.changes); + } } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ +function validateYAMLComments(tree, file) { + visit$2(tree, "html", function visitor(node) { + if (node.value.startsWith("<!--YAML\n")) + file.message( + "Expected `<!-- YAML`, found `<!--YAML`. Please add a space", + node + ); + if (!node.value.startsWith("<!-- YAML\n")) return; + try { + const meta = jsYaml.load("#" + node.value.slice(0, -"-->".length)); -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$3 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } + validateMeta(node, file, meta); + } catch (e) { + file.message(e, node); + } + }); +} - visitParents$4(tree, test, overload, reverse); +const remarkLintNodejsYamlComments = lintRule( + "remark-lint:nodejs-yaml-comments", + validateYAMLComments +); - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); +var escapeStringRegexp$2 = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +}; -var pointStart$3 = point$3('start'); +var start$2 = factory$2('start'); +var end = factory$2('end'); + +var unistUtilPosition = position$1; + +position$1.start = start$2; +position$1.end = end; + +function position$1(node) { + return {start: start$2(node), end: end(node)} +} + +function factory$2(type) { + point.displayName = type; -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$3(type) { return point - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point var point = (node && node.position && node.position[type]) || {}; return { line: point.line || null, column: point.column || null, - offset: point.offset > -1 ? point.offset : null + offset: isNaN(point.offset) ? null : point.offset } } } -/** - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @module strong-marker - * @fileoverview - * Warn for violating importance (strong) markers. - * - * Options: `'consistent'`, `'*'`, or `'_'`, default: `'consistent'`. - * - * `'consistent'` detects the first used importance style and warns when - * subsequent importance sequences use different styles. - * - * ## Fix - * - * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) - * formats importance using an `*` (asterisk) by default. - * Pass - * [`strong: '_'`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsstrong) - * to use `_` (underscore) instead. - * - * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) - * on how to automatically fix warnings for this rule. - * - * @example - * {"name": "ok.md"} - * - * **foo** and **bar**. - * - * @example - * {"name": "also-ok.md"} - * - * __foo__ and __bar__. - * - * @example - * {"name": "ok.md", "setting": "*"} - * - * **foo**. - * - * @example - * {"name": "ok.md", "setting": "_"} - * - * __foo__. - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * **foo** and __bar__. - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:13-1:20: Strong should use `*` as a marker - * - * @example - * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true} - * - * 1:1: Incorrect strong marker `💩`: use either `'consistent'`, `'*'`, or `'_'` - */ - -const remarkLintStrongMarker = lintRule$3( - 'remark-lint:strong-marker', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - const value = String(file); - - if (option !== '*' && option !== '_' && option !== 'consistent') { - file.fail( - 'Incorrect strong marker `' + - option + - "`: use either `'consistent'`, `'*'`, or `'_'`" - ); - } +var wrapped = wrapped_1; - visit$3(tree, 'strong', (node) => { - const start = pointStart$3(node).offset; +var unifiedLintRule = factory$1; - if (typeof start === 'number') { - const marker = /** @type {Marker} */ (value.charAt(start)); +function factory$1(id, rule) { + var parts = id.split(':'); + var source = parts[0]; + var ruleId = parts[1]; + var fn = wrapped(rule); - if (option === 'consistent') { - option = marker; - } else if (marker !== option) { - file.message('Strong should use `' + option + '` as a marker', node); - } - } - }); + /* istanbul ignore if - possibly useful if externalised later. */ + if (!ruleId) { + ruleId = source; + source = null; } -); - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$2 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$2(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - Object.defineProperty(plugin, 'name', {value: id}); + attacher.displayName = id; - return plugin + return attacher - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$2(ruleId, raw); + function attacher(raw) { + var config = coerce(ruleId, raw); + var severity = config[0]; + var options = config[1]; + var fatal = severity === 2; - if (!severity) return + return severity ? transformer : undefined - const fatal = severity === 2; + function transformer(tree, file, next) { + var index = file.messages.length; - return (tree, file, next) => { - let index = file.messages.length - 1; + fn(tree, file, options, done); - wrap(rule, (error) => { - const messages = file.messages; + function done(err) { + var messages = file.messages; + var message; // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { + /* istanbul ignore if - only happens for incorrect plugins */ + if (err && messages.indexOf(err) === -1) { try { - file.fail(error); - } catch {} + file.fail(err); + } catch (_) {} } - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); + while (index < messages.length) { + message = messages[index]; + message.ruleId = ruleId; + message.source = source; + message.fatal = fatal; + + index++; } next(); - })(tree, file, options); + } } } } -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$2(name, value) { - /** @type {unknown[]} */ - let result; +// Coerce a value to a severity--options tuple. +function coerce(name, value) { + var def = 1; + var result; + var level; + /* istanbul ignore if - Handled by unified in v6.0.0 */ if (typeof value === 'boolean') { result = [value]; - } else if (value === null || value === undefined) { - result = [1]; + } else if (value == null) { + result = [def]; } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$2.has(typeof value[0]) + typeof value === 'object' && + (typeof value[0] === 'number' || + typeof value[0] === 'boolean' || + typeof value[0] === 'string') ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; + result = value.concat(); } else { result = [1, value]; } - let level = result[0]; + level = result[0]; if (typeof level === 'boolean') { level = level ? 1 : 0; @@ -79129,428 +60683,552 @@ function coerce$2(name, value) { } else if (level === 'on' || level === 'warn') { level = 1; } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$3 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$3 - } + level = 2; + } else { + level = 1; + result = [level, result]; + } + } - if (typeof test === 'string') { - return typeFactory$3(test) - } + if (level < 0 || level > 2) { + throw new Error( + 'Incorrect severity `' + + level + + '` for `' + + name + + '`, ' + + 'expected 0, 1, or 2' + ) + } - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$3(test) : propsFactory$3(test) - } + result[0] = level; - if (typeof test === 'function') { - return castFactory$3(test) - } + return result +} - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$3(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; +var convert_1 = convert$1; - while (++index < tests.length) { - checks[index] = convert$3(tests[index]); +function convert$1(test) { + if (test == null) { + return ok } - return castFactory$3(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; + if (typeof test === 'string') { + return typeFactory(test) + } - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } + if (typeof test === 'object') { + return 'length' in test ? anyFactory(test) : allFactory(test) + } - return false + if (typeof test === 'function') { + return test } + + throw new Error('Expected function, string, or object as test') } -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$3(check) { - return castFactory$3(all) +// Utility assert each property in `test` is represented in `node`, and each +// values are strictly equal. +function allFactory(test) { + return all - /** - * @param {Node} node - * @returns {boolean} - */ function all(node) { - /** @type {string} */ - let key; + var key; - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false + for (key in test) { + if (node[key] !== test[key]) return false } return true } } -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$3(check) { - return castFactory$3(type) +function anyFactory(tests) { + var checks = []; + var index = -1; - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check + while (++index < tests.length) { + checks[index] = convert$1(tests[index]); + } + + return any + + function any() { + var index = -1; + + while (++index < checks.length) { + if (checks[index].apply(this, arguments)) { + return true + } + } + + return false } } -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$3(check) { - return assertion +// Utility to convert a string into a function which checks a given node’s type +// for said string. +function typeFactory(test) { + return type - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) + function type(node) { + return Boolean(node && node.type === test) } } // Utility to return true. -function ok$3() { +function ok() { return true } -/** - * @param {string} d - * @returns {string} - */ -function color$3(d) { +var color_1 = color$1; +function color$1(d) { return '\u001B[33m' + d + '\u001B[39m' } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ +var unistUtilVisitParents = visitParents$1; -/** - * Continue traversing as normal - */ -const CONTINUE$3 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$3 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$3 = false; +var convert = convert_1; +var color = color_1; -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$3 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } +var CONTINUE$1 = true; +var SKIP$1 = 'skip'; +var EXIT$1 = false; - const is = convert$3(test); - const step = reverse ? -1 : 1; +visitParents$1.CONTINUE = CONTINUE$1; +visitParents$1.SKIP = SKIP$1; +visitParents$1.EXIT = EXIT$1; - factory(tree, null, [])(); +function visitParents$1(tree, test, visitor, reverse) { + var step; + var is; - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + is = convert(test); + step = reverse ? -1 : 1; - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$3(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } + factory(tree, null, [])(); - return visit + function factory(node, index, parents) { + var value = typeof node === 'object' && node !== null ? node : {}; + var name; - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; + if (typeof value.type === 'string') { + name = + typeof value.tagName === 'string' + ? value.tagName + : typeof value.name === 'string' + ? value.name + : undefined; - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$3(visitor(node, parents)); + visit.displayName = + 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'; + } - if (result[0] === EXIT$3) { - return result - } - } + return visit - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$3) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); + function visit() { + var grandparents = parents.concat(node); + var result = []; + var subresult; + var offset; - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)); - if (subresult[0] === EXIT$3) { - return subresult - } + if (result[0] === EXIT$1) { + return result + } + } - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } + if (node.children && result[0] !== SKIP$1) { + offset = (reverse ? node.children.length : -1) + step; + + while (offset > -1 && offset < node.children.length) { + subresult = factory(node.children[offset], offset, grandparents)(); + + if (subresult[0] === EXIT$1) { + return subresult } - return result + offset = + typeof subresult[1] === 'number' ? subresult[1] : offset + step; } } + + return result } - ); + } +} -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$3(value) { - if (Array.isArray(value)) { +function toResult(value) { + if (value !== null && typeof value === 'object' && 'length' in value) { return value } if (typeof value === 'number') { - return [CONTINUE$3, value] + return [CONTINUE$1, value] } return [value] } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ +var unistUtilVisit = visit$1; + +var visitParents = unistUtilVisitParents; + +var CONTINUE = visitParents.CONTINUE; +var SKIP = visitParents.SKIP; +var EXIT = visitParents.EXIT; + +visit$1.CONTINUE = CONTINUE; +visit$1.SKIP = SKIP; +visit$1.EXIT = EXIT; + +function visit$1(tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + + visitParents(tree, test, overload, reverse); + + function overload(node, parents) { + var parent = parents[parents.length - 1]; + var index = parent ? parent.children.indexOf(node) : null; + return visitor(node, index, parent) + } +} + +var vfileLocation$1 = factory; + +function factory(file) { + var value = String(file); + var indices = []; + var search = /\r?\n|\r/g; + + while (search.exec(value)) { + indices.push(search.lastIndex); + } + + indices.push(value.length + 1); + + return { + toPoint: offsetToPoint, + toPosition: offsetToPoint, + toOffset: pointToOffset + } + + // Get the line and column-based `point` for `offset` in the bound indices. + function offsetToPoint(offset) { + var index = -1; + + if (offset > -1 && offset < indices[indices.length - 1]) { + while (++index < indices.length) { + if (indices[index] > offset) { + return { + line: index + 1, + column: offset - (indices[index - 1] || 0) + 1, + offset: offset + } + } + } + } + + return {} + } + + // Get the `offset` for a line and column-based `point` in the bound + // indices. + function pointToOffset(point) { + var line = point && point.line; + var column = point && point.column; + var offset; + + if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { + offset = (indices[line - 2] || 0) + column - 1 || 0; + } + + return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 + } +} + +const escapeStringRegexp$1 = escapeStringRegexp$2; +const position = unistUtilPosition; +const rule = unifiedLintRule; +const visit = unistUtilVisit; +const vfileLocation = vfileLocation$1; + +const start$1 = position.start; + +var remarkLintProhibitedStrings = rule('remark-lint:prohibited-strings', prohibitedStrings); + +function testProhibited (val, content) { + let regexpFlags = 'g'; + let no = val.no; + + if (!no) { + no = escapeStringRegexp$1(val.yes); + regexpFlags += 'i'; + } + + let regexpString = '(?<!\\.|@[a-zA-Z0-9/-]*)'; + + const ignoreNextTo = val.ignoreNextTo ? escapeStringRegexp$1(val.ignoreNextTo) : ''; + const replaceCaptureGroups = !!val.replaceCaptureGroups; + + // If it starts with a letter, make sure it is a word break. + if (/^\b/.test(no)) { + regexpString += '\\b'; + } + if (ignoreNextTo) { + regexpString += `(?<!${ignoreNextTo})`; + } + + regexpString += `(${no})`; + + if (ignoreNextTo) { + regexpString += `(?!${ignoreNextTo})`; + } + + // If it ends with a letter, make sure it is a word break. + if (/\b$/.test(no)) { + regexpString += '\\b'; + } + regexpString += '(?!\\.\\w)'; + const re = new RegExp(regexpString, regexpFlags); + + const results = []; + let result = re.exec(content); + while (result) { + if (result[1] !== val.yes) { + let yes = val.yes; + if (replaceCaptureGroups) { + yes = result[1].replace(new RegExp(no), yes); + } + results.push({ result: result[1], index: result.index, yes: yes }); + } + result = re.exec(content); + } + + return results +} + +function prohibitedStrings (ast, file, strings) { + const location = vfileLocation(file); + + visit(ast, 'text', checkText); + + function checkText (node) { + const content = node.value; + const initial = start$1(node).offset; + + strings.forEach((val) => { + const results = testProhibited(val, content); + if (results.length) { + results.forEach(({ result, index, yes }) => { + const message = val.yes ? `Use "${yes}" instead of "${result}"` : `Do not use "${result}"`; + file.message(message, { + start: location.toPoint(initial + index), + end: location.toPoint(initial + index + [...result].length) + }); + }); + } + }); + } +} /** - * Visit children of tree which pass a test + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module rule-style + * @fileoverview + * Warn when the thematic breaks (horizontal rules) violate a given or + * detected style. * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false + * Options: `string`, either a corect thematic breaks such as `***`, or + * `'consistent'`, default: `'consistent'`. + * + * `'consistent'` detects the first used thematic break style and warns when + * subsequent rules use different styles. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * has three settings that define how rules are created: + * + * * [`rule`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsrule) + * (default: `*`) — Marker to use + * * [`ruleRepetition`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsrulerepetition) + * (default: `3`) — Number of markers to use + * * [`ruleSpaces`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsrulespaces) + * (default: `true`) — Whether to pad markers with spaces + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md", "setting": "* * *"} + * + * * * * + * + * * * * + * + * @example + * {"name": "ok.md", "setting": "_______"} + * + * _______ + * + * _______ + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * *** + * + * * * * + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 3:1-3:6: Rules should use `***` + * + * @example + * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true} + * + * 1:1: Incorrect preferred rule style: provide a correct markdown rule or `'consistent'` */ -const visit$2 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - visitParents$3(tree, test, overload, reverse); +const remarkLintRuleStyle = lintRule( + 'remark-lint:rule-style', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + const value = String(file); - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } + if (option !== 'consistent' && /[^-_* ]/.test(option)) { + file.fail( + "Incorrect preferred rule style: provide a correct markdown rule or `'consistent'`" + ); } - ); + + visit$2(tree, 'thematicBreak', (node) => { + const initial = pointStart(node).offset; + const final = pointEnd(node).offset; + + if (typeof initial === 'number' && typeof final === 'number') { + const rule = value.slice(initial, final); + + if (option === 'consistent') { + option = rule; + } else if (rule !== option) { + file.message('Rules should use `' + option + '`', node); + } + } + }); + } +); + +var remarkLintRuleStyle$1 = remarkLintRuleStyle; /** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module strong-marker + * @fileoverview + * Warn for violating importance (strong) markers. * - * @typedef {Partial<Point>} PointLike + * Options: `'consistent'`, `'*'`, or `'_'`, default: `'consistent'`. * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] + * `'consistent'` detects the first used importance style and warns when + * subsequent importance sequences use different styles. * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart$2 = point$2('start'); -var pointEnd$1 = point$2('end'); - -/** - * Get the positional info of `node`. + * ## Fix * - * @param {'start'|'end'} type + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * formats importance using an `*` (asterisk) by default. + * Pass + * [`strong: '_'`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsstrong) + * to use `_` (underscore) instead. + * + * See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown) + * on how to automatically fix warnings for this rule. + * + * @example + * {"name": "ok.md"} + * + * **foo** and **bar**. + * + * @example + * {"name": "also-ok.md"} + * + * __foo__ and __bar__. + * + * @example + * {"name": "ok.md", "setting": "*"} + * + * **foo**. + * + * @example + * {"name": "ok.md", "setting": "_"} + * + * __foo__. + * + * @example + * {"name": "not-ok.md", "label": "input"} + * + * **foo** and __bar__. + * + * @example + * {"name": "not-ok.md", "label": "output"} + * + * 1:13-1:20: Strong should use `*` as a marker + * + * @example + * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true} + * + * 1:1: Incorrect strong marker `💩`: use either `'consistent'`, `'*'`, or `'_'` */ -function point$2(type) { - return point - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; +const remarkLintStrongMarker = lintRule( + 'remark-lint:strong-marker', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + const value = String(file); - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null + if (option !== '*' && option !== '_' && option !== 'consistent') { + file.fail( + 'Incorrect strong marker `' + + option + + "`: use either `'consistent'`, `'*'`, or `'_'`" + ); } + + visit$2(tree, 'strong', (node) => { + const start = pointStart(node).offset; + + if (typeof start === 'number') { + const marker = /** @type {Marker} */ (value.charAt(start)); + + if (option === 'consistent') { + option = marker; + } else if (marker !== option) { + file.message('Strong should use `' + option + '` as a marker', node); + } + } + }); } -} +); + +var remarkLintStrongMarker$1 = remarkLintStrongMarker; /** * @author Titus Wormer @@ -79657,761 +61335,236 @@ function point$2(type) { * | Alpha | Bravo | * * | C | D | - * | :----- | ----: | - * |Charlie | Delta | - * - * @example - * {"name": "not-ok-padded.md", "label": "output", "setting": "consistent", "gfm": true} - * - * 7:2: Cell should be padded - * - * @example - * {"name": "ok-compact.md", "setting": "consistent", "gfm": true} - * - * |A |B | - * |-----|-----| - * |Alpha|Bravo| - * - * |C |D | - * |-------|-----| - * |Charlie|Delta| - * - * @example - * {"name": "not-ok-compact.md", "label": "input", "setting": "consistent", "gfm": true} - * - * |A |B | - * |-----|-----| - * |Alpha|Bravo| - * - * |C | D| - * |:------|-----:| - * |Charlie|Delta | - * - * @example - * {"name": "not-ok-compact.md", "label": "output", "setting": "consistent", "gfm": true} - * - * 7:16: Cell should be compact - * - * @example - * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true, "gfm": true} - * - * 1:1: Incorrect table cell padding style `💩`, expected `'padded'`, `'compact'`, or `'consistent'` - * - * @example - * {"name": "empty.md", "label": "input", "setting": "padded", "gfm": true} - * - * <!-- Empty cells are OK, but those surrounding them may not be. --> - * - * | | Alpha | Bravo| - * | ------ | ----- | ---: | - * | Charlie| | Echo| - * - * @example - * {"name": "empty.md", "label": "output", "setting": "padded", "gfm": true} - * - * 3:25: Cell should be padded - * 5:10: Cell should be padded - * 5:25: Cell should be padded - * - * @example - * {"name": "missing-body.md", "setting": "padded", "gfm": true} - * - * <!-- Missing cells are fine as well. --> - * - * | Alpha | Bravo | Charlie | - * | ----- | ------- | ------- | - * | Delta | - * | Echo | Foxtrot | - */ - -const remarkLintTableCellPadding = lintRule$2( - 'remark-lint:table-cell-padding', - /** @type {import('unified-lint-rule').Rule<Root, Options>} */ - (tree, file, option = 'consistent') => { - if ( - option !== 'padded' && - option !== 'compact' && - option !== 'consistent' - ) { - file.fail( - 'Incorrect table cell padding style `' + - option + - "`, expected `'padded'`, `'compact'`, or `'consistent'`" - ); - } - - visit$2(tree, 'table', (node) => { - const rows = node.children; - // To do: fix types to always have `align` defined. - /* c8 ignore next */ - const align = node.align || []; - /** @type {number[]} */ - const sizes = Array.from({length: align.length}); - /** @type {Entry[]} */ - const entries = []; - let index = -1; - - // Check rows. - while (++index < rows.length) { - const row = rows[index]; - let column = -1; - - // Check fences (before, between, and after cells). - while (++column < row.children.length) { - const cell = row.children[column]; - - if (cell.children.length > 0) { - const cellStart = pointStart$2(cell).offset; - const cellEnd = pointEnd$1(cell).offset; - const contentStart = pointStart$2(cell.children[0]).offset; - const contentEnd = pointEnd$1( - cell.children[cell.children.length - 1] - ).offset; - - if ( - typeof cellStart !== 'number' || - typeof cellEnd !== 'number' || - typeof contentStart !== 'number' || - typeof contentEnd !== 'number' - ) { - continue - } - - entries.push({ - node: cell, - start: contentStart - cellStart - (column ? 0 : 1), - end: cellEnd - contentEnd - 1, - column - }); - - // Detect max space per column. - sizes[column] = Math.max( - sizes[column] || 0, - contentEnd - contentStart - ); - } - } - } - - const style = - option === 'consistent' - ? entries[0] && (!entries[0].start || !entries[0].end) - ? 0 - : 1 - : option === 'padded' - ? 1 - : 0; - - index = -1; - - while (++index < entries.length) { - checkSide('start', entries[index], style, sizes); - checkSide('end', entries[index], style, sizes); - } - - return SKIP$3 - }); - - /** - * @param {'start'|'end'} side - * @param {Entry} entry - * @param {0|1} style - * @param {number[]} sizes - */ - function checkSide(side, entry, style, sizes) { - const cell = entry.node; - const column = entry.column; - const spacing = entry[side]; - - if (spacing === undefined || spacing === style) { - return - } - - let reason = 'Cell should be '; - - if (style === 0) { - // Ignore every cell except the biggest in the column. - if (size(cell) < sizes[column]) { - return - } - - reason += 'compact'; - } else { - reason += 'padded'; - - if (spacing > style) { - // May be right or center aligned. - if (size(cell) < sizes[column]) { - return - } - - reason += ' with 1 space, not ' + spacing; - } - } - - /** @type {Point} */ - let point; - - if (side === 'start') { - point = pointStart$2(cell); - if (!column) { - point.column++; - - if (typeof point.offset === 'number') { - point.offset++; - } - } - } else { - point = pointEnd$1(cell); - point.column--; - - if (typeof point.offset === 'number') { - point.offset--; - } - } - - file.message(reason, point); - } - } -); - -/** - * @param {TableCell} node - * @returns {number} - */ -function size(node) { - const head = pointStart$2(node.children[0]).offset; - const tail = pointEnd$1(node.children[node.children.length - 1]).offset; - // Only called when we’re sure offsets exist. - /* c8 ignore next */ - return typeof head === 'number' && typeof tail === 'number' ? tail - head : 0 -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives$1 = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule$1(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce$1(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce$1(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives$1.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent + * | :----- | ----: | + * |Charlie | Delta | * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props + * @example + * {"name": "not-ok-padded.md", "label": "output", "setting": "consistent", "gfm": true} * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$2 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$2 - } - - if (typeof test === 'string') { - return typeFactory$2(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$2(test) : propsFactory$2(test) - } - - if (typeof test === 'function') { - return castFactory$2(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$2(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$2(tests[index]); - } - - return castFactory$2(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. + * 7:2: Cell should be padded * - * @param {Props} check - * @returns {AssertAnything} + * @example + * {"name": "ok-compact.md", "setting": "consistent", "gfm": true} + * + * |A |B | + * |-----|-----| + * |Alpha|Bravo| + * + * |C |D | + * |-------|-----| + * |Charlie|Delta| + * + * @example + * {"name": "not-ok-compact.md", "label": "input", "setting": "consistent", "gfm": true} + * + * |A |B | + * |-----|-----| + * |Alpha|Bravo| + * + * |C | D| + * |:------|-----:| + * |Charlie|Delta | + * + * @example + * {"name": "not-ok-compact.md", "label": "output", "setting": "consistent", "gfm": true} + * + * 7:16: Cell should be compact + * + * @example + * {"name": "not-ok.md", "label": "output", "setting": "💩", "positionless": true, "gfm": true} + * + * 1:1: Incorrect table cell padding style `💩`, expected `'padded'`, `'compact'`, or `'consistent'` + * + * @example + * {"name": "empty.md", "label": "input", "setting": "padded", "gfm": true} + * + * <!-- Empty cells are OK, but those surrounding them may not be. --> + * + * | | Alpha | Bravo| + * | ------ | ----- | ---: | + * | Charlie| | Echo| + * + * @example + * {"name": "empty.md", "label": "output", "setting": "padded", "gfm": true} + * + * 3:25: Cell should be padded + * 5:10: Cell should be padded + * 5:25: Cell should be padded + * + * @example + * {"name": "missing-body.md", "setting": "padded", "gfm": true} + * + * <!-- Missing cells are fine as well. --> + * + * | Alpha | Bravo | Charlie | + * | ----- | ------- | ------- | + * | Delta | + * | Echo | Foxtrot | */ -function propsFactory$2(check) { - return castFactory$2(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false +const remarkLintTableCellPadding = lintRule( + 'remark-lint:table-cell-padding', + /** @type {import('unified-lint-rule').Rule<Root, Options>} */ + (tree, file, option = 'consistent') => { + if ( + option !== 'padded' && + option !== 'compact' && + option !== 'consistent' + ) { + file.fail( + 'Incorrect table cell padding style `' + + option + + "`, expected `'padded'`, `'compact'`, or `'consistent'`" + ); } - return true - } -} + visit$2(tree, 'table', (node) => { + const rows = node.children; + // To do: fix types to always have `align` defined. + /* c8 ignore next */ + const align = node.align || []; + /** @type {number[]} */ + const sizes = Array.from({length: align.length}); + /** @type {Entry[]} */ + const entries = []; + let index = -1; -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$2(check) { - return castFactory$2(type) + // Check rows. + while (++index < rows.length) { + const row = rows[index]; + let column = -1; - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} + // Check fences (before, between, and after cells). + while (++column < row.children.length) { + const cell = row.children[column]; -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$2(check) { - return assertion + if (cell.children.length > 0) { + const cellStart = pointStart(cell).offset; + const cellEnd = pointEnd(cell).offset; + const contentStart = pointStart(cell.children[0]).offset; + const contentEnd = pointEnd( + cell.children[cell.children.length - 1] + ).offset; - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} + if ( + typeof cellStart !== 'number' || + typeof cellEnd !== 'number' || + typeof contentStart !== 'number' || + typeof contentEnd !== 'number' + ) { + continue + } -// Utility to return true. -function ok$2() { - return true -} + entries.push({ + node: cell, + start: contentStart - cellStart - (column ? 0 : 1), + end: cellEnd - contentEnd - 1, + column + }); -/** - * @param {string} d - * @returns {string} - */ -function color$2(d) { - return '\u001B[33m' + d + '\u001B[39m' -} + // Detect max space per column. + sizes[column] = Math.max( + sizes[column] || 0, + contentEnd - contentStart + ); + } + } + } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ + const style = + option === 'consistent' + ? entries[0] && (!entries[0].start || !entries[0].end) + ? 0 + : 1 + : option === 'padded' + ? 1 + : 0; -/** - * Continue traversing as normal - */ -const CONTINUE$2 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$2 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$2 = false; + index = -1; -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$2 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; + while (++index < entries.length) { + checkSide('start', entries[index], style, sizes); + checkSide('end', entries[index], style, sizes); } - const is = convert$2(test); - const step = reverse ? -1 : 1; + return SKIP$2 + }); - factory(tree, null, [])(); + /** + * @param {'start'|'end'} side + * @param {Entry} entry + * @param {0|1} style + * @param {number[]} sizes + */ + function checkSide(side, entry, style, sizes) { + const cell = entry.node; + const column = entry.column; + const spacing = entry[side]; - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; + if (spacing === undefined || spacing === style) { + return + } - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; + let reason = 'Cell should be '; - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$2(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); + if (style === 0) { + // Ignore every cell except the biggest in the column. + if (size(cell) < sizes[column]) { + return } - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$2(visitor(node, parents)); - - if (result[0] === EXIT$2) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$2) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$2) { - return subresult - } + reason += 'compact'; + } else { + reason += 'padded'; - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } + if (spacing > style) { + // May be right or center aligned. + if (size(cell) < sizes[column]) { + return } - return result + reason += ' with 1 space, not ' + spacing; } } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$2(value) { - if (Array.isArray(value)) { - return value - } - if (typeof value === 'number') { - return [CONTINUE$2, value] - } + /** @type {Point} */ + let point; - return [value] -} + if (side === 'start') { + point = pointStart(cell); + if (!column) { + point.column++; -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ + if (typeof point.offset === 'number') { + point.offset++; + } + } + } else { + point = pointEnd(cell); + point.column--; -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$1 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; + if (typeof point.offset === 'number') { + point.offset--; + } } - visitParents$2(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } + file.message(reason, point); } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ + } +); -var pointStart$1 = point$1('start'); -var pointEnd = point$1('end'); +var remarkLintTableCellPadding$1 = remarkLintTableCellPadding; /** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point$1(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } + * @param {TableCell} node + * @returns {number} + */ +function size(node) { + const head = pointStart(node.children[0]).offset; + const tail = pointEnd(node.children[node.children.length - 1]).offset; + // Only called when we’re sure offsets exist. + /* c8 ignore next */ + return typeof head === 'number' && typeof tail === 'number' ? tail - head : 0 } /** @@ -80456,18 +61609,18 @@ function point$1(type) { const reasonStart = 'Missing initial pipe in table fence'; const reasonEnd = 'Missing final pipe in table fence'; -const remarkLintTablePipes = lintRule$1( +const remarkLintTablePipes = lintRule( 'remark-lint:table-pipes', /** @type {import('unified-lint-rule').Rule<Root, void>} */ (tree, file) => { const value = String(file); - visit$1(tree, 'table', (node) => { + visit$2(tree, 'table', (node) => { let index = -1; while (++index < node.children.length) { const row = node.children[index]; - const start = pointStart$1(row); + const start = pointStart(row); const end = pointEnd(row); if ( @@ -80488,531 +61641,7 @@ const remarkLintTablePipes = lintRule$1( } ); -/** - * @typedef {import('unist').Node} Node - * @typedef {import('vfile').VFile} VFile - * - * @typedef {0|1|2} Severity - * @typedef {'warn'|'on'|'off'|'error'} Label - * @typedef {[Severity, ...unknown[]]} SeverityTuple - * - * @callback Rule - * @param {Node} tree - * @param {VFile} file - * @param {unknown} options - * @returns {void} - */ - -const primitives = new Set(['string', 'number', 'boolean']); - -/** - * @param {string} id - * @param {Rule} rule - */ -function lintRule(id, rule) { - const parts = id.split(':'); - // Possibly useful if externalised later. - /* c8 ignore next */ - const source = parts[1] ? parts[0] : undefined; - const ruleId = parts[1]; - - Object.defineProperty(plugin, 'name', {value: id}); - - return plugin - - /** @type {import('unified').Plugin<[unknown]|void[]>} */ - function plugin(raw) { - const [severity, options] = coerce(ruleId, raw); - - if (!severity) return - - const fatal = severity === 2; - - return (tree, file, next) => { - let index = file.messages.length - 1; - - wrap(rule, (error) => { - const messages = file.messages; - - // Add the error, if not already properly added. - // Only happens for incorrect plugins. - /* c8 ignore next 6 */ - // @ts-expect-error: errors could be `messages`. - if (error && !messages.includes(error)) { - try { - file.fail(error); - } catch {} - } - - while (++index < messages.length) { - Object.assign(messages[index], {ruleId, source, fatal}); - } - - next(); - })(tree, file, options); - } - } -} - -/** - * Coerce a value to a severity--options tuple. - * - * @param {string} name - * @param {unknown} value - * @returns {SeverityTuple} - */ -function coerce(name, value) { - /** @type {unknown[]} */ - let result; - - if (typeof value === 'boolean') { - result = [value]; - } else if (value === null || value === undefined) { - result = [1]; - } else if ( - Array.isArray(value) && - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - primitives.has(typeof value[0]) - ) { - // `isArray(unknown)` is turned into `any[]`: - // type-coverage:ignore-next-line - result = [...value]; - } else { - result = [1, value]; - } - - let level = result[0]; - - if (typeof level === 'boolean') { - level = level ? 1 : 0; - } else if (typeof level === 'string') { - if (level === 'off') { - level = 0; - } else if (level === 'on' || level === 'warn') { - level = 1; - } else if (level === 'error') { - level = 2; - } else { - level = 1; - result = [level, result]; - } - } - - if (typeof level !== 'number' || level < 0 || level > 2) { - throw new Error( - 'Incorrect severity `' + - level + - '` for `' + - name + - '`, ' + - 'expected 0, 1, or 2' - ) - } - - result[0] = level; - - // @ts-expect-error: it’s now a valid tuple. - return result -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert$1 = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$1 - } - - if (typeof test === 'string') { - return typeFactory$1(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$1(test) : propsFactory$1(test) - } - - if (typeof test === 'function') { - return castFactory$1(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory$1(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$1(tests[index]); - } - - return castFactory$1(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$1(check) { - return castFactory$1(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$1(check) { - return castFactory$1(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$1(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$1() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$1(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$1 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$1 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$1 = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$1 = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('./complex-types').Matches<import('./complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('./complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$1(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$1(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.<Parent>} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$1(visitor(node, parents)); - - if (result[0] === EXIT$1) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$1) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$1) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$1(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$1, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit = - /** - * @type {( - * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) & - * (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {Visitor<Node>} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$1(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.<Parent>} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('unist').Position} Position - * @typedef {import('unist').Point} Point - * - * @typedef {Partial<Point>} PointLike - * - * @typedef {Object} PositionLike - * @property {PointLike} [start] - * @property {PointLike} [end] - * - * @typedef {Object} NodeLike - * @property {PositionLike} [position] - */ - -var pointStart = point('start'); - -/** - * Get the positional info of `node`. - * - * @param {'start'|'end'} type - */ -function point(type) { - return point - - /** - * Get the positional info of `node`. - * - * @param {NodeLike} [node] - * @returns {Point} - */ - function point(node) { - /** @type {Point} */ - // @ts-ignore looks like a point - var point = (node && node.position && node.position[type]) || {}; - - return { - line: point.line || null, - column: point.column || null, - offset: point.offset > -1 ? point.offset : null - } - } -} +var remarkLintTablePipes$1 = remarkLintTablePipes; /** * @author Titus Wormer @@ -81105,7 +61734,7 @@ const remarkLintUnorderedListMarkerStyle = lintRule( ); } - visit(tree, 'list', (node) => { + visit$2(tree, 'list', (node) => { if (node.ordered) return let index = -1; @@ -81135,19 +61764,21 @@ const remarkLintUnorderedListMarkerStyle = lintRule( } ); +var remarkLintUnorderedListMarkerStyle$1 = remarkLintUnorderedListMarkerStyle; + // @see https://github.com/nodejs/node/blob/master/doc/guides/doc-style-guide.md // Add in rules alphabetically const remarkPresetLintNode = [ // Leave preset at the top so it can be overridden - remarkPresetLintRecommended, - [remarkLintBlockquoteIndentation, 2], - [remarkLintCheckboxCharacterStyle, { checked: "x", unchecked: " " }], - remarkLintCheckboxContentIndent, - [remarkLintCodeBlockStyle, "fenced"], - remarkLintDefinitionSpacing, + remarkPresetLintRecommended$1, + [remarkLintBlockquoteIndentation$1, 2], + [remarkLintCheckboxCharacterStyle$1, { checked: "x", unchecked: " " }], + remarkLintCheckboxContentIndent$1, + [remarkLintCodeBlockStyle$1, "fenced"], + remarkLintDefinitionSpacing$1, [ - remarkLintFencedCodeFlag, + remarkLintFencedCodeFlag$1, { flags: [ "bash", @@ -81168,22 +61799,22 @@ const remarkPresetLintNode = [ ], }, ], - [remarkLintFencedCodeMarker, "`"], - [remarkLintFileExtension, "md"], - remarkLintFinalDefinition, - [remarkLintFirstHeadingLevel, 1], - [remarkLintHeadingStyle, "atx"], - [remarkLintListItemIndent, "space"], - remarkLintMaximumLineLength, - remarkLintNoConsecutiveBlankLines, - remarkLintNoFileNameArticles, - remarkLintNoFileNameConsecutiveDashes, - remarkLintNofileNameOuterDashes, - remarkLintNoHeadingIndent, - remarkLintNoMultipleToplevelHeadings, - remarkLintNoShellDollars, - remarkLintNoTableIndentation, - remarkLintNoTabs, + [remarkLintFencedCodeMarker$1, "`"], + [remarkLintFileExtension$1, "md"], + remarkLintFinalDefinition$1, + [remarkLintFirstHeadingLevel$1, 1], + [remarkLintHeadingStyle$1, "atx"], + [remarkLintListItemIndent$1, "space"], + remarkLintMaximumLineLength$1, + remarkLintNoConsecutiveBlankLines$1, + remarkLintNoFileNameArticles$1, + remarkLintNoFileNameConsecutiveDashes$1, + remarkLintNofileNameOuterDashes$1, + remarkLintNoHeadingIndent$1, + remarkLintNoMultipleToplevelHeadings$1, + remarkLintNoShellDollars$1, + remarkLintNoTableIndentation$1, + remarkLintNoTabs$1, remarkLintNoTrailingSpaces, remarkLintNodejsLinks, remarkLintNodejsYamlComments, @@ -81206,11 +61837,11 @@ const remarkPresetLintNode = [ { yes: "V8" }, ], ], - remarkLintRuleStyle, - [remarkLintStrongMarker, "*"], - [remarkLintTableCellPadding, "padded"], - remarkLintTablePipes, - [remarkLintUnorderedListMarkerStyle, "*"], + remarkLintRuleStyle$1, + [remarkLintStrongMarker$1, "*"], + [remarkLintTableCellPadding$1, "padded"], + remarkLintTablePipes$1, + [remarkLintUnorderedListMarkerStyle$1, "*"], ]; var remarkPresetLintNode$1 = /*#__PURE__*/Object.freeze({ @@ -83658,300 +64289,6 @@ function escapeStringRegexp(string) { .replace(/-/g, '\\x2d'); } -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object<string, unknown>} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.<Type|Props|TestFunctionAnything>} Test - */ - -const convert = - /** - * @type {( - * (<T extends Node>(test: T['type']|Partial<T>|TestFunctionPredicate<T>) => AssertPredicate<T>) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok - } - - if (typeof test === 'string') { - return typeFactory(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory(test) : propsFactory(test) - } - - if (typeof test === 'function') { - return castFactory(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.<Type|Props|TestFunctionAnything>} tests - * @returns {AssertAnything} - */ -function anyFactory(tests) { - /** @type {Array.<AssertAnything>} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert(tests[index]); - } - - return castFactory(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory(check) { - return castFactory(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory(check) { - return castFactory(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.<unknown>} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - */ - -/** - * Continue traversing as normal - */ -const CONTINUE = true; -/** - * Do not traverse this node’s children - */ -const SKIP = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT = false; - -const visitParents = - /** - * @type {( - * (<T extends Node>(tree: Node, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>, visitor: Visitor<T>, reverse?: boolean) => void) & - * ((tree: Node, test: Test, visitor: Visitor<Node>, reverse?: boolean) => void) & - * ((tree: Node, visitor: Visitor<Node>, reverse?: boolean) => void) - * )} - */ - ( - /** - * Visit children of tree which pass a test - * - * @param {Node} tree Abstract syntax tree to walk - * @param {Test} test test Test node - * @param {Visitor<Node>} visitor Function to run for each node - * @param {boolean} [reverse] Fisit the tree in reverse, defaults to false - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-ignore no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - var is = convert(test); - var step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.<Parent>} parents - */ - function factory(node, index, parents) { - /** @type {Object.<string, unknown>} */ - var value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string} */ - var name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - var result = []; - /** @type {ActionTuple} */ - var subresult; - /** @type {number} */ - var offset; - /** @type {Array.<Parent>} */ - var grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult(visitor(node, parents)); - - if (result[0] === EXIT) { - return result - } - } - - if (node.children && result[0] !== SKIP) { - // @ts-ignore looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-ignore looks like a parent. - grandparents = parents.concat(node); - - // @ts-ignore looks like a parent. - while (offset > -1 && offset < node.children.length) { - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE, value] - } - - return [value] -} - /** * @typedef Options Configuration. * @property {Test} [ignore] `unist-util-is` test used to assert parents @@ -84027,12 +64364,12 @@ const findAndReplace = settings = {}; } - const ignored = convert(settings.ignore || []); + const ignored = convert$2(settings.ignore || []); const pairs = toPairs(schema); let pairIndex = -1; while (++pairIndex < pairs.length) { - visitParents(tree, 'text', visitor); + visitParents$3(tree, 'text', visitor); } return tree @@ -84189,6 +64526,7 @@ function toFunction(replace) { } /** + * @typedef {import('mdast').Link} Link * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension * @typedef {import('mdast-util-from-markdown').Transform} FromMarkdownTransform * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle @@ -84241,7 +64579,6 @@ const gfmAutolinkLiteralToMarkdown = { /** @type {FromMarkdownHandle} */ function enterLiteralAutolink(token) { - // @ts-expect-error: `null` is fine. this.enter({type: 'link', title: null, url: '', children: []}, token); } @@ -84258,7 +64595,8 @@ function exitLiteralAutolinkHttp(token) { /** @type {FromMarkdownHandle} */ function exitLiteralAutolinkWww(token) { this.config.exit.data.call(this, token); - this.stack[this.stack.length - 1].url = 'http://' + this.sliceSerialize(token); + const node = /** @type {Link} */ (this.stack[this.stack.length - 1]); + node.url = 'http://' + this.sliceSerialize(token); } /** @type {FromMarkdownHandle} */ @@ -84276,8 +64614,8 @@ function transformGfmAutolinkLiterals(tree) { findAndReplace( tree, [ - [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/i, findUrl], - [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/, findEmail] + [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl], + [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g, findEmail] ], {ignore: ['link', 'linkReference']} ); @@ -84316,7 +64654,6 @@ function findUrl(_, protocol, domain, path, match) { if (!parts[0]) return false /** @type {PhrasingContent} */ - // @ts-expect-error: `null` is fine. const result = { type: 'link', title: null, @@ -84346,7 +64683,6 @@ function findEmail(_, atext, label, match) { return { type: 'link', - // @ts-expect-error: `null` is fine. title: null, url: 'mailto:' + atext + '@' + label, children: [{type: 'text', value: atext + '@' + label}] diff --git a/tools/node-lint-md-cli-rollup/package-lock.json b/tools/node-lint-md-cli-rollup/package-lock.json index 38dc0793812599..6f4faeea257a31 100644 --- a/tools/node-lint-md-cli-rollup/package-lock.json +++ b/tools/node-lint-md-cli-rollup/package-lock.json @@ -209,9 +209,9 @@ } }, "node_modules/@types/mdast": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz", - "integrity": "sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz", + "integrity": "sha512-YwR7OK8aPmaBvMMUi+pZXBNoW2unbVbfok4YRqGMJBe1dpDlzpRkJrYEYmvjxgs5JhuQmKfDexrN98u941Zasg==", "dependencies": { "@types/unist": "*" } @@ -237,9 +237,9 @@ } }, "node_modules/@types/unist": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", - "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", + "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==" }, "node_modules/ansi-regex": { "version": "5.0.0", @@ -281,18 +281,18 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/bail": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", - "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", + "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -518,11 +518,11 @@ } }, "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -645,9 +645,9 @@ "dev": true }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -713,19 +713,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-from-parse5/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", - "dependencies": { - "@types/unist": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/hast-util-is-element": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-2.1.1.tgz", @@ -772,15 +759,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-to-html/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/hast-util-whitespace": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz", @@ -912,9 +890,9 @@ } }, "node_modules/is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", + "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -988,14 +966,11 @@ } }, "node_modules/is-plain-obj": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", - "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/is-reference": { @@ -1128,6 +1103,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/mdast-comment-marker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-2.0.0.tgz", + "integrity": "sha512-LQ4sf7vUzxz4mQQlzzBDgjaCJO5A0lkIAT9TyeNMfqaP31ooP1Qw9hprf7/V3NCo5FA1nvo5gbnfLVRY79QlDQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-find-and-replace": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.1.0.tgz", @@ -1142,39 +1126,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mdast-util-find-and-replace/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-find-and-replace/node_modules/unist-util-visit-parents": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", - "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdast-util-from-markdown": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", @@ -1284,18 +1235,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/mdast-util-from-markdown/node_modules/unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "dependencies": { - "@types/unist": "^2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdast-util-gfm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-1.0.0.tgz", @@ -1312,10 +1251,11 @@ } }, "node_modules/mdast-util-gfm-autolink-literal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.0.tgz", - "integrity": "sha512-NaGypnNJop+hybP/PLnMVV5aN14VFda31DU+j8qsQdPR8m8AENuCX959hXaCiwVeUem33O6zY+JTt0sH1Kj7ng==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.1.tgz", + "integrity": "sha512-dCUDNYXCytIonTHIUOZXp5S3FWd1XAt6IVH1fBfH6BbUF9U+9m1T9XllfHPvKJCccKNI+0RlYmQJ0rfMTDxEtA==", "dependencies": { + "@types/mdast": "^3.0.0", "ccount": "^2.0.0", "mdast-util-find-and-replace": "^2.0.0", "micromark-util-character": "^1.0.0" @@ -1924,9 +1864,9 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "engines": { "node": ">=8.6" }, @@ -2017,6 +1957,53 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/rehype-parse/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/rehype-parse/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rehype-parse/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/rehype-parse/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/rehype-stringify": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.1.tgz", @@ -2031,61 +2018,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", - "integrity": "sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA==", - "dependencies": { - "remark-parse": "^9.0.0", - "remark-stringify": "^9.0.0", - "unified": "^9.1.0" - }, + "node_modules/rehype-stringify/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-gfm": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-2.0.0.tgz", - "integrity": "sha512-waIv4Tjcd2CTUDxKRYzuPyIHw1FoX4H2GjXAzXV9PxQWb+dU4fJivd/FZ+nxyzPARrqTjMIkwIwPoWNbpBhjcQ==", - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-gfm": "^1.0.0", - "micromark-extension-gfm": "^1.0.0", - "unified": "^10.0.0" + "node_modules/rehype-stringify/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-blockquote-indentation": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-3.0.0.tgz", - "integrity": "sha512-qWWyAJWHwnVFsfKEyl51os1rr4ex9KX398g8326esJ2/RFsCYJbJaXmVk/S+uf7B7HfOWFuJo+tu/7jlZZ54+Q==", - "dependencies": { - "@types/mdast": "^3.0.0", - "pluralize": "^8.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - }, + "node_modules/rehype-stringify/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-blockquote-indentation/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/rehype-stringify/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2093,210 +2065,201 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-blockquote-indentation/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/rehype/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-blockquote-indentation/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/rehype/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-blockquote-indentation/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/rehype/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-blockquote-indentation/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/rehype/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-character-style": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-4.0.0.tgz", - "integrity": "sha512-NHpVZOcTJeLOI1gGOvVDz8i3sXVY3s9K+OADupEA89Syfs4YAbnrij8OMJ6ozbHTn4av/HyVfsF4IK8X2pBUeQ==", + "node_modules/remark": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", + "integrity": "sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA==", "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "remark-parse": "^9.0.0", + "remark-stringify": "^9.0.0", + "unified": "^9.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-character-style/node_modules/unified-lint-rule": { + "node_modules/remark-gfm": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-2.0.0.tgz", + "integrity": "sha512-waIv4Tjcd2CTUDxKRYzuPyIHw1FoX4H2GjXAzXV9PxQWb+dU4fJivd/FZ+nxyzPARrqTjMIkwIwPoWNbpBhjcQ==", "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" + "@types/mdast": "^3.0.0", + "mdast-util-gfm": "^1.0.0", + "micromark-extension-gfm": "^1.0.0", + "unified": "^10.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-character-style/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-gfm/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-checkbox-character-style/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-gfm/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-checkbox-character-style/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-gfm/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-checkbox-character-style/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-gfm/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-content-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-4.0.0.tgz", - "integrity": "sha512-WeB8aSC1oesu0t/wcqNEbn3bg0kRw+NK7Y5xrhQsREw6NcH1TnvjH95PvizFT5LxXAGhz4AtCFz0B28YugSznQ==", + "node_modules/remark-lint": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-9.0.1.tgz", + "integrity": "sha512-q4VFsA7LEG4REJhR2P4A6CU9b4cCQL53845CX74Z4N/W0EgB9mm/GXpYzjbEqgkMPl5ctP8yp/vBYTNmjfUCtw==", "dependencies": { "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0", - "vfile-location": "^4.0.0" + "remark-message-control": "^7.0.0", + "unified": "^10.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-content-indent/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-blockquote-indentation": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-3.0.1.tgz", + "integrity": "sha512-CfjXeaomk3bxt1Y0Z4T/cKVoE+8lm5jw5C+jz8EieWNIziGNUlDxIAbMk1F1sO8EXc4LjkbTSq4zz8h1vOHkew==", "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", + "@types/mdast": "^3.0.0", + "pluralize": "^8.0.0", "unified": "^10.0.0", - "vfile": "^5.0.0" + "unified-lint-rule": "^2.0.0", + "unist-util-generated": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-checkbox-content-indent/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-checkbox-content-indent/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-blockquote-indentation/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-checkbox-content-indent/node_modules/unist-util-visit": { + "node_modules/remark-lint-blockquote-indentation/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-checkbox-content-indent/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, + "node_modules/remark-lint-blockquote-indentation/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-checkbox-content-indent/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "node_modules/remark-lint-blockquote-indentation/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2304,15 +2267,14 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code-block-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-3.0.0.tgz", - "integrity": "sha512-xZMfFeaMOb5OIM4SrNz3QTRV3u5g3/+e6Oq40A3Apwd+a9Kx49lZbGxl8vfqaczP89PTNanm2e4OqqRsCen4Mg==", + "node_modules/remark-lint-checkbox-character-style": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-4.0.1.tgz", + "integrity": "sha512-f/Dvcw4tsWWv0vx4POVZXZmiytsyGMCKmPiMefz4zfy9hTwTGngp9EZhbDivHXiqd5YTUhvjYXFITEfVdxH4qA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", "unist-util-position": "^4.0.0", "unist-util-visit": "^4.0.0" }, @@ -2321,14 +2283,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code-block-style/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-checkbox-character-style/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-checkbox-character-style/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-checkbox-character-style/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-checkbox-character-style/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2336,59 +2330,79 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code-block-style/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-checkbox-content-indent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-4.0.1.tgz", + "integrity": "sha512-uv4qIBdIxGshQ1a84a2RClbX39lYfWgPm3Wg35EJbSWPpe+KWt4rYi9nxB51dIEUXw3KAujlOVougPwhAZROuA==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0", + "vfile-location": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-code-block-style/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-code-block-style/node_modules/unist-util-visit": { + "node_modules/remark-lint-checkbox-content-indent/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-code-block-style/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-checkbox-content-indent/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-checkbox-content-indent/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-definition-spacing": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-3.0.0.tgz", - "integrity": "sha512-3LxU7lwCpfPstldcGly2ULb8knH4IOqZHoABT2KyKFw3rRFUCAEUBSl0k5eetnXXNc/X4NlHmnyjIyzhyl4PhA==", + "node_modules/remark-lint-code-block-style": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-3.0.1.tgz", + "integrity": "sha512-B6338x1UggrAMe4gdmk1No2L/OkK1d1uCelekj6cnl+Pi5/HLlSw3lXIaOTRNIXOccT1zMmNApA4sDZ5qsQWtw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0", + "unist-util-generated": "^2.0.0", "unist-util-position": "^4.0.0", "unist-util-visit": "^4.0.0" }, @@ -2397,14 +2411,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-definition-spacing/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-code-block-style/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-code-block-style/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-code-block-style/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-code-block-style/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2412,45 +2458,63 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-definition-spacing/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-definition-spacing": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-3.0.1.tgz", + "integrity": "sha512-jtCUaZ+6KP4nNutBoiWoqBfa2sMsD4uvvFbuU5MOlzI0wlMmaeAq1pxWuNtkK+w8AEk/8CzfCUrLct5w65KSLQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-definition-spacing/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-definition-spacing/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-definition-spacing/node_modules/unist-util-visit": { + "node_modules/remark-lint-definition-spacing/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-definition-spacing/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-definition-spacing/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-definition-spacing/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -2458,9 +2522,9 @@ } }, "node_modules/remark-lint-fenced-code-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-3.0.0.tgz", - "integrity": "sha512-wvyaTvQ5F78yuw4BDQsneTCvkxHGAjq0OuDQU4pawAZMYO3qFJlau7qoLppgquY1D+jBakejMT/yKnoQgRf1dQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-3.0.1.tgz", + "integrity": "sha512-HsEhvalGxCauZO6OAnaVzIBycfaHLuyZxy1KlniWXQJKZ6EjRAsWwkZHYx9qfPl/ZW7zDG+xAoWTqdHjZW/BTg==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -2474,60 +2538,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-fenced-code-flag/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-fenced-code-flag/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-fenced-code-flag/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-fenced-code-flag/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-fenced-code-flag/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-fenced-code-flag/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-fenced-code-flag/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-fenced-code-flag/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-fenced-code-flag/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -2535,9 +2586,9 @@ } }, "node_modules/remark-lint-fenced-code-marker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-3.0.0.tgz", - "integrity": "sha512-x3wr1+22Atr72Z7+dUS8cqwuz8m8d4UgCAfBTNO+E6pRLVeCnVMvEtuJbDI5UqBlqvkLGlNofV4lJZQvrZUxqQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-3.0.1.tgz", + "integrity": "sha512-vFRjlzyxtG3zdvmlTn6cV1YiZAivQwOzYRNnH5KavC39EZHDxqjQl84QTXshgfCzFupvYCi6ykATIa7obgx9jg==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -2550,60 +2601,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-fenced-code-marker/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-fenced-code-marker/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-fenced-code-marker/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-fenced-code-marker/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-fenced-code-marker/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-fenced-code-marker/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-fenced-code-marker/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-fenced-code-marker/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-fenced-code-marker/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -2611,9 +2649,9 @@ } }, "node_modules/remark-lint-file-extension": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-2.0.0.tgz", - "integrity": "sha512-fZ0nDGyuZSgkrakLKl+cjqXwOT7iAz0wfSbrkCabYW3DdN6X1QYeSlMtHPizGXuri+AZhVkrUnujSn+9P4hJ2w==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-2.0.1.tgz", + "integrity": "sha512-A2N6XoLPbYyRhgXyTI7WlW9Nb9QvXQNXG514hjHdNNd0cL+5P4JU6vivgZiYfViCzOLgsys6hwhXBSC9ZQ45tw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -2624,14 +2662,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-file-extension/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-file-extension/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-file-extension/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-file-extension/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-file-extension/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2640,9 +2710,9 @@ } }, "node_modules/remark-lint-final-definition": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-3.0.0.tgz", - "integrity": "sha512-RHR8aku0jCH4AoHVepw9b0tCmiBevMtLPG1l5FKhbkLtBWk9GRRryuD3GExxsInEUN2P/a6FhvcBBtRSJbIfIA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-3.0.1.tgz", + "integrity": "sha512-bzha13GTKFnQ0h4ZvaHadK6HxM2eRJj/yj59aXyvJkHFNx7i0sQn1884t3yYM4ppdDmO+cCMMgsVo8DxE8ifFA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -2656,88 +2726,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-final-definition/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-final-definition/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-final-definition/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-final-definition/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-final-definition/node_modules/unist-util-visit": { + "node_modules/remark-lint-final-definition/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-final-definition/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-2.0.0.tgz", - "integrity": "sha512-3u1IbgVfUN5Qgid8iqc1qlZhzscs4YPu8mwyahvLWVKMkBtoRWjDIVL6+CXcPPoUB2k3p+zuZ5oaE4yfO5Pb4w==", - "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0" - }, + "node_modules/remark-lint-final-definition/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-final-newline/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-final-definition/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2745,83 +2773,76 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-first-heading-level": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-first-heading-level/-/remark-lint-first-heading-level-3.0.0.tgz", - "integrity": "sha512-SMvBHO4HJd1ZkFDfx7OikJAoq5FQe+nFPm3n4DeAKIgM1FywaC7tD7ShwTRUL2DJMzdPjlta7UQRtTryAQGj+w==", + "node_modules/remark-lint-final-newline": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-2.0.1.tgz", + "integrity": "sha512-vv1LT36frgc0FVc7V52CdOxqh1TqGcNvAVD89935sb9wpEELiUfbGG1Xb9PVZoIaVQcFo8qEDWCvfhsKTKk8Nw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" + "unified-lint-rule": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-first-heading-level/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-final-newline/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-first-heading-level/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-final-newline/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-first-heading-level/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-final-newline/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-first-heading-level/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-final-newline/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-hard-break-spaces": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-3.0.0.tgz", - "integrity": "sha512-TNTI32Va6hE33pTYC6iqn4NvyZHqCULsOKKLnAzBocFFFIYuaNUdfKyVc9wknAAutbQLqApr8tgs1mLHtHm9Fw==", + "node_modules/remark-lint-first-heading-level": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-first-heading-level/-/remark-lint-first-heading-level-3.0.1.tgz", + "integrity": "sha512-3ym0v/aMFpHTGv2/DPln6NHB2DFnx6Nbd+3Z9kf6wfnJCzXNA3zXyCKt11i5MPzUV5wlwButcW+JkPDtDJsfog==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0", "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", "unist-util-visit": "^4.0.0" }, "funding": { @@ -2829,14 +2850,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-hard-break-spaces/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-first-heading-level/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-first-heading-level/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-first-heading-level/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-first-heading-level/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -2844,45 +2897,64 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-hard-break-spaces": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-3.0.1.tgz", + "integrity": "sha512-CPjbfc9DcV4Qy3d8jyhh/QXsLD5uRtweb0d04p2MyzMDrqwXAq5X4MW3rId3JbVVl7o1AKXq1FdvqIMrh9Rpuw==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-generated": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-hard-break-spaces/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-visit": { + "node_modules/remark-lint-hard-break-spaces/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-hard-break-spaces/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-hard-break-spaces/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-hard-break-spaces/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -2890,9 +2962,9 @@ } }, "node_modules/remark-lint-heading-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-3.0.0.tgz", - "integrity": "sha512-pPiXG24yXER7xXZr+J11iuMd1DXa71m6Cx7jqUO5z1Ptc7WkolcW6lNRFG76BCOJp8Jp6vH5eNITuQxYa0AnJw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-3.0.1.tgz", + "integrity": "sha512-/9rsTE+coYdUgT/spxg4ioorG2W5XdabLHajKjTOOQ4ME8Wa5fXHMJ3WpK3Vnz8ZKP7WQwTTPsKWIHcy5d6C+w==", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-heading-style": "^2.0.0", @@ -2906,51 +2978,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-heading-style/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-heading-style/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-heading-style/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-heading-style/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-heading-style/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-heading-style/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-heading-style/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-heading-style/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -2958,9 +3026,9 @@ } }, "node_modules/remark-lint-list-item-bullet-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-4.0.0.tgz", - "integrity": "sha512-b/U3wAJPE00xGQGYBvjPPsdXsBPJxUvITYgAZee7aA2sGEiflMGmg90anS2sJZEAoD4XtNzp96bPaY6QLN89dQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-4.0.1.tgz", + "integrity": "sha512-7XjtSLUwvxHi28/q9XMzYy7A+agpArvLlTksD0r1jj5MpGYTSUW9b54rRRV3JxHJMoX+ZJ9juId6GmVaUZwsTg==", "dependencies": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -2973,51 +3041,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-list-item-bullet-indent/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-list-item-bullet-indent/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-list-item-bullet-indent/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-list-item-bullet-indent/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-list-item-bullet-indent/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-list-item-bullet-indent/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-list-item-bullet-indent/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-list-item-bullet-indent/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3025,9 +3089,9 @@ } }, "node_modules/remark-lint-list-item-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-3.0.0.tgz", - "integrity": "sha512-z7doG/aJCy8ivmfbE/cSm9HOpIeUaV5zZHMqSsZ6XZ+wXIj4wtMFVhI7fsAVs5pAB1gzSvZQuwJOfSs2//Fw2g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-3.0.1.tgz", + "integrity": "sha512-5/H5B2g6TTpJZiwMmBa/Drexwq5Dw50QoypTUgXwFETz91s7zvjy+IGGVoVv0L0LM0rCwblmgtLomqeWIyo9sA==", "dependencies": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -3042,60 +3106,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-list-item-indent/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-list-item-indent/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-list-item-indent/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-list-item-indent/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-list-item-indent/node_modules/unist-util-visit": { + "node_modules/remark-lint-list-item-indent/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-list-item-indent/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-list-item-indent/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-list-item-indent/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3103,9 +3154,9 @@ } }, "node_modules/remark-lint-maximum-line-length": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-3.0.0.tgz", - "integrity": "sha512-0x5TsUDlc4IDPUObNjVtcQxzI1JokUwbVpr22akWypnZaX9QMIL+Cp1OXrKRknZVU3rIndt4QCNnjMEYKezn1g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-3.0.1.tgz", + "integrity": "sha512-R4hiRRx46xa3NE/AY8IKzPTRVyq1ZWrtWVd2KfWwNHmj7a6ASjb75DPzGyckZ46UAQq9mSBPsgL5Rfhq5XmggA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3119,60 +3170,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-maximum-line-length/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-maximum-line-length/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-maximum-line-length/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-maximum-line-length/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-maximum-line-length/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-maximum-line-length/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3180,9 +3218,9 @@ } }, "node_modules/remark-lint-no-auto-link-without-protocol": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-3.0.0.tgz", - "integrity": "sha512-qeJhWZcO0wnavTdpLU6M1q5RBfo4nZnYmzASoSCmIj/ZxIinluXLmLcMHC2Ol46egWdvwDNpr3V0dJP79fiJMQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-3.0.1.tgz", + "integrity": "sha512-FdbB9O4SegELBreglpOXhMyusKORPS0X7KrBY/V+tDo4+2sJHMEEdiN4RbK2ofWwRP7V+muZ5WrscLliuAExQg==", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^3.0.0", @@ -3197,60 +3235,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3258,9 +3283,9 @@ } }, "node_modules/remark-lint-no-blockquote-without-marker": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-5.0.0.tgz", - "integrity": "sha512-6m1KZE8X2OhNV9wpEPVUfFxdzgVD523unRkstlRedKC3ONLlqP/CIliAOITRmIGuUxXVjyD7mDC892bFJnJTfw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-5.0.1.tgz", + "integrity": "sha512-3aUFCV1BSqO15MuJ6fQept36An/vLo9VgAj1TRWk4Gsnaewbq7haT/m6eiYn5Ia8t2sSBbv4LKz1lwnj5nOVPQ==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3275,72 +3300,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unist-util-visit": { + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-blockquote-without-marker/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "node_modules/remark-lint-no-blockquote-without-marker/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" }, "funding": { @@ -3349,9 +3348,9 @@ } }, "node_modules/remark-lint-no-consecutive-blank-lines": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-4.0.0.tgz", - "integrity": "sha512-gP1b3lM+oemvA0WOC5HbvkjESG2BiZHL8ZDSX+wbg/2+7zu14rOmAAMiUOlk/CxbusttwJxsz8a/Wn1dEK/jPg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-4.0.1.tgz", + "integrity": "sha512-nvwglXFdR8ubTjSduK3cVdgBaKCH/DqV0kVkCKSQmLEl8NyozFH03VB/bhQDCrmSeNt6rYClBF0ppaHT27OmpA==", "dependencies": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", @@ -3367,60 +3366,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-consecutive-blank-lines/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3428,9 +3414,9 @@ } }, "node_modules/remark-lint-no-duplicate-definitions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-3.0.0.tgz", - "integrity": "sha512-6VOGPegh2ZQ0d9yronmhNXhg2wLYA5litT7bC1ljg2LQwMTIjYOgJbJsQJSKWD+FiHuqVhdWvXHzyTbFCch8Aw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-3.0.1.tgz", + "integrity": "sha512-gwQe65dW2fkMQR02hwlHtc0OOvshst+gXMOEwd1/fpIb6OORpMiK6ueoNBxCnKSsKqftjWV0JXVdZ7MfKKxQQw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3445,60 +3431,59 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-duplicate-definitions/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-duplicate-definitions/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-duplicate-definitions/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-duplicate-definitions/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-duplicate-definitions/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-duplicate-definitions/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-duplicate-definitions/node_modules/unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^2.0.0" }, "funding": { "type": "opencollective", @@ -3506,9 +3491,9 @@ } }, "node_modules/remark-lint-no-file-name-articles": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-2.0.0.tgz", - "integrity": "sha512-PgyJXEsZDT2r1bvtwaChwTjYKPxo47/OxpJmiozwLcnPsBNbsDtrH+W5gIjNkvkENNcIQD48WZ9jIwyJiskBng==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-2.0.1.tgz", + "integrity": "sha512-9kZ/ydzJlntswJjsQEbPPx0tc6uAPuowmG/3aOCSE+6CjJ+bCQZiVLL3VhjktNyzFxDGTDN6LlbVwiyIHEUMwA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3519,14 +3504,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-articles/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-no-file-name-articles/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-file-name-articles/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-no-file-name-articles/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-file-name-articles/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -3535,9 +3552,9 @@ } }, "node_modules/remark-lint-no-file-name-consecutive-dashes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-2.0.0.tgz", - "integrity": "sha512-o7yz//+vel7IFDoZ/M0BmOS4sVE3sTAFOkeYlH44meGbNnEudr+TKKa0lwopMqZHKhXgUPSayCq+D5dgRO6JLA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-2.0.1.tgz", + "integrity": "sha512-e9ei9KwQSRzUQeYHEhCKUMDeavFOIj46NtuyZxYtrklOcblvaZLAV133UcFHk5CimdUj3dzTtFZebHdpvu5omw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3548,14 +3565,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-file-name-consecutive-dashes/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -3564,9 +3613,9 @@ } }, "node_modules/remark-lint-no-file-name-outer-dashes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-2.0.0.tgz", - "integrity": "sha512-SZS9FeGLty0wOBLTKyboDUZpjIKMihH88ZvgdqCUgIiDlZ9/72JKtZv43UuMnMVRgKJWQCRyZtT3nSNw3HwM+g==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-2.0.1.tgz", + "integrity": "sha512-INp+0gW5T2j6+sHglmDmCLL7/goVKCryXyf+ZApB5oWYBpVr2fLnHEHTUmkbQkksxe7me+VsB+WW/KN1PXGrtw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3577,14 +3626,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-file-name-outer-dashes/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -3593,9 +3674,9 @@ } }, "node_modules/remark-lint-no-heading-content-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-4.0.0.tgz", - "integrity": "sha512-2SljHUYTN83EN5DEZrl7WH4ibmUxai6gONhZaQrQOJyGUO2ReZj5Zdn4xi79NHpORSzCzjn2tSXPB6yL3AhJag==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-4.0.1.tgz", + "integrity": "sha512-IRYlydfT0Xt4AEs5OKSBGP9hLNDckd1mKcV8crnNu91HhcmFVJznzsLV1QrUTTI94cwkSmSWqpjNzsDrKGPbIw==", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-heading-style": "^2.0.0", @@ -3611,60 +3692,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-heading-content-indent/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-heading-content-indent/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-heading-content-indent/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-heading-content-indent/node_modules/unist-util-visit": { + "node_modules/remark-lint-no-heading-content-indent/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-heading-content-indent/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-heading-content-indent/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-no-heading-content-indent/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3672,9 +3740,9 @@ } }, "node_modules/remark-lint-no-heading-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-4.0.0.tgz", - "integrity": "sha512-t4MWiMjPH6TOdM8d5i5Eik6NVrOokoYy6z0GnuI7PNrmNmVVIV9CVBJU94aSXZ7friKx5ucvUEw6NhXIRcNtOw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-4.0.1.tgz", + "integrity": "sha512-LjRsRJOPT1M5MwvGxGEPIHzB713chWgJF5v/FNaHnniLgBrwIbpmsqEhAAam/+i593B5tx84ZyaCf8ujXTP0gg==", "dependencies": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -3689,60 +3757,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-heading-indent/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-heading-indent/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-heading-indent/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-heading-indent/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-heading-indent/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-heading-indent/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-heading-indent/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-heading-indent/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-heading-indent/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3750,9 +3805,9 @@ } }, "node_modules/remark-lint-no-inline-padding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-4.0.0.tgz", - "integrity": "sha512-dugEtHudM/UVQYzTbQoWy4aeG9Micd9g6O/uzN59sIMM8Xb+Srbv/p5/2JNtJWej9PmzINldE0AHjpuB8NiNLA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-4.0.1.tgz", + "integrity": "sha512-UcjJ2XTf7kOmQo5mU/5AV+Gth1YYGcp+gYU4gS/CzdOLYstqsS/W+IN6ALJjEbdbtSyfWCElpxI4p/mW16Z90A==", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^3.0.0", @@ -3766,51 +3821,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-inline-padding/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-inline-padding/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-inline-padding/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-inline-padding/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-inline-padding/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-inline-padding/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-inline-padding/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-inline-padding/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3818,9 +3869,9 @@ } }, "node_modules/remark-lint-no-literal-urls": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-3.0.0.tgz", - "integrity": "sha512-P+9VxemAeSGWGMmFGKcQMIsPgVDaoXnQLl0Bx/TuBms0Favb7XI3ecii/HjjDeks3zlrxlVhzvEkHBk1uH1tdA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-3.0.1.tgz", + "integrity": "sha512-3OAFcaZawfrFgZGrpuZlNPyuvfIURtUzDN7/Bl2X42ivqx4ih1OH9LtiBgz+J0g1DEWnC5ebOmDr7x6XLM76Fw==", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^3.0.0", @@ -3835,60 +3886,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-literal-urls/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-literal-urls/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-literal-urls/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-literal-urls/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-literal-urls/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-literal-urls/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-literal-urls/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-literal-urls/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-literal-urls/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -3896,9 +3934,9 @@ } }, "node_modules/remark-lint-no-multiple-toplevel-headings": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-3.0.0.tgz", - "integrity": "sha512-HzPTSy9nu9RHSIUfZCbxEa7KP4CoKNbfI4SW8txh7KnYwr6vC6QgqXPF77z1sIpiSgD9X2z0LwMk0DBk1v3bmA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-3.0.1.tgz", + "integrity": "sha512-K62PKOOanFiFM4R0oHlo1PKWJa0dPPasQl28yzk6G2xZzqc5eJm5S3d0grU479jqEUbDQMaDQw282hO6WR/MbA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3913,60 +3951,59 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-multiple-toplevel-headings/node_modules/unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^2.0.0" }, "funding": { "type": "opencollective", @@ -3974,9 +4011,9 @@ } }, "node_modules/remark-lint-no-shell-dollars": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-3.0.0.tgz", - "integrity": "sha512-jygHSWi+w7C/VT6+oKIMHhrnMlURWF+ohjdtkxDc/C/7FXWyHg1nJR2t+c+j5Dmirz3oSfInSGw/jUfYP048GQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-3.0.1.tgz", + "integrity": "sha512-QvnA8Ltj3FPaAqUu0DebKYv66LFndTk0fXVZ9rQWOjTEVIKImy9Dy59kVqwYMpCwZbJkpigu2bMl/7UG/BA0XA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -3989,51 +4026,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-shell-dollars/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-shell-dollars/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-shell-dollars/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-shell-dollars/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-shell-dollars/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-shell-dollars/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-shell-dollars/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-shell-dollars/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -4041,9 +4074,9 @@ } }, "node_modules/remark-lint-no-shortcut-reference-image": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-3.0.0.tgz", - "integrity": "sha512-PyB5xkCd8moJf1MrmIXlBTSXZ8pkjXtdrmHzYba7La8S/6TKN2+LFrfN9daLG9pVsD0DSBAlvbajM/MBFh2DfQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-3.0.1.tgz", + "integrity": "sha512-0o0YO88Atib0eWloy5ZbL2IZ1axMNysbJI5j58sxMjEwLq1JORtGOR9Z6aHsOccS5yseeenw5w3DoMLB9PtJtw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -4056,51 +4089,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-shortcut-reference-image/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -4108,9 +4137,9 @@ } }, "node_modules/remark-lint-no-shortcut-reference-link": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-3.0.0.tgz", - "integrity": "sha512-SbPrP6ZfRA2IJ++L7xAivXl7PJdOMzBUlhVwlt5PsWJKWHX07TIB02GGAiMnSOLN0FnUCvgF2c5we6eU1K3plA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-3.0.1.tgz", + "integrity": "sha512-uXujnVm5LXLtGyJkTIbn/uxDRu507B9vC8TieiX6HX8OjVeDWUjtcVJOaqeyLJGjV0Ri1Y+AegMNWx5eDBHTDQ==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -4123,51 +4152,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-shortcut-reference-link/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -4175,9 +4200,9 @@ } }, "node_modules/remark-lint-no-table-indentation": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-4.0.0.tgz", - "integrity": "sha512-S1u4DHBS75xAcM/u1zsYize/0uB2u+xAoHbstN3JmFWsTRj5LUSppwkSrWsPk/3y9/jHJAQ4XSihwH7C95EObQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-4.0.1.tgz", + "integrity": "sha512-GYBX5P1Vj0gO7S7JLU2tpYR5rg9xbeccPQ0ZgHYK4d7T9FjDwfE1hrdvlha3k8s3CFKqQ7MC0OgQw/2IN413MA==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -4191,115 +4216,108 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-table-indentation/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-table-indentation/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-table-indentation/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-table-indentation/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-table-indentation/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-table-indentation/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-table-indentation/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "node_modules/remark-lint-no-table-indentation/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-table-indentation/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-tabs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-3.0.1.tgz", + "integrity": "sha512-B2q1I+fyRDvWTQxCC91NoEvz0KzI9e6Yhu1TdOLkwc02hMWj869G165Rh+EcBKGW/CLKuMPhIn2XtL86emqZRw==", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "vfile-location": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-table-indentation/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", - "dependencies": { - "@types/unist": "^2.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-tabs/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-tabs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-3.0.0.tgz", - "integrity": "sha512-iK5gXQLoBchviHRNNDIWKQsMAbsLIZzK2ZKo0ywzNBHBckd8fy+wIP6RUosb6p/RBHtq1JG1lUC5ADg1PSj0tQ==", - "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "vfile-location": "^4.0.0" + "node_modules/remark-lint-no-tabs/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-tabs/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-tabs/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-tabs/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "node_modules/remark-lint-no-tabs/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" }, "funding": { @@ -4315,10 +4333,22 @@ "unified-lint-rule": "^1.0.2" } }, + "node_modules/remark-lint-no-trailing-spaces/node_modules/unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dependencies": { + "wrapped": "^1.0.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-lint-no-undefined-references": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-4.0.0.tgz", - "integrity": "sha512-HI68vLoTTCXDADAp8LQ6RqCuf9QHX7bSaaqKI1V82EyvizxgnFtvN46XIi1uiDTN+Jv/KzAAGaFrofV8OJknBA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-4.0.1.tgz", + "integrity": "sha512-mmNJO30TYMxwfFJPHkwKNRaW63sU9ffhpb4xkyhyHDmnsplQ96RVYR4WGOXw0/wR+gZECmFtBU+OIWz0cbaiEw==", "dependencies": { "@types/mdast": "^3.0.0", "micromark-util-normalize-identifier": "^1.0.0", @@ -4334,72 +4364,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-undefined-references/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-undefined-references/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-no-undefined-references/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-no-undefined-references/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-undefined-references/node_modules/unist-util-visit": { + "node_modules/remark-lint-no-undefined-references/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-undefined-references/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, + "node_modules/remark-lint-no-undefined-references/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-undefined-references/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "node_modules/remark-lint-no-undefined-references/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" }, "funding": { @@ -4408,9 +4412,9 @@ } }, "node_modules/remark-lint-no-unused-definitions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-3.0.0.tgz", - "integrity": "sha512-1LqEZx0IJx59ezXA9e0qq6h5W3n9I6oiBm3Kl+HvmXTFl1OME6f8SVFwtDbt9EaGmf+3NL+T24cWIhZWjmZ0bA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-3.0.1.tgz", + "integrity": "sha512-bcbboInyb8vAPtYakZdaxRQsDIdQnV5WvUdc03PWFlG8YtGOhRQ57SPc+4uVH+VwHoq+lsEsRszr4sOXuuopxw==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -4423,51 +4427,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-no-unused-definitions/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, + "node_modules/remark-lint-no-unused-definitions/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-unused-definitions/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-no-unused-definitions/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-no-unused-definitions/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-no-unused-definitions/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-no-unused-definitions/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-no-unused-definitions/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -4475,9 +4475,9 @@ } }, "node_modules/remark-lint-ordered-list-marker-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-3.0.0.tgz", - "integrity": "sha512-HDg5Fyg3tENtmI5SpEL34TvEjIiVX4GhuOjU8aOGF7T4SMG69kLyx+IWMKhg39pBw+3h4lG6FDC8IfqYXONNLg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-3.0.1.tgz", + "integrity": "sha512-CGXvolLwfZIxG9hm4o7OXQXEEpu3r5oyTpYGteJDtOSrpVrBSqFKNq7lfhKYFQkcg2AMJYrH9XEexrYvAoUQOQ==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -4491,60 +4491,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-ordered-list-marker-style/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-ordered-list-marker-style/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-ordered-list-marker-style/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-ordered-list-marker-style/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-ordered-list-marker-style/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-ordered-list-marker-style/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-lint-ordered-list-marker-style/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-ordered-list-marker-style/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-ordered-list-marker-style/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -4552,9 +4539,9 @@ } }, "node_modules/remark-lint-prohibited-strings": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-prohibited-strings/-/remark-lint-prohibited-strings-2.0.0.tgz", - "integrity": "sha512-N94RTdAT4qmYNBczNZEZbnpGvtl9GiLPO/xdG569IpbbtNFh5l+Nf5Mx5B1VeJMC8/hAR7wShag03Zf29MOO6Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/remark-lint-prohibited-strings/-/remark-lint-prohibited-strings-2.1.0.tgz", + "integrity": "sha512-tbIXL7cmzZrJEc+hcvLUv9jqU9sxi7MO9atrA/rY4ivVG5xomk+BycE6xFVwiwQC6Fn8dguJ6eHA4/UcT0Xm6w==", "dependencies": { "escape-string-regexp": "^4.0.0", "unified-lint-rule": "^1.0.2", @@ -4563,86 +4550,87 @@ "vfile-location": "^3.0.1" } }, - "node_modules/remark-lint-rule-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-3.0.0.tgz", - "integrity": "sha512-KHSPHW/7YCl9gHFsqqWOqIkJYmPuxTu/5G3Ks3lG8seBDf1bg+lPPUg5TigsKa/E7juVgfTR7AhK6P+lYAp4EA==", - "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "node_modules/remark-lint-prohibited-strings/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-rule-style/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" + "node_modules/remark-lint-prohibited-strings/node_modules/unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "dependencies": { + "wrapped": "^1.0.1" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-rule-style/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-prohibited-strings/node_modules/unist-util-is": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", + "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-rule-style/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-prohibited-strings/node_modules/unist-util-position": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz", + "integrity": "sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-rule-style/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "node_modules/remark-lint-prohibited-strings/node_modules/unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-rule-style/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-prohibited-strings/node_modules/unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "unist-util-is": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-strong-marker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-3.0.0.tgz", - "integrity": "sha512-nNyW3tKl0rEf2j784HzVWChAomCxzld+v2A5R5r5Zw5VogUNikZA7ZRwy51HsmhqiTWHArVGeyuvCPrpkTDZ0A==", + "node_modules/remark-lint-prohibited-strings/node_modules/vfile-location": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", + "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-rule-style": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-3.0.1.tgz", + "integrity": "sha512-j1e60nfZJk0C6mvDZkiFwVu0b58f219ATlMNaZ9h8QdQhdxD/0kUnizJ7xW3wS4sHtCgkKGctAp04Ma0c+Dkhg==", "dependencies": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -4655,14 +4643,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-strong-marker/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-rule-style/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-rule-style/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-rule-style/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-rule-style/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -4670,45 +4690,63 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-strong-marker/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-strong-marker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-3.0.1.tgz", + "integrity": "sha512-J5dJviBd747vXBkFuA2j/Ni7RjTg+Mg2GgXlPHtbgDnal51CdN2WXDmbVG/A98+3P18MlysvQ7KnBrSiiuGBpQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-strong-marker/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-strong-marker/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-strong-marker/node_modules/unist-util-visit": { + "node_modules/remark-lint-strong-marker/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-strong-marker/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-strong-marker/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-strong-marker/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -4716,9 +4754,9 @@ } }, "node_modules/remark-lint-table-cell-padding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-4.0.0.tgz", - "integrity": "sha512-jYBhfu/x0bEXt+wilHnm76q6wHnPVW2v2EuTdvAsxqkVtlvWSl9BbO4bb/L7jKqwlfiTK8E/luHKZuPiNWlucw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-4.0.1.tgz", + "integrity": "sha512-NdF0WHFOaMjeumRIrGHXVadwWkgnfJuMb96FGbf1HvSEv9l41PHkS1KTsL6Zoe1Cva57niAuarMv6xzcJqVjrA==", "dependencies": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", @@ -4732,14 +4770,46 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-cell-padding/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-table-cell-padding/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-table-cell-padding/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -4747,75 +4817,126 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-cell-padding/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-lint-table-pipes": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-4.0.1.tgz", + "integrity": "sha512-om6i8SMSjMsR/mYlx5cMSoxXK+EFI8/n73qCVx/RAhFCIsW4TFR+gYmgFTyLr5Mp4vqjV3uYBIR9Ucv6Johauw==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-cell-padding/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint-table-pipes/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-table-cell-padding/node_modules/unist-util-visit": { + "node_modules/remark-lint-table-pipes/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-table-pipes/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-cell-padding/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-lint-unordered-list-marker-style": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-3.0.1.tgz", + "integrity": "sha512-DPveL2hhkcY608Bkn/Hx+C7pxviufpYyRiu0CnfFxkbLBlMgVdvVIOGCCOlhbvKuGtozmH/RCRsdIfzjlkXiew==", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-generated": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-table-pipes": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-4.0.0.tgz", - "integrity": "sha512-wOIAwkPAEDArKYMEpDylycGOCCt9hUxfgirgYCaHujCvyg484GWO+n+Moabgd19O9ZjuYr2P7akuOocsTh2z3g==", - "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - }, + "node_modules/remark-lint-unordered-list-marker-style/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-table-pipes/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-lint-unordered-list-marker-style/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" }, "funding": { @@ -4823,76 +4944,63 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-table-pipes/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-lint-table-pipes/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-lint/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-table-pipes/node_modules/unist-util-visit": { + "node_modules/remark-lint/node_modules/is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-table-pipes/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, + "node_modules/remark-lint/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-unordered-list-marker-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-3.0.0.tgz", - "integrity": "sha512-iwliMh7GzTdFAWKnVSabpdfcI6qoDE5PPX8hacDIZNbTe4xuUVFbopGCzsTlLiFQkTn6m3ePwOQn+lIbFofKDQ==", + "node_modules/remark-lint/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-unordered-list-marker-style/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "node_modules/remark-message-control": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.0.0.tgz", + "integrity": "sha512-KZySoC97TrMPYfIZ9vJ7wxvQwniy68K6WCY3vmSedDN5YuGfdVOpMj6sjaZQcqbWZV9n7BhrT70E3xaUTtk4hA==", "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-comment-marker": "^2.0.0", + "rehype": "^12.0.0", "unified": "^10.0.0", + "unified-message-control": "^4.0.0", "vfile": "^5.0.0" }, "funding": { @@ -4900,45 +5008,47 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-lint-unordered-list-marker-style/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-message-control/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-unordered-list-marker-style/node_modules/unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", + "node_modules/remark-message-control/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-lint-unordered-list-marker-style/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, + "node_modules/remark-message-control/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-lint-unordered-list-marker-style/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "node_modules/remark-message-control/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, "funding": { "type": "opencollective", @@ -5001,61 +5111,10 @@ "node": ">=12.0.0" } }, - "node_modules/remark-preset-lint-node/node_modules/unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "dependencies": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-node/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-node/node_modules/unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-node/node_modules/unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-preset-lint-recommended": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-6.0.0.tgz", - "integrity": "sha512-ZVugDvBLFQ2JZ/tRIb0q/Oo4Qwp8s8AD8M/8GU7VgQYQ39GDVzo8lUTg2ugWy3YuBCX7wmnP0UDOSwIJt7vn0A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-6.0.1.tgz", + "integrity": "sha512-8ZlwP2aDCGf+3UFPP1K8CofWI/WLoq8hPhQiuKotCFNSdTe98/27XYqWXpbMt4feWtX4+tcJY1y0duuLK5lhBg==", "dependencies": { "@types/mdast": "^3.0.0", "remark-lint": "^9.0.0", @@ -5068,118 +5127,59 @@ "remark-lint-no-duplicate-definitions": "^3.0.0", "remark-lint-no-heading-content-indent": "^4.0.0", "remark-lint-no-inline-padding": "^4.0.0", - "remark-lint-no-literal-urls": "^3.0.0", - "remark-lint-no-shortcut-reference-image": "^3.0.0", - "remark-lint-no-shortcut-reference-link": "^3.0.0", - "remark-lint-no-undefined-references": "^4.0.0", - "remark-lint-no-unused-definitions": "^3.0.0", - "remark-lint-ordered-list-marker-style": "^3.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-recommended/node_modules/mdast-comment-marker": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-2.0.0.tgz", - "integrity": "sha512-LQ4sf7vUzxz4mQQlzzBDgjaCJO5A0lkIAT9TyeNMfqaP31ooP1Qw9hprf7/V3NCo5FA1nvo5gbnfLVRY79QlDQ==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-recommended/node_modules/remark-lint": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-9.0.0.tgz", - "integrity": "sha512-ETO4zI48PR1Nz42YiyaYBzyhOiEfppXLnck7HW2pjKqxd36SIyQgM6sxD4ToMQI9KuCgy8mLAl/iVJoDLKxVjw==", - "dependencies": { - "@types/mdast": "^3.0.0", - "remark-message-control": "^7.0.0", - "unified": "^10.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-recommended/node_modules/remark-message-control": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.0.0.tgz", - "integrity": "sha512-KZySoC97TrMPYfIZ9vJ7wxvQwniy68K6WCY3vmSedDN5YuGfdVOpMj6sjaZQcqbWZV9n7BhrT70E3xaUTtk4hA==", - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-comment-marker": "^2.0.0", - "rehype": "^12.0.0", - "unified": "^10.0.0", - "unified-message-control": "^4.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark-preset-lint-recommended/node_modules/unified-message-control": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-4.0.0.tgz", - "integrity": "sha512-1b92N+VkPHftOsvXNOtkJm4wHlr+UDmTBF2dUzepn40oy9NxanJ9xS1RwUBTjXJwqr2K0kMbEyv1Krdsho7+Iw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit": "^3.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0", - "vfile-message": "^3.0.0" + "remark-lint-no-literal-urls": "^3.0.0", + "remark-lint-no-shortcut-reference-image": "^3.0.0", + "remark-lint-no-shortcut-reference-link": "^3.0.0", + "remark-lint-no-undefined-references": "^4.0.0", + "remark-lint-no-unused-definitions": "^3.0.0", + "remark-lint-ordered-list-marker-style": "^3.0.0", + "unified": "^10.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/remark-preset-lint-recommended/node_modules/unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "node_modules/remark-preset-lint-recommended/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-preset-lint-recommended/node_modules/unist-util-visit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", - "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^4.0.0" + "node_modules/remark-preset-lint-recommended/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/remark-preset-lint-recommended/node_modules/unist-util-visit-parents": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", - "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - }, + "node_modules/remark-preset-lint-recommended/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark-preset-lint-recommended/node_modules/vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "node_modules/remark-preset-lint-recommended/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "dependencies": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" }, "funding": { @@ -5327,89 +5327,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/remark/node_modules/bail": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", - "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/remark/node_modules/trough": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", - "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/remark/node_modules/unified": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", - "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", - "dependencies": { - "bail": "^1.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^2.0.0", - "trough": "^1.0.0", - "vfile": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark/node_modules/unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "dependencies": { - "@types/unist": "^2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark/node_modules/vfile": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", - "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^2.0.0", - "vfile-message": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/remark/node_modules/vfile-message": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", - "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -5419,12 +5336,12 @@ } }, "node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "dependencies": { - "is-core-module": "^2.1.0", + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" }, "funding": { @@ -5440,9 +5357,9 @@ } }, "node_modules/rollup": { - "version": "2.52.7", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.7.tgz", - "integrity": "sha512-55cSH4CCU6MaPr9TAOyrIC+7qFCHscL7tkNsm1MBfIJRRqRbCEY0mmeFn4Wg8FKsHtEH8r389Fz38r/o+kgXLg==", + "version": "2.56.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz", + "integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -5474,9 +5391,9 @@ ] }, "node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5630,18 +5547,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/to-vfile/node_modules/unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "dependencies": { - "@types/unist": "^2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/to-vfile/node_modules/vfile": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", @@ -5671,9 +5576,9 @@ } }, "node_modules/trough": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", - "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", + "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -5685,17 +5590,16 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "node_modules/unified": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", - "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", + "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", + "bail": "^1.0.0", "extend": "^3.0.0", "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" }, "funding": { "type": "opencollective", @@ -5757,14 +5661,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/unified-engine/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, "node_modules/unified-engine/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -5777,21 +5673,121 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/unified-engine/node_modules/trough": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", - "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", + "node_modules/unified-lint-rule": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.1.tgz", + "integrity": "sha512-2RzZuuuWW+ifftM0zd/ZEng0Hb5lah+Zi+ZL/ybj8BrLO/TH2aQAMYvG+iC95aCg2FkWu/pcvVvHqsh2UMmzPg==", + "dependencies": { + "@types/unist": "^2.0.0", + "trough": "^2.0.0", + "unified": "^10.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-lint-rule/node_modules/bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unified-lint-rule/node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unified-lint-rule/node_modules/trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/unified-lint-rule/node_modules/unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-4.0.0.tgz", + "integrity": "sha512-1b92N+VkPHftOsvXNOtkJm4wHlr+UDmTBF2dUzepn40oy9NxanJ9xS1RwUBTjXJwqr2K0kMbEyv1Krdsho7+Iw==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit": "^3.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified-message-control/node_modules/unist-util-visit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", + "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unified/node_modules/vfile": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", + "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^2.0.0", + "vfile-message": "^2.0.0" + }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "node_modules/unified/node_modules/vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", "dependencies": { - "wrapped": "^1.0.1" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" }, "funding": { "type": "opencollective", @@ -5820,29 +5816,29 @@ } }, "node_modules/unist-util-is": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.4.tgz", - "integrity": "sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", + "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-position": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz", - "integrity": "sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", + "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-stringify-position": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", - "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", "dependencies": { - "@types/unist": "^2.0.0" + "@types/unist": "^2.0.2" }, "funding": { "type": "opencollective", @@ -5850,13 +5846,13 @@ } }, "node_modules/unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", + "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" }, "funding": { "type": "opencollective", @@ -5864,12 +5860,25 @@ } }, "node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", + "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", "dependencies": { "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit/node_modules/unist-util-visit-parents": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", + "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" }, "funding": { "type": "opencollective", @@ -5897,9 +5906,13 @@ } }, "node_modules/vfile-location": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", - "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", + "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "dependencies": { + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -5918,6 +5931,18 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/vfile-message/node_modules/unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vfile-reporter": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-6.0.2.tgz", @@ -5954,18 +5979,6 @@ "node": ">=6" } }, - "node_modules/vfile-reporter/node_modules/unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "dependencies": { - "@types/unist": "^2.0.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/vfile-sort": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-2.2.2.tgz", @@ -5984,6 +5997,18 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/vfile/node_modules/unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/web-namespaces": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.0.tgz", @@ -6169,9 +6194,9 @@ } }, "@types/mdast": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz", - "integrity": "sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz", + "integrity": "sha512-YwR7OK8aPmaBvMMUi+pZXBNoW2unbVbfok4YRqGMJBe1dpDlzpRkJrYEYmvjxgs5JhuQmKfDexrN98u941Zasg==", "requires": { "@types/unist": "*" } @@ -6197,9 +6222,9 @@ } }, "@types/unist": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", - "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", + "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==" }, "ansi-regex": { "version": "5.0.0", @@ -6229,14 +6254,14 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "bail": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", - "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", + "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==" }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "binary-extensions": { "version": "2.2.0", @@ -6398,9 +6423,9 @@ } }, "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" }, "esprima": { "version": "4.0.1", @@ -6485,9 +6510,9 @@ "dev": true }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -6532,17 +6557,6 @@ "vfile": "^5.0.0", "vfile-location": "^4.0.0", "web-namespaces": "^2.0.0" - }, - "dependencies": { - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", - "requires": { - "@types/unist": "^2.0.0", - "vfile": "^5.0.0" - } - } } }, "hast-util-is-element": { @@ -6577,13 +6591,6 @@ "space-separated-tokens": "^2.0.0", "stringify-entities": "^4.0.0", "unist-util-is": "^5.0.0" - }, - "dependencies": { - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - } } }, "hast-util-whitespace": { @@ -6671,9 +6678,9 @@ "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" }, "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", + "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", "dev": true, "requires": { "has": "^1.0.3" @@ -6724,9 +6731,9 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-plain-obj": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", - "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" }, "is-reference": { "version": "1.2.1", @@ -6828,6 +6835,11 @@ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.1.tgz", "integrity": "sha512-CBbaYXKSGnE1uLRpKA1SWgIRb2PQrpkllNWpZtZe6VojOJ4ysqiq7/2glYcmKsOYN09QgH/HEBX5hIshAeiK6A==" }, + "mdast-comment-marker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-2.0.0.tgz", + "integrity": "sha512-LQ4sf7vUzxz4mQQlzzBDgjaCJO5A0lkIAT9TyeNMfqaP31ooP1Qw9hprf7/V3NCo5FA1nvo5gbnfLVRY79QlDQ==" + }, "mdast-util-find-and-replace": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.1.0.tgz", @@ -6836,27 +6848,6 @@ "escape-string-regexp": "^5.0.0", "unist-util-is": "^5.0.0", "unist-util-visit-parents": "^4.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==" - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-visit-parents": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", - "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } - } } }, "mdast-util-from-markdown": { @@ -6927,14 +6918,6 @@ "is-decimal": "^1.0.0", "is-hexadecimal": "^1.0.0" } - }, - "unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "requires": { - "@types/unist": "^2.0.2" - } } } }, @@ -6950,10 +6933,11 @@ } }, "mdast-util-gfm-autolink-literal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.0.tgz", - "integrity": "sha512-NaGypnNJop+hybP/PLnMVV5aN14VFda31DU+j8qsQdPR8m8AENuCX959hXaCiwVeUem33O6zY+JTt0sH1Kj7ng==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.1.tgz", + "integrity": "sha512-dCUDNYXCytIonTHIUOZXp5S3FWd1XAt6IVH1fBfH6BbUF9U+9m1T9XllfHPvKJCccKNI+0RlYmQJ0rfMTDxEtA==", "requires": { + "@types/mdast": "^3.0.0", "ccount": "^2.0.0", "mdast-util-find-and-replace": "^2.0.0", "micromark-util-character": "^1.0.0" @@ -7326,9 +7310,9 @@ "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" }, "pluralize": { "version": "8.0.0", @@ -7376,6 +7360,37 @@ "rehype-parse": "^8.0.0", "rehype-stringify": "^9.0.0", "unified": "^10.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } + } } }, "rehype-parse": { @@ -7387,6 +7402,37 @@ "hast-util-from-parse5": "^7.0.0", "parse5": "^6.0.0", "unified": "^10.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } + } } }, "rehype-stringify": { @@ -7397,6 +7443,37 @@ "@types/hast": "^2.0.0", "hast-util-to-html": "^8.0.0", "unified": "^10.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } + } } }, "remark": { @@ -7407,81 +7484,95 @@ "remark-parse": "^9.0.0", "remark-stringify": "^9.0.0", "unified": "^9.1.0" + } + }, + "remark-gfm": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-2.0.0.tgz", + "integrity": "sha512-waIv4Tjcd2CTUDxKRYzuPyIHw1FoX4H2GjXAzXV9PxQWb+dU4fJivd/FZ+nxyzPARrqTjMIkwIwPoWNbpBhjcQ==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-util-gfm": "^1.0.0", + "micromark-extension-gfm": "^1.0.0", + "unified": "^10.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } + } + } + }, + "remark-lint": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-9.0.1.tgz", + "integrity": "sha512-q4VFsA7LEG4REJhR2P4A6CU9b4cCQL53845CX74Z4N/W0EgB9mm/GXpYzjbEqgkMPl5ctP8yp/vBYTNmjfUCtw==", + "requires": { + "@types/mdast": "^3.0.0", + "remark-message-control": "^7.0.0", + "unified": "^10.1.0" }, "dependencies": { "bail": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", - "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, "trough": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", - "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, "unified": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", - "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", - "requires": { - "bail": "^1.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^2.0.0", - "trough": "^1.0.0", - "vfile": "^4.0.0" - } - }, - "unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "requires": { - "@types/unist": "^2.0.2" - } - }, - "vfile": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", - "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^2.0.0", - "vfile-message": "^2.0.0" - } - }, - "vfile-message": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", - "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^2.0.0" + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, - "remark-gfm": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-2.0.0.tgz", - "integrity": "sha512-waIv4Tjcd2CTUDxKRYzuPyIHw1FoX4H2GjXAzXV9PxQWb+dU4fJivd/FZ+nxyzPARrqTjMIkwIwPoWNbpBhjcQ==", - "requires": { - "@types/mdast": "^3.0.0", - "mdast-util-gfm": "^1.0.0", - "micromark-extension-gfm": "^1.0.0", - "unified": "^10.0.0" - } - }, "remark-lint-blockquote-indentation": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-3.0.0.tgz", - "integrity": "sha512-qWWyAJWHwnVFsfKEyl51os1rr4ex9KX398g8326esJ2/RFsCYJbJaXmVk/S+uf7B7HfOWFuJo+tu/7jlZZ54+Q==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-3.0.1.tgz", + "integrity": "sha512-CfjXeaomk3bxt1Y0Z4T/cKVoE+8lm5jw5C+jz8EieWNIziGNUlDxIAbMk1F1sO8EXc4LjkbTSq4zz8h1vOHkew==", "requires": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -7492,52 +7583,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-checkbox-character-style": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-4.0.0.tgz", - "integrity": "sha512-NHpVZOcTJeLOI1gGOvVDz8i3sXVY3s9K+OADupEA89Syfs4YAbnrij8OMJ6ozbHTn4av/HyVfsF4IK8X2pBUeQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-4.0.1.tgz", + "integrity": "sha512-f/Dvcw4tsWWv0vx4POVZXZmiytsyGMCKmPiMefz4zfy9hTwTGngp9EZhbDivHXiqd5YTUhvjYXFITEfVdxH4qA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7546,52 +7626,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-checkbox-content-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-4.0.0.tgz", - "integrity": "sha512-WeB8aSC1oesu0t/wcqNEbn3bg0kRw+NK7Y5xrhQsREw6NcH1TnvjH95PvizFT5LxXAGhz4AtCFz0B28YugSznQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-checkbox-content-indent/-/remark-lint-checkbox-content-indent-4.0.1.tgz", + "integrity": "sha512-uv4qIBdIxGshQ1a84a2RClbX39lYfWgPm3Wg35EJbSWPpe+KWt4rYi9nxB51dIEUXw3KAujlOVougPwhAZROuA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7601,61 +7670,41 @@ "vfile-location": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-code-block-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-3.0.0.tgz", - "integrity": "sha512-xZMfFeaMOb5OIM4SrNz3QTRV3u5g3/+e6Oq40A3Apwd+a9Kx49lZbGxl8vfqaczP89PTNanm2e4OqqRsCen4Mg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-3.0.1.tgz", + "integrity": "sha512-B6338x1UggrAMe4gdmk1No2L/OkK1d1uCelekj6cnl+Pi5/HLlSw3lXIaOTRNIXOccT1zMmNApA4sDZ5qsQWtw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7665,52 +7714,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-definition-spacing": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-3.0.0.tgz", - "integrity": "sha512-3LxU7lwCpfPstldcGly2ULb8knH4IOqZHoABT2KyKFw3rRFUCAEUBSl0k5eetnXXNc/X4NlHmnyjIyzhyl4PhA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-3.0.1.tgz", + "integrity": "sha512-jtCUaZ+6KP4nNutBoiWoqBfa2sMsD4uvvFbuU5MOlzI0wlMmaeAq1pxWuNtkK+w8AEk/8CzfCUrLct5w65KSLQ==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7719,52 +7757,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-fenced-code-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-3.0.0.tgz", - "integrity": "sha512-wvyaTvQ5F78yuw4BDQsneTCvkxHGAjq0OuDQU4pawAZMYO3qFJlau7qoLppgquY1D+jBakejMT/yKnoQgRf1dQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-3.0.1.tgz", + "integrity": "sha512-HsEhvalGxCauZO6OAnaVzIBycfaHLuyZxy1KlniWXQJKZ6EjRAsWwkZHYx9qfPl/ZW7zDG+xAoWTqdHjZW/BTg==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7774,52 +7801,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-fenced-code-marker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-3.0.0.tgz", - "integrity": "sha512-x3wr1+22Atr72Z7+dUS8cqwuz8m8d4UgCAfBTNO+E6pRLVeCnVMvEtuJbDI5UqBlqvkLGlNofV4lJZQvrZUxqQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-3.0.1.tgz", + "integrity": "sha512-vFRjlzyxtG3zdvmlTn6cV1YiZAivQwOzYRNnH5KavC39EZHDxqjQl84QTXshgfCzFupvYCi6ykATIa7obgx9jg==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7828,75 +7844,82 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-file-extension": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-2.0.0.tgz", - "integrity": "sha512-fZ0nDGyuZSgkrakLKl+cjqXwOT7iAz0wfSbrkCabYW3DdN6X1QYeSlMtHPizGXuri+AZhVkrUnujSn+9P4hJ2w==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-2.0.1.tgz", + "integrity": "sha512-A2N6XoLPbYyRhgXyTI7WlW9Nb9QvXQNXG514hjHdNNd0cL+5P4JU6vivgZiYfViCzOLgsys6hwhXBSC9ZQ45tw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-final-definition": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-3.0.0.tgz", - "integrity": "sha512-RHR8aku0jCH4AoHVepw9b0tCmiBevMtLPG1l5FKhbkLtBWk9GRRryuD3GExxsInEUN2P/a6FhvcBBtRSJbIfIA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-3.0.1.tgz", + "integrity": "sha512-bzha13GTKFnQ0h4ZvaHadK6HxM2eRJj/yj59aXyvJkHFNx7i0sQn1884t3yYM4ppdDmO+cCMMgsVo8DxE8ifFA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7906,75 +7929,82 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-2.0.0.tgz", - "integrity": "sha512-3u1IbgVfUN5Qgid8iqc1qlZhzscs4YPu8mwyahvLWVKMkBtoRWjDIVL6+CXcPPoUB2k3p+zuZ5oaE4yfO5Pb4w==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-final-newline/-/remark-lint-final-newline-2.0.1.tgz", + "integrity": "sha512-vv1LT36frgc0FVc7V52CdOxqh1TqGcNvAVD89935sb9wpEELiUfbGG1Xb9PVZoIaVQcFo8qEDWCvfhsKTKk8Nw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-first-heading-level": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-first-heading-level/-/remark-lint-first-heading-level-3.0.0.tgz", - "integrity": "sha512-SMvBHO4HJd1ZkFDfx7OikJAoq5FQe+nFPm3n4DeAKIgM1FywaC7tD7ShwTRUL2DJMzdPjlta7UQRtTryAQGj+w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-first-heading-level/-/remark-lint-first-heading-level-3.0.1.tgz", + "integrity": "sha512-3ym0v/aMFpHTGv2/DPln6NHB2DFnx6Nbd+3Z9kf6wfnJCzXNA3zXyCKt11i5MPzUV5wlwButcW+JkPDtDJsfog==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -7983,47 +8013,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-hard-break-spaces": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-3.0.0.tgz", - "integrity": "sha512-TNTI32Va6hE33pTYC6iqn4NvyZHqCULsOKKLnAzBocFFFIYuaNUdfKyVc9wknAAutbQLqApr8tgs1mLHtHm9Fw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-3.0.1.tgz", + "integrity": "sha512-CPjbfc9DcV4Qy3d8jyhh/QXsLD5uRtweb0d04p2MyzMDrqwXAq5X4MW3rId3JbVVl7o1AKXq1FdvqIMrh9Rpuw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8033,52 +8057,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-heading-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-3.0.0.tgz", - "integrity": "sha512-pPiXG24yXER7xXZr+J11iuMd1DXa71m6Cx7jqUO5z1Ptc7WkolcW6lNRFG76BCOJp8Jp6vH5eNITuQxYa0AnJw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-3.0.1.tgz", + "integrity": "sha512-/9rsTE+coYdUgT/spxg4ioorG2W5XdabLHajKjTOOQ4ME8Wa5fXHMJ3WpK3Vnz8ZKP7WQwTTPsKWIHcy5d6C+w==", "requires": { "@types/mdast": "^3.0.0", "mdast-util-heading-style": "^2.0.0", @@ -8088,47 +8101,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-list-item-bullet-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-4.0.0.tgz", - "integrity": "sha512-b/U3wAJPE00xGQGYBvjPPsdXsBPJxUvITYgAZee7aA2sGEiflMGmg90anS2sJZEAoD4XtNzp96bPaY6QLN89dQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-bullet-indent/-/remark-lint-list-item-bullet-indent-4.0.1.tgz", + "integrity": "sha512-7XjtSLUwvxHi28/q9XMzYy7A+agpArvLlTksD0r1jj5MpGYTSUW9b54rRRV3JxHJMoX+ZJ9juId6GmVaUZwsTg==", "requires": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -8137,47 +8144,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-list-item-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-3.0.0.tgz", - "integrity": "sha512-z7doG/aJCy8ivmfbE/cSm9HOpIeUaV5zZHMqSsZ6XZ+wXIj4wtMFVhI7fsAVs5pAB1gzSvZQuwJOfSs2//Fw2g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-3.0.1.tgz", + "integrity": "sha512-5/H5B2g6TTpJZiwMmBa/Drexwq5Dw50QoypTUgXwFETz91s7zvjy+IGGVoVv0L0LM0rCwblmgtLomqeWIyo9sA==", "requires": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -8188,52 +8189,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-maximum-line-length": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-3.0.0.tgz", - "integrity": "sha512-0x5TsUDlc4IDPUObNjVtcQxzI1JokUwbVpr22akWypnZaX9QMIL+Cp1OXrKRknZVU3rIndt4QCNnjMEYKezn1g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-3.0.1.tgz", + "integrity": "sha512-R4hiRRx46xa3NE/AY8IKzPTRVyq1ZWrtWVd2KfWwNHmj7a6ASjb75DPzGyckZ46UAQq9mSBPsgL5Rfhq5XmggA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8243,52 +8233,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-auto-link-without-protocol": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-3.0.0.tgz", - "integrity": "sha512-qeJhWZcO0wnavTdpLU6M1q5RBfo4nZnYmzASoSCmIj/ZxIinluXLmLcMHC2Ol46egWdvwDNpr3V0dJP79fiJMQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-3.0.1.tgz", + "integrity": "sha512-FdbB9O4SegELBreglpOXhMyusKORPS0X7KrBY/V+tDo4+2sJHMEEdiN4RbK2ofWwRP7V+muZ5WrscLliuAExQg==", "requires": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^3.0.0", @@ -8299,52 +8278,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-blockquote-without-marker": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-5.0.0.tgz", - "integrity": "sha512-6m1KZE8X2OhNV9wpEPVUfFxdzgVD523unRkstlRedKC3ONLlqP/CIliAOITRmIGuUxXVjyD7mDC892bFJnJTfw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-5.0.1.tgz", + "integrity": "sha512-3aUFCV1BSqO15MuJ6fQept36An/vLo9VgAj1TRWk4Gsnaewbq7haT/m6eiYn5Ia8t2sSBbv4LKz1lwnj5nOVPQ==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8355,61 +8323,41 @@ "vfile-location": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-no-consecutive-blank-lines": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-4.0.0.tgz", - "integrity": "sha512-gP1b3lM+oemvA0WOC5HbvkjESG2BiZHL8ZDSX+wbg/2+7zu14rOmAAMiUOlk/CxbusttwJxsz8a/Wn1dEK/jPg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-4.0.1.tgz", + "integrity": "sha512-nvwglXFdR8ubTjSduK3cVdgBaKCH/DqV0kVkCKSQmLEl8NyozFH03VB/bhQDCrmSeNt6rYClBF0ppaHT27OmpA==", "requires": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", @@ -8421,52 +8369,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-duplicate-definitions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-3.0.0.tgz", - "integrity": "sha512-6VOGPegh2ZQ0d9yronmhNXhg2wLYA5litT7bC1ljg2LQwMTIjYOgJbJsQJSKWD+FiHuqVhdWvXHzyTbFCch8Aw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-definitions/-/remark-lint-no-duplicate-definitions-3.0.1.tgz", + "integrity": "sha512-gwQe65dW2fkMQR02hwlHtc0OOvshst+gXMOEwd1/fpIb6OORpMiK6ueoNBxCnKSsKqftjWV0JXVdZ7MfKKxQQw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8477,121 +8414,172 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^2.0.0" } } } }, "remark-lint-no-file-name-articles": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-2.0.0.tgz", - "integrity": "sha512-PgyJXEsZDT2r1bvtwaChwTjYKPxo47/OxpJmiozwLcnPsBNbsDtrH+W5gIjNkvkENNcIQD48WZ9jIwyJiskBng==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-2.0.1.tgz", + "integrity": "sha512-9kZ/ydzJlntswJjsQEbPPx0tc6uAPuowmG/3aOCSE+6CjJ+bCQZiVLL3VhjktNyzFxDGTDN6LlbVwiyIHEUMwA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-no-file-name-consecutive-dashes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-2.0.0.tgz", - "integrity": "sha512-o7yz//+vel7IFDoZ/M0BmOS4sVE3sTAFOkeYlH44meGbNnEudr+TKKa0lwopMqZHKhXgUPSayCq+D5dgRO6JLA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-2.0.1.tgz", + "integrity": "sha512-e9ei9KwQSRzUQeYHEhCKUMDeavFOIj46NtuyZxYtrklOcblvaZLAV133UcFHk5CimdUj3dzTtFZebHdpvu5omw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-no-file-name-outer-dashes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-2.0.0.tgz", - "integrity": "sha512-SZS9FeGLty0wOBLTKyboDUZpjIKMihH88ZvgdqCUgIiDlZ9/72JKtZv43UuMnMVRgKJWQCRyZtT3nSNw3HwM+g==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-2.0.1.tgz", + "integrity": "sha512-INp+0gW5T2j6+sHglmDmCLL7/goVKCryXyf+ZApB5oWYBpVr2fLnHEHTUmkbQkksxe7me+VsB+WW/KN1PXGrtw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-no-heading-content-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-4.0.0.tgz", - "integrity": "sha512-2SljHUYTN83EN5DEZrl7WH4ibmUxai6gONhZaQrQOJyGUO2ReZj5Zdn4xi79NHpORSzCzjn2tSXPB6yL3AhJag==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-content-indent/-/remark-lint-no-heading-content-indent-4.0.1.tgz", + "integrity": "sha512-IRYlydfT0Xt4AEs5OKSBGP9hLNDckd1mKcV8crnNu91HhcmFVJznzsLV1QrUTTI94cwkSmSWqpjNzsDrKGPbIw==", "requires": { "@types/mdast": "^3.0.0", "mdast-util-heading-style": "^2.0.0", @@ -8603,52 +8591,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-heading-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-4.0.0.tgz", - "integrity": "sha512-t4MWiMjPH6TOdM8d5i5Eik6NVrOokoYy6z0GnuI7PNrmNmVVIV9CVBJU94aSXZ7friKx5ucvUEw6NhXIRcNtOw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-heading-indent/-/remark-lint-no-heading-indent-4.0.1.tgz", + "integrity": "sha512-LjRsRJOPT1M5MwvGxGEPIHzB713chWgJF5v/FNaHnniLgBrwIbpmsqEhAAam/+i593B5tx84ZyaCf8ujXTP0gg==", "requires": { "@types/mdast": "^3.0.0", "pluralize": "^8.0.0", @@ -8659,102 +8636,85 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-inline-padding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-4.0.0.tgz", - "integrity": "sha512-dugEtHudM/UVQYzTbQoWy4aeG9Micd9g6O/uzN59sIMM8Xb+Srbv/p5/2JNtJWej9PmzINldE0AHjpuB8NiNLA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-4.0.1.tgz", + "integrity": "sha512-UcjJ2XTf7kOmQo5mU/5AV+Gth1YYGcp+gYU4gS/CzdOLYstqsS/W+IN6ALJjEbdbtSyfWCElpxI4p/mW16Z90A==", "requires": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^3.0.0", "unified": "^10.0.0", "unified-lint-rule": "^2.0.0", "unist-util-generated": "^2.0.0", - "unist-util-visit": "^4.0.0" - }, - "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "unist-util-visit": "^4.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-literal-urls": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-3.0.0.tgz", - "integrity": "sha512-P+9VxemAeSGWGMmFGKcQMIsPgVDaoXnQLl0Bx/TuBms0Favb7XI3ecii/HjjDeks3zlrxlVhzvEkHBk1uH1tdA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-3.0.1.tgz", + "integrity": "sha512-3OAFcaZawfrFgZGrpuZlNPyuvfIURtUzDN7/Bl2X42ivqx4ih1OH9LtiBgz+J0g1DEWnC5ebOmDr7x6XLM76Fw==", "requires": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^3.0.0", @@ -8765,52 +8725,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-multiple-toplevel-headings": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-3.0.0.tgz", - "integrity": "sha512-HzPTSy9nu9RHSIUfZCbxEa7KP4CoKNbfI4SW8txh7KnYwr6vC6QgqXPF77z1sIpiSgD9X2z0LwMk0DBk1v3bmA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-3.0.1.tgz", + "integrity": "sha512-K62PKOOanFiFM4R0oHlo1PKWJa0dPPasQl28yzk6G2xZzqc5eJm5S3d0grU479jqEUbDQMaDQw282hO6WR/MbA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8821,52 +8770,49 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "@types/unist": "^2.0.0" } } } }, "remark-lint-no-shell-dollars": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-3.0.0.tgz", - "integrity": "sha512-jygHSWi+w7C/VT6+oKIMHhrnMlURWF+ohjdtkxDc/C/7FXWyHg1nJR2t+c+j5Dmirz3oSfInSGw/jUfYP048GQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-3.0.1.tgz", + "integrity": "sha512-QvnA8Ltj3FPaAqUu0DebKYv66LFndTk0fXVZ9rQWOjTEVIKImy9Dy59kVqwYMpCwZbJkpigu2bMl/7UG/BA0XA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8875,47 +8821,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-shortcut-reference-image": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-3.0.0.tgz", - "integrity": "sha512-PyB5xkCd8moJf1MrmIXlBTSXZ8pkjXtdrmHzYba7La8S/6TKN2+LFrfN9daLG9pVsD0DSBAlvbajM/MBFh2DfQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-3.0.1.tgz", + "integrity": "sha512-0o0YO88Atib0eWloy5ZbL2IZ1axMNysbJI5j58sxMjEwLq1JORtGOR9Z6aHsOccS5yseeenw5w3DoMLB9PtJtw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8924,47 +8864,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-shortcut-reference-link": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-3.0.0.tgz", - "integrity": "sha512-SbPrP6ZfRA2IJ++L7xAivXl7PJdOMzBUlhVwlt5PsWJKWHX07TIB02GGAiMnSOLN0FnUCvgF2c5we6eU1K3plA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-3.0.1.tgz", + "integrity": "sha512-uXujnVm5LXLtGyJkTIbn/uxDRu507B9vC8TieiX6HX8OjVeDWUjtcVJOaqeyLJGjV0Ri1Y+AegMNWx5eDBHTDQ==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -8973,47 +8907,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-no-table-indentation": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-4.0.0.tgz", - "integrity": "sha512-S1u4DHBS75xAcM/u1zsYize/0uB2u+xAoHbstN3JmFWsTRj5LUSppwkSrWsPk/3y9/jHJAQ4XSihwH7C95EObQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-4.0.1.tgz", + "integrity": "sha512-GYBX5P1Vj0gO7S7JLU2tpYR5rg9xbeccPQ0ZgHYK4d7T9FjDwfE1hrdvlha3k8s3CFKqQ7MC0OgQw/2IN413MA==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9023,61 +8951,41 @@ "vfile-location": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-no-tabs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-3.0.0.tgz", - "integrity": "sha512-iK5gXQLoBchviHRNNDIWKQsMAbsLIZzK2ZKo0ywzNBHBckd8fy+wIP6RUosb6p/RBHtq1JG1lUC5ADg1PSj0tQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-tabs/-/remark-lint-no-tabs-3.0.1.tgz", + "integrity": "sha512-B2q1I+fyRDvWTQxCC91NoEvz0KzI9e6Yhu1TdOLkwc02hMWj869G165Rh+EcBKGW/CLKuMPhIn2XtL86emqZRw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9085,23 +8993,32 @@ "vfile-location": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" } } @@ -9113,12 +9030,22 @@ "integrity": "sha512-cj8t+nvtO6eAY2lJC7o5du8VeOCK13XiDUHL4U6k5aw6ZLr3EYWbQ/rNc6cr60eHkh5Ldm09KiZjV3CWpxqJ0g==", "requires": { "unified-lint-rule": "^1.0.2" + }, + "dependencies": { + "unified-lint-rule": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "requires": { + "wrapped": "^1.0.1" + } + } } }, "remark-lint-no-undefined-references": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-4.0.0.tgz", - "integrity": "sha512-HI68vLoTTCXDADAp8LQ6RqCuf9QHX7bSaaqKI1V82EyvizxgnFtvN46XIi1uiDTN+Jv/KzAAGaFrofV8OJknBA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-undefined-references/-/remark-lint-no-undefined-references-4.0.1.tgz", + "integrity": "sha512-mmNJO30TYMxwfFJPHkwKNRaW63sU9ffhpb4xkyhyHDmnsplQ96RVYR4WGOXw0/wR+gZECmFtBU+OIWz0cbaiEw==", "requires": { "@types/mdast": "^3.0.0", "micromark-util-normalize-identifier": "^1.0.0", @@ -9130,61 +9057,41 @@ "vfile-location": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" } } } }, "remark-lint-no-unused-definitions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-3.0.0.tgz", - "integrity": "sha512-1LqEZx0IJx59ezXA9e0qq6h5W3n9I6oiBm3Kl+HvmXTFl1OME6f8SVFwtDbt9EaGmf+3NL+T24cWIhZWjmZ0bA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-no-unused-definitions/-/remark-lint-no-unused-definitions-3.0.1.tgz", + "integrity": "sha512-bcbboInyb8vAPtYakZdaxRQsDIdQnV5WvUdc03PWFlG8YtGOhRQ57SPc+4uVH+VwHoq+lsEsRszr4sOXuuopxw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9193,47 +9100,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-ordered-list-marker-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-3.0.0.tgz", - "integrity": "sha512-HDg5Fyg3tENtmI5SpEL34TvEjIiVX4GhuOjU8aOGF7T4SMG69kLyx+IWMKhg39pBw+3h4lG6FDC8IfqYXONNLg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-3.0.1.tgz", + "integrity": "sha512-CGXvolLwfZIxG9hm4o7OXQXEEpu3r5oyTpYGteJDtOSrpVrBSqFKNq7lfhKYFQkcg2AMJYrH9XEexrYvAoUQOQ==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9243,118 +9144,102 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-prohibited-strings": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-prohibited-strings/-/remark-lint-prohibited-strings-2.0.0.tgz", - "integrity": "sha512-N94RTdAT4qmYNBczNZEZbnpGvtl9GiLPO/xdG569IpbbtNFh5l+Nf5Mx5B1VeJMC8/hAR7wShag03Zf29MOO6Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/remark-lint-prohibited-strings/-/remark-lint-prohibited-strings-2.1.0.tgz", + "integrity": "sha512-tbIXL7cmzZrJEc+hcvLUv9jqU9sxi7MO9atrA/rY4ivVG5xomk+BycE6xFVwiwQC6Fn8dguJ6eHA4/UcT0Xm6w==", "requires": { "escape-string-regexp": "^4.0.0", "unified-lint-rule": "^1.0.2", "unist-util-position": "^3.1.0", "unist-util-visit": "^2.0.0", "vfile-location": "^3.0.1" - } - }, - "remark-lint-rule-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-3.0.0.tgz", - "integrity": "sha512-KHSPHW/7YCl9gHFsqqWOqIkJYmPuxTu/5G3Ks3lG8seBDf1bg+lPPUg5TigsKa/E7juVgfTR7AhK6P+lYAp4EA==", - "requires": { - "@types/mdast": "^3.0.0", - "unified": "^10.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" }, "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", + "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" + "wrapped": "^1.0.1" } }, "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", + "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==" }, "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz", + "integrity": "sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==" }, "unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" } }, "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "unist-util-is": "^4.0.0" } + }, + "vfile-location": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", + "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==" } } }, - "remark-lint-strong-marker": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-3.0.0.tgz", - "integrity": "sha512-nNyW3tKl0rEf2j784HzVWChAomCxzld+v2A5R5r5Zw5VogUNikZA7ZRwy51HsmhqiTWHArVGeyuvCPrpkTDZ0A==", + "remark-lint-rule-style": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-3.0.1.tgz", + "integrity": "sha512-j1e60nfZJk0C6mvDZkiFwVu0b58f219ATlMNaZ9h8QdQhdxD/0kUnizJ7xW3wS4sHtCgkKGctAp04Ma0c+Dkhg==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9363,52 +9248,84 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } + } + } + }, + "remark-lint-strong-marker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-3.0.1.tgz", + "integrity": "sha512-J5dJviBd747vXBkFuA2j/Ni7RjTg+Mg2GgXlPHtbgDnal51CdN2WXDmbVG/A98+3P18MlysvQ7KnBrSiiuGBpQ==", + "requires": { + "@types/mdast": "^3.0.0", + "unified": "^10.0.0", + "unified-lint-rule": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" - }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-table-cell-padding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-4.0.0.tgz", - "integrity": "sha512-jYBhfu/x0bEXt+wilHnm76q6wHnPVW2v2EuTdvAsxqkVtlvWSl9BbO4bb/L7jKqwlfiTK8E/luHKZuPiNWlucw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-4.0.1.tgz", + "integrity": "sha512-NdF0WHFOaMjeumRIrGHXVadwWkgnfJuMb96FGbf1HvSEv9l41PHkS1KTsL6Zoe1Cva57niAuarMv6xzcJqVjrA==", "requires": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", @@ -9418,52 +9335,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-table-pipes": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-4.0.0.tgz", - "integrity": "sha512-wOIAwkPAEDArKYMEpDylycGOCCt9hUxfgirgYCaHujCvyg484GWO+n+Moabgd19O9ZjuYr2P7akuOocsTh2z3g==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-4.0.1.tgz", + "integrity": "sha512-om6i8SMSjMsR/mYlx5cMSoxXK+EFI8/n73qCVx/RAhFCIsW4TFR+gYmgFTyLr5Mp4vqjV3uYBIR9Ucv6Johauw==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9472,52 +9378,41 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } }, "remark-lint-unordered-list-marker-style": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-3.0.0.tgz", - "integrity": "sha512-iwliMh7GzTdFAWKnVSabpdfcI6qoDE5PPX8hacDIZNbTe4xuUVFbopGCzsTlLiFQkTn6m3ePwOQn+lIbFofKDQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-3.0.1.tgz", + "integrity": "sha512-DPveL2hhkcY608Bkn/Hx+C7pxviufpYyRiu0CnfFxkbLBlMgVdvVIOGCCOlhbvKuGtozmH/RCRsdIfzjlkXiew==", "requires": { "@types/mdast": "^3.0.0", "unified": "^10.0.0", @@ -9527,44 +9422,77 @@ "unist-util-visit": "^4.0.0" }, "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" + }, + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", "trough": "^2.0.0", - "unified": "^10.0.0", "vfile": "^5.0.0" } + } + } + }, + "remark-message-control": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.0.0.tgz", + "integrity": "sha512-KZySoC97TrMPYfIZ9vJ7wxvQwniy68K6WCY3vmSedDN5YuGfdVOpMj6sjaZQcqbWZV9n7BhrT70E3xaUTtk4hA==", + "requires": { + "@types/mdast": "^3.0.0", + "mdast-comment-marker": "^2.0.0", + "rehype": "^12.0.0", + "unified": "^10.0.0", + "unified-message-control": "^4.0.0", + "vfile": "^5.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-position": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", - "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" - }, - "unist-util-visit": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" } } } @@ -9616,49 +9544,12 @@ "semver": "^7.3.2", "unified-lint-rule": "^2.0.0", "unist-util-visit": "^4.0.0" - }, - "dependencies": { - "unified-lint-rule": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.0.tgz", - "integrity": "sha512-3V+eyHZR+PAeKavQrrvSacXq83C3TGVDZJpTZ8+MTlHZmS4arL1ul5U4WRymok0zobAsMiri42bJj0rCHIlIjA==", - "requires": { - "@types/unist": "^2.0.0", - "trough": "^2.0.0", - "unified": "^10.0.0", - "vfile": "^5.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" - }, - "unist-util-visit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", - "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - } - }, - "unist-util-visit-parents": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", - "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } - } } }, "remark-preset-lint-recommended": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-6.0.0.tgz", - "integrity": "sha512-ZVugDvBLFQ2JZ/tRIb0q/Oo4Qwp8s8AD8M/8GU7VgQYQ39GDVzo8lUTg2ugWy3YuBCX7wmnP0UDOSwIJt7vn0A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-6.0.1.tgz", + "integrity": "sha512-8ZlwP2aDCGf+3UFPP1K8CofWI/WLoq8hPhQiuKotCFNSdTe98/27XYqWXpbMt4feWtX4+tcJY1y0duuLK5lhBg==", "requires": { "@types/mdast": "^3.0.0", "remark-lint": "^9.0.0", @@ -9680,77 +9571,32 @@ "unified": "^10.0.0" }, "dependencies": { - "mdast-comment-marker": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-2.0.0.tgz", - "integrity": "sha512-LQ4sf7vUzxz4mQQlzzBDgjaCJO5A0lkIAT9TyeNMfqaP31ooP1Qw9hprf7/V3NCo5FA1nvo5gbnfLVRY79QlDQ==" - }, - "remark-lint": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-9.0.0.tgz", - "integrity": "sha512-ETO4zI48PR1Nz42YiyaYBzyhOiEfppXLnck7HW2pjKqxd36SIyQgM6sxD4ToMQI9KuCgy8mLAl/iVJoDLKxVjw==", - "requires": { - "@types/mdast": "^3.0.0", - "remark-message-control": "^7.0.0", - "unified": "^10.1.0" - } - }, - "remark-message-control": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.0.0.tgz", - "integrity": "sha512-KZySoC97TrMPYfIZ9vJ7wxvQwniy68K6WCY3vmSedDN5YuGfdVOpMj6sjaZQcqbWZV9n7BhrT70E3xaUTtk4hA==", - "requires": { - "@types/mdast": "^3.0.0", - "mdast-comment-marker": "^2.0.0", - "rehype": "^12.0.0", - "unified": "^10.0.0", - "unified-message-control": "^4.0.0", - "vfile": "^5.0.0" - } + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" }, - "unified-message-control": { + "is-plain-obj": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-4.0.0.tgz", - "integrity": "sha512-1b92N+VkPHftOsvXNOtkJm4wHlr+UDmTBF2dUzepn40oy9NxanJ9xS1RwUBTjXJwqr2K0kMbEyv1Krdsho7+Iw==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit": "^3.0.0", - "vfile": "^5.0.0", - "vfile-location": "^4.0.0", - "vfile-message": "^3.0.0" - } - }, - "unist-util-is": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", - "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, - "unist-util-visit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", - "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^4.0.0" - } - }, - "unist-util-visit-parents": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", - "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", - "requires": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" - } + "trough": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" }, - "vfile-location": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", - "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", "requires": { "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", "vfile": "^5.0.0" } } @@ -9852,12 +9698,12 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { - "is-core-module": "^2.1.0", + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -9867,9 +9713,9 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" }, "rollup": { - "version": "2.52.7", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.7.tgz", - "integrity": "sha512-55cSH4CCU6MaPr9TAOyrIC+7qFCHscL7tkNsm1MBfIJRRqRbCEY0mmeFn4Wg8FKsHtEH8r389Fz38r/o+kgXLg==", + "version": "2.56.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz", + "integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -9881,9 +9727,9 @@ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "requires": { "lru-cache": "^6.0.0" } @@ -9995,14 +9841,6 @@ "vfile": "^4.0.0" }, "dependencies": { - "unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "requires": { - "@types/unist": "^2.0.2" - } - }, "vfile": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", @@ -10026,9 +9864,9 @@ } }, "trough": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", - "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", + "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" }, "typedarray": { "version": "0.0.6", @@ -10036,17 +9874,38 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "unified": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", - "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", + "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", "requires": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", + "bail": "^1.0.0", "extend": "^3.0.0", "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + }, + "dependencies": { + "vfile": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", + "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^2.0.0", + "vfile-message": "^2.0.0" + } + }, + "vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + } + } } }, "unified-args": { @@ -10096,11 +9955,6 @@ "sprintf-js": "~1.0.2" } }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" - }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -10109,20 +9963,74 @@ "argparse": "^1.0.7", "esprima": "^4.0.0" } + } + } + }, + "unified-lint-rule": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-2.0.1.tgz", + "integrity": "sha512-2RzZuuuWW+ifftM0zd/ZEng0Hb5lah+Zi+ZL/ybj8BrLO/TH2aQAMYvG+iC95aCg2FkWu/pcvVvHqsh2UMmzPg==", + "requires": { + "@types/unist": "^2.0.0", + "trough": "^2.0.0", + "unified": "^10.0.0", + "vfile": "^5.0.0" + }, + "dependencies": { + "bail": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.1.tgz", + "integrity": "sha512-d5FoTAr2S5DSUPKl85WNm2yUwsINN8eidIdIwsOge2t33DaOfOdSmmsI11jMN3GmALCXaw+Y6HMVHDzePshFAA==" + }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==" }, "trough": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", - "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz", + "integrity": "sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w==" + }, + "unified": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.0.tgz", + "integrity": "sha512-4U3ru/BRXYYhKbwXV6lU6bufLikoAavTwev89H5UxY8enDFaAT2VXmIXYNm6hb5oHPng/EXr77PVyDFcptbk5g==", + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } } } }, - "unified-lint-rule": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.6.tgz", - "integrity": "sha512-YPK15YBFwnsVorDFG/u0cVVQN5G2a3V8zv5/N6KN3TCG+ajKtaALcy7u14DCSrJI+gZeyYquFL9cioJXOGXSvg==", + "unified-message-control": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-4.0.0.tgz", + "integrity": "sha512-1b92N+VkPHftOsvXNOtkJm4wHlr+UDmTBF2dUzepn40oy9NxanJ9xS1RwUBTjXJwqr2K0kMbEyv1Krdsho7+Iw==", "requires": { - "wrapped": "^1.0.1" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit": "^3.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "vfile-message": "^3.0.0" + }, + "dependencies": { + "unist-util-visit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-3.1.0.tgz", + "integrity": "sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^4.0.0" + } + } } }, "unist-util-generated": { @@ -10139,40 +10047,51 @@ } }, "unist-util-is": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.4.tgz", - "integrity": "sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA==" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", + "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==" }, "unist-util-position": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz", - "integrity": "sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.1.tgz", + "integrity": "sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA==" }, "unist-util-stringify-position": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", - "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", "requires": { - "@types/unist": "^2.0.0" + "@types/unist": "^2.0.2" } }, "unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.0.0.tgz", + "integrity": "sha512-3HWTvrtU10/E7qgPznBfiOyG0TXj9W8c1GSfaI8L9GkaG1pLePiQPZ7E35a0R3ToQ/zcy4Im6aZ9WBgOTnv1MQ==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + }, + "dependencies": { + "unist-util-visit-parents": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.0.0.tgz", + "integrity": "sha512-CVaLOYPM/EaFTYMytbaju3Tw4QI3DHnHFnL358FkEu0hZOzSm/hqBdVwOQDR60jF5ZzhB1tlZlRH0ll/yekZIQ==", + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + } + } } }, "unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz", + "integrity": "sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw==", "requires": { "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" + "unist-util-is": "^5.0.0" } }, "util-deprecate": { @@ -10189,12 +10108,26 @@ "is-buffer": "^2.0.0", "unist-util-stringify-position": "^3.0.0", "vfile-message": "^3.0.0" + }, + "dependencies": { + "unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "requires": { + "@types/unist": "^2.0.0" + } + } } }, "vfile-location": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.2.0.tgz", - "integrity": "sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", + "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "requires": { + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" + } }, "vfile-message": { "version": "3.0.2", @@ -10203,6 +10136,16 @@ "requires": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" + }, + "dependencies": { + "unist-util-stringify-position": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.0.tgz", + "integrity": "sha512-SdfAl8fsDclywZpfMDTVDxA2V7LjtRDTOFd44wUJamgl6OlVngsqWjxvermMYf60elWHbxhuRCZml7AnuXCaSA==", + "requires": { + "@types/unist": "^2.0.0" + } + } } }, "vfile-reporter": { @@ -10230,14 +10173,6 @@ "requires": { "has-flag": "^3.0.0" } - }, - "unist-util-stringify-position": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", - "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", - "requires": { - "@types/unist": "^2.0.2" - } } } }, diff --git a/tools/node-lint-md-cli-rollup/rollup.config.js b/tools/node-lint-md-cli-rollup/rollup.config.js index 654f033cf65b8d..93a97c12f8041d 100644 --- a/tools/node-lint-md-cli-rollup/rollup.config.js +++ b/tools/node-lint-md-cli-rollup/rollup.config.js @@ -40,13 +40,15 @@ module.exports = { 'fsevents = require(\'fsevents\');', 'fsevents = undefined;' ); } + // Remove circular dependency in glob that messes up rollup + return code.replace("var Glob = require('./glob.js').Glob", ''); } }, json({ preferConst: true }), nodeResolve(), // tells Rollup how to find date-fns in node_modules - commonjs(), // Converts date-fns to ES modules + commonjs(), { name: 'banner', renderChunk(code) {