From c784f15588bf659d0301fea1ba3587748c03f0bb Mon Sep 17 00:00:00 2001 From: Daniele Belardi Date: Sun, 27 Dec 2020 20:59:59 +0100 Subject: [PATCH 001/161] Revert "http: use `autoDestroy: true` in incoming message" This reverts commits: * 55e83cbe957de2c752521557ffd74d4496fa8b81 * 6120028ee3ca88d009c62711a225b1af7fad1919 * 70eaf55a9d2da25742df79a862edf16f122fdfbb * 5ae96908696b7a017df3efb48ec1f8c8be5c24b8 * f20a88fb866917d7dd489b88c233a5e123ff3271 * a6bf74eac00516fd0767b585c8f304857dddd2aa * 8154e47e2b407a906f2c1270e5fc76fe466cc886 Because of the breaking change in the order of emitting the `close` event in `IncomingMessage` described in: https://github.com/nodejs/node/pull/33035#issuecomment-751476367 PR-URL: https://github.com/nodejs/node/pull/36647 Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina Reviewed-By: Rich Trott --- lib/_http_client.js | 19 +++++++- lib/_http_incoming.js | 46 +++++-------------- lib/_http_server.js | 14 +++++- ...est-http-client-incomingmessage-destroy.js | 25 ---------- ...est-http-server-incomingmessage-destroy.js | 25 ---------- 5 files changed, 43 insertions(+), 86 deletions(-) delete mode 100644 test/parallel/test-http-client-incomingmessage-destroy.js delete mode 100644 test/parallel/test-http-server-incomingmessage-destroy.js diff --git a/lib/_http_client.js b/lib/_http_client.js index 782b8e9714fe81..6fb5dd65cb368c 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -430,13 +430,25 @@ function socketCloseListener() { req.destroyed = true; if (res) { // Socket closed before we emitted 'end' below. + // TOOD(ronag): res.destroy(err) if (!res.complete) { - res.destroy(connResetException('aborted')); + res.aborted = true; + res.emit('aborted'); + if (res.listenerCount('error') > 0) { + res.emit('error', connResetException('aborted')); + } } req._closed = true; req.emit('close'); if (!res.aborted && res.readable) { + res.on('end', function() { + this.destroyed = true; + this.emit('close'); + }); res.push(null); + } else { + res.destroyed = true; + res.emit('close'); } } else { if (!req.socket._hadError) { @@ -685,6 +697,7 @@ function responseKeepAlive(req) { req.destroyed = true; if (req.res) { + req.res.destroyed = true; // Detach socket from IncomingMessage to avoid destroying the freed // socket in IncomingMessage.destroy(). req.res.socket = null; @@ -739,6 +752,10 @@ function requestOnPrefinish() { function emitFreeNT(req) { req._closed = true; req.emit('close'); + if (req.res) { + req.res.emit('close'); + } + if (req.socket) { req.socket.emit('free'); } diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 22ab591b7ad78c..7943c69f54d911 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -27,7 +27,7 @@ const { Symbol } = primordials; -const { Readable, finished } = require('stream'); +const Stream = require('stream'); const kHeaders = Symbol('kHeaders'); const kHeadersCount = Symbol('kHeadersCount'); @@ -54,7 +54,7 @@ function IncomingMessage(socket) { }; } - Readable.call(this, streamOptions); + Stream.Readable.call(this, { autoDestroy: false, ...streamOptions }); this._readableState.readingMore = true; @@ -89,8 +89,8 @@ function IncomingMessage(socket) { // read by the user, so there's no point continuing to handle it. this._dumped = false; } -ObjectSetPrototypeOf(IncomingMessage.prototype, Readable.prototype); -ObjectSetPrototypeOf(IncomingMessage, Readable); +ObjectSetPrototypeOf(IncomingMessage.prototype, Stream.Readable.prototype); +ObjectSetPrototypeOf(IncomingMessage, Stream.Readable); ObjectDefineProperty(IncomingMessage.prototype, 'connection', { get: function() { @@ -160,31 +160,19 @@ IncomingMessage.prototype._read = function _read(n) { readStart(this.socket); }; + // It's possible that the socket will be destroyed, and removed from // any messages, before ever calling this. In that case, just skip // it, since something else is destroying this connection anyway. -IncomingMessage.prototype._destroy = function _destroy(err, cb) { - if (!this.readableEnded || !this.complete) { - this.aborted = true; - this.emit('aborted'); - } - - // If aborted and the underlying socket is not already destroyed, - // destroy it. - // We have to check if the socket is already destroyed because finished - // does not call the callback when this methdod is invoked from `_http_client` - // in `test/parallel/test-http-client-spurious-aborted.js` - if (this.socket && !this.socket.destroyed && this.aborted) { - this.socket.destroy(err); - const cleanup = finished(this.socket, (e) => { - cleanup(); - onError(this, e || err, cb); - }); - } else { - onError(this, err, cb); - } +IncomingMessage.prototype.destroy = function destroy(error) { + // TODO(ronag): Implement in terms of _destroy + this.destroyed = true; + if (this.socket) + this.socket.destroy(error); + return this; }; + IncomingMessage.prototype._addHeaderLines = _addHeaderLines; function _addHeaderLines(headers, n) { if (headers && headers.length) { @@ -361,16 +349,6 @@ IncomingMessage.prototype._dump = function _dump() { } }; -function onError(self, error, cb) { - // This is to keep backward compatible behavior. - // An error is emitted only if there are listeners attached to the event. - if (self.listenerCount('error') === 0) { - cb(); - } else { - cb(error); - } -} - module.exports = { IncomingMessage, readStart, diff --git a/lib/_http_server.js b/lib/_http_server.js index 8cd10bb3a00194..419b08a7a0986d 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -575,7 +575,14 @@ function socketOnClose(socket, state) { function abortIncoming(incoming) { while (incoming.length) { const req = incoming.shift(); - req.destroy(connResetException('aborted')); + // TODO(ronag): req.destroy(err) + req.aborted = true; + req.destroyed = true; + req.emit('aborted'); + if (req.listenerCount('error') > 0) { + req.emit('error', connResetException('aborted')); + } + req.emit('close'); } // Abort socket._httpMessage ? } @@ -734,9 +741,14 @@ function clearIncoming(req) { if (parser && parser.incoming === req) { if (req.readableEnded) { parser.incoming = null; + req.destroyed = true; + req.emit('close'); } else { req.on('end', clearIncoming); } + } else { + req.destroyed = true; + req.emit('close'); } } diff --git a/test/parallel/test-http-client-incomingmessage-destroy.js b/test/parallel/test-http-client-incomingmessage-destroy.js deleted file mode 100644 index a0823d37786365..00000000000000 --- a/test/parallel/test-http-client-incomingmessage-destroy.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const common = require('../common'); -const { createServer, get } = require('http'); -const assert = require('assert'); - -const server = createServer(common.mustCall((req, res) => { - res.writeHead(200); - res.write('Part of res.'); -})); - -function onUncaught(error) { - assert.strictEqual(error.message, 'Destroy test'); - server.close(); -} - -process.on('uncaughtException', common.mustCall(onUncaught)); - -server.listen(0, () => { - get({ - port: server.address().port - }, common.mustCall((res) => { - res.destroy(new Error('Destroy test')); - })); -}); diff --git a/test/parallel/test-http-server-incomingmessage-destroy.js b/test/parallel/test-http-server-incomingmessage-destroy.js deleted file mode 100644 index cfe7e4feecba45..00000000000000 --- a/test/parallel/test-http-server-incomingmessage-destroy.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const common = require('../common'); -const { createServer, get } = require('http'); -const assert = require('assert'); - -const server = createServer(common.mustCall((req, res) => { - req.destroy(new Error('Destroy test')); -})); - -function onUncaught(error) {} - -process.on('uncaughtException', common.mustNotCall(onUncaught)); - -server.listen(0, common.mustCall(() => { - get({ - port: server.address().port - }, (res) => { - res.resume(); - }).on('error', (error) => { - assert.strictEqual(error.message, 'socket hang up'); - assert.strictEqual(error.code, 'ECONNRESET'); - server.close(); - }); -})); From 5e499c490ec75a072523f6368dd2033ca6b2fddf Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 17 Nov 2020 12:54:37 +0100 Subject: [PATCH 002/161] http: refactor to use more primordials PR-URL: https://github.com/nodejs/node/pull/36194 Backport-PR-URL: https://github.com/nodejs/node/pull/36803 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- lib/_http_agent.js | 45 +++++++++++++++---------- lib/_http_client.js | 28 ++++++++++------ lib/_http_common.js | 11 +++--- lib/_http_incoming.js | 16 ++++++--- lib/_http_outgoing.js | 48 +++++++++++++++----------- lib/_http_server.js | 78 +++++++++++++++++++++++++++---------------- lib/http.js | 4 ++- lib/internal/http.js | 9 +++-- 8 files changed, 150 insertions(+), 89 deletions(-) diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 686d561b283d89..fb97b6e6534362 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -22,10 +22,21 @@ 'use strict'; const { + ArrayPrototypeIncludes, + ArrayPrototypeIndexOf, + ArrayPrototypePop, + ArrayPrototypePush, + ArrayPrototypeShift, + ArrayPrototypeSplice, + FunctionPrototypeCall, NumberIsNaN, ObjectKeys, ObjectSetPrototypeOf, ObjectValues, + StringPrototypeIndexOf, + StringPrototypeSplit, + StringPrototypeStartsWith, + StringPrototypeSubstr, Symbol, } = primordials; @@ -78,7 +89,7 @@ function Agent(options) { if (!(this instanceof Agent)) return new Agent(options); - EventEmitter.call(this); + FunctionPrototypeCall(EventEmitter, this); this.defaultPort = 80; this.protocol = 'http:'; @@ -125,7 +136,7 @@ function Agent(options) { const requests = this.requests[name]; if (requests && requests.length) { - const req = requests.shift(); + const req = ArrayPrototypeShift(requests); const reqAsyncRes = req[kRequestAsyncResource]; if (reqAsyncRes) { // Run request within the original async context. @@ -171,7 +182,7 @@ function Agent(options) { this.removeSocket(socket, options); socket.once('error', freeSocketErrorListener); - freeSockets.push(socket); + ArrayPrototypePush(freeSockets, socket); }); // Don't emit keylog events unless there is a listener for them. @@ -249,11 +260,11 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, let socket; if (freeSockets) { while (freeSockets.length && freeSockets[0].destroyed) { - freeSockets.shift(); + ArrayPrototypeShift(freeSockets); } socket = this.scheduling === 'fifo' ? - freeSockets.shift() : - freeSockets.pop(); + ArrayPrototypeShift(freeSockets) : + ArrayPrototypePop(freeSockets); if (!freeSockets.length) delete this.freeSockets[name]; } @@ -265,7 +276,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, asyncResetHandle(socket); this.reuseSocket(socket, req); setRequestSocket(this, req, socket); - this.sockets[name].push(socket); + ArrayPrototypePush(this.sockets[name], socket); this.totalSocketCount++; } else if (sockLen < this.maxSockets && this.totalSocketCount < this.maxTotalSockets) { @@ -289,7 +300,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, // Used to capture the original async context. req[kRequestAsyncResource] = new AsyncResource('QueuedRequest'); - this.requests[name].push(req); + ArrayPrototypePush(this.requests[name], req); } }; @@ -313,7 +324,7 @@ Agent.prototype.createSocket = function createSocket(req, options, cb) { if (!this.sockets[name]) { this.sockets[name] = []; } - this.sockets[name].push(s); + ArrayPrototypePush(this.sockets[name], s); this.totalSocketCount++; debug('sockets', name, this.sockets[name].length, this.totalSocketCount); installListeners(this, s, options); @@ -338,16 +349,16 @@ function calculateServerName(options, req) { // abc:123 => abc // [::1] => ::1 // [::1]:123 => ::1 - if (hostHeader.startsWith('[')) { - const index = hostHeader.indexOf(']'); + if (StringPrototypeStartsWith(hostHeader, '[')) { + const index = StringPrototypeIndexOf(hostHeader, ']'); if (index === -1) { // Leading '[', but no ']'. Need to do something... servername = hostHeader; } else { - servername = hostHeader.substr(1, index - 1); + servername = StringPrototypeSubstr(hostHeader, 1, index - 1); } } else { - servername = hostHeader.split(':', 1)[0]; + servername = StringPrototypeSplit(hostHeader, ':', 1)[0]; } } // Don't implicitly set invalid (IP) servernames. @@ -379,7 +390,7 @@ function installListeners(agent, s, options) { // TODO(ronag): Always destroy, even if not in free list. const sockets = agent.freeSockets; for (const name of ObjectKeys(sockets)) { - if (sockets[name].includes(s)) { + if (ArrayPrototypeIncludes(sockets[name], s)) { return s.destroy(); } } @@ -411,13 +422,13 @@ Agent.prototype.removeSocket = function removeSocket(s, options) { // If the socket was destroyed, remove it from the free buffers too. if (!s.writable) - sets.push(this.freeSockets); + ArrayPrototypePush(sets, this.freeSockets); for (const sockets of sets) { if (sockets[name]) { - const index = sockets[name].indexOf(s); + const index = ArrayPrototypeIndexOf(sockets[name], s); if (index !== -1) { - sockets[name].splice(index, 1); + ArrayPrototypeSplice(sockets[name], index, 1); // Don't leak if (sockets[name].length === 0) delete sockets[name]; diff --git a/lib/_http_client.js b/lib/_http_client.js index 6fb5dd65cb368c..6bae982eb1c97b 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -25,12 +25,20 @@ const { ArrayIsArray, Boolean, Error, + FunctionPrototypeCall, NumberIsFinite, ObjectAssign, ObjectKeys, ObjectSetPrototypeOf, + ReflectApply, + RegExpPrototypeTest, String, - Symbol + StringPrototypeCharCodeAt, + StringPrototypeIncludes, + StringPrototypeIndexOf, + StringPrototypeToUpperCase, + Symbol, + TypedArrayPrototypeSlice, } = primordials; const net = require('net'); @@ -91,7 +99,7 @@ class HTTPClientAsyncResource { let urlWarningEmitted = false; function ClientRequest(input, options, cb) { - OutgoingMessage.call(this); + FunctionPrototypeCall(OutgoingMessage, this); if (typeof input === 'string') { const urlStr = input; @@ -151,7 +159,7 @@ function ClientRequest(input, options, cb) { if (options.path) { const path = String(options.path); - if (INVALID_PATH_REGEX.test(path)) + if (RegExpPrototypeTest(INVALID_PATH_REGEX, path)) throw new ERR_UNESCAPED_CHARACTERS('Request path'); } @@ -187,7 +195,7 @@ function ClientRequest(input, options, cb) { if (!checkIsHttpToken(method)) { throw new ERR_INVALID_HTTP_TOKEN('Method', method); } - method = this.method = method.toUpperCase(); + method = this.method = StringPrototypeToUpperCase(method); } else { method = this.method = 'GET'; } @@ -266,10 +274,10 @@ function ClientRequest(input, options, cb) { // For the Host header, ensure that IPv6 addresses are enclosed // in square brackets, as defined by URI formatting // https://tools.ietf.org/html/rfc3986#section-3.2.2 - const posColon = hostHeader.indexOf(':'); + const posColon = StringPrototypeIndexOf(hostHeader, ':'); if (posColon !== -1 && - hostHeader.includes(':', posColon + 1) && - hostHeader.charCodeAt(0) !== 91/* '[' */) { + StringPrototypeIncludes(hostHeader, ':', posColon + 1) && + StringPrototypeCharCodeAt(hostHeader, 0) !== 91/* '[' */) { hostHeader = `[${hostHeader}]`; } @@ -337,7 +345,7 @@ ObjectSetPrototypeOf(ClientRequest, OutgoingMessage); ClientRequest.prototype._finish = function _finish() { DTRACE_HTTP_CLIENT_REQUEST(this, this.socket); - OutgoingMessage.prototype._finish.call(this); + FunctionPrototypeCall(OutgoingMessage.prototype._finish, this); }; ClientRequest.prototype._implicitHeader = function _implicitHeader() { @@ -547,7 +555,7 @@ function socketOnData(d) { parser.finish(); freeParser(parser, req, socket); - const bodyHead = d.slice(bytesParsed, d.length); + const bodyHead = TypedArrayPrototypeSlice(d, bytesParsed, d.length); const eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade'; if (req.listenerCount(eventName) > 0) { @@ -848,7 +856,7 @@ function _deferToConnect(method, arguments_, cb) { const callSocketMethod = () => { if (method) - this.socket[method].apply(this.socket, arguments_); + ReflectApply(this.socket[method], this.socket, arguments_); if (typeof cb === 'function') cb(); diff --git a/lib/_http_common.js b/lib/_http_common.js index e97670f0acaf11..f249a86776b580 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -22,8 +22,11 @@ 'use strict'; const { + ArrayPrototypeConcat, MathMin, Symbol, + RegExpPrototypeTest, + TypedArrayPrototypeSlice, } = primordials; const { setImmediate } = require('timers'); @@ -63,7 +66,7 @@ function parserOnHeaders(headers, url) { // Once we exceeded headers limit - stop collecting them if (this.maxHeaderPairs <= 0 || this._headers.length < this.maxHeaderPairs) { - this._headers = this._headers.concat(headers); + this._headers = ArrayPrototypeConcat(this._headers, headers); } this._url += url; } @@ -135,7 +138,7 @@ function parserOnBody(b, start, len) { // Pretend this was the result of a stream._read call. if (len > 0 && !stream._dumped) { - const slice = b.slice(start, start + len); + const slice = TypedArrayPrototypeSlice(b, start, start + len); const ret = stream.push(slice); if (!ret) readStop(this.socket); @@ -217,7 +220,7 @@ const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; * See https://tools.ietf.org/html/rfc7230#section-3.2.6 */ function checkIsHttpToken(val) { - return tokenRegExp.test(val); + return RegExpPrototypeTest(tokenRegExp, val); } const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; @@ -228,7 +231,7 @@ const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; * field-vchar = VCHAR / obs-text */ function checkInvalidHeaderChar(val) { - return headerCharRegex.test(val); + return RegExpPrototypeTest(headerCharRegex, val); } function cleanParser(parser) { diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 7943c69f54d911..e166177e0d4947 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -22,8 +22,13 @@ 'use strict'; const { + ArrayPrototypePush, + FunctionPrototypeCall, ObjectDefineProperty, ObjectSetPrototypeOf, + StringPrototypeCharCodeAt, + StringPrototypeSlice, + StringPrototypeToLowerCase, Symbol } = primordials; @@ -54,7 +59,8 @@ function IncomingMessage(socket) { }; } - Stream.Readable.call(this, { autoDestroy: false, ...streamOptions }); + FunctionPrototypeCall(Stream.Readable, this, + { autoDestroy: false, ...streamOptions }); this._readableState.readingMore = true; @@ -300,7 +306,7 @@ function matchKnownFields(field, lowercased) { if (lowercased) { return '\u0000' + field; } - return matchKnownFields(field.toLowerCase(), true); + return matchKnownFields(StringPrototypeToLowerCase(field), true); } // Add the given (field, value) pair to the message // @@ -314,9 +320,9 @@ function matchKnownFields(field, lowercased) { IncomingMessage.prototype._addHeaderLine = _addHeaderLine; function _addHeaderLine(field, value, dest) { field = matchKnownFields(field); - const flag = field.charCodeAt(0); + const flag = StringPrototypeCharCodeAt(field, 0); if (flag === 0 || flag === 2) { - field = field.slice(1); + field = StringPrototypeSlice(field, 1); // Make a delimited list if (typeof dest[field] === 'string') { dest[field] += (flag === 0 ? ', ' : '; ') + value; @@ -326,7 +332,7 @@ function _addHeaderLine(field, value, dest) { } else if (flag === 1) { // Array header -- only Set-Cookie at the moment if (dest['set-cookie'] !== undefined) { - dest['set-cookie'].push(value); + ArrayPrototypePush(dest['set-cookie'], value); } else { dest['set-cookie'] = [value]; } diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 8fb64ab82efceb..8b2959986af8e0 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -23,12 +23,21 @@ const { ArrayIsArray, + ArrayPrototypeJoin, + ArrayPrototypePush, + ArrayPrototypeUnshift, + FunctionPrototype, + FunctionPrototypeBind, + FunctionPrototypeCall, + MathFloor, + NumberPrototypeToString, ObjectCreate, ObjectDefineProperty, ObjectKeys, ObjectPrototypeHasOwnProperty, ObjectSetPrototypeOf, - MathFloor, + RegExpPrototypeTest, + StringPrototypeToLowerCase, Symbol, } = primordials; @@ -72,7 +81,7 @@ const { CRLF, debug } = common; const kCorked = Symbol('corked'); -function nop() {} +const nop = FunctionPrototype; const RE_CONN_CLOSE = /(?:^|\W)close(?:$|\W)/i; const RE_TE_CHUNKED = common.chunkExpression; @@ -81,13 +90,11 @@ const RE_TE_CHUNKED = common.chunkExpression; // against the word "cookie." As of V8 6.6 this is faster than handrolling or // using a case-insensitive RegExp. function isCookieField(s) { - return s.length === 6 && s.toLowerCase() === 'cookie'; + return s.length === 6 && StringPrototypeToLowerCase(s) === 'cookie'; } -function noopPendingOutput(amount) {} - function OutgoingMessage() { - Stream.call(this); + FunctionPrototypeCall(Stream, this); // Queue that holds all currently pending data, until the response will be // assigned to the socket (until it will its turn in the HTTP pipeline). @@ -128,7 +135,7 @@ function OutgoingMessage() { this._keepAliveTimeout = 0; - this._onPendingData = noopPendingOutput; + this._onPendingData = nop; } ObjectSetPrototypeOf(OutgoingMessage.prototype, Stream.prototype); ObjectSetPrototypeOf(OutgoingMessage, Stream); @@ -182,7 +189,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', { // Refs: https://github.com/nodejs/node/pull/30958 for (let i = 0; i < keys.length; ++i) { const name = keys[i]; - headers[name.toLowerCase()] = [name, val[name]]; + headers[StringPrototypeToLowerCase(name)] = [name, val[name]]; } } }, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066') @@ -317,7 +324,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback) { data = this._header + data; } else { const header = this._header; - this.outputData.unshift({ + ArrayPrototypeUnshift(this.outputData, { data: header, encoding: 'latin1', callback: null @@ -354,7 +361,7 @@ function _writeRaw(data, encoding, callback) { return conn.write(data, encoding, callback); } // Buffer, as long as we're not destroyed. - this.outputData.push({ data, encoding, callback }); + ArrayPrototypePush(this.outputData, { data, encoding, callback }); this.outputSize += data.length; this._onPendingData(data.length); return this.outputSize < HIGH_WATER_MARK; @@ -497,7 +504,7 @@ function processHeader(self, state, key, value, validate) { storeHeader(self, state, key, value[i], validate); return; } - value = value.join('; '); + value = ArrayPrototypeJoin(value, '; '); } storeHeader(self, state, key, value, validate); } @@ -512,12 +519,12 @@ function storeHeader(self, state, key, value, validate) { function matchHeader(self, state, field, value) { if (field.length < 4 || field.length > 17) return; - field = field.toLowerCase(); + field = StringPrototypeToLowerCase(field); switch (field) { case 'connection': state.connection = true; self._removedConnection = false; - if (RE_CONN_CLOSE.test(value)) + if (RegExpPrototypeTest(RE_CONN_CLOSE, value)) self._last = true; else self.shouldKeepAlive = true; @@ -525,7 +532,8 @@ function matchHeader(self, state, field, value) { case 'transfer-encoding': state.te = true; self._removedTE = false; - if (RE_TE_CHUNKED.test(value)) self.chunkedEncoding = true; + if (RegExpPrototypeTest(RE_TE_CHUNKED, value)) + self.chunkedEncoding = true; break; case 'content-length': state.contLen = true; @@ -569,7 +577,7 @@ OutgoingMessage.prototype.setHeader = function setHeader(name, value) { if (headers === null) this[kOutHeaders] = headers = ObjectCreate(null); - headers[name.toLowerCase()] = [name, value]; + headers[StringPrototypeToLowerCase(name)] = [name, value]; return this; }; @@ -581,7 +589,7 @@ OutgoingMessage.prototype.getHeader = function getHeader(name) { if (headers === null) return; - const entry = headers[name.toLowerCase()]; + const entry = headers[StringPrototypeToLowerCase(name)]; return entry && entry[1]; }; @@ -613,7 +621,7 @@ OutgoingMessage.prototype.getHeaders = function getHeaders() { OutgoingMessage.prototype.hasHeader = function hasHeader(name) { validateString(name, 'name'); return this[kOutHeaders] !== null && - !!this[kOutHeaders][name.toLowerCase()]; + !!this[kOutHeaders][StringPrototypeToLowerCase(name)]; }; @@ -624,7 +632,7 @@ OutgoingMessage.prototype.removeHeader = function removeHeader(name) { throw new ERR_HTTP_HEADERS_SENT('remove'); } - const key = name.toLowerCase(); + const key = StringPrototypeToLowerCase(name); switch (key) { case 'connection': @@ -750,7 +758,7 @@ function write_(msg, chunk, encoding, callback, fromEnd) { let ret; if (msg.chunkedEncoding && chunk.length !== 0) { - msg._send(len.toString(16), 'latin1', null); + msg._send(NumberPrototypeToString(len, 16), 'latin1', null); msg._send(crlf_buf, null, null); msg._send(chunk, encoding, null); ret = msg._send(crlf_buf, null, callback); @@ -839,7 +847,7 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) { if (typeof callback === 'function') this.once('finish', callback); - const finish = onFinish.bind(undefined, this); + const finish = FunctionPrototypeBind(onFinish, undefined, this); if (this._hasBody && this.chunkedEncoding) { this._send('0\r\n' + this._trailer + '\r\n', 'latin1', finish); diff --git a/lib/_http_server.js b/lib/_http_server.js index 419b08a7a0986d..f1372b56dc6c1b 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -23,11 +23,19 @@ const { ArrayIsArray, + ArrayPrototypePush, + ArrayPrototypeShift, Error, + FunctionPrototype, + FunctionPrototypeBind, + FunctionPrototypeCall, ObjectKeys, ObjectSetPrototypeOf, + ReflectApply, + RegExpPrototypeTest, Symbol, SymbolFor, + TypedArrayPrototypeSlice, } = primordials; const net = require('net'); @@ -169,7 +177,7 @@ class HTTPServerAsyncResource { } function ServerResponse(req) { - OutgoingMessage.call(this); + FunctionPrototypeCall(OutgoingMessage, this); if (req.method === 'HEAD') this._hasBody = false; @@ -178,7 +186,8 @@ function ServerResponse(req) { this._expect_continue = false; if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) { - this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te); + this.useChunkedEncodingByDefault = RegExpPrototypeTest(chunkExpression, + req.headers.te); this.shouldKeepAlive = false; } @@ -197,7 +206,7 @@ ServerResponse.prototype._finish = function _finish() { if (this[kServerResponseStatistics] !== undefined) { emitStatistics(this[kServerResponseStatistics]); } - OutgoingMessage.prototype._finish.call(this); + FunctionPrototypeCall(OutgoingMessage.prototype._finish, this); }; @@ -371,7 +380,7 @@ function Server(options, requestListener) { validateBoolean(insecureHTTPParser, 'options.insecureHTTPParser'); this.insecureHTTPParser = insecureHTTPParser; - net.Server.call(this, { allowHalfOpen: true }); + FunctionPrototypeCall(net.Server, this, { allowHalfOpen: true }); if (requestListener) { this.on('request', requestListener); @@ -417,8 +426,8 @@ Server.prototype[EE.captureRejectionSymbol] = function(err, event, ...args) { } break; default: - net.Server.prototype[SymbolFor('nodejs.rejection')] - .call(this, err, event, ...args); + ReflectApply(net.Server.prototype[SymbolFor('nodejs.rejection')], + this, arguments); } }; @@ -477,16 +486,21 @@ function connectionListenerInternal(server, socket) { outgoingData: 0, keepAliveTimeoutSet: false }; - state.onData = socketOnData.bind(undefined, server, socket, parser, state); - state.onEnd = socketOnEnd.bind(undefined, server, socket, parser, state); - state.onClose = socketOnClose.bind(undefined, socket, state); - state.onDrain = socketOnDrain.bind(undefined, socket, state); + state.onData = FunctionPrototypeBind(socketOnData, undefined, + server, socket, parser, state); + state.onEnd = FunctionPrototypeBind(socketOnEnd, undefined, + server, socket, parser, state); + state.onClose = FunctionPrototypeBind(socketOnClose, undefined, + socket, state); + state.onDrain = FunctionPrototypeBind(socketOnDrain, undefined, + socket, state); socket.on('data', state.onData); socket.on('error', socketOnError); socket.on('end', state.onEnd); socket.on('close', state.onClose); socket.on('drain', state.onDrain); - parser.onIncoming = parserOnIncoming.bind(undefined, server, socket, state); + parser.onIncoming = FunctionPrototypeBind(parserOnIncoming, undefined, + server, socket, state); // We are consuming socket, so it won't get any actual data socket.on('resume', onSocketResume); @@ -506,15 +520,18 @@ function connectionListenerInternal(server, socket) { parser.consume(socket._handle); } parser[kOnExecute] = - onParserExecute.bind(undefined, server, socket, parser, state); + FunctionPrototypeBind(onParserExecute, undefined, + server, socket, parser, state); parser[kOnTimeout] = - onParserTimeout.bind(undefined, server, socket); + FunctionPrototypeBind(onParserTimeout, undefined, + server, socket); // When receiving new requests on the same socket (pipelining or keep alive) // make sure the requestTimeout is active. parser[kOnMessageBegin] = - setRequestTimeout.bind(undefined, server, socket); + FunctionPrototypeBind(setRequestTimeout, undefined, + server, socket); // This protects from DOS attack where an attacker establish the connection // without sending any data on applications where server.timeout is left to @@ -574,7 +591,7 @@ function socketOnClose(socket, state) { function abortIncoming(incoming) { while (incoming.length) { - const req = incoming.shift(); + const req = ArrayPrototypeShift(incoming); // TODO(ronag): req.destroy(err) req.aborted = true; req.destroyed = true; @@ -592,7 +609,7 @@ function socketOnEnd(server, socket, parser, state) { if (ret instanceof Error) { debug('parse error'); - socketOnError.call(socket, ret); + FunctionPrototypeCall(socketOnError, socket, ret); return; } @@ -618,7 +635,7 @@ function socketOnData(server, socket, parser, state, d) { function onRequestTimeout(socket) { socket[kRequestTimeout] = undefined; - socketOnError.call(socket, new ERR_HTTP_REQUEST_TIMEOUT()); + ReflectApply(socketOnError, socket, [new ERR_HTTP_REQUEST_TIMEOUT()]); } function onParserExecute(server, socket, parser, state, ret) { @@ -638,7 +655,7 @@ function onParserTimeout(server, socket) { socket.destroy(); } -const noop = () => {}; +const noop = FunctionPrototype; const badRequestResponse = Buffer.from( `HTTP/1.1 400 ${STATUS_CODES[400]}${CRLF}` + `Connection: close${CRLF}${CRLF}`, 'ascii' @@ -685,7 +702,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) { prepareError(ret, parser, d); ret.rawPacket = d || parser.getCurrentBuffer(); debug('parse error', ret); - socketOnError.call(socket, ret); + FunctionPrototypeCall(socketOnError, socket, ret); } else if (parser.incoming && parser.incoming.upgrade) { // Upgrade or CONNECT const req = parser.incoming; @@ -708,7 +725,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) { const eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade'; if (eventName === 'upgrade' || server.listenerCount(eventName) > 0) { debug('SERVER have listener for %s', eventName); - const bodyHead = d.slice(ret, d.length); + const bodyHead = TypedArrayPrototypeSlice(d, ret, d.length); socket.readableFlowing = null; @@ -724,7 +741,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) { // When receiving new requests on the same socket (pipelining or keep alive) // make sure the requestTimeout is active. parser[kOnMessageBegin] = - setRequestTimeout.bind(undefined, server, socket); + FunctionPrototypeBind(setRequestTimeout, undefined, server, socket); } if (socket._paused && socket.parser) { @@ -793,7 +810,7 @@ function resOnFinish(req, res, socket, state, server) { // array will be empty. assert(state.incoming.length === 0 || state.incoming[0] === req); - state.incoming.shift(); + ArrayPrototypeShift(state.incoming); // If the user never called req.read(), and didn't pipe() or // .resume() or .on('data'), then we call req._dump() so that the @@ -826,7 +843,7 @@ function resOnFinish(req, res, socket, state, server) { } } else { // Start sending the next message - const m = state.outgoing.shift(); + const m = ArrayPrototypeShift(state.outgoing); if (m) { m.assignSocket(socket); } @@ -852,7 +869,7 @@ function parserOnIncoming(server, socket, state, req, keepAlive) { return 2; } - state.incoming.push(req); + ArrayPrototypePush(state.incoming, req); // If the writable end isn't consuming, then stop reading // so that we don't become overwhelmed by a flood of @@ -870,7 +887,8 @@ function parserOnIncoming(server, socket, state, req, keepAlive) { const res = new server[kServerResponse](req); res._keepAliveTimeout = server.keepAliveTimeout; - res._onPendingData = updateOutgoingData.bind(undefined, socket, state); + res._onPendingData = FunctionPrototypeBind(updateOutgoingData, undefined, + socket, state); res.shouldKeepAlive = keepAlive; DTRACE_HTTP_SERVER_REQUEST(req, socket); @@ -886,7 +904,7 @@ function parserOnIncoming(server, socket, state, req, keepAlive) { if (socket._httpMessage) { // There are already pending outgoing res, append. - state.outgoing.push(res); + ArrayPrototypePush(state.outgoing, res); } else { res.assignSocket(socket); } @@ -894,11 +912,12 @@ function parserOnIncoming(server, socket, state, req, keepAlive) { // When we're finished writing the response, check if this is the last // response, if so destroy the socket. res.on('finish', - resOnFinish.bind(undefined, req, res, socket, state, server)); + FunctionPrototypeBind(resOnFinish, undefined, + req, res, socket, state, server)); if (req.headers.expect !== undefined && (req.httpVersionMajor === 1 && req.httpVersionMinor === 1)) { - if (continueExpression.test(req.headers.expect)) { + if (RegExpPrototypeTest(continueExpression, req.headers.expect)) { res._expect_continue = true; if (server.listenerCount('checkContinue') > 0) { @@ -966,7 +985,8 @@ function unconsume(parser, socket) { function generateSocketListenerWrapper(originalFnName) { return function socketListenerWrap(ev, fn) { - const res = net.Socket.prototype[originalFnName].call(this, ev, fn); + const res = ReflectApply(net.Socket.prototype[originalFnName], this, + [ev, fn]); if (!this.parser) { this.on = net.Socket.prototype.on; this.addListener = net.Socket.prototype.addListener; diff --git a/lib/http.js b/lib/http.js index 4bbe42e652c24e..491162f9c4a172 100644 --- a/lib/http.js +++ b/lib/http.js @@ -22,6 +22,8 @@ 'use strict'; const { + ArrayPrototypeSlice, + ArrayPrototypeSort, ObjectDefineProperty, } = primordials; @@ -58,7 +60,7 @@ function get(url, options, cb) { module.exports = { _connectionListener, - METHODS: methods.slice().sort(), + METHODS: ArrayPrototypeSort(ArrayPrototypeSlice(methods)), STATUS_CODES, Agent: httpAgent.Agent, ClientRequest, diff --git a/lib/internal/http.js b/lib/internal/http.js index 1d5973593e9ada..0065f93fd896f0 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -3,6 +3,9 @@ const { Symbol, Date, + DatePrototypeGetMilliseconds, + DatePrototypeToUTCString, + DatePrototypeValueOf, } = primordials; const { setUnrefTimeout } = require('internal/timers'); @@ -23,9 +26,9 @@ function utcDate() { function cache() { const d = new Date(); - nowCache = d.valueOf(); - utcCache = d.toUTCString(); - setUnrefTimeout(resetCache, 1000 - d.getMilliseconds()); + nowCache = DatePrototypeValueOf(d); + utcCache = DatePrototypeToUTCString(d); + setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d)); } function resetCache() { From c844d22b7247a81bd1378ff98af83d12037a4308 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Wed, 14 Oct 2020 17:39:21 +0200 Subject: [PATCH 003/161] errors: eliminate all overhead for hidden calls Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: https://github.com/nodejs/node/issues/35386 PR-URL: https://github.com/nodejs/node/pull/35644 Reviewed-By: Matteo Collina Reviewed-By: Rich Trott Reviewed-By: Vladimir de Turckheim Reviewed-By: Antoine du Hamel --- benchmark/misc/hidestackframes.js | 45 +++++ lib/internal/errors.js | 306 +++++++++++++++--------------- lib/internal/fs/promises.js | 4 +- 3 files changed, 205 insertions(+), 150 deletions(-) create mode 100644 benchmark/misc/hidestackframes.js diff --git a/benchmark/misc/hidestackframes.js b/benchmark/misc/hidestackframes.js new file mode 100644 index 00000000000000..5b14f2d95b22e2 --- /dev/null +++ b/benchmark/misc/hidestackframes.js @@ -0,0 +1,45 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + type: ['hide-stackframes-throw', 'direct-call-throw', + 'hide-stackframes-noerr', 'direct-call-noerr'], + n: [10e4] +}, { + flags: ['--expose-internals'] +}); + +function main({ n, type }) { + const { + hideStackFrames, + codes: { + ERR_INVALID_ARG_TYPE, + }, + } = require('internal/errors'); + + const testfn = (value) => { + if (typeof value !== 'number') { + throw new ERR_INVALID_ARG_TYPE('Benchmark', 'number', value); + } + }; + + let fn = testfn; + if (type.startsWith('hide-stackframe')) + fn = hideStackFrames(testfn); + let value = 42; + if (type.endsWith('-throw')) + value = 'err'; + + bench.start(); + + for (let i = 0; i < n; i++) { + try { + fn(value); + } catch { + // No-op + } + } + + bench.end(n); +} diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 8a7e744c5fe667..0b6a95d761ee75 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -75,6 +75,8 @@ const kTypes = [ const MainContextError = Error; const overrideStackTrace = new SafeWeakMap(); const kNoOverride = Symbol('kNoOverride'); +let userStackTraceLimit; +const nodeInternalPrefix = '__node_internal_'; const prepareStackTrace = (globalThis, error, trace) => { // API for node internals to override error stack formatting // without interfering with userland code. @@ -84,6 +86,21 @@ const prepareStackTrace = (globalThis, error, trace) => { return f(error, trace); } + const firstFrame = trace[0]?.getFunctionName(); + if (firstFrame && StringPrototypeStartsWith(firstFrame, nodeInternalPrefix)) { + for (let l = trace.length - 1; l >= 0; l--) { + const fn = trace[l]?.getFunctionName(); + if (fn && StringPrototypeStartsWith(fn, nodeInternalPrefix)) { + ArrayPrototypeSplice(trace, 0, l + 1); + break; + } + } + // `userStackTraceLimit` is the user value for `Error.stackTraceLimit`, + // it is updated at every new exception in `captureLargerStackTrace`. + if (trace.length > userStackTraceLimit) + ArrayPrototypeSplice(trace, userStackTraceLimit); + } + const globalOverride = maybeOverridePrepareStackTrace(globalThis, error, trace); if (globalOverride !== kNoOverride) return globalOverride; @@ -118,8 +135,6 @@ const maybeOverridePrepareStackTrace = (globalThis, error, trace) => { return kNoOverride; }; -let excludedStackFn; - // Lazily loaded let util; let assert; @@ -147,6 +162,27 @@ function lazyBuffer() { return buffer; } +const addCodeToName = hideStackFrames(function addCodeToName(err, name, code) { + // Set the stack + err = captureLargerStackTrace(err); + // Add the error code to the name to include it in the stack trace. + err.name = `${name} [${code}]`; + // Access the stack to generate the error message including the error code + // from the name. + err.stack; // eslint-disable-line no-unused-expressions + // Reset the name to the actual name. + if (name === 'SystemError') { + ObjectDefineProperty(err, 'name', { + value: name, + enumerable: false, + writable: true, + configurable: true + }); + } else { + delete err.name; + } +}); + // A specialized Error that includes an additional info property with // additional information about the error condition. // It has the properties present in a UVException but with a custom error @@ -157,15 +193,11 @@ function lazyBuffer() { // and may have .path and .dest. class SystemError extends Error { constructor(key, context) { - if (excludedStackFn === undefined) { - super(); - } else { - const limit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - super(); - // Reset the limit and setting the name property. - Error.stackTraceLimit = limit; - } + const limit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + super(); + // Reset the limit and setting the name property. + Error.stackTraceLimit = limit; const prefix = getMessage(key, [], this); let message = `${prefix}: ${context.syscall} returned ` + `${context.code} (${context.message})`; @@ -273,16 +305,11 @@ function makeSystemErrorWithCode(key) { function makeNodeErrorWithCode(Base, key) { return function NodeError(...args) { - let error; - if (excludedStackFn === undefined) { - error = new Base(); - } else { - const limit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - error = new Base(); - // Reset the limit and setting the name property. - Error.stackTraceLimit = limit; - } + const limit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + const error = new Base(); + // Reset the limit and setting the name property. + Error.stackTraceLimit = limit; const message = getMessage(key, args, error); ObjectDefineProperty(error, 'message', { value: message, @@ -306,44 +333,11 @@ function makeNodeErrorWithCode(Base, key) { // This function removes unnecessary frames from Node.js core errors. function hideStackFrames(fn) { - return function hidden(...args) { - // Make sure the most outer `hideStackFrames()` function is used. - let setStackFn = false; - if (excludedStackFn === undefined) { - excludedStackFn = hidden; - setStackFn = true; - } - try { - return fn(...args); - } finally { - if (setStackFn === true) { - excludedStackFn = undefined; - } - } - }; -} - -function addCodeToName(err, name, code) { - // Set the stack - if (excludedStackFn !== undefined) { - ErrorCaptureStackTrace(err, excludedStackFn); - } - // Add the error code to the name to include it in the stack trace. - err.name = `${name} [${code}]`; - // Access the stack to generate the error message including the error code - // from the name. - err.stack; // eslint-disable-line no-unused-expressions - // Reset the name to the actual name. - if (name === 'SystemError') { - ObjectDefineProperty(err, 'name', { - value: name, - enumerable: false, - writable: true, - configurable: true - }); - } else { - delete err.name; - } + // We rename the functions that will be hidden to cut off the stacktrace + // at the outermost one + const hidden = nodeInternalPrefix + fn.name; + ObjectDefineProperty(fn, 'name', { value: hidden }); + return fn; } // Utility function for registering the error codes. Only used here. Exported @@ -413,6 +407,16 @@ function uvErrmapGet(name) { return uvBinding.errmap.get(name); } +const captureLargerStackTrace = hideStackFrames( + function captureLargerStackTrace(err) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Infinity; + ErrorCaptureStackTrace(err); + // Reset the limit + Error.stackTraceLimit = userStackTraceLimit; + + return err; + }); /** * This creates an error compatible with errors produced in the C++ @@ -423,8 +427,8 @@ function uvErrmapGet(name) { * @param {Object} ctx * @returns {Error} */ -function uvException(ctx) { - const [ code, uvmsg ] = uvErrmapGet(ctx.errno) || uvUnmappedError; +const uvException = hideStackFrames(function uvException(ctx) { + const [code, uvmsg] = uvErrmapGet(ctx.errno) || uvUnmappedError; let message = `${code}: ${ctx.message || uvmsg}, ${ctx.syscall}`; let path; @@ -463,9 +467,9 @@ function uvException(ctx) { if (dest) { err.dest = dest; } - ErrorCaptureStackTrace(err, excludedStackFn || uvException); - return err; -} + + return captureLargerStackTrace(err); +}); /** * This creates an error compatible with errors produced in the C++ @@ -478,35 +482,36 @@ function uvException(ctx) { * @param {number} [port] * @returns {Error} */ -function uvExceptionWithHostPort(err, syscall, address, port) { - const [ code, uvmsg ] = uvErrmapGet(err) || uvUnmappedError; - const message = `${syscall} ${code}: ${uvmsg}`; - let details = ''; - - if (port && port > 0) { - details = ` ${address}:${port}`; - } else if (address) { - details = ` ${address}`; - } +const uvExceptionWithHostPort = hideStackFrames( + function uvExceptionWithHostPort(err, syscall, address, port) { + const [code, uvmsg] = uvErrmapGet(err) || uvUnmappedError; + const message = `${syscall} ${code}: ${uvmsg}`; + let details = ''; + + if (port && port > 0) { + details = ` ${address}:${port}`; + } else if (address) { + details = ` ${address}`; + } - // Reducing the limit improves the performance significantly. We do not lose - // the stack frames due to the `captureStackTrace()` function that is called - // later. - const tmpLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - // eslint-disable-next-line no-restricted-syntax - const ex = new Error(`${message}${details}`); - Error.stackTraceLimit = tmpLimit; - ex.code = code; - ex.errno = err; - ex.syscall = syscall; - ex.address = address; - if (port) { - ex.port = port; - } - ErrorCaptureStackTrace(ex, excludedStackFn || uvExceptionWithHostPort); - return ex; -} + // Reducing the limit improves the performance significantly. We do not + // lose the stack frames due to the `captureStackTrace()` function that + // is called later. + const tmpLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + // eslint-disable-next-line no-restricted-syntax + const ex = new Error(`${message}${details}`); + Error.stackTraceLimit = tmpLimit; + ex.code = code; + ex.errno = err; + ex.syscall = syscall; + ex.address = address; + if (port) { + ex.port = port; + } + + return captureLargerStackTrace(ex); + }); /** * This used to be util._errnoException(). @@ -516,24 +521,28 @@ function uvExceptionWithHostPort(err, syscall, address, port) { * @param {string} [original] * @returns {Error} */ -function errnoException(err, syscall, original) { - // TODO(joyeecheung): We have to use the type-checked - // getSystemErrorName(err) to guard against invalid arguments from users. - // This can be replaced with [ code ] = errmap.get(err) when this method - // is no longer exposed to user land. - if (util === undefined) util = require('util'); - const code = util.getSystemErrorName(err); - const message = original ? - `${syscall} ${code} ${original}` : `${syscall} ${code}`; - - // eslint-disable-next-line no-restricted-syntax - const ex = new Error(message); - ex.errno = err; - ex.code = code; - ex.syscall = syscall; - ErrorCaptureStackTrace(ex, excludedStackFn || errnoException); - return ex; -} +const errnoException = hideStackFrames( + function errnoException(err, syscall, original) { + // TODO(joyeecheung): We have to use the type-checked + // getSystemErrorName(err) to guard against invalid arguments from users. + // This can be replaced with [ code ] = errmap.get(err) when this method + // is no longer exposed to user land. + if (util === undefined) util = require('util'); + const code = util.getSystemErrorName(err); + const message = original ? + `${syscall} ${code} ${original}` : `${syscall} ${code}`; + + const tmpLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + // eslint-disable-next-line no-restricted-syntax + const ex = new Error(message); + Error.stackTraceLimit = tmpLimit; + ex.errno = err; + ex.code = code; + ex.syscall = syscall; + + return captureLargerStackTrace(ex); + }); /** * Deprecated, new function is `uvExceptionWithHostPort()` @@ -546,41 +555,42 @@ function errnoException(err, syscall, original) { * @param {string} [additional] * @returns {Error} */ -function exceptionWithHostPort(err, syscall, address, port, additional) { - // TODO(joyeecheung): We have to use the type-checked - // getSystemErrorName(err) to guard against invalid arguments from users. - // This can be replaced with [ code ] = errmap.get(err) when this method - // is no longer exposed to user land. - if (util === undefined) util = require('util'); - const code = util.getSystemErrorName(err); - let details = ''; - if (port && port > 0) { - details = ` ${address}:${port}`; - } else if (address) { - details = ` ${address}`; - } - if (additional) { - details += ` - Local (${additional})`; - } +const exceptionWithHostPort = hideStackFrames( + function exceptionWithHostPort(err, syscall, address, port, additional) { + // TODO(joyeecheung): We have to use the type-checked + // getSystemErrorName(err) to guard against invalid arguments from users. + // This can be replaced with [ code ] = errmap.get(err) when this method + // is no longer exposed to user land. + if (util === undefined) util = require('util'); + const code = util.getSystemErrorName(err); + let details = ''; + if (port && port > 0) { + details = ` ${address}:${port}`; + } else if (address) { + details = ` ${address}`; + } + if (additional) { + details += ` - Local (${additional})`; + } - // Reducing the limit improves the performance significantly. We do not lose - // the stack frames due to the `captureStackTrace()` function that is called - // later. - const tmpLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - // eslint-disable-next-line no-restricted-syntax - const ex = new Error(`${syscall} ${code}${details}`); - Error.stackTraceLimit = tmpLimit; - ex.errno = err; - ex.code = code; - ex.syscall = syscall; - ex.address = address; - if (port) { - ex.port = port; - } - ErrorCaptureStackTrace(ex, excludedStackFn || exceptionWithHostPort); - return ex; -} + // Reducing the limit improves the performance significantly. We do not + // lose the stack frames due to the `captureStackTrace()` function that + // is called later. + const tmpLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + // eslint-disable-next-line no-restricted-syntax + const ex = new Error(`${syscall} ${code}${details}`); + Error.stackTraceLimit = tmpLimit; + ex.errno = err; + ex.code = code; + ex.syscall = syscall; + ex.address = address; + if (port) { + ex.port = port; + } + + return captureLargerStackTrace(ex); + }); /** * @param {number|string} code - A libuv error number or a c-ares error code @@ -588,7 +598,7 @@ function exceptionWithHostPort(err, syscall, address, port, additional) { * @param {string} [hostname] * @returns {Error} */ -function dnsException(code, syscall, hostname) { +const dnsException = hideStackFrames(function(code, syscall, hostname) { let errno; // If `code` is of type number, it is a libuv error number, else it is a // c-ares error code. @@ -622,9 +632,9 @@ function dnsException(code, syscall, hostname) { if (hostname) { ex.hostname = hostname; } - ErrorCaptureStackTrace(ex, excludedStackFn || dnsException); - return ex; -} + + return captureLargerStackTrace(ex); +}); function connResetException(msg) { // eslint-disable-next-line no-restricted-syntax diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 885df198a0629b..34aa897c331dc1 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -276,7 +276,7 @@ async function writeFileHandle(filehandle, data, signal) { if (remaining === 0) return; do { if (signal?.aborted) { - throw new lazyDOMException('The operation was aborted', 'AbortError'); + throw lazyDOMException('The operation was aborted', 'AbortError'); } const { bytesWritten } = await write(filehandle, data, 0, @@ -670,7 +670,7 @@ async function writeFile(path, data, options) { const fd = await open(path, flag, options.mode); if (options.signal?.aborted) { - throw new lazyDOMException('The operation was aborted', 'AbortError'); + throw lazyDOMException('The operation was aborted', 'AbortError'); } return PromisePrototypeFinally(writeFileHandle(fd, data), fd.close); } From 3170636a8ee9a06ab9df272569bc9ec9746ed374 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Thu, 17 Dec 2020 12:10:00 +0100 Subject: [PATCH 004/161] =?UTF-8?q?v8:=20fix=C2=A0native=20`serdes`=C2=A0c?= =?UTF-8?q?onstructors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/13326 Refs: https://github.com/nodejs/node/pull/13541 PR-URL: https://github.com/nodejs/node/pull/36549 Reviewed-By: Rich Trott Reviewed-By: Benjamin Gruenbaum --- lib/v8.js | 11 ++--------- src/node_serdes.cc | 11 +++++++++++ test/parallel/test-v8-serdes.js | 17 ++++++++++------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/lib/v8.js b/lib/v8.js index 2ecb4c06a1931e..0ca1103cee9c0e 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -35,8 +35,8 @@ const { const { Buffer } = require('buffer'); const { validateString } = require('internal/validators'); const { - Serializer: _Serializer, - Deserializer: _Deserializer + Serializer, + Deserializer } = internalBinding('serdes'); let profiler = {}; @@ -70,13 +70,6 @@ function getHeapSnapshot() { return new HeapSnapshotStream(handle); } -// Calling exposed c++ functions directly throws exception as it expected to be -// called with new operator and caused an assert to fire. -// Creating JS wrapper so that it gets caught at JS layer. -class Serializer extends _Serializer { } - -class Deserializer extends _Deserializer { } - const { cachedDataVersionTag, setFlagsFromString: _setFlagsFromString, diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 28844f1858ff3d..b51d315989ce71 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -169,6 +169,10 @@ Maybe SerializerContext::WriteHostObject(Isolate* isolate, void SerializerContext::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); + if (!args.IsConstructCall()) { + return THROW_ERR_CONSTRUCT_CALL_REQUIRED( + env, "Class constructor Serializer cannot be invoked without 'new'"); + } new SerializerContext(env, args.This()); } @@ -319,6 +323,10 @@ MaybeLocal DeserializerContext::ReadHostObject(Isolate* isolate) { void DeserializerContext::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); + if (!args.IsConstructCall()) { + return THROW_ERR_CONSTRUCT_CALL_REQUIRED( + env, "Class constructor Deserializer cannot be invoked without 'new'"); + } if (!args[0]->IsArrayBufferView()) { return node::THROW_ERR_INVALID_ARG_TYPE( @@ -470,6 +478,7 @@ void Initialize(Local target, Local serializerString = FIXED_ONE_BYTE_STRING(env->isolate(), "Serializer"); ser->SetClassName(serializerString); + ser->ReadOnlyPrototype(); target->Set(env->context(), serializerString, ser->GetFunction(env->context()).ToLocalChecked()).Check(); @@ -496,6 +505,8 @@ void Initialize(Local target, Local deserializerString = FIXED_ONE_BYTE_STRING(env->isolate(), "Deserializer"); + des->SetLength(1); + des->ReadOnlyPrototype(); des->SetClassName(deserializerString); target->Set(env->context(), deserializerString, diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 593fb34ad73594..7485aa19a7d3d9 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -25,11 +25,6 @@ const objects = [ const hostObject = new (internalBinding('js_stream').JSStream)(); -const serializerTypeError = - /^TypeError: Class constructor Serializer cannot be invoked without 'new'$/; -const deserializerTypeError = - /^TypeError: Class constructor Deserializer cannot be invoked without 'new'$/; - { const ser = new v8.DefaultSerializer(); ser.writeHeader(); @@ -186,8 +181,16 @@ const deserializerTypeError = } { - assert.throws(v8.Serializer, serializerTypeError); - assert.throws(v8.Deserializer, deserializerTypeError); + assert.throws(() => v8.Serializer(), { + constructor: TypeError, + message: "Class constructor Serializer cannot be invoked without 'new'", + code: 'ERR_CONSTRUCT_CALL_REQUIRED' + }); + assert.throws(() => v8.Deserializer(), { + constructor: TypeError, + message: "Class constructor Deserializer cannot be invoked without 'new'", + code: 'ERR_CONSTRUCT_CALL_REQUIRED' + }); } From cb7f73c9d4885488d335f2afaa5e0c4ec8b8b758 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 17 Dec 2020 05:35:24 -0800 Subject: [PATCH 005/161] tools: revise line in configure.py for clarity * Replace unused identifier with Python convention `_`. * Remove unneeded parentheses. * Remove line-wrapping. I confirmed that this doesn't change the output by running `./configure --shared-zlib` and confirming that it created the same `common.gypi` with and without these changes. The code changed here doesn't run unless there is a `--shared-*` flag. PR-URL: https://github.com/nodejs/node/pull/36551 Reviewed-By: Richard Lau Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Daijiro Wachi --- configure.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.py b/configure.py index c24d56b5d1891d..8ed8524b26667e 100755 --- a/configure.py +++ b/configure.py @@ -1347,8 +1347,7 @@ def configure_library(lib, output, pkgname=None): output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib)) if getattr(options, shared_lib): - (pkg_libs, pkg_cflags, pkg_libpath, pkg_modversion) = ( - pkg_config(pkgname or lib)) + (pkg_libs, pkg_cflags, pkg_libpath, _) = pkg_config(pkgname or lib) if options.__dict__[shared_lib + '_includes']: output['include_dirs'] += [options.__dict__[shared_lib + '_includes']] From 63091f8440c41e7b5ef8d22aeb67d5f97976400d Mon Sep 17 00:00:00 2001 From: raisinten Date: Wed, 9 Dec 2020 19:13:07 +0530 Subject: [PATCH 006/161] lib: refactor to use more primordials in internal/histogram.js Co-authored-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/36455 Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott Reviewed-By: James M Snell --- lib/internal/histogram.js | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/internal/histogram.js b/lib/internal/histogram.js index 6deb8314a41bbb..00149db50236da 100644 --- a/lib/internal/histogram.js +++ b/lib/internal/histogram.js @@ -5,7 +5,7 @@ const { } = require('internal/util'); const { format } = require('util'); -const { Map, Symbol } = primordials; +const { SafeMap, Symbol } = primordials; const { ERR_INVALID_ARG_TYPE, @@ -19,11 +19,10 @@ const kHandle = Symbol('kHandle'); // record various metrics. This Histogram class provides a // generally read-only view of the internal histogram. class Histogram { - #handle = undefined; - #map = new Map(); + #map = new SafeMap(); constructor(internal) { - this.#handle = internal; + this[kHandle] = internal; } [kInspect]() { @@ -39,23 +38,23 @@ class Histogram { } get min() { - return this.#handle ? this.#handle.min() : undefined; + return this[kHandle]?.min(); } get max() { - return this.#handle ? this.#handle.max() : undefined; + return this[kHandle]?.max(); } get mean() { - return this.#handle ? this.#handle.mean() : undefined; + return this[kHandle]?.mean(); } get exceeds() { - return this.#handle ? this.#handle.exceeds() : undefined; + return this[kHandle]?.exceeds(); } get stddev() { - return this.#handle ? this.#handle.stddev() : undefined; + return this[kHandle]?.stddev(); } percentile(percentile) { @@ -65,26 +64,22 @@ class Histogram { if (percentile <= 0 || percentile > 100) throw new ERR_INVALID_ARG_VALUE.RangeError('percentile', percentile); - return this.#handle ? this.#handle.percentile(percentile) : undefined; + return this[kHandle]?.percentile(percentile); } get percentiles() { this.#map.clear(); - if (this.#handle) - this.#handle.percentiles(this.#map); + this[kHandle]?.percentiles(this.#map); return this.#map; } reset() { - if (this.#handle) - this.#handle.reset(); + this[kHandle]?.reset(); } [kDestroy]() { - this.#handle = undefined; + this[kHandle] = undefined; } - - get [kHandle]() { return this.#handle; } } module.exports = { From 7134d49e56b17ba8c595af6391361b52f0316c7e Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Mon, 7 Dec 2020 12:54:50 +0200 Subject: [PATCH 007/161] child_process: clean event listener correctly I was working on AbortSignal for spawn and noticed there is a leak in the current code for AbortSignal support in child_process since it removes the wrong listener. I used the new signal as argument feature to make removing the listener easier and added a test. PR-URL: https://github.com/nodejs/node/pull/36424 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- lib/child_process.js | 9 ++++----- test/parallel/test-child-process-execfile.js | 11 +++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index ae5a5f6587d1af..29a6450210f5f6 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -378,14 +378,13 @@ function execFile(file /* , args, options, callback */) { if (options.signal.aborted) { process.nextTick(() => kill()); } else { + const childController = new AbortController(); options.signal.addEventListener('abort', () => { - if (!ex) { + if (!ex) ex = new AbortError(); - } kill(); - }); - const remove = () => options.signal.removeEventListener('abort', kill); - child.once('close', remove); + }, { signal: childController.signal }); + child.once('close', () => childController.abort()); } } diff --git a/test/parallel/test-child-process-execfile.js b/test/parallel/test-child-process-execfile.js index a6345a7e5f6890..aec80b4e2baf22 100644 --- a/test/parallel/test-child-process-execfile.js +++ b/test/parallel/test-child-process-execfile.js @@ -3,6 +3,7 @@ const common = require('../common'); const assert = require('assert'); const execFile = require('child_process').execFile; +const { getEventListeners } = require('events'); const { getSystemErrorName } = require('util'); const fixtures = require('../common/fixtures'); @@ -68,5 +69,15 @@ const execOpts = { encoding: 'utf8', shell: true }; execFile(process.execPath, [echoFixture, 0], { signal: 'hello' }, callback); }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' }); +} +{ + // Verify that the process completing removes the abort listener + const ac = new AbortController(); + const { signal } = ac; + const callback = common.mustCall((err) => { + assert.strictEqual(getEventListeners(ac.signal).length, 0); + assert.strictEqual(err, null); + }); + execFile(process.execPath, [fixture, 0], { signal }, callback); } From 2dd2ec38367a2fb5c0c3cd069386ef541f83e299 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 5 Dec 2020 11:56:34 +0100 Subject: [PATCH 008/161] v8: refactor to use more primordials PR-URL: https://github.com/nodejs/node/pull/36527 Reviewed-By: Rich Trott Reviewed-By: Pooja D P --- lib/v8.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/v8.js b/lib/v8.js index 0ca1103cee9c0e..f1c624bc10add0 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -17,6 +17,8 @@ const { Array, ArrayBuffer, + ArrayPrototypeForEach, + ArrayPrototypePush, DataView, Error, Float32Array, @@ -191,13 +193,14 @@ const arrayBufferViewTypeToIndex = new SafeMap(); { const dummy = new ArrayBuffer(); - for (const [i, ctor] of arrayBufferViewTypes.entries()) { + ArrayPrototypeForEach(arrayBufferViewTypes, (ctor, i) => { const tag = ObjectPrototypeToString(new ctor(dummy)); arrayBufferViewTypeToIndex.set(tag, i); - } + }); } -const bufferConstructorIndex = arrayBufferViewTypes.push(FastBuffer) - 1; +const bufferConstructorIndex = + ArrayPrototypePush(arrayBufferViewTypes, FastBuffer) - 1; class DefaultSerializer extends Serializer { constructor() { From dcc93d3dceb741f8c9f721317c10edb614267a33 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 17 Dec 2020 13:08:37 -0500 Subject: [PATCH 009/161] doc: expand openssl instructions Refs: https://github.com/nodejs/node/pull/36541 Expand the instructions to cover what is needed when updates are required across all active release lines PR-URL: https://github.com/nodejs/node/pull/36554 Reviewed-By: Richard Lau Reviewed-By: Myles Borins --- doc/guides/maintaining-openssl.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/guides/maintaining-openssl.md b/doc/guides/maintaining-openssl.md index 1b59c24f8c32d4..1e75831482a260 100644 --- a/doc/guides/maintaining-openssl.md +++ b/doc/guides/maintaining-openssl.md @@ -2,6 +2,21 @@ This document describes how to update `deps/openssl/`. +If you need to provide updates across all active release lines you will +currently need to generate three PRs as follows: + +* a PR for master which is generated following the instructions + below which include the QUIC patch. +* a PR for 14.x following the instruction below based on the + 14,x branch but skipping the step to apply the QUICK patch. + This PR should cherry pick back to the active release lines + except for the 10.x line. +* a PR which uses the same commit from the second PR to apply the + updates to the openssl source code, with a new commit generated + by following steps 2 onwards on the 10.x line. This is + necessary because differences in 10.x requires that the + configuration files be regenerated specifically for 10.x. + ## Requirements * Linux environment. * `perl` Only Perl version 5 is tested. From 538f226f6d518c097618a0ec5ece1f3aabb5a905 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 21 Dec 2020 05:13:52 -0800 Subject: [PATCH 010/161] doc: remove "Related Issues" from pull request template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't require an issue for a pull request, so this section usually ends up displaying confusing default content. PR-URL: https://github.com/nodejs/node/pull/36590 Reviewed-By: Richard Lau Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Anna Henningsen Reviewed-By: Daijiro Wachi --- .github/PULL_REQUEST_TEMPLATE.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dd3a2964c85db9..66efca5cd000e7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,10 +7,6 @@ Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md --> -#### Related Issues - -Fixes: https://github.com/nodejs/node/issues/ - ##### Checklist From 93237c59993ede0dd255bd41579f3dc48697dd4b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 21 Dec 2020 06:10:12 -0800 Subject: [PATCH 011/161] doc: remove replication of GitHub template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pull-request template was replicated in the pull-requests.md which is a maintenance annoyance when changing the template. Replace the replication with a link to the raw template. PR-URL: https://github.com/nodejs/node/pull/36590 Reviewed-By: Richard Lau Reviewed-By: Michaël Zasso Reviewed-By: Antoine du Hamel Reviewed-By: Anna Henningsen Reviewed-By: Daijiro Wachi --- doc/guides/contributing/pull-requests.md | 32 +++--------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/doc/guides/contributing/pull-requests.md b/doc/guides/contributing/pull-requests.md index 627ae2218a7b6d..4ca1df219bb941 100644 --- a/doc/guides/contributing/pull-requests.md +++ b/doc/guides/contributing/pull-requests.md @@ -268,34 +268,9 @@ $ git push origin my-branch ### Step 8: Opening the Pull Request -From within GitHub, opening a new Pull Request will present you with a template -that should be filled out: - -```markdown - - -#### Related Issues - -Fixes: https://github.com/nodejs/node/issues/ - -#### Checklist - - -- [ ] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes -- [ ] tests and/or benchmarks are included -- [ ] documentation is changed or added -- [ ] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines) -``` - -Please try to do your best at filling out the details, but feel free to skip -parts if you're not sure what to put. +From within GitHub, opening a new Pull Request will present you with a +[pull request template][]. Please try to do your best at filling out the +details, but feel free to skip parts if you're not sure what to put. Once opened, Pull Requests are usually reviewed within a few days. @@ -630,4 +605,5 @@ More than one subsystem may be valid for any particular issue or pull request. [guide for writing tests in Node.js]: ../writing-tests.md [hiding-a-comment]: https://help.github.com/articles/managing-disruptive-comments/#hiding-a-comment [https://ci.nodejs.org/]: https://ci.nodejs.org/ +[pull request template]: https://raw.githubusercontent.com/nodejs/node/master/.github/PULL_REQUEST_TEMPLATE.md [running tests]: ../../../BUILDING.md#running-tests From d20235b6cb5d12fe2a039bb352624cbe26cb7dfa Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Tue, 22 Dec 2020 20:43:32 +0800 Subject: [PATCH 012/161] lib: fix diagnostics_channel hasSubscribers error Fixes: https://github.com/nodejs/node/issues/36598 PR-URL: https://github.com/nodejs/node/pull/36599 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- lib/diagnostics_channel.js | 3 +-- .../test-diagnostics-channel-has-subscribers.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-diagnostics-channel-has-subscribers.js diff --git a/lib/diagnostics_channel.js b/lib/diagnostics_channel.js index 0a3552dc975040..c29c9ff0052405 100644 --- a/lib/diagnostics_channel.js +++ b/lib/diagnostics_channel.js @@ -8,7 +8,6 @@ const { ObjectGetPrototypeOf, ObjectSetPrototypeOf, SymbolHasInstance, - WeakRefPrototypeGet } = primordials; const { @@ -107,7 +106,7 @@ function channel(name) { function hasSubscribers(name) { let channel; const ref = channels[name]; - if (ref) channel = WeakRefPrototypeGet(ref); + if (ref) channel = ref.get(); if (!channel) { return false; } diff --git a/test/parallel/test-diagnostics-channel-has-subscribers.js b/test/parallel/test-diagnostics-channel-has-subscribers.js new file mode 100644 index 00000000000000..de37267555089e --- /dev/null +++ b/test/parallel/test-diagnostics-channel-has-subscribers.js @@ -0,0 +1,10 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const { channel, hasSubscribers } = require('diagnostics_channel'); + +const dc = channel('test'); +assert.ok(!hasSubscribers('test')); + +dc.subscribe(() => {}); +assert.ok(hasSubscribers('test')); From 863bfc44d2456cfc163d6ff3db4100435258c874 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 17 Dec 2020 05:06:20 +0100 Subject: [PATCH 013/161] test: redirect stderr EnvironmentWithNoESMLoader This commit adds a suggestion to redirect stderr for EnvironmentTest.EnvironmentWithNoESMLoader. The motivation for this is that currently this tests prints the following error (which is expected): vm:module(0):1 globalThis.importResult = import("") ^ Error: Not supported at vm:module(0):1:1 at SourceTextModule.evaluate (node:internal/vm/module:229:23) at node:embedder_main_12:1:328 at processTicksAndRejections (node:internal/process/task_queues:93:5) It might not be obvious which test caused this error just by looking at the output above and it would be nice if it was not displayed. PR-URL: https://github.com/nodejs/node/pull/36548 Reviewed-By: Rich Trott Reviewed-By: Joyee Cheung --- test/cctest/test_environment.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index a2066121cd964f..862dfd5780868a 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -5,6 +5,8 @@ #include #include "gtest/gtest.h" #include "node_test_fixture.h" +#include +#include using node::AtExit; using node::RunAtExit; @@ -66,7 +68,34 @@ TEST_F(EnvironmentTest, EnvironmentWithESMLoader) { "})()"); } +class RedirectStdErr { + public: + explicit RedirectStdErr(const char* filename) : filename_(filename) { + fflush(stderr); + fgetpos(stderr, &pos_); + fd_ = dup(fileno(stderr)); + freopen(filename_, "w", stderr); + } + + ~RedirectStdErr() { + fflush(stderr); + dup2(fd_, fileno(stderr)); + close(fd_); + remove(filename_); + clearerr(stderr); + fsetpos(stderr, &pos_); + } + + private: + int fd_; + fpos_t pos_; + const char* filename_; +}; + TEST_F(EnvironmentTest, EnvironmentWithNoESMLoader) { + // The following line will cause stderr to get redirected to avoid the + // error that would otherwise be printed to the console by this test. + RedirectStdErr redirect_scope("environment_test.log"); const v8::HandleScope handle_scope(isolate_); Argv argv; Env env {handle_scope, argv, node::EnvironmentFlags::kNoRegisterESMLoader}; From 578fa0fedf9e58969566c6258549a499d2920264 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Fri, 18 Dec 2020 10:40:07 -0800 Subject: [PATCH 014/161] deps: V8: cherry-pick dfcdf7837e23 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [coverage] fix greedy nullish coalescing The SourceRangeScope helper was consuming too many characters, instead explicitly create SourceRange, based on scanner position. Bug: v8:11231 Change-Id: I852d211227abacf867e8f1ab3e3ab06dbdba2a9b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2576006 Reviewed-by: Toon Verwaest Commit-Queue: Toon Verwaest Cr-Commit-Position: refs/heads/master@{#71765} Refs: https://github.com/v8/v8/commit/dfcdf7837e23cc0da31f9b2d4211f856413d13af PR-URL: https://github.com/nodejs/node/pull/36573 Fixes: https://github.com/nodejs/node/issues/36619 Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott Reviewed-By: Michael Dawson Reviewed-By: Jiawen Geng --- deps/v8/src/parsing/parser-base.h | 15 +++++++++------ deps/v8/test/mjsunit/code-coverage-block.js | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index 50902f67d6e6b9..608427664961b5 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -2983,12 +2983,15 @@ ParserBase::ParseCoalesceExpression(ExpressionT expression) { bool first_nullish = true; while (peek() == Token::NULLISH) { SourceRange right_range; - SourceRangeScope right_range_scope(scanner(), &right_range); - Consume(Token::NULLISH); - int pos = peek_position(); - - // Parse BitwiseOR or higher. - ExpressionT y = ParseBinaryExpression(6); + int pos; + ExpressionT y; + { + SourceRangeScope right_range_scope(scanner(), &right_range); + Consume(Token::NULLISH); + pos = peek_position(); + // Parse BitwiseOR or higher. + y = ParseBinaryExpression(6); + } if (first_nullish) { expression = factory()->NewBinaryOperation(Token::NULLISH, expression, y, pos); diff --git a/deps/v8/test/mjsunit/code-coverage-block.js b/deps/v8/test/mjsunit/code-coverage-block.js index ea1c2ea5fc9770..4584f3134a90db 100644 --- a/deps/v8/test/mjsunit/code-coverage-block.js +++ b/deps/v8/test/mjsunit/code-coverage-block.js @@ -1177,4 +1177,22 @@ a(true); // 0500 {"start":0,"end":401,"count":2}, {"start":154,"end":254,"count":0}]); + TestCoverage( +"https://crbug.com/v8/11231 - nullish coalescing", +` +const a = true // 0000 +const b = false // 0050 +const c = undefined // 0100 +const d = a ?? 99 // 0150 +const e = 33 // 0200 +const f = b ?? (c ?? 99) // 0250 +const g = 33 // 0300 +const h = c ?? (c ?? 'hello') // 0350 +const i = c ?? b ?? 'hello' // 0400 +`, +[{"start":0,"end":449,"count":1}, + {"start":162,"end":167,"count":0}, + {"start":262,"end":274,"count":0}, + {"start":417,"end":427,"count":0}]); + %DebugToggleBlockCoverage(false); From a8a427f6461a0a4b6ca7a2a6ec461f82733025d0 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Tue, 22 Dec 2020 15:27:14 +0200 Subject: [PATCH 015/161] child_process: support AbortSignal in fork PR-URL: https://github.com/nodejs/node/pull/36603 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- doc/api/child_process.md | 11 +++++-- lib/child_process.js | 4 +-- .../child-process-stay-alive-forever.js | 3 ++ .../test-child-process-fork-abort-signal.js | 33 +++++++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/child-process-stay-alive-forever.js create mode 100644 test/parallel/test-child-process-fork-abort-signal.js diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 116e9f71333468..02ea48df44d16d 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -351,6 +351,9 @@ controller.abort(); * {Object} From 82393aefffecf0ef0ce513a4f0ed07f4af6c0869 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Nov 2020 00:31:30 +0100 Subject: [PATCH 021/161] events: refactor to use more primordials PR-URL: https://github.com/nodejs/node/pull/36304 Reviewed-By: Rich Trott --- lib/events.js | 15 +++++++++------ lib/internal/event_target.js | 7 ++++--- lib/trace_events.js | 7 ++++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/events.js b/lib/events.js index dc08042578bc7a..942e5e01eee044 100644 --- a/lib/events.js +++ b/lib/events.js @@ -22,10 +22,13 @@ 'use strict'; const { + ArrayPrototypeForEach, ArrayPrototypePush, + ArrayPrototypeSlice, Boolean, Error, ErrorCaptureStackTrace, + FunctionPrototypeCall, MathMin, NumberIsNaN, ObjectCreate, @@ -81,7 +84,7 @@ const lazyDOMException = hideStackFrames((message, name) => { function EventEmitter(opts) { - EventEmitter.init.call(this, opts); + FunctionPrototypeCall(EventEmitter.init, this, opts); } module.exports = EventEmitter; module.exports.once = once; @@ -173,7 +176,7 @@ EventEmitter.setMaxListeners = isEventTarget = require('internal/event_target').isEventTarget; // Performance for forEach is now comparable with regular for-loop - eventTargets.forEach((target) => { + ArrayPrototypeForEach(eventTargets, (target) => { if (isEventTarget(target)) { target[kMaxEventTargetListeners] = n; target[kMaxEventTargetListenersWarned] = false; @@ -224,7 +227,7 @@ function addCatch(that, promise, type, args) { const then = promise.then; if (typeof then === 'function') { - then.call(promise, undefined, function(err) { + FunctionPrototypeCall(then, promise, undefined, function(err) { // The callback is called with nextTick to avoid a follow-up // rejection from this promise. process.nextTick(emitUnhandledRejectionOrErr, that, err, type, args); @@ -670,7 +673,7 @@ function arrayClone(arr) { case 5: return [arr[0], arr[1], arr[2], arr[3], arr[4]]; case 6: return [arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]]; } - return arr.slice(); + return ArrayPrototypeSlice(arr); } function unwrapListeners(arr) { @@ -813,7 +816,7 @@ function on(emitter, event, options) { // Wait until an event happens return new Promise(function(resolve, reject) { - unconsumedPromises.push({ resolve, reject }); + ArrayPrototypePush(unconsumedPromises, { resolve, reject }); }); }, @@ -877,7 +880,7 @@ function on(emitter, event, options) { if (promise) { promise.resolve(createIterResult(args, false)); } else { - unconsumedEvents.push(args); + ArrayPrototypePush(unconsumedEvents, args); } } diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index a0efe8c18e875a..cfc138d6dbf7cf 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -4,6 +4,7 @@ const { ArrayFrom, Boolean, Error, + FunctionPrototypeBind, FunctionPrototypeCall, NumberIsInteger, ObjectAssign, @@ -212,7 +213,7 @@ class Listener { this.callback = typeof listener === 'function' ? listener : - listener.handleEvent.bind(listener); + FunctionPrototypeBind(listener.handleEvent, listener); } same(listener, capture) { @@ -419,7 +420,7 @@ class EventTarget { } else { arg = createEvent(); } - const result = handler.callback.call(this, arg); + const result = FunctionPrototypeCall(handler.callback, this, arg); if (result !== undefined && result !== null) addCatch(this, result, createEvent()); } catch (err) { @@ -590,7 +591,7 @@ function isEventTarget(obj) { function addCatch(that, promise, event) { const then = promise.then; if (typeof then === 'function') { - then.call(promise, undefined, function(err) { + FunctionPrototypeCall(then, promise, undefined, function(err) { // The callback is called with nextTick to avoid a follow-up // rejection from this promise. process.nextTick(emitUnhandledRejectionOrErr, that, err, event); diff --git a/lib/trace_events.js b/lib/trace_events.js index 35f776ad53c310..85101e7930d977 100644 --- a/lib/trace_events.js +++ b/lib/trace_events.js @@ -2,7 +2,8 @@ const { ArrayIsArray, - Set, + ArrayPrototypeJoin, + SafeSet, Symbol, } = primordials; @@ -27,7 +28,7 @@ const { CategorySet, getEnabledCategories } = internalBinding('trace_events'); const { customInspectSymbol } = require('internal/util'); const { format } = require('internal/util/inspect'); -const enabledTracingObjects = new Set(); +const enabledTracingObjects = new SafeSet(); class Tracing { constructor(categories) { @@ -63,7 +64,7 @@ class Tracing { } get categories() { - return this[kCategories].join(','); + return ArrayPrototypeJoin(this[kCategories], ','); } [customInspectSymbol](depth, opts) { From 56af1250fe993c6452a3fc504ed27f8067b7b124 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 7 Dec 2020 13:57:18 +0100 Subject: [PATCH 022/161] lib: make safe primordials safe to construct PR-URL: https://github.com/nodejs/node/pull/36428 Reviewed-By: Rich Trott --- lib/internal/per_context/primordials.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index ad5707954738ae..8bb7d41983262b 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -146,21 +146,31 @@ primordials.makeSafe = makeSafe; // Subclass the constructors because we need to use their prototype // methods later. +// Defining the `constructor` is necessary here to avoid the default +// constructor which uses the user-mutable `%ArrayIteratorPrototype%.next`. primordials.SafeMap = makeSafe( Map, - class SafeMap extends Map {} + class SafeMap extends Map { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } ); primordials.SafeWeakMap = makeSafe( WeakMap, - class SafeWeakMap extends WeakMap {} + class SafeWeakMap extends WeakMap { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } ); primordials.SafeSet = makeSafe( Set, - class SafeSet extends Set {} + class SafeSet extends Set { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } ); primordials.SafeWeakSet = makeSafe( WeakSet, - class SafeWeakSet extends WeakSet {} + class SafeWeakSet extends WeakSet { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } ); // Create copies of the namespace objects From 8ac2016229d53795d7538ee2437cccff803a3100 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 4 Dec 2020 14:48:52 +0100 Subject: [PATCH 023/161] lib: add primordials.SafeStringIterator PR-URL: https://github.com/nodejs/node/pull/36526 Reviewed-By: Rich Trott --- lib/internal/per_context/primordials.js | 8 ++++++++ lib/internal/repl/utils.js | 3 ++- lib/internal/source_map/prepare_stack_trace.js | 4 +++- lib/internal/util/inspect.js | 3 ++- lib/readline.js | 5 +++-- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index 8bb7d41983262b..68c36229825f73 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -242,6 +242,9 @@ primordials.SafeWeakSet = makeSafe( // Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object [ { name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) }, + { name: 'StringIterator', original: { + prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()), + } }, ].forEach(({ name, original }) => { primordials[name] = original; // The static %TypedArray% methods require a valid `this`, but can't be bound, @@ -250,5 +253,10 @@ primordials.SafeWeakSet = makeSafe( copyPrototype(original.prototype, primordials, `${name}Prototype`); }); +primordials.SafeStringIterator = createSafeIterator( + primordials.StringPrototypeSymbolIterator, + primordials.StringIteratorPrototypeNext +); + Object.setPrototypeOf(primordials, null); Object.freeze(primordials); diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index e2bda7665a9138..594b6a0c4485c7 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -9,6 +9,7 @@ const { MathMin, RegExpPrototypeTest, SafeSet, + SafeStringIterator, StringPrototypeEndsWith, StringPrototypeIndexOf, StringPrototypeLastIndexOf, @@ -425,7 +426,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { getStringWidth(inspected) > maxColumns) { maxColumns -= 4 + (repl.useColors ? 0 : 3); let res = ''; - for (const char of inspected) { + for (const char of new SafeStringIterator(inspected)) { maxColumns -= getStringWidth(char); if (maxColumns < 0) break; diff --git a/lib/internal/source_map/prepare_stack_trace.js b/lib/internal/source_map/prepare_stack_trace.js index 60bcb2fcadd1a1..c32f9780c2fb3f 100644 --- a/lib/internal/source_map/prepare_stack_trace.js +++ b/lib/internal/source_map/prepare_stack_trace.js @@ -9,6 +9,7 @@ const { StringPrototypeSlice, StringPrototypeSplit, StringPrototypeStartsWith, + SafeStringIterator, } = primordials; let debug = require('internal/util/debuglog').debuglog('source_map', (fn) => { @@ -144,7 +145,8 @@ function getErrorSource( // Display ^ in appropriate position, regardless of whether tabs or // spaces are used: let prefix = ''; - for (const character of StringPrototypeSlice(line, 0, originalColumn + 1)) { + for (const character of new SafeStringIterator( + StringPrototypeSlice(line, 0, originalColumn + 1))) { prefix += (character === '\t') ? '\t' : StringPrototypeRepeat(' ', getStringWidth(character)); } diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 17ca3f3d2b39ce..04b7b68c5d41c6 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -42,6 +42,7 @@ const { ReflectApply, RegExp, RegExpPrototypeToString, + SafeStringIterator, Set, SetPrototypeGetSize, SetPrototypeValues, @@ -2005,7 +2006,7 @@ if (internalBinding('config').hasIntl) { if (removeControlChars) str = stripVTControlCharacters(str); str = str.normalize('NFC'); - for (const char of str) { + for (const char of new SafeStringIterator(str)) { const code = char.codePointAt(0); if (isFullWidthCodePoint(code)) { width += 2; diff --git a/lib/readline.js b/lib/readline.js index 03e8b27db7ac75..8995fcbbf44335 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -59,6 +59,7 @@ const { StringPrototypeTrim, Symbol, SymbolAsyncIterator, + SafeStringIterator, } = primordials; const { @@ -752,7 +753,7 @@ Interface.prototype._getDisplayPos = function(str) { const col = this.columns; let rows = 0; str = stripVTControlCharacters(str); - for (const char of str) { + for (const char of new SafeStringIterator(str)) { if (char === '\n') { // Rows must be incremented by 1 even if offset = 0 or col = +Infinity. rows += MathCeil(offset / col) || 1; @@ -1168,7 +1169,7 @@ function emitKeypressEvents(stream, iface = {}) { iface.isCompletionEnabled = false; let length = 0; - for (const character of string) { + for (const character of new SafeStringIterator(string)) { length += character.length; if (length === string.length) { iface.isCompletionEnabled = true; From 822ac482728c12882323082aa1dea3defc0a74fa Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 20 Dec 2020 12:59:44 +0100 Subject: [PATCH 024/161] buffer: make FastBuffer safe to construct Using an explicit constructor is necessary to avoid relying on `Array.prototype[Symbol.iterator]` and `%ArrayIteratorPrototype%.next`, which can be mutated by users. PR-URL: https://github.com/nodejs/node/pull/36587 Refs: https://github.com/nodejs/node/pull/36428 Refs: https://github.com/nodejs/node/pull/36532 Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca --- lib/internal/buffer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index 60f6cab093135d..3515626041bbad 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -949,7 +949,14 @@ function writeFloatBackwards(val, offset = 0) { return offset; } -class FastBuffer extends Uint8Array {} +class FastBuffer extends Uint8Array { + // Using an explicit constructor here is necessary to avoid relying on + // `Array.prototype[Symbol.iterator]`, which can be mutated by users. + // eslint-disable-next-line no-useless-constructor + constructor(bufferOrLength, byteOffset, length) { + super(bufferOrLength, byteOffset, length); + } +} function addBufferPrototypeMethods(proto) { proto.readBigUInt64LE = readBigUInt64LE; From 7aedda9dcdd01d6172a187a57e8ad74fda71d4b0 Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Wed, 23 Dec 2020 16:52:44 +0300 Subject: [PATCH 025/161] benchmark: add simple https benchmark Adds a simple benchmark for https server based on the http simple benchmark. Updates benchmarker integration for autocannon and wrk, so that they support https scheme. Also adds a new HTTPS section and improves HTTP/2 section in the benchmark guide. PR-URL: https://github.com/nodejs/node/pull/36612 Reviewed-By: Rich Trott Reviewed-By: Antoine du Hamel --- benchmark/_http-benchmarkers.js | 14 ++-- benchmark/_test-double-benchmarker.js | 15 +++- benchmark/fixtures/simple-https-server.js | 72 ++++++++++++++++++++ benchmark/https/simple.js | 29 ++++++++ doc/guides/writing-and-running-benchmarks.md | 11 ++- 5 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 benchmark/fixtures/simple-https-server.js create mode 100644 benchmark/https/simple.js diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index d0f192e75948b6..f25bcd319882f6 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -29,7 +29,8 @@ class AutocannonBenchmarker { for (const field in options.headers) { args.push('-H', `${field}=${options.headers[field]}`); } - args.push(`http://127.0.0.1:${options.port}${options.path}`); + const scheme = options.scheme || 'http'; + args.push(`${scheme}://127.0.0.1:${options.port}${options.path}`); const child = child_process.spawn(this.executable, args); return child; } @@ -60,11 +61,12 @@ class WrkBenchmarker { const duration = typeof options.duration === 'number' ? Math.max(options.duration, 1) : options.duration; + const scheme = options.scheme || 'http'; const args = [ '-d', duration, '-c', options.connections, '-t', Math.min(options.connections, require('os').cpus().length || 8), - `http://127.0.0.1:${options.port}${options.path}`, + `${scheme}://127.0.0.1:${options.port}${options.path}`, ]; for (const field in options.headers) { args.push('-H', `${field}: ${options.headers[field]}`); @@ -90,8 +92,8 @@ class WrkBenchmarker { */ class TestDoubleBenchmarker { constructor(type) { - // `type` is the type of benchmarker. Possible values are 'http' and - // 'http2'. + // `type` is the type of benchmarker. Possible values are 'http', 'https', + // and 'http2'. this.name = `test-double-${type}`; this.executable = path.resolve(__dirname, '_test-double-benchmarker.js'); this.present = fs.existsSync(this.executable); @@ -101,8 +103,9 @@ class TestDoubleBenchmarker { create(options) { process.env.duration = process.env.duration || options.duration || 5; + const scheme = options.scheme || 'http'; const env = { - test_url: `http://127.0.0.1:${options.port}${options.path}`, + test_url: `${scheme}://127.0.0.1:${options.port}${options.path}`, ...process.env }; @@ -179,6 +182,7 @@ const http_benchmarkers = [ new WrkBenchmarker(), new AutocannonBenchmarker(), new TestDoubleBenchmarker('http'), + new TestDoubleBenchmarker('https'), new TestDoubleBenchmarker('http2'), new H2LoadBenchmarker(), ]; diff --git a/benchmark/_test-double-benchmarker.js b/benchmark/_test-double-benchmarker.js index 60264dfd46a606..89843d4616cc50 100644 --- a/benchmark/_test-double-benchmarker.js +++ b/benchmark/_test-double-benchmarker.js @@ -1,10 +1,15 @@ 'use strict'; const myModule = process.argv[2]; -if (!['http', 'http2'].includes(myModule)) { +if (!['http', 'https', 'http2'].includes(myModule)) { throw new Error(`Invalid module for benchmark test double: ${myModule}`); } +let options; +if (myModule === 'https') { + options = { rejectUnauthorized: false }; +} + const http = require(myModule); const duration = +process.env.duration; @@ -33,8 +38,12 @@ function request(res, client) { } function run() { - if (http.get) { // HTTP - http.get(url, request); + if (http.get) { // HTTP or HTTPS + if (options) { + http.get(url, options, request); + } else { + http.get(url, request); + } } else { // HTTP/2 const client = http.connect(url); client.on('error', (e) => { throw e; }); diff --git a/benchmark/fixtures/simple-https-server.js b/benchmark/fixtures/simple-https-server.js new file mode 100644 index 00000000000000..d3b07a110113d7 --- /dev/null +++ b/benchmark/fixtures/simple-https-server.js @@ -0,0 +1,72 @@ +'use strict'; + +const fixtures = require('../../test/common/fixtures'); +const https = require('https'); + +const options = { + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') +}; + +const storedBytes = Object.create(null); +const storedBuffer = Object.create(null); + +module.exports = https.createServer(options, (req, res) => { + // URL format: ////chunkedEnc + const params = req.url.split('/'); + const command = params[1]; + let body = ''; + const arg = params[2]; + const n_chunks = parseInt(params[3], 10); + const chunkedEnc = params.length >= 5 && params[4] === '0' ? false : true; + let status = 200; + + let n, i; + if (command === 'bytes') { + n = ~~arg; + if (n <= 0) + throw new Error('bytes called with n <= 0'); + if (storedBytes[n] === undefined) { + storedBytes[n] = 'C'.repeat(n); + } + body = storedBytes[n]; + } else if (command === 'buffer') { + n = ~~arg; + if (n <= 0) + throw new Error('buffer called with n <= 0'); + if (storedBuffer[n] === undefined) { + storedBuffer[n] = Buffer.allocUnsafe(n); + for (i = 0; i < n; i++) { + storedBuffer[n][i] = 'C'.charCodeAt(0); + } + } + body = storedBuffer[n]; + } else { + status = 404; + body = 'not found\n'; + } + + // example: https://localhost:port/bytes/512/4 + // sends a 512 byte body in 4 chunks of 128 bytes + const len = body.length; + if (chunkedEnc) { + res.writeHead(status, { + 'Content-Type': 'text/plain', + 'Transfer-Encoding': 'chunked' + }); + } else { + res.writeHead(status, { + 'Content-Type': 'text/plain', + 'Content-Length': len.toString() + }); + } + // send body in chunks + if (n_chunks > 1) { + const step = Math.floor(len / n_chunks) || 1; + for (i = 0, n = (n_chunks - 1); i < n; ++i) + res.write(body.slice(i * step, i * step + step)); + res.end(body.slice((n_chunks - 1) * step)); + } else { + res.end(body); + } +}); diff --git a/benchmark/https/simple.js b/benchmark/https/simple.js new file mode 100644 index 00000000000000..243546c346f484 --- /dev/null +++ b/benchmark/https/simple.js @@ -0,0 +1,29 @@ +'use strict'; +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + type: ['bytes', 'buffer'], + len: [4, 1024, 102400], + chunks: [1, 4], + c: [50, 500], + chunkedEnc: [1, 0], + benchmarker: ['test-double-https'], + duration: 5 +}); + +function main({ type, len, chunks, c, chunkedEnc, duration }) { + const server = require('../fixtures/simple-https-server.js') + .listen(common.PORT) + .on('listening', () => { + const path = `/${type}/${len}/${chunks}/${chunkedEnc}`; + + bench.http({ + path, + connections: c, + scheme: 'https', + duration + }, () => { + server.close(); + }); + }); +} diff --git a/doc/guides/writing-and-running-benchmarks.md b/doc/guides/writing-and-running-benchmarks.md index b6b22d75c17e2c..ef93714899e534 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -4,6 +4,8 @@ * [Prerequisites](#prerequisites) * [HTTP Benchmark Requirements](#http-benchmark-requirements) + * [HTTPS Benchmark Requirements](#https-benchmark-requirements) + * [HTTP/2 Benchmark Requirements](#http2-benchmark-requirements) * [Benchmark Analysis Requirements](#benchmark-analysis-requirements) * [Running benchmarks](#running-benchmarks) * [Running individual benchmarks](#running-individual-benchmarks) @@ -43,13 +45,20 @@ benchmarker to be used should be specified by providing it as an argument: `node benchmark/http/simple.js benchmarker=autocannon` +#### HTTPS Benchmark Requirements + +To run the `https` benchmarks, one of `autocannon` or `wrk` benchmarkers must +be used. + +`node benchmark/https/simple.js benchmarker=autocannon` + #### HTTP/2 Benchmark Requirements To run the `http2` benchmarks, the `h2load` benchmarker must be used. The `h2load` tool is a component of the `nghttp2` project and may be installed from [nghttp2.org][] or built from source. -`node benchmark/http2/simple.js benchmarker=autocannon` +`node benchmark/http2/simple.js benchmarker=h2load` ### Benchmark Analysis Requirements From b1c6a44cafc47eaa966c7bb004fef20e8ebf54b9 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 20 Nov 2020 10:20:15 +0100 Subject: [PATCH 026/161] url: refactor to use more primordials PR-URL: https://github.com/nodejs/node/pull/36316 Reviewed-By: Rich Trott --- lib/internal/url.js | 148 ++++++++++++++++++++++++++------------------ 1 file changed, 89 insertions(+), 59 deletions(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index 9c883b6268737c..a15f19889800c5 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -2,6 +2,12 @@ const { Array, + ArrayPrototypeJoin, + ArrayPrototypeMap, + ArrayPrototypePush, + ArrayPrototypeReduce, + ArrayPrototypeSlice, + FunctionPrototypeBind, Int8Array, Number, ObjectCreate, @@ -10,9 +16,17 @@ const { ObjectGetOwnPropertySymbols, ObjectGetPrototypeOf, ObjectKeys, + ReflectApply, ReflectGetOwnPropertyDescriptor, ReflectOwnKeys, + RegExpPrototypeExec, String, + StringPrototypeCharCodeAt, + StringPrototypeIncludes, + StringPrototypeReplace, + StringPrototypeSlice, + StringPrototypeSplit, + StringPrototypeStartsWith, Symbol, SymbolIterator, SymbolToStringTag, @@ -101,7 +115,7 @@ function toUSVString(val) { const str = `${val}`; // As of V8 5.5, `str.search()` (and `unpairedSurrogateRe[@@search]()`) are // slower than `unpairedSurrogateRe.exec()`. - const match = unpairedSurrogateRe.exec(str); + const match = RegExpPrototypeExec(unpairedSurrogateRe, str); if (!match) return str; return _toUSVString(str, match.index); @@ -166,8 +180,8 @@ class URLSearchParams { } const convertedPair = []; for (const element of pair) - convertedPair.push(toUSVString(element)); - pairs.push(convertedPair); + ArrayPrototypePush(convertedPair, toUSVString(element)); + ArrayPrototypePush(pairs, convertedPair); } this[searchParams] = []; @@ -175,7 +189,7 @@ class URLSearchParams { if (pair.length !== 2) { throw new ERR_INVALID_TUPLE('Each query pair', '[name, value]'); } - this[searchParams].push(pair[0], pair[1]); + ArrayPrototypePush(this[searchParams], pair[0], pair[1]); } } else { // Record @@ -221,16 +235,21 @@ class URLSearchParams { const list = this[searchParams]; const output = []; for (let i = 0; i < list.length; i += 2) - output.push(`${innerInspect(list[i])} => ${innerInspect(list[i + 1])}`); + ArrayPrototypePush( + output, + `${innerInspect(list[i])} => ${innerInspect(list[i + 1])}`); - const length = output.reduce( + const length = ArrayPrototypeReduce( + output, (prev, cur) => prev + removeColors(cur).length + separator.length, -separator.length ); if (length > ctx.breakLength) { - return `${this.constructor.name} {\n ${output.join(',\n ')} }`; + return `${this.constructor.name} {\n` + + ` ${ArrayPrototypeJoin(output, ',\n ')} }`; } else if (output.length) { - return `${this.constructor.name} { ${output.join(separator)} }`; + return `${this.constructor.name} { ` + + `${ArrayPrototypeJoin(output, separator)} }`; } return `${this.constructor.name} {}`; } @@ -290,9 +309,9 @@ function onParsePortComplete(flags, protocol, username, password, function onParseHostComplete(flags, protocol, username, password, host, port, path, query, fragment) { - onParseHostnameComplete.apply(this, arguments); + ReflectApply(onParseHostnameComplete, this, arguments); if (port !== null || ((flags & URL_FLAGS_IS_DEFAULT_SCHEME_PORT) !== 0)) - onParsePortComplete.apply(this, arguments); + ReflectApply(onParsePortComplete, this, arguments); } function onParsePathComplete(flags, protocol, username, password, @@ -332,8 +351,8 @@ class URL { base_context = new URL(base)[context]; } this[context] = new URLContext(); - parse(input, -1, base_context, undefined, onParseComplete.bind(this), - onParseError); + parse(input, -1, base_context, undefined, + FunctionPrototypeBind(onParseComplete, this), onParseError); } get [special]() { @@ -461,8 +480,8 @@ ObjectDefineProperties(URL.prototype, { set(input) { // toUSVString is not needed. input = `${input}`; - parse(input, -1, undefined, undefined, onParseComplete.bind(this), - onParseError); + parse(input, -1, undefined, undefined, + FunctionPrototypeBind(onParseComplete, this), onParseError); } }, origin: { // readonly @@ -504,7 +523,7 @@ ObjectDefineProperties(URL.prototype, { return; const ctx = this[context]; parse(scheme, kSchemeStart, null, ctx, - onParseProtocolComplete.bind(this)); + FunctionPrototypeBind(onParseProtocolComplete, this)); } }, username: { @@ -567,7 +586,8 @@ ObjectDefineProperties(URL.prototype, { // Cannot set the host if cannot-be-base is set return; } - parse(host, kHost, null, ctx, onParseHostComplete.bind(this)); + parse(host, kHost, null, ctx, + FunctionPrototypeBind(onParseHostComplete, this)); } }, hostname: { @@ -604,7 +624,8 @@ ObjectDefineProperties(URL.prototype, { ctx.port = null; return; } - parse(port, kPort, null, ctx, onParsePortComplete.bind(this)); + parse(port, kPort, null, ctx, + FunctionPrototypeBind(onParsePortComplete, this)); } }, pathname: { @@ -616,7 +637,7 @@ ObjectDefineProperties(URL.prototype, { return ctx.path[0]; if (ctx.path.length === 0) return ''; - return `/${ctx.path.join('/')}`; + return `/${ArrayPrototypeJoin(ctx.path, '/')}`; }, set(path) { // toUSVString is not needed. @@ -643,11 +664,12 @@ ObjectDefineProperties(URL.prototype, { ctx.query = null; ctx.flags &= ~URL_FLAGS_HAS_QUERY; } else { - if (search[0] === '?') search = search.slice(1); + if (search[0] === '?') search = StringPrototypeSlice(search, 1); ctx.query = ''; ctx.flags |= URL_FLAGS_HAS_QUERY; if (search) { - parse(search, kQuery, null, ctx, onParseSearchComplete.bind(this)); + parse(search, kQuery, null, ctx, + FunctionPrototypeBind(onParseSearchComplete, this)); } } initSearchParams(this[searchParams], search); @@ -678,10 +700,11 @@ ObjectDefineProperties(URL.prototype, { ctx.flags &= ~URL_FLAGS_HAS_FRAGMENT; return; } - if (hash[0] === '#') hash = hash.slice(1); + if (hash[0] === '#') hash = StringPrototypeSlice(hash, 1); ctx.fragment = ''; ctx.flags |= URL_FLAGS_HAS_FRAGMENT; - parse(hash, kFragment, null, ctx, onParseHashComplete.bind(this)); + parse(hash, kFragment, null, ctx, + FunctionPrototypeBind(onParseHashComplete, this)); } }, toJSON: { @@ -730,7 +753,7 @@ function parseParams(qs) { let encodeCheck = 0; let i; for (i = 0; i < qs.length; ++i) { - const code = qs.charCodeAt(i); + const code = StringPrototypeCharCodeAt(qs, i); // Try matching key/value pair separator if (code === CHAR_AMPERSAND) { @@ -778,7 +801,7 @@ function parseParams(qs) { // Handle + and percent decoding. if (code === CHAR_PLUS) { if (lastPos < i) - buf += qs.slice(lastPos, i); + buf += StringPrototypeSlice(qs, lastPos, i); buf += ' '; lastPos = i + 1; } else if (!encoded) { @@ -806,14 +829,14 @@ function parseParams(qs) { return out; if (lastPos < i) - buf += qs.slice(lastPos, i); + buf += StringPrototypeSlice(qs, lastPos, i); if (encoded) buf = querystring.unescape(buf); - out.push(buf); + ArrayPrototypePush(out, buf); // If `buf` is the key, add an empty value. if (!seenSep) - out.push(''); + ArrayPrototypePush(out, ''); return out; } @@ -927,7 +950,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { name = toUSVString(name); value = toUSVString(value); - this[searchParams].push(name, value); + ArrayPrototypePush(this[searchParams], name, value); update(this[context], this); }, @@ -1041,7 +1064,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { // Otherwise, append a new name-value pair whose name is `name` and value // is `value`, to `list`. if (!found) { - list.push(name, value); + ArrayPrototypePush(list, name, value); } update(this[context], this); @@ -1227,24 +1250,28 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { kind, index } = this[context]; - const output = target[searchParams].slice(index).reduce((prev, cur, i) => { - const key = i % 2 === 0; - if (kind === 'key' && key) { - prev.push(cur); - } else if (kind === 'value' && !key) { - prev.push(cur); - } else if (kind === 'key+value' && !key) { - prev.push([target[searchParams][index + i - 1], cur]); - } - return prev; - }, []); + const output = ArrayPrototypeReduce( + ArrayPrototypeSlice(target[searchParams], index), + (prev, cur, i) => { + const key = i % 2 === 0; + if (kind === 'key' && key) { + ArrayPrototypePush(prev, cur); + } else if (kind === 'value' && !key) { + ArrayPrototypePush(prev, cur); + } else if (kind === 'key+value' && !key) { + ArrayPrototypePush(prev, [target[searchParams][index + i - 1], cur]); + } + return prev; + }, + [] + ); const breakLn = inspect(output, innerOpts).includes('\n'); - const outputStrs = output.map((p) => inspect(p, innerOpts)); + const outputStrs = ArrayPrototypeMap(output, (p) => inspect(p, innerOpts)); let outputStr; if (breakLn) { - outputStr = `\n ${outputStrs.join(',\n ')}`; + outputStr = `\n ${ArrayPrototypeJoin(outputStrs, ',\n ')}`; } else { - outputStr = ` ${outputStrs.join(', ')}`; + outputStr = ` ${ArrayPrototypeJoin(outputStrs, ', ')}`; } return `${this[SymbolToStringTag]} {${outputStr} }`; } @@ -1272,8 +1299,9 @@ function domainToUnicode(domain) { function urlToOptions(url) { const options = { protocol: url.protocol, - hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? - url.hostname.slice(1, -1) : + hostname: typeof url.hostname === 'string' && + StringPrototypeStartsWith(url.hostname, '[') ? + StringPrototypeSlice(url.hostname, 1, -1) : url.hostname, hash: url.hash, search: url.search, @@ -1373,25 +1401,25 @@ const carriageReturnRegEx = /\r/g; const tabRegEx = /\t/g; function encodePathChars(filepath) { - if (filepath.includes('%')) - filepath = filepath.replace(percentRegEx, '%25'); + if (StringPrototypeIncludes(filepath, '%')) + filepath = StringPrototypeReplace(filepath, percentRegEx, '%25'); // In posix, backslash is a valid character in paths: - if (!isWindows && filepath.includes('\\')) - filepath = filepath.replace(backslashRegEx, '%5C'); - if (filepath.includes('\n')) - filepath = filepath.replace(newlineRegEx, '%0A'); - if (filepath.includes('\r')) - filepath = filepath.replace(carriageReturnRegEx, '%0D'); - if (filepath.includes('\t')) - filepath = filepath.replace(tabRegEx, '%09'); + if (!isWindows && StringPrototypeIncludes(filepath, '\\')) + filepath = StringPrototypeReplace(filepath, backslashRegEx, '%5C'); + if (StringPrototypeIncludes(filepath, '\n')) + filepath = StringPrototypeReplace(filepath, newlineRegEx, '%0A'); + if (StringPrototypeIncludes(filepath, '\r')) + filepath = StringPrototypeReplace(filepath, carriageReturnRegEx, '%0D'); + if (StringPrototypeIncludes(filepath, '\t')) + filepath = StringPrototypeReplace(filepath, tabRegEx, '%09'); return filepath; } function pathToFileURL(filepath) { const outURL = new URL('file://'); - if (isWindows && filepath.startsWith('\\\\')) { + if (isWindows && StringPrototypeStartsWith(filepath, '\\\\')) { // UNC path format: \\server\share\resource - const paths = filepath.split('\\'); + const paths = StringPrototypeSplit(filepath, '\\'); if (paths.length <= 3) { throw new ERR_INVALID_ARG_VALUE( 'filepath', @@ -1408,11 +1436,13 @@ function pathToFileURL(filepath) { ); } outURL.hostname = domainToASCII(hostname); - outURL.pathname = encodePathChars(paths.slice(3).join('/')); + outURL.pathname = encodePathChars( + ArrayPrototypeJoin(ArrayPrototypeSlice(paths, 3), '/')); } else { let resolved = path.resolve(filepath); // path.resolve strips trailing slashes so we must add them back - const filePathLast = filepath.charCodeAt(filepath.length - 1); + const filePathLast = StringPrototypeCharCodeAt(filepath, + filepath.length - 1); if ((filePathLast === CHAR_FORWARD_SLASH || (isWindows && filePathLast === CHAR_BACKWARD_SLASH)) && resolved[resolved.length - 1] !== path.sep) From ec3e841f59473ee68f97452fdb3ee403f2422220 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Fri, 18 Dec 2020 18:21:58 +0800 Subject: [PATCH 027/161] lib: refactor to use primordials in internal/priority_queue.js PR-URL: https://github.com/nodejs/node/pull/36560 Reviewed-By: Antoine du Hamel Reviewed-By: Pooja D P Reviewed-By: Rich Trott --- lib/internal/priority_queue.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/priority_queue.js b/lib/internal/priority_queue.js index c31c1eea385857..a0a18f7301e3b7 100644 --- a/lib/internal/priority_queue.js +++ b/lib/internal/priority_queue.js @@ -2,6 +2,7 @@ const { Array, + ArrayPrototypeIndexOf, Symbol, } = primordials; @@ -106,7 +107,7 @@ module.exports = class PriorityQueue { remove(value) { const heap = this[kHeap]; - const pos = heap.indexOf(value); + const pos = ArrayPrototypeIndexOf(heap, value); if (pos < 1) return false; From b367d5a61d3327561121669494f2b61046812549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 19 Dec 2020 10:27:54 +0100 Subject: [PATCH 028/161] tools: update gyp-next to v0.7.0 Refs: https://github.com/nodejs/gyp-next/releases/tag/v0.7.0 PR-URL: https://github.com/nodejs/node/pull/36580 Reviewed-By: Richard Lau Reviewed-By: Rich Trott Reviewed-By: Ujjwal Sharma --- tools/gyp/CHANGELOG.md | 19 +++++++ tools/gyp/pylib/gyp/generator/cmake.py | 4 +- tools/gyp/pylib/gyp/generator/msvs.py | 8 +-- tools/gyp/pylib/gyp/input.py | 2 +- tools/gyp/pylib/gyp/xcode_emulation.py | 69 ++++++++++++++------------ tools/gyp/setup.py | 2 +- tools/js2c.py | 2 +- 7 files changed, 62 insertions(+), 44 deletions(-) mode change 100755 => 100644 tools/gyp/setup.py diff --git a/tools/gyp/CHANGELOG.md b/tools/gyp/CHANGELOG.md index 53c922b6c903f8..79403676950671 100644 --- a/tools/gyp/CHANGELOG.md +++ b/tools/gyp/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [0.7.0](https://www.github.com/nodejs/gyp-next/compare/v0.6.2...v0.7.0) (2020-12-17) + + +### ⚠ BREAKING CHANGES + +* **msvs:** On Windows, arguments passed to the "action" commands are no longer transformed to replace slashes with backslashes. + +### Features + +* **xcode:** --cross-compiling overrides arch-specific settings ([973bae0](https://www.github.com/nodejs/gyp-next/commit/973bae0b7b08be7b680ecae9565fbd04b3e0787d)) + + +### Bug Fixes + +* **msvs:** do not fix paths in action command arguments ([fc22f83](https://www.github.com/nodejs/gyp-next/commit/fc22f8335e2016da4aae4f4233074bd651d2faea)) +* cmake on python 3 ([fd61f5f](https://www.github.com/nodejs/gyp-next/commit/fd61f5faa5275ec8fc98e3c7868c0dd46f109540)) +* ValueError: invalid mode: 'rU' while trying to load binding.gyp ([d0504e6](https://www.github.com/nodejs/gyp-next/commit/d0504e6700ce48f44957a4d5891b142a60be946f)) +* xcode cmake parsing ([eefe8d1](https://www.github.com/nodejs/gyp-next/commit/eefe8d10e99863bc4ac7e2ed32facd608d400d4b)) + ### [0.6.2](https://www.github.com/nodejs/gyp-next/compare/v0.6.1...v0.6.2) (2020-10-16) diff --git a/tools/gyp/pylib/gyp/generator/cmake.py b/tools/gyp/pylib/gyp/generator/cmake.py index f5ceacfca364ce..75f5822369735a 100644 --- a/tools/gyp/pylib/gyp/generator/cmake.py +++ b/tools/gyp/pylib/gyp/generator/cmake.py @@ -41,7 +41,7 @@ try: # maketrans moved to str in python3. _maketrans = string.maketrans -except NameError: +except (NameError, AttributeError): _maketrans = str.maketrans generator_default_variables = { @@ -1047,7 +1047,7 @@ def WriteTarget( # XCode settings xcode_settings = config.get("xcode_settings", {}) - for xcode_setting, xcode_value in xcode_settings.viewitems(): + for xcode_setting, xcode_value in xcode_settings.items(): SetTargetProperty( output, cmake_target_name, diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index 32bf4746a179cb..96283b275756e5 100644 --- a/tools/gyp/pylib/gyp/generator/msvs.py +++ b/tools/gyp/pylib/gyp/generator/msvs.py @@ -423,13 +423,7 @@ def _BuildCommandLineForRuleRaw( # file out of the raw command string, and some commands (like python) are # actually batch files themselves. command.insert(0, "call") - # Fix the paths - # TODO(quote): This is a really ugly heuristic, and will miss path fixing - # for arguments like "--arg=path" or "/opt:path". - # If the argument starts with a slash or dash, it's probably a command line - # switch - arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]] - arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments] + arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in cmd[1:]] arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] if quote_cmd: # Support a mode for using cmd directly. diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py index 5504390c0bb33f..90397762404a7c 100644 --- a/tools/gyp/pylib/gyp/input.py +++ b/tools/gyp/pylib/gyp/input.py @@ -231,7 +231,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check # Open the build file for read ('r') with universal-newlines mode ('U') # to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n' # which otherwise will fail eval() - if sys.platform == "zos": + if PY3 or sys.platform == "zos": # On z/OS, universal-newlines mode treats the file as an ascii file. # But since node-gyp produces ebcdic files, do not use that mode. build_file_contents = open(build_file_path, "r").read() diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py index 8af2b39f9a1479..a79aaa41fbcee8 100644 --- a/tools/gyp/pylib/gyp/xcode_emulation.py +++ b/tools/gyp/pylib/gyp/xcode_emulation.py @@ -654,28 +654,32 @@ def GetCflags(self, configname, arch=None): self._WarnUnimplemented("MACH_O_TYPE") self._WarnUnimplemented("PRODUCT_TYPE") - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented("ARCHS") - archs = ["i386"] - cflags.append("-arch " + archs[0]) - - if archs[0] in ("i386", "x86_64"): - if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse3") - if self._Test( - "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" - ): - cflags.append("-mssse3") # Note 3rd 's'. - if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse4.1") - if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse4.2") + # If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific + # additions and assume these will be provided as required via CC_host, + # CXX_host, CC_target and CXX_target. + if not gyp.common.CrossCompileRequested(): + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented("ARCHS") + archs = ["i386"] + cflags.append("-arch " + archs[0]) + + if archs[0] in ("i386", "x86_64"): + if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse3") + if self._Test( + "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" + ): + cflags.append("-mssse3") # Note 3rd 's'. + if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse4.1") + if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse4.2") cflags += self._Settings().get("WARNING_CFLAGS", []) @@ -938,16 +942,17 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): + gyp_to_build_path(self._Settings()["ORDER_FILE"]) ) - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented("ARCHS") - archs = ["i386"] - ldflags.append("-arch " + archs[0]) + if not gyp.common.CrossCompileRequested(): + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented("ARCHS") + archs = ["i386"] + ldflags.append("-arch " + archs[0]) # Xcode adds the product directory by default. # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 diff --git a/tools/gyp/setup.py b/tools/gyp/setup.py old mode 100755 new mode 100644 index d1869c1b52055f..766a7651ba09f5 --- a/tools/gyp/setup.py +++ b/tools/gyp/setup.py @@ -15,7 +15,7 @@ setup( name="gyp-next", - version="0.6.2", + version="0.7.0", description="A fork of the GYP build system for use in the Node.js projects", long_description=long_description, long_description_content_type="text/markdown", diff --git a/tools/js2c.py b/tools/js2c.py index 0f073e182bdb28..dd3ff9d5ca9f98 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -123,7 +123,7 @@ def AddModule(filename, definitions, initializers): initializers.append(initializer) def NormalizeFileName(filename): - split = filename.split(os.path.sep) + split = filename.split('/') if split[0] == 'deps': split = ['internal'] + split else: # `lib/**/*.js` so drop the 'lib' part From 1ed517c1765e577b8356877557aa128770a57123 Mon Sep 17 00:00:00 2001 From: Michael Chen <4326639+mcgitty@users.noreply.github.com> Date: Thu, 3 Dec 2020 11:40:58 -0800 Subject: [PATCH 029/161] doc: document return value of https.request Add missing topic about what https.request() returns. PR-URL: https://github.com/nodejs/node/pull/36370 Reviewed-By: Rich Trott Reviewed-By: Pooja D P --- doc/api/https.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/https.md b/doc/api/https.md index b322c3ee147909..f4c1f0487a779a 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -275,6 +275,7 @@ changes: * `port` **Default:** `443` * `agent` **Default:** `https.globalAgent` * `callback` {Function} +* Returns: {http.ClientRequest} Makes a request to a secure web server. @@ -288,6 +289,10 @@ The following additional `options` from [`tls.connect()`][] are also accepted: string, it is automatically parsed with [`new URL()`][]. If it is a [`URL`][] object, it will be automatically converted to an ordinary `options` object. +`https.request()` returns an instance of the [`http.ClientRequest`][] +class. The `ClientRequest` instance is a writable stream. If one needs to +upload a file with a POST request, then write to the `ClientRequest` object. + ```js const https = require('https'); @@ -458,6 +463,7 @@ headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; p [`URL`]: url.md#url_the_whatwg_url_api [`http.Agent(options)`]: http.md#http_new_agent_options [`http.Agent`]: http.md#http_class_http_agent +[`http.ClientRequest`]: http.md#http_class_http_clientrequest [`http.Server#headersTimeout`]: http.md#http_server_headerstimeout [`http.Server#keepAliveTimeout`]: http.md#http_server_keepalivetimeout [`http.Server#maxHeadersCount`]: http.md#http_server_maxheaderscount From 6e338dac3c68da0c265a3972cc78b7f263f170b1 Mon Sep 17 00:00:00 2001 From: raisinten Date: Fri, 11 Dec 2020 20:04:02 +0530 Subject: [PATCH 030/161] lib: refactor to use more primordials in internal/encoding.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36480 Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott Reviewed-By: Pooja D P Reviewed-By: Antoine du Hamel --- lib/internal/encoding.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 5226bf518dac38..78ec2ca1043cf6 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -4,10 +4,11 @@ // https://encoding.spec.whatwg.org const { - Map, ObjectCreate, ObjectDefineProperties, ObjectGetOwnPropertyDescriptors, + SafeMap, + StringPrototypeSlice, Symbol, SymbolToStringTag, Uint32Array, @@ -73,7 +74,7 @@ const CONVERTER_FLAGS_IGNORE_BOM = 0x4; const empty = new Uint8Array(0); -const encodings = new Map([ +const encodings = new SafeMap([ ['unicode-1-1-utf-8', 'utf-8'], ['utf8', 'utf-8'], ['utf-8', 'utf-8'], @@ -308,7 +309,7 @@ function trimAsciiWhitespace(label) { label[e - 1] === '\u0020')) { e--; } - return label.slice(s, e); + return StringPrototypeSlice(label, s, e); } function getEncodingFromLabel(label) { @@ -503,7 +504,7 @@ function makeTextDecoderJS() { // If the very first result in the stream is a BOM, and we are not // explicitly told to ignore it, then we discard it. if (result[0] === '\ufeff') { - result = result.slice(1); + result = StringPrototypeSlice(result, 1); } this[kBOMSeen] = true; } From f623d5d3776eaec2ec61360b793a03fc99f21276 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 23 Dec 2020 05:22:21 -0800 Subject: [PATCH 031/161] doc: use _code name_ rather than _codename_ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is excrutiatingly minor, but every authoritative resource I've checked (which is to say, a few dictionaries) uses "code name" primarily or exclusively. Let's follow suit. PR-URL: https://github.com/nodejs/node/pull/36611 Reviewed-By: Michaël Zasso Reviewed-By: Michael Dawson Reviewed-By: Richard Lau Reviewed-By: Benjamin Gruenbaum --- README.md | 2 +- doc/api/process.md | 7 +++---- doc/guides/releases.md | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 35db3c9d275276..512cd485b8f57a 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Looking for help? Check out the * **LTS**: Releases that receive Long-term Support, with a focus on stability and security. Every even-numbered major version will become an LTS release. LTS releases receive 12 months of _Active LTS_ support and a further 18 months - of _Maintenance_. LTS release lines have alphabetically-ordered codenames, + of _Maintenance_. LTS release lines have alphabetically-ordered code names, beginning with v4 Argon. There are no breaking changes or feature additions, except in some special circumstances. * **Nightly**: Code from the Current branch built every 24-hours when there are diff --git a/doc/api/process.md b/doc/api/process.md index 5665deab898573..8f7a98503a6d48 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1782,12 +1782,11 @@ tarball. * `lts` {string} a string label identifying the [LTS][] label for this release. This property only exists for LTS releases and is `undefined` for all other release types, including _Current_ releases. - Valid values include the LTS Release Codenames (including those - that are no longer supported). A non-exhaustive example of - these codenames includes: + Valid values include the LTS Release code names (including those + that are no longer supported). * `'Dubnium'` for the 10.x LTS line beginning with 10.13.0. * `'Erbium'` for the 12.x LTS line beginning with 12.13.0. - For other LTS Release Codenames, see [Node.js Changelog Archive](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_ARCHIVE.md) + For other LTS Release code names, see [Node.js Changelog Archive](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_ARCHIVE.md) ```js diff --git a/doc/guides/releases.md b/doc/guides/releases.md index 5444f2d364554e..903b31c744abc2 100644 --- a/doc/guides/releases.md +++ b/doc/guides/releases.md @@ -497,7 +497,7 @@ $ git secure-tag -sm "YYYY-MM-DD Node.js vx.y.z ( Date: Thu, 24 Dec 2020 15:51:23 -0800 Subject: [PATCH 032/161] test: increase runInAsyncScope() coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't appear to have any test coverage for passing the `thisArg` argument to `runInAsyncScope()`. Test coverage stats seem to bear this out. Add a test for it. PR-URL: https://github.com/nodejs/node/pull/36624 Reviewed-By: Antoine du Hamel Reviewed-By: Michaël Zasso --- ...t-async-hooks-run-in-async-scope-this-arg.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/parallel/test-async-hooks-run-in-async-scope-this-arg.js diff --git a/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js b/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js new file mode 100644 index 00000000000000..a5016da9d5fcd3 --- /dev/null +++ b/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js @@ -0,0 +1,17 @@ +'use strict'; + +// Test that passing thisArg to runInAsyncScope() works. + +const common = require('../common'); +const assert = require('assert'); +const { AsyncResource } = require('async_hooks'); + +const thisArg = {}; + +const res = new AsyncResource('fhqwhgads'); + +function callback() { + assert.strictEqual(this, thisArg); +} + +res.runInAsyncScope(common.mustCall(callback), thisArg); From 34d1d791e56e0d2053af6a8eb483edeec0e57609 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 24 Dec 2020 16:14:43 -0800 Subject: [PATCH 033/161] test: improve coverage for util.inspect() with classes Refs: https://github.com/nodejs/node/pull/36622#pullrequestreview-558721102 PR-URL: https://github.com/nodejs/node/pull/36625 Reviewed-By: Antoine du Hamel Reviewed-By: Benjamin Gruenbaum --- test/parallel/test-util-inspect.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index b14cab3d13358a..ad8da0a7a47e9d 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -2011,6 +2011,11 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); rest[rest.length - 1] = rest[rest.length - 1].slice(0, -1); rest.length = 1; } + Object.setPrototypeOf(clazz, Map.prototype); + assert.strictEqual( + util.inspect(clazz), + ['[class', name, '[Map]', ...rest].join(' ') + ']' + ); Object.setPrototypeOf(clazz, null); assert.strictEqual( util.inspect(clazz), From 8ad3455ae3738d6e5e6e9fb7de996f2a34ac7c75 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 25 Dec 2020 05:05:28 -0800 Subject: [PATCH 034/161] tools: revise install.py for minor improvements * Use an with block for reading the config file. Refs: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files * Use explicit blank return to make it clear that the return value is not actually used and that it is being used for flow control only.. PR-URL: https://github.com/nodejs/node/pull/36626 Reviewed-By: Antoine du Hamel Reviewed-By: Christian Clauss --- tools/install.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/install.py b/tools/install.py index 729b416fc47d3f..693faff4c37ac4 100755 --- a/tools/install.py +++ b/tools/install.py @@ -19,8 +19,8 @@ def abspath(*args): return os.path.abspath(path) def load_config(): - s = open('config.gypi').read() - return ast.literal_eval(s) + with open('config.gypi') as f: + return ast.literal_eval(f.read()) def try_unlink(path): try: @@ -223,11 +223,19 @@ def run(args): cmd = args[1] if len(args) > 1 else 'install' if os.environ.get('HEADERS_ONLY'): - if cmd == 'install': return headers(install) - if cmd == 'uninstall': return headers(uninstall) + if cmd == 'install': + headers(install) + return + if cmd == 'uninstall': + headers(uninstall) + return else: - if cmd == 'install': return files(install) - if cmd == 'uninstall': return files(uninstall) + if cmd == 'install': + files(install) + return + if cmd == 'uninstall': + files(uninstall) + return raise RuntimeError('Bad command: %s\n' % cmd) From ff4674b03376f9e3ef95c194b9aba7f8f6393671 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 25 Dec 2020 06:21:09 -0800 Subject: [PATCH 035/161] doc: correct callback parameter type for createPushResponse() Refs: https://github.com/nodejs/node/issues/22322#issuecomment-749348347 PR-URL: https://github.com/nodejs/node/pull/36631 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca --- doc/api/http2.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index ddb5658d25367f..a89a87a94ee1a4 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3691,7 +3691,8 @@ added: v8.4.0 has been rejected, or the state of `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method * `err` {Error} - * `stream` {ServerHttp2Stream} The newly-created `ServerHttp2Stream` object + * `res` {http2.Http2ServerResponse} The newly-created `Http2ServerResponse` + object Call [`http2stream.pushStream()`][] with the given headers, and wrap the given [`Http2Stream`][] on a newly created `Http2ServerResponse` as the callback From 8a0cdb3b4eb5f88dcab5e42fbf429386c4ae8a88 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 25 Dec 2020 06:23:32 -0800 Subject: [PATCH 036/161] doc: alphabetize http response properties All the properties are already in alphabetical order except for createPushResponse(). Move that property to the alphabetical location in the list. PR-URL: https://github.com/nodejs/node/pull/36631 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca --- doc/api/http2.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index a89a87a94ee1a4..ec6a6381d7eb75 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3283,6 +3283,25 @@ deprecated: v13.0.0 See [`response.socket`][]. +#### `response.createPushResponse(headers, callback)` + + +* `headers` {HTTP/2 Headers Object} An object describing the headers +* `callback` {Function} Called once `http2stream.pushStream()` is finished, + or either when the attempt to create the pushed `Http2Stream` has failed or + has been rejected, or the state of `Http2ServerRequest` is closed prior to + calling the `http2stream.pushStream()` method + * `err` {Error} + * `res` {http2.Http2ServerResponse} The newly-created `Http2ServerResponse` + object + +Call [`http2stream.pushStream()`][] with the given headers, and wrap the +given [`Http2Stream`][] on a newly created `Http2ServerResponse` as the callback +parameter if successful. When `Http2ServerRequest` is closed, the callback is +called with an error `ERR_HTTP2_INVALID_STREAM`. + #### `response.end([data[, encoding]][, callback])` - -* `headers` {HTTP/2 Headers Object} An object describing the headers -* `callback` {Function} Called once `http2stream.pushStream()` is finished, - or either when the attempt to create the pushed `Http2Stream` has failed or - has been rejected, or the state of `Http2ServerRequest` is closed prior to - calling the `http2stream.pushStream()` method - * `err` {Error} - * `res` {http2.Http2ServerResponse} The newly-created `Http2ServerResponse` - object - -Call [`http2stream.pushStream()`][] with the given headers, and wrap the -given [`Http2Stream`][] on a newly created `Http2ServerResponse` as the callback -parameter if successful. When `Http2ServerRequest` is closed, the callback is -called with an error `ERR_HTTP2_INVALID_STREAM`. - ## Collecting HTTP/2 performance metrics The [Performance Observer][] API can be used to collect basic performance From 8b7336b0728d1dacbe616db8d6007f5bdebc1f0f Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Tue, 22 Dec 2020 23:23:23 +0800 Subject: [PATCH 037/161] quic,timers: refactor to use validateAbortSignal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36604 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott Reviewed-By: Juan José Arboleda Reviewed-By: Richard Lau --- lib/internal/quic/core.js | 7 +++---- lib/timers/promises.js | 28 ++++++++++------------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js index d6f94ed831a982..0c326872a7a2ea 100644 --- a/lib/internal/quic/core.js +++ b/lib/internal/quic/core.js @@ -204,6 +204,7 @@ const { } = require('internal/histogram'); const { + validateAbortSignal, validateBoolean, validateInteger, validateObject, @@ -680,8 +681,7 @@ class QuicEndpoint { return this.address; const { signal } = { ...options }; - if (signal != null && !('aborted' in signal)) - throw new ERR_INVALID_ARG_TYPE('options.signal', 'AbortSignal', signal); + validateAbortSignal(signal, 'options.signal'); // If an AbortSignal was passed in, check to make sure it is not already // aborted before we continue on to do any work. @@ -1083,8 +1083,7 @@ class QuicSocket extends EventEmitter { return; const { signal } = { ...options }; - if (signal != null && !('aborted' in signal)) - throw new ERR_INVALID_ARG_TYPE('options.signal', 'AbortSignal', signal); + validateAbortSignal(signal, 'options.signal'); // If an AbotSignal was passed in, check to make sure it is not already // aborted before we continue on to do any work. diff --git a/lib/timers/promises.js b/lib/timers/promises.js index 76713bcf603342..55d554bb838e95 100644 --- a/lib/timers/promises.js +++ b/lib/timers/promises.js @@ -18,6 +18,8 @@ const { codes: { ERR_INVALID_ARG_TYPE } } = require('internal/errors'); +const { validateAbortSignal } = require('internal/validators'); + function cancelListenerHandler(clear, reject) { if (!this._destroyed) { clear(this); @@ -35,15 +37,10 @@ function setTimeout(after, value, options = {}) { options)); } const { signal, ref = true } = options; - if (signal !== undefined && - (signal === null || - typeof signal !== 'object' || - !('aborted' in signal))) { - return PromiseReject( - new ERR_INVALID_ARG_TYPE( - 'options.signal', - 'AbortSignal', - signal)); + try { + validateAbortSignal(signal, 'options.signal'); + } catch (err) { + return PromiseReject(err); } if (typeof ref !== 'boolean') { return PromiseReject( @@ -85,15 +82,10 @@ function setImmediate(value, options = {}) { options)); } const { signal, ref = true } = options; - if (signal !== undefined && - (signal === null || - typeof signal !== 'object' || - !('aborted' in signal))) { - return PromiseReject( - new ERR_INVALID_ARG_TYPE( - 'options.signal', - 'AbortSignal', - signal)); + try { + validateAbortSignal(signal, 'options.signal'); + } catch (err) { + return PromiseReject(err); } if (typeof ref !== 'boolean') { return PromiseReject( From 9156f430b5889623b5a8ebef9059ec7212a31b8a Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Fri, 25 Dec 2020 22:22:33 +0800 Subject: [PATCH 038/161] http: remove dead code from internal/http.js PR-URL: https://github.com/nodejs/node/pull/36630 Refs: https://github.com/nodejs/node/pull/32329 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- lib/internal/http.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/internal/http.js b/lib/internal/http.js index 0065f93fd896f0..081f13c0b95e91 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -11,14 +11,8 @@ const { const { setUnrefTimeout } = require('internal/timers'); const { PerformanceEntry, notify } = internalBinding('performance'); -let nowCache; let utcCache; -function nowDate() { - if (!nowCache) cache(); - return nowCache; -} - function utcDate() { if (!utcCache) cache(); return utcCache; @@ -26,13 +20,11 @@ function utcDate() { function cache() { const d = new Date(); - nowCache = DatePrototypeValueOf(d); - utcCache = DatePrototypeToUTCString(d); - setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d)); + utcCache = d.toUTCString(); + setUnrefTimeout(resetCache, 1000 - d.getMilliseconds()); } function resetCache() { - nowCache = undefined; utcCache = undefined; } @@ -55,7 +47,6 @@ function emitStatistics(statistics) { module.exports = { kOutHeaders: Symbol('kOutHeaders'), kNeedDrain: Symbol('kNeedDrain'), - nowDate, utcDate, emitStatistics }; From ffaa8c173555465d5a5fe018dfd7a14a1d8618f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Denis=20Gonthier?= Date: Tue, 6 Oct 2020 11:29:25 -0400 Subject: [PATCH 039/161] build: do not "exit" a script meant to be "source"d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running exit in a script meant to be sourced means the user shell will exit, which prevents seeing the error message, and is generally very annoying. Fix the "android-configure" script to use "return" instead of "exit". PR-URL: https://github.com/nodejs/node/pull/35520 Fixes: https://github.com/nodejs/node/issues/35519 Reviewed-By: Michaël Zasso --- android-configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android-configure b/android-configure index e3f4a721827e84..ecb13f399e4d5d 100755 --- a/android-configure +++ b/android-configure @@ -10,7 +10,7 @@ if [ $# -ne 3 ]; then echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version" - exit 1 + return 1 fi NDK_PATH=$1 @@ -44,7 +44,7 @@ case $ARCH in ;; *) echo "Unsupported architecture provided: $ARCH" - exit 1 + return 1 ;; esac @@ -58,7 +58,7 @@ major=$(echo $host_gcc_version | awk -F . '{print $1}') minor=$(echo $host_gcc_version | awk -F . '{print $2}') if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || [ $major -eq 6 -a $minor -lt 3 ]; then echo "host gcc $host_gcc_version is too old, need gcc 6.3.0" - exit 1 + return 1 fi SUFFIX="$TOOLCHAIN_NAME$ANDROID_SDK_VERSION" From a4d64f967a9b1dc7c24cee2ae1bac40693cd0056 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 17 Nov 2020 13:10:49 +0100 Subject: [PATCH 040/161] https: refactor to use more primordials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36195 Reviewed-By: Andrey Pechkurov Reviewed-By: Michaël Zasso --- lib/https.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/https.js b/lib/https.js index e1f0936b631ade..a7fcf06a95f273 100644 --- a/lib/https.js +++ b/lib/https.js @@ -22,9 +22,16 @@ 'use strict'; const { + ArrayPrototypeIndexOf, + ArrayPrototypePush, + ArrayPrototypeShift, + ArrayPrototypeSplice, + ArrayPrototypeUnshift, + FunctionPrototypeCall, + JSONStringify, ObjectAssign, ObjectSetPrototypeOf, - JSONStringify, + ReflectConstruct, } = primordials; require('internal/util').assertCrypto(); @@ -64,7 +71,7 @@ function Server(opts, requestListener) { this[kIncomingMessage] = opts.IncomingMessage || IncomingMessage; this[kServerResponse] = opts.ServerResponse || ServerResponse; - tls.Server.call(this, opts, _connectionListener); + FunctionPrototypeCall(tls.Server, this, opts, _connectionListener); this.httpAllowHalfOpen = false; @@ -150,7 +157,7 @@ function Agent(options) { if (!(this instanceof Agent)) return new Agent(options); - HttpAgent.call(this, options); + FunctionPrototypeCall(HttpAgent, this, options); this.defaultPort = 443; this.protocol = 'https:'; this.maxCachedSessions = this.options.maxCachedSessions; @@ -167,7 +174,7 @@ ObjectSetPrototypeOf(Agent, HttpAgent); Agent.prototype.createConnection = createConnection; Agent.prototype.getName = function getName(options) { - let name = HttpAgent.prototype.getName.call(this, options); + let name = FunctionPrototypeCall(HttpAgent.prototype.getName, this, options); name += ':'; if (options.ca) @@ -269,21 +276,21 @@ Agent.prototype._cacheSession = function _cacheSession(key, session) { // Put new entry if (this._sessionCache.list.length >= this.maxCachedSessions) { - const oldKey = this._sessionCache.list.shift(); + const oldKey = ArrayPrototypeShift(this._sessionCache.list); debug('evicting %j', oldKey); delete this._sessionCache.map[oldKey]; } - this._sessionCache.list.push(key); + ArrayPrototypePush(this._sessionCache.list, key); this._sessionCache.map[key] = session; }; Agent.prototype._evictSession = function _evictSession(key) { - const index = this._sessionCache.list.indexOf(key); + const index = ArrayPrototypeIndexOf(this._sessionCache.list, key); if (index === -1) return; - this._sessionCache.list.splice(index, 1); + ArrayPrototypeSplice(this._sessionCache.list, index, 1); delete this._sessionCache.map[key]; }; @@ -294,7 +301,7 @@ function request(...args) { let options = {}; if (typeof args[0] === 'string') { - const urlStr = args.shift(); + const urlStr = ArrayPrototypeShift(args); try { options = urlToOptions(new URL(urlStr)); } catch (err) { @@ -313,17 +320,17 @@ function request(...args) { } else if (args[0] && args[0][searchParamsSymbol] && args[0][searchParamsSymbol][searchParamsSymbol]) { // url.URL instance - options = urlToOptions(args.shift()); + options = urlToOptions(ArrayPrototypeShift(args)); } if (args[0] && typeof args[0] !== 'function') { - ObjectAssign(options, args.shift()); + ObjectAssign(options, ArrayPrototypeShift(args)); } options._defaultAgent = module.exports.globalAgent; - args.unshift(options); + ArrayPrototypeUnshift(args, options); - return new ClientRequest(...args); + return ReflectConstruct(ClientRequest, args); } function get(input, options, cb) { From 181bad58d31f81e18b641b9efb79839c00f3583a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 6 Dec 2020 12:04:41 +0100 Subject: [PATCH 041/161] lib: add primordials.SafeArrayIterator PR-URL: https://github.com/nodejs/node/pull/36532 Reviewed-By: Rich Trott --- lib/internal/event_target.js | 2 ++ lib/internal/modules/cjs/loader.js | 2 +- lib/internal/modules/esm/module_job.js | 9 +++++---- lib/internal/per_context/primordials.js | 7 +++++++ lib/internal/url.js | 4 ++-- lib/internal/util/debuglog.js | 5 +++-- test/parallel/test-require-delete-array-iterator.js | 13 +++++++++++++ 7 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 test/parallel/test-require-delete-array-iterator.js diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index cfc138d6dbf7cf..fd29b07bf6df02 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -13,6 +13,7 @@ const { ObjectGetOwnPropertyDescriptor, ObjectGetOwnPropertyDescriptors, ReflectApply, + SafeArrayIterator, SafeMap, String, Symbol, @@ -653,6 +654,7 @@ function defineEventHandler(emitter, name) { const EventEmitterMixin = (Superclass) => { class MixedEventEmitter extends Superclass { constructor(...args) { + args = new SafeArrayIterator(args); super(...args); FunctionPrototypeCall(EventEmitter, this); } diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 037d872e1d4fa1..b129e94d9890c0 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -462,7 +462,7 @@ function trySelf(parentPath, request) { const EXPORTS_PATTERN = /^((?:@[^/\\%]+\/)?[^./\\%][^/\\%]*)(\/.*)?$/; function resolveExports(nmPath, request) { // The implementation's behavior is meant to mirror resolution in ESM. - const [, name, expansion = ''] = + const { 1: name, 2: expansion = '' } = StringPrototypeMatch(request, EXPORTS_PATTERN) || []; if (!name) return; diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index 549d43cc20e119..5043da896622be 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -10,6 +10,7 @@ const { PromiseResolve, PromisePrototypeCatch, ReflectApply, + SafeArrayIterator, SafeSet, StringPrototypeIncludes, StringPrototypeMatch, @@ -60,9 +61,9 @@ class ModuleJob { }); if (promises !== undefined) - await PromiseAll(promises); + await PromiseAll(new SafeArrayIterator(promises)); - return PromiseAll(dependencyJobs); + return PromiseAll(new SafeArrayIterator(dependencyJobs)); }; // Promise for the list of all dependencyJobs. this.linked = link(); @@ -90,8 +91,8 @@ class ModuleJob { } jobsInGraph.add(moduleJob); const dependencyJobs = await moduleJob.linked; - return PromiseAll( - ArrayPrototypeMap(dependencyJobs, addJobsToDependencyGraph)); + return PromiseAll(new SafeArrayIterator( + ArrayPrototypeMap(dependencyJobs, addJobsToDependencyGraph))); }; await addJobsToDependencyGraph(this); diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index 68c36229825f73..7947c14cde8d39 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -242,6 +242,9 @@ primordials.SafeWeakSet = makeSafe( // Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object [ { name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) }, + { name: 'ArrayIterator', original: { + prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()), + } }, { name: 'StringIterator', original: { prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()), } }, @@ -253,6 +256,10 @@ primordials.SafeWeakSet = makeSafe( copyPrototype(original.prototype, primordials, `${name}Prototype`); }); +primordials.SafeArrayIterator = createSafeIterator( + primordials.ArrayPrototypeSymbolIterator, + primordials.ArrayIteratorPrototypeNext +); primordials.SafeStringIterator = createSafeIterator( primordials.StringPrototypeSymbolIterator, primordials.StringIteratorPrototypeNext diff --git a/lib/internal/url.js b/lib/internal/url.js index a15f19889800c5..d718dfa9d13d1f 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -446,8 +446,8 @@ ObjectDefineProperties(URL.prototype, { if (ctx.host === null && ctx.path.length > 1 && ctx.path[0] === '') { ret += '/.'; } - for (const segment of ctx.path) { - ret += '/' + segment; + if (ctx.path.length) { + ret += '/' + ArrayPrototypeJoin(ctx.path, '/'); } } if (options.search && ctx.query !== null) diff --git a/lib/internal/util/debuglog.js b/lib/internal/util/debuglog.js index a3b8a84772054e..46d3ed5613246e 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -6,6 +6,7 @@ const { ObjectDefineProperty, RegExp, RegExpPrototypeTest, + SafeArrayIterator, StringPrototypeToUpperCase } = primordials; @@ -78,7 +79,7 @@ function debuglog(set, cb) { debug = debuglogImpl(enabled, set); if (typeof cb === 'function') cb(debug); - debug(...args); + debug(...new SafeArrayIterator(args)); }; let enabled; let test = () => { @@ -86,7 +87,7 @@ function debuglog(set, cb) { test = () => enabled; return enabled; }; - const logger = (...args) => debug(...args); + const logger = (...args) => debug(...new SafeArrayIterator(args)); ObjectDefineProperty(logger, 'enabled', { get() { return test(); diff --git a/test/parallel/test-require-delete-array-iterator.js b/test/parallel/test-require-delete-array-iterator.js new file mode 100644 index 00000000000000..5424ef8b75da9d --- /dev/null +++ b/test/parallel/test-require-delete-array-iterator.js @@ -0,0 +1,13 @@ +'use strict'; + +const common = require('../common'); + + +const ArrayIteratorPrototype = + Object.getPrototypeOf(Array.prototype[Symbol.iterator]()); + +delete Array.prototype[Symbol.iterator]; +delete ArrayIteratorPrototype.next; + +require('../common/fixtures'); +import('../fixtures/es-modules/test-esm-ok.mjs').then(common.mustCall()); From f81556563aa4526a6448320b86edf79c04de7348 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Fri, 25 Dec 2020 21:48:31 +0800 Subject: [PATCH 042/161] test: increase coverage for internal/error_serdes.js test serializeError with getter property Refs: https://coverage.nodejs.org/coverage-73a21e4c06d5781d/lib/internal/error_serdes.js.html#L49 PR-URL: https://github.com/nodejs/node/pull/36628 Reviewed-By: Rich Trott Reviewed-By: Antoine du Hamel --- test/parallel/test-error-serdes.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/parallel/test-error-serdes.js b/test/parallel/test-error-serdes.js index f01dc0d6a8a81d..a65781c25eb261 100644 --- a/test/parallel/test-error-serdes.js +++ b/test/parallel/test-error-serdes.js @@ -49,3 +49,20 @@ assert.strictEqual(cycle(Function), '[Function: Function]'); assert.strictEqual(err.name, 'TypeError'); assert.strictEqual(err.code, 'ERR_INVALID_ARG_TYPE'); } + +{ + let called = false; + class DynamicError extends Error { + get type() { + called = true; + return 'dynamic'; + } + + get shouldIgnoreError() { + throw new Error(); + } + } + + serializeError(new DynamicError()); + assert.deepStrictEqual(called, true); +} From 857b98eed9026915e8bc021b1ff9094985b170d7 Mon Sep 17 00:00:00 2001 From: raisinten Date: Fri, 25 Dec 2020 19:29:46 +0530 Subject: [PATCH 043/161] build: fix unknown warning option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: unknown warning option '-Wno-int-in-bool-context'; did you mean '-Wno-gnu-include-next'? [-Wunknown-warning-option] 1 warning generated. The `-Wint-in-bool-context` diagnostic is not enabled by default, so no additional option is needed. PR-URL: https://github.com/nodejs/node/pull/36629 Reviewed-By: Rich Trott Reviewed-By: Michaël Zasso From 64bf2f229e14c667e7161cbb062f3aa9246aec4a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 16 Nov 2020 16:39:28 +0100 Subject: [PATCH 044/161] util: refactor to use more primordials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36265 Reviewed-By: Rich Trott Reviewed-By: Michaël Zasso --- lib/internal/util.js | 55 ++++++++------ lib/internal/util/comparisons.js | 34 +++++---- lib/internal/util/debuglog.js | 8 ++- lib/internal/util/inspect.js | 120 +++++++++++++++++++------------ lib/internal/util/inspector.js | 17 +++-- lib/util.js | 25 +++++-- 6 files changed, 162 insertions(+), 97 deletions(-) diff --git a/lib/internal/util.js b/lib/internal/util.js index f26ea970e8dce0..cd0edfe44ee13f 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -3,8 +3,11 @@ const { ArrayFrom, ArrayIsArray, + ArrayPrototypePop, + ArrayPrototypePush, + ArrayPrototypeSlice, + ArrayPrototypeSort, Error, - Map, ObjectCreate, ObjectDefineProperties, ObjectDefineProperty, @@ -13,8 +16,14 @@ const { ObjectGetPrototypeOf, ObjectSetPrototypeOf, Promise, + ReflectApply, ReflectConstruct, - Set, + RegExpPrototypeTest, + SafeMap, + SafeSet, + StringPrototypeReplace, + StringPrototypeToLowerCase, + StringPrototypeToUpperCase, Symbol, SymbolFor, } = primordials; @@ -40,12 +49,12 @@ const { isNativeError } = internalBinding('types'); const noCrypto = !process.versions.openssl; -const experimentalWarnings = new Set(); +const experimentalWarnings = new SafeSet(); const colorRegExp = /\u001b\[\d\d?m/g; // eslint-disable-line no-control-regex function removeColors(str) { - return str.replace(colorRegExp, ''); + return StringPrototypeReplace(str, colorRegExp, ''); } function isError(e) { @@ -57,7 +66,7 @@ function isError(e) { // Keep a list of deprecation codes that have been warned on so we only warn on // each one once. -const codesWarned = new Set(); +const codesWarned = new SafeSet(); // Mark that a method should not be used. // Returns a modified function which warns once by default. @@ -86,7 +95,7 @@ function deprecate(fn, msg, code) { if (new.target) { return ReflectConstruct(fn, args, new.target); } - return fn.apply(this, args); + return ReflectApply(fn, this, args); } // The wrapper will keep the same prototype as fn to maintain prototype chain @@ -132,12 +141,13 @@ function slowCases(enc) { case 4: if (enc === 'UTF8') return 'utf8'; if (enc === 'ucs2' || enc === 'UCS2') return 'utf16le'; - enc = `${enc}`.toLowerCase(); + enc = StringPrototypeToLowerCase(`${enc}`); if (enc === 'utf8') return 'utf8'; if (enc === 'ucs2') return 'utf16le'; break; case 3: - if (enc === 'hex' || enc === 'HEX' || `${enc}`.toLowerCase() === 'hex') + if (enc === 'hex' || enc === 'HEX' || + StringPrototypeToLowerCase(`${enc}`) === 'hex') return 'hex'; break; case 5: @@ -146,7 +156,7 @@ function slowCases(enc) { if (enc === 'UTF-8') return 'utf8'; if (enc === 'ASCII') return 'ascii'; if (enc === 'UCS-2') return 'utf16le'; - enc = `${enc}`.toLowerCase(); + enc = StringPrototypeToLowerCase(`${enc}`); if (enc === 'utf-8') return 'utf8'; if (enc === 'ascii') return 'ascii'; if (enc === 'ucs-2') return 'utf16le'; @@ -156,18 +166,18 @@ function slowCases(enc) { if (enc === 'latin1' || enc === 'binary') return 'latin1'; if (enc === 'BASE64') return 'base64'; if (enc === 'LATIN1' || enc === 'BINARY') return 'latin1'; - enc = `${enc}`.toLowerCase(); + enc = StringPrototypeToLowerCase(`${enc}`); if (enc === 'base64') return 'base64'; if (enc === 'latin1' || enc === 'binary') return 'latin1'; break; case 7: if (enc === 'utf16le' || enc === 'UTF16LE' || - `${enc}`.toLowerCase() === 'utf16le') + StringPrototypeToLowerCase(`${enc}`) === 'utf16le') return 'utf16le'; break; case 8: if (enc === 'utf-16le' || enc === 'UTF-16LE' || - `${enc}`.toLowerCase() === 'utf-16le') + StringPrototypeToLowerCase(`${enc}`) === 'utf-16le') return 'utf16le'; break; default: @@ -184,17 +194,17 @@ function emitExperimentalWarning(feature) { } function filterDuplicateStrings(items, low) { - const map = new Map(); + const map = new SafeMap(); for (let i = 0; i < items.length; i++) { const item = items[i]; - const key = item.toLowerCase(); + const key = StringPrototypeToLowerCase(item); if (low) { map.set(key, key); } else { map.set(key, item); } } - return ArrayFrom(map.values()).sort(); + return ArrayPrototypeSort(ArrayFrom(map.values())); } function cachedResult(fn) { @@ -202,7 +212,7 @@ function cachedResult(fn) { return () => { if (result === undefined) result = fn(); - return result.slice(); + return ArrayPrototypeSlice(result); }; } @@ -244,7 +254,7 @@ function convertToValidSignal(signal) { return signal; if (typeof signal === 'string') { - const signalName = signals[signal.toUpperCase()]; + const signalName = signals[StringPrototypeToUpperCase(signal)]; if (signalName) return signalName; } @@ -294,7 +304,7 @@ function promisify(original) { function fn(...args) { return new Promise((resolve, reject) => { - original.call(this, ...args, (err, ...values) => { + ArrayPrototypePush(args, (err, ...values) => { if (err) { return reject(err); } @@ -307,6 +317,7 @@ function promisify(original) { resolve(values[0]); } }); + ReflectApply(original, this, args); }); } @@ -343,7 +354,7 @@ function join(output, separator) { function spliceOne(list, index) { for (; index + 1 < list.length; index++) list[index] = list[index + 1]; - list.pop(); + ArrayPrototypePop(list); } const kNodeModulesRE = /^(.*)[\\/]node_modules[\\/]/; @@ -376,9 +387,9 @@ function isInsideNodeModules() { const filename = frame.getFileName(); // If a filename does not start with / or contain \, // it's likely from Node.js core. - if (!/^\/|\\/.test(filename)) + if (!RegExpPrototypeTest(/^\/|\\/, filename)) continue; - return kNodeModulesRE.test(filename); + return RegExpPrototypeTest(kNodeModulesRE, filename); } } return false; @@ -389,7 +400,7 @@ function once(callback) { return function(...args) { if (called) return; called = true; - callback.apply(this, args); + ReflectApply(callback, this, args); }; } diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 2c10f0c8929752..0bc46257e829fc 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -2,11 +2,12 @@ const { ArrayIsArray, + ArrayPrototypeFilter, + ArrayPrototypePush, BigIntPrototypeValueOf, BooleanPrototypeValueOf, DatePrototypeGetTime, Error, - Map, NumberIsNaN, NumberPrototypeValueOf, ObjectGetOwnPropertySymbols, @@ -16,10 +17,11 @@ const { ObjectPrototypeHasOwnProperty, ObjectPrototypePropertyIsEnumerable, ObjectPrototypeToString, - Set, + SafeMap, + SafeSet, StringPrototypeValueOf, SymbolPrototypeValueOf, - SymbolToStringTag, + TypedArrayPrototypeGetSymbolToStringTag, Uint8Array, } = primordials; @@ -126,7 +128,7 @@ function isEqualBoxedPrimitive(val1, val2) { function isIdenticalTypedArrayType(a, b) { // Fast path to reduce type checks in the common case. - const check = types[`is${a[SymbolToStringTag]}`]; + const check = types[`is${TypedArrayPrototypeGetSymbolToStringTag(a)}`]; if (check !== undefined && check(a)) { return check(b); } @@ -150,8 +152,9 @@ function isIdenticalTypedArrayType(a, b) { } /* c8 ignore next 4 */ assert.fail( - `Unknown TypedArray type checking ${a[SymbolToStringTag]} ${a}\n` + - `and ${b[SymbolToStringTag]} ${b}` + 'Unknown TypedArray type checking ' + + `${TypedArrayPrototypeGetSymbolToStringTag(a)} ${a}\n` + + `and ${TypedArrayPrototypeGetSymbolToStringTag(b)} ${b}` ); } @@ -291,7 +294,10 @@ function innerDeepEqual(val1, val2, strict, memos) { } function getEnumerables(val, keys) { - return keys.filter((k) => ObjectPrototypePropertyIsEnumerable(val, k)); + return ArrayPrototypeFilter( + keys, + (k) => ObjectPrototypePropertyIsEnumerable(val, k) + ); } function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { @@ -330,7 +336,7 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { if (!ObjectPrototypePropertyIsEnumerable(val2, key)) { return false; } - aKeys.push(key); + ArrayPrototypePush(aKeys, key); count++; } else if (ObjectPrototypePropertyIsEnumerable(val2, key)) { return false; @@ -360,8 +366,8 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { // Use memos to handle cycles. if (memos === undefined) { memos = { - val1: new Map(), - val2: new Map(), + val1: new SafeMap(), + val2: new SafeMap(), position: 0 }; } else { @@ -458,7 +464,7 @@ function setEquiv(a, b, strict, memo) { // to check this improves the worst case scenario instead. if (typeof val === 'object' && val !== null) { if (set === null) { - set = new Set(); + set = new SafeSet(); } // If the specified value doesn't exist in the second set its an not null // object (or non strict only: a not matching primitive) we'll need to go @@ -475,7 +481,7 @@ function setEquiv(a, b, strict, memo) { } if (set === null) { - set = new Set(); + set = new SafeSet(); } set.add(val); } @@ -521,7 +527,7 @@ function mapEquiv(a, b, strict, memo) { for (const [key, item1] of a) { if (typeof key === 'object' && key !== null) { if (set === null) { - set = new Set(); + set = new SafeSet(); } set.add(key); } else { @@ -537,7 +543,7 @@ function mapEquiv(a, b, strict, memo) { if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false; if (set === null) { - set = new Set(); + set = new SafeSet(); } set.add(key); } diff --git a/lib/internal/util/debuglog.js b/lib/internal/util/debuglog.js index 46d3ed5613246e..3dc7a5157d5e65 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -1,13 +1,15 @@ 'use strict'; const { + FunctionPrototype, FunctionPrototypeBind, ObjectCreate, ObjectDefineProperty, RegExp, RegExpPrototypeTest, SafeArrayIterator, - StringPrototypeToUpperCase + StringPrototypeToLowerCase, + StringPrototypeToUpperCase, } = primordials; const { inspect, format, formatWithOptions } = require('internal/util/inspect'); @@ -37,13 +39,13 @@ function initializeDebugEnv(debugEnv) { function emitWarningIfNeeded(set) { if ('HTTP' === set || 'HTTP2' === set) { process.emitWarning('Setting the NODE_DEBUG environment variable ' + - 'to \'' + set.toLowerCase() + '\' can expose sensitive ' + + 'to \'' + StringPrototypeToLowerCase(set) + '\' can expose sensitive ' + 'data (such as passwords, tokens and authentication headers) ' + 'in the resulting log.'); } } -function noop() {} +const noop = FunctionPrototype; function debuglogImpl(enabled, set) { if (debugImpls[set] === undefined) { diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 04b7b68c5d41c6..2672ccb50bfa1c 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -3,6 +3,10 @@ const { Array, ArrayIsArray, + ArrayPrototypeFilter, + ArrayPrototypePush, + ArrayPrototypeSort, + ArrayPrototypeUnshift, BigIntPrototypeValueOf, BooleanPrototypeValueOf, DatePrototypeGetTime, @@ -12,7 +16,6 @@ const { FunctionPrototypeCall, FunctionPrototypeToString, JSONStringify, - Map, MapPrototypeGetSize, MapPrototypeEntries, MathFloor, @@ -39,14 +42,27 @@ const { ObjectPrototypePropertyIsEnumerable, ObjectSeal, ObjectSetPrototypeOf, - ReflectApply, RegExp, + RegExpPrototypeTest, RegExpPrototypeToString, SafeStringIterator, - Set, + SafeMap, + SafeSet, SetPrototypeGetSize, SetPrototypeValues, String, + StringPrototypeCharCodeAt, + StringPrototypeCodePointAt, + StringPrototypeIncludes, + StringPrototypeNormalize, + StringPrototypePadEnd, + StringPrototypePadStart, + StringPrototypeRepeat, + StringPrototypeReplace, + StringPrototypeSlice, + StringPrototypeSplit, + StringPrototypeToLowerCase, + StringPrototypeTrim, StringPrototypeValueOf, SymbolPrototypeToString, SymbolPrototypeValueOf, @@ -120,8 +136,11 @@ const { NativeModule } = require('internal/bootstrap/loaders'); let hexSlice; -const builtInObjects = new Set( - ObjectGetOwnPropertyNames(global).filter((e) => /^[A-Z][a-zA-Z0-9]+$/.test(e)) +const builtInObjects = new SafeSet( + ArrayPrototypeFilter( + ObjectGetOwnPropertyNames(global), + (e) => RegExpPrototypeTest(/^[A-Z][a-zA-Z0-9]+$/, e) + ) ); // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot @@ -430,7 +449,7 @@ function addQuotes(str, quotes) { return `'${str}'`; } -const escapeFn = (str) => meta[str.charCodeAt(0)]; +const escapeFn = (str) => meta[StringPrototypeCharCodeAt(str)]; // Escape control characters, single quotes and the backslash. // This is similar to JSON stringify escaping. @@ -458,10 +477,10 @@ function strEscape(str) { } // Some magic numbers that worked out fine while benchmarking with v8 6.0 - if (str.length < 5000 && !escapeTest.test(str)) + if (str.length < 5000 && !RegExpPrototypeTest(escapeTest, str)) return addQuotes(str, singleQuote); if (str.length > 100) { - str = str.replace(escapeReplace, escapeFn); + str = StringPrototypeReplace(str, escapeReplace, escapeFn); return addQuotes(str, singleQuote); } @@ -477,14 +496,14 @@ function strEscape(str) { if (last === i) { result += meta[point]; } else { - result += `${str.slice(last, i)}${meta[point]}`; + result += `${StringPrototypeSlice(str, last, i)}${meta[point]}`; } last = i + 1; } } if (last !== lastIndex) { - result += str.slice(last); + result += StringPrototypeSlice(str, last); } return addQuotes(result, singleQuote); } @@ -588,7 +607,7 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) { } if (depth === 0) { - keySet = new Set(); + keySet = new SafeSet(); } else { keys.forEach((key) => keySet.add(key)); } @@ -661,7 +680,7 @@ function getKeys(value, showHidden) { } if (symbols.length !== 0) { const filter = (key) => ObjectPrototypePropertyIsEnumerable(value, key); - keys.push(...symbols.filter(filter)); + ArrayPrototypePush(keys, ...ArrayPrototypeFilter(symbols, filter)); } } return keys; @@ -751,7 +770,8 @@ function formatValue(ctx, value, recurseTimes, typedArray) { if (ctx.seen.includes(value)) { let index = 1; if (ctx.circular === undefined) { - ctx.circular = new Map([[value, index]]); + ctx.circular = new SafeMap(); + ctx.circular.set(value, index); } else { index = ctx.circular.get(value); if (index === undefined) { @@ -924,11 +944,11 @@ function formatRaw(ctx, value, recurseTimes, typedArray) { `{ byteLength: ${formatNumber(ctx.stylize, value.byteLength)} }`; } braces[0] = `${prefix}{`; - keys.unshift('byteLength'); + ArrayPrototypeUnshift(keys, 'byteLength'); } else if (isDataView(value)) { braces[0] = `${getPrefix(constructor, tag, 'DataView')}{`; // .buffer goes last, it's not a primitive like the others. - keys.unshift('byteLength', 'byteOffset', 'buffer'); + ArrayPrototypeUnshift(keys, 'byteLength', 'byteOffset', 'buffer'); } else if (isPromise(value)) { braces[0] = `${getPrefix(constructor, tag, 'Promise')}{`; formatter = formatPromise; @@ -1072,7 +1092,7 @@ function getBoxedBase(value, ctx, keys, constructor, tag) { } if (keys.length !== 0 || ctx.stylize === stylizeNoColor) return base; - return ctx.stylize(base, type.toLowerCase()); + return ctx.stylize(base, StringPrototypeToLowerCase(type)); } function getClassBase(value, constructor, tag) { @@ -1287,11 +1307,11 @@ function groupArrayElements(ctx, output, value) { lineMaxLength += separatorSpace; maxLineLength[i] = lineMaxLength; } - let order = 'padStart'; + let order = StringPrototypePadStart; if (value !== undefined) { for (let i = 0; i < output.length; i++) { if (typeof value[i] !== 'number' && typeof value[i] !== 'bigint') { - order = 'padEnd'; + order = StringPrototypePadEnd; break; } } @@ -1307,21 +1327,21 @@ function groupArrayElements(ctx, output, value) { // done line by line as some lines might contain more colors than // others. const padding = maxLineLength[j - i] + output[j].length - dataLen[j]; - str += `${output[j]}, `[order](padding, ' '); + str += order(`${output[j]}, `, padding, ' '); } - if (order === 'padStart') { + if (order === StringPrototypePadStart) { const padding = maxLineLength[j - i] + output[j].length - dataLen[j] - separatorSpace; - str += output[j].padStart(padding, ' '); + str += StringPrototypePadStart(output[j], padding, ' '); } else { str += output[j]; } - tmp.push(str); + ArrayPrototypePush(tmp, str); } if (ctx.maxArrayLength < output.length) { - tmp.push(output[outputLength]); + ArrayPrototypePush(tmp, output[outputLength]); } output = tmp; } @@ -1458,8 +1478,9 @@ function formatArrayBuffer(ctx, value) { } if (hexSlice === undefined) hexSlice = uncurryThis(require('buffer').Buffer.prototype.hexSlice); - let str = hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)) - .replace(/(.{2})/g, '$1 ').trim(); + let str = StringPrototypeTrim(StringPrototypeReplace( + hexSlice(buffer, 0, MathMin(ctx.maxArrayLength, buffer.length)), + /(.{2})/g, '$1 ')); const remaining = buffer.length - ctx.maxArrayLength; if (remaining > 0) str += ` ... ${remaining} more byte${remaining > 1 ? 's' : ''}`; @@ -1508,7 +1529,7 @@ function formatTypedArray(value, length, ctx, ignored, recurseTimes) { 'buffer' ]) { const str = formatValue(ctx, value[key], recurseTimes, true); - output.push(`[${key}]: ${str}`); + ArrayPrototypePush(output, `[${key}]: ${str}`); } ctx.indentationLvl -= 2; } @@ -1519,7 +1540,7 @@ function formatSet(value, ctx, ignored, recurseTimes) { const output = []; ctx.indentationLvl += 2; for (const v of value) { - output.push(formatValue(ctx, v, recurseTimes)); + ArrayPrototypePush(output, formatValue(ctx, v, recurseTimes)); } ctx.indentationLvl -= 2; return output; @@ -1539,7 +1560,7 @@ function formatMap(value, ctx, ignored, recurseTimes) { function formatSetIterInner(ctx, recurseTimes, entries, state) { const maxArrayLength = MathMax(ctx.maxArrayLength, 0); const maxLength = MathMin(maxArrayLength, entries.length); - let output = new Array(maxLength); + const output = new Array(maxLength); ctx.indentationLvl += 2; for (let i = 0; i < maxLength; i++) { output[i] = formatValue(ctx, entries[i], recurseTimes); @@ -1549,11 +1570,12 @@ function formatSetIterInner(ctx, recurseTimes, entries, state) { // Sort all entries to have a halfway reliable output (if more entries than // retrieved ones exist, we can not reliably return the same output) if the // output is not sorted anyway. - output = output.sort(); + ArrayPrototypeSort(output); } const remaining = entries.length - maxLength; if (remaining > 0) { - output.push(`... ${remaining} more item${remaining > 1 ? 's' : ''}`); + ArrayPrototypePush(output, + `... ${remaining} more item${remaining > 1 ? 's' : ''}`); } return output; } @@ -1661,7 +1683,7 @@ function formatProperty(ctx, value, recurseTimes, key, type, desc, (ctx.getters === 'get' && desc.set === undefined) || (ctx.getters === 'set' && desc.set !== undefined))) { try { - const tmp = ReflectApply(desc.get, original, []); + const tmp = FunctionPrototypeCall(desc.get, original); ctx.indentationLvl += 2; if (tmp === null) { str = `${s(`[${label}:`, sp)} ${s('null', 'null')}${s(']', sp)}`; @@ -1688,11 +1710,16 @@ function formatProperty(ctx, value, recurseTimes, key, type, desc, return str; } if (typeof key === 'symbol') { - const tmp = key.toString().replace(strEscapeSequencesReplacer, escapeFn); + const tmp = StringPrototypeReplace( + SymbolPrototypeToString(key), + strEscapeSequencesReplacer, escapeFn + ); name = `[${ctx.stylize(tmp, 'symbol')}]`; } else if (desc.enumerable === false) { - name = `[${key.replace(strEscapeSequencesReplacer, escapeFn)}]`; - } else if (keyStrRegExp.test(key)) { + const tmp = StringPrototypeReplace(key, + strEscapeSequencesReplacer, escapeFn); + name = `[${tmp}]`; + } else if (RegExpPrototypeTest(keyStrRegExp, key)) { name = ctx.stylize(key, 'name'); } else { name = ctx.stylize(strEscape(key), 'string'); @@ -1721,7 +1748,7 @@ function isBelowBreakLength(ctx, output, start, base) { } } // Do not line up properties on the same line if `base` contains line breaks. - return base === '' || !base.includes('\n'); + return base === '' || !StringPrototypeIncludes(base, '\n'); } function reduceToSingleString( @@ -1764,7 +1791,7 @@ function reduceToSingleString( } } // Line up each entry on an individual line. - const indentation = `\n${' '.repeat(ctx.indentationLvl)}`; + const indentation = `\n${StringPrototypeRepeat(' ', ctx.indentationLvl)}`; return `${base ? `${base} ` : ''}${braces[0]}${indentation} ` + `${join(output, `,${indentation} `)}${indentation}${braces[1]}`; } @@ -1774,7 +1801,7 @@ function reduceToSingleString( return `${braces[0]}${base ? ` ${base}` : ''} ${join(output, ', ')} ` + braces[1]; } - const indentation = ' '.repeat(ctx.indentationLvl); + const indentation = StringPrototypeRepeat(' ', ctx.indentationLvl); // If the opening "brace" is too large, like in the case of "Set {", // we need to force the first item to be on the next line or the // items will not line up correctly. @@ -1816,7 +1843,8 @@ function hasBuiltInToString(value) { builtInObjects.has(descriptor.value.name); } -const firstErrorLine = (error) => error.message.split('\n')[0]; +const firstErrorLine = (error) => + StringPrototypeSplit(error.message, '\n', 1)[0]; let CIRCULAR_ERROR_MESSAGE; function tryStringify(arg) { try { @@ -1864,8 +1892,8 @@ function formatWithOptionsInternal(inspectOptions, ...args) { let lastPos = 0; for (let i = 0; i < first.length - 1; i++) { - if (first.charCodeAt(i) === 37) { // '%' - const nextChar = first.charCodeAt(++i); + if (StringPrototypeCharCodeAt(first, i) === 37) { // '%' + const nextChar = StringPrototypeCharCodeAt(first, ++i); if (a + 1 !== args.length) { switch (nextChar) { case 115: // 's' @@ -1936,19 +1964,19 @@ function formatWithOptionsInternal(inspectOptions, ...args) { tempStr = ''; break; case 37: // '%' - str += first.slice(lastPos, i); + str += StringPrototypeSlice(first, lastPos, i); lastPos = i + 1; continue; default: // Any other character is not a correct placeholder continue; } if (lastPos !== i - 1) { - str += first.slice(lastPos, i - 1); + str += StringPrototypeSlice(first, lastPos, i - 1); } str += tempStr; lastPos = i + 1; } else if (nextChar === 37) { - str += first.slice(lastPos, i); + str += StringPrototypeSlice(first, lastPos, i); lastPos = i + 1; } } @@ -1957,7 +1985,7 @@ function formatWithOptionsInternal(inspectOptions, ...args) { a++; join = ' '; if (lastPos < first.length) { - str += first.slice(lastPos); + str += StringPrototypeSlice(first, lastPos); } } } @@ -2005,9 +2033,9 @@ if (internalBinding('config').hasIntl) { if (removeControlChars) str = stripVTControlCharacters(str); - str = str.normalize('NFC'); + str = StringPrototypeNormalize(str, 'NFC'); for (const char of new SafeStringIterator(str)) { - const code = char.codePointAt(0); + const code = StringPrototypeCodePointAt(char, 0); if (isFullWidthCodePoint(code)) { width += 2; } else if (!isZeroWidthCodePoint(code)) { diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index 8d413b116fd0f2..cf8651c33ad6d0 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -1,6 +1,8 @@ 'use strict'; const { + ArrayPrototypeConcat, + FunctionPrototypeBind, ObjectDefineProperty, ObjectKeys, } = primordials; @@ -27,8 +29,10 @@ function installConsoleExtensions(commandLineApi) { const { makeRequireFunction } = require('internal/modules/cjs/helpers'); const consoleAPIModule = new CJSModule(''); const cwd = tryGetCwd(); - consoleAPIModule.paths = - CJSModule._nodeModulePaths(cwd).concat(CJSModule.globalPaths); + consoleAPIModule.paths = ArrayPrototypeConcat( + CJSModule._nodeModulePaths(cwd), + CJSModule.globalPaths + ); commandLineApi.require = makeRequireFunction(consoleAPIModule); } @@ -40,9 +44,12 @@ function wrapConsole(consoleFromNode, consoleFromVM) { // then wrap these two methods into one. Native wrapper will preserve // the original stack. if (consoleFromNode.hasOwnProperty(key)) { - consoleFromNode[key] = consoleCall.bind(consoleFromNode, - consoleFromVM[key], - consoleFromNode[key]); + consoleFromNode[key] = FunctionPrototypeBind( + consoleCall, + consoleFromNode, + consoleFromVM[key], + consoleFromNode[key] + ); ObjectDefineProperty(consoleFromNode[key], 'name', { value: key }); diff --git a/lib/util.js b/lib/util.js index 2d8687ac9c569a..abd1f6e663610e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -23,8 +23,16 @@ const { ArrayIsArray, + ArrayPrototypeJoin, + ArrayPrototypePop, Date, + DatePrototypeGetDate, + DatePrototypeGetHours, + DatePrototypeGetMinutes, + DatePrototypeGetMonth, + DatePrototypeGetSeconds, Error, + FunctionPrototypeBind, NumberIsSafeInteger, ObjectDefineProperties, ObjectDefineProperty, @@ -33,6 +41,7 @@ const { ObjectPrototypeToString, ObjectSetPrototypeOf, ReflectApply, + StringPrototypePadStart, } = primordials; const { @@ -110,7 +119,7 @@ function isPrimitive(arg) { } function pad(n) { - return n.toString().padStart(2, '0'); + return StringPrototypePadStart(n.toString(), 2, '0'); } const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', @@ -119,10 +128,12 @@ const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', // 26 Feb 16:19:34 function timestamp() { const d = new Date(); - const time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); + const t = ArrayPrototypeJoin([ + pad(DatePrototypeGetHours(d)), + pad(DatePrototypeGetMinutes(d)), + pad(DatePrototypeGetSeconds(d)), + ], ':'); + return `${DatePrototypeGetDate(d)} ${months[DatePrototypeGetMonth(d)]} ${t}`; } let console; @@ -201,11 +212,11 @@ function callbackify(original) { // the promise is actually somehow related to the callback's execution // and that the callback throwing will reject the promise. function callbackified(...args) { - const maybeCb = args.pop(); + const maybeCb = ArrayPrototypePop(args); if (typeof maybeCb !== 'function') { throw new ERR_INVALID_ARG_TYPE('last argument', 'Function', maybeCb); } - const cb = (...args) => { ReflectApply(maybeCb, this, args); }; + const cb = FunctionPrototypeBind(maybeCb, this); // In true node style we process the callback on `nextTick` with all the // implications (stack, `uncaughtException`, `async_hooks`) ReflectApply(original, this, args) From bb4f8c87327616c8729ffd3f4eff43dd57711149 Mon Sep 17 00:00:00 2001 From: Pooja D P Date: Thu, 17 Dec 2020 06:56:33 -0800 Subject: [PATCH 045/161] lib: use more primordials in shared validators PR-URL: https://github.com/nodejs/node/pull/36552 Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott --- lib/internal/validators.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/internal/validators.js b/lib/internal/validators.js index 2439342ae8a78b..192c21b52c83e8 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -2,11 +2,17 @@ const { ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypeMap, NumberIsInteger, NumberMAX_SAFE_INTEGER, NumberMIN_SAFE_INTEGER, NumberParseInt, + RegExpPrototypeTest, String, + StringPrototypeToUpperCase, + StringPrototypeTrim, } = primordials; const { @@ -63,7 +69,7 @@ function parseFileMode(value, name, def) { } if (typeof value === 'string') { - if (!octalReg.test(value)) { + if (!RegExpPrototypeTest(octalReg, value)) { throw new ERR_INVALID_ARG_VALUE(name, value, modeDesc); } return NumberParseInt(value, 8); @@ -129,10 +135,11 @@ function validateNumber(value, name) { } const validateOneOf = hideStackFrames((value, name, oneOf) => { - if (!oneOf.includes(value)) { - const allowed = oneOf - .map((v) => (typeof v === 'string' ? `'${v}'` : String(v))) - .join(', '); + if (!ArrayPrototypeIncludes(oneOf, value)) { + const allowed = ArrayPrototypeJoin( + ArrayPrototypeMap(oneOf, (v) => + (typeof v === 'string' ? `'${v}'` : String(v))), + ', '); const reason = 'must be one of: ' + allowed; throw new ERR_INVALID_ARG_VALUE(name, value, reason); } @@ -167,7 +174,7 @@ function validateSignalName(signal, name = 'signal') { throw new ERR_INVALID_ARG_TYPE(name, 'string', signal); if (signals[signal] === undefined) { - if (signals[signal.toUpperCase()] !== undefined) { + if (signals[StringPrototypeToUpperCase(signal)] !== undefined) { throw new ERR_UNKNOWN_SIGNAL(signal + ' (signals must use all capital letters)'); } @@ -198,7 +205,7 @@ function validateEncoding(data, encoding) { // is an integer and that it falls within the legal range of port numbers. function validatePort(port, name = 'Port', { allowZero = true } = {}) { if ((typeof port !== 'number' && typeof port !== 'string') || - (typeof port === 'string' && port.trim().length === 0) || + (typeof port === 'string' && StringPrototypeTrim(port).length === 0) || +port !== (+port >>> 0) || port > 0xFFFF || (port === 0 && !allowZero)) { From 72b0ab073964f6e22987d5a5c51ff6f9d7fccc21 Mon Sep 17 00:00:00 2001 From: Yash Ladha Date: Mon, 28 Dec 2020 21:16:59 +0530 Subject: [PATCH 046/161] doc: add yashLadha to collaborator Fixes: https://github.com/nodejs/node/issues/36500 PR-URL: https://github.com/nodejs/node/pull/36666 Reviewed-By: Gireesh Punathil Reviewed-By: Antoine du Hamel Reviewed-By: Pooja D P Reviewed-By: Rich Trott --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 512cd485b8f57a..9b41c451da114e 100644 --- a/README.md +++ b/README.md @@ -431,6 +431,8 @@ For information about the governance of the Node.js project, see **Thomas Watson** <w@tson.dk> * [XadillaX](https://github.com/XadillaX) - **Khaidi Chu** <i@2333.moe> (he/him) +* [yashLadha](https://github.com/yashLadha) - +**Yash Ladha** <yash@yashladha.in> (he/him) * [yhwang](https://github.com/yhwang) - **Yihong Wang** <yh.wang@ibm.com> * [yorkie](https://github.com/yorkie) - From 1fc30a84aca6729eda80c505d37a503bd4a21f15 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 24 Dec 2020 16:25:53 +0100 Subject: [PATCH 047/161] stream,zlib: do not use _stream_* anymore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36618 Reviewed-By: Robert Nagy Reviewed-By: Rich Trott Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Michaël Zasso --- lib/internal/streams/pipeline.js | 2 +- lib/zlib.js | 3 +-- test/parallel/test-zlib-no-stream.js | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 test/parallel/test-zlib-no-stream.js diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 89561433c8c132..30f8c9acf4ece9 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -215,7 +215,7 @@ function pipeline(...streams) { } } else { if (!PassThrough) { - PassThrough = require('_stream_passthrough'); + PassThrough = require('internal/streams/passthrough'); } // If the last argument to pipeline is not a stream diff --git a/lib/zlib.js b/lib/zlib.js index 91eabbefa3576e..cb7e0cff40e48e 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -52,7 +52,7 @@ const { }, hideStackFrames } = require('internal/errors'); -const Transform = require('_stream_transform'); +const { Transform, finished } = require('stream'); const { deprecate } = require('internal/util'); @@ -62,7 +62,6 @@ const { } = require('internal/util/types'); const binding = internalBinding('zlib'); const assert = require('internal/assert'); -const finished = require('internal/streams/end-of-stream'); const { Buffer, kMaxLength diff --git a/test/parallel/test-zlib-no-stream.js b/test/parallel/test-zlib-no-stream.js new file mode 100644 index 00000000000000..68da269ab8f57e --- /dev/null +++ b/test/parallel/test-zlib-no-stream.js @@ -0,0 +1,14 @@ +/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first */ + +'use strict'; + +// We are not loading common because it will load the stream module, +// defeating the purpose of this test. + +const { gzipSync } = require('zlib'); + +// Avoid regressions such as https://github.com/nodejs/node/issues/36615 + +// This must not throw +gzipSync('fooobar'); From 7fe1b5ef5a54df9a7435c9e027cc3da1c47e2557 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Wed, 23 Dec 2020 19:22:00 +0800 Subject: [PATCH 048/161] lib: refactor to use validateCallback PR-URL: https://github.com/nodejs/node/pull/36609 Reviewed-By: Rich Trott Reviewed-By: Antoine du Hamel --- lib/_tls_wrap.js | 7 +++--- lib/dns.js | 35 ++++++++++++++-------------- lib/fs.js | 19 ++++++--------- lib/inspector.js | 10 ++++---- lib/internal/crypto/diffiehellman.js | 8 +++---- lib/internal/crypto/hkdf.js | 5 ++-- lib/internal/crypto/keygen.js | 8 +++---- lib/internal/crypto/pbkdf2.js | 5 ++-- lib/internal/crypto/random.js | 19 ++++++++------- lib/internal/crypto/scrypt.js | 5 ++-- lib/internal/fs/dir.js | 15 +++++------- lib/internal/http2/compat.js | 9 +++---- lib/internal/http2/core.js | 26 ++++++++++----------- lib/internal/process/task_queues.js | 6 ++--- lib/internal/stream_base_commons.js | 10 +++----- lib/internal/streams/pipeline.js | 6 ++--- lib/internal/timers.js | 10 ++++---- lib/internal/url.js | 7 +++--- lib/perf_hooks.js | 7 +++--- lib/readline.js | 22 ++++++++++------- 20 files changed, 114 insertions(+), 125 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index adbefa4839826d..1447253bf73224 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -67,7 +67,6 @@ const { connResetException, codes } = require('internal/errors'); const { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_MULTIPLE_CALLBACK, ERR_SOCKET_CLOSED, ERR_TLS_DH_PARAM_SIZE, @@ -85,6 +84,7 @@ const { getAllowUnauthorized, } = require('internal/options'); const { + validateCallback, validateString, validateBuffer, validateUint32 @@ -825,8 +825,9 @@ TLSSocket.prototype._init = function(socket, wrap) { TLSSocket.prototype.renegotiate = function(options, callback) { if (options === null || typeof options !== 'object') throw new ERR_INVALID_ARG_TYPE('options', 'Object', options); - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } debug('%s renegotiate()', this._tlsOptions.isServer ? 'server' : 'client', diff --git a/lib/dns.js b/lib/dns.js index 0c1b259d7341ee..1116c73f670438 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -45,10 +45,10 @@ const { const { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_MISSING_ARGS, } = errors.codes; const { + validateCallback, validatePort, validateString, validateOneOf, @@ -101,20 +101,24 @@ function lookup(hostname, options, callback) { // Parse arguments if (hostname && typeof hostname !== 'string') { throw new ERR_INVALID_ARG_TYPE('hostname', 'string', hostname); - } else if (typeof options === 'function') { + } + + if (typeof options === 'function') { callback = options; family = 0; - } else if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } else if (options !== null && typeof options === 'object') { - hints = options.hints >>> 0; - family = options.family >>> 0; - all = options.all === true; - verbatim = options.verbatim === true; - - validateHints(hints); } else { - family = options >>> 0; + validateCallback(callback); + + if (options !== null && typeof options === 'object') { + hints = options.hints >>> 0; + family = options.family >>> 0; + all = options.all === true; + verbatim = options.verbatim === true; + + validateHints(hints); + } else { + family = options >>> 0; + } } validateOneOf(family, 'family', [0, 4, 6]); @@ -177,8 +181,7 @@ function lookupService(address, port, callback) { validatePort(port); - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); port = +port; @@ -217,9 +220,7 @@ function resolver(bindingName) { } validateString(name, 'name'); - if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } + validateCallback(callback); const req = new QueryReqWrap(); req.bindingName = bindingName; diff --git a/lib/fs.js b/lib/fs.js index 93e875311e08a6..918762877e6f99 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -75,7 +75,6 @@ const { ERR_FS_FILE_TOO_LARGE, ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, - ERR_INVALID_CALLBACK, ERR_FEATURE_UNAVAILABLE_ON_PLATFORM }, hideStackFrames, @@ -125,6 +124,7 @@ const { isUint32, parseFileMode, validateBuffer, + validateCallback, validateInteger, validateInt32 } = require('internal/validators'); @@ -170,19 +170,16 @@ function showTruncateDeprecation() { } function maybeCallback(cb) { - if (typeof cb === 'function') - return cb; + validateCallback(cb); - throw new ERR_INVALID_CALLBACK(cb); + return cb; } // Ensure that callbacks run in the global context. Only use this function // for callbacks that are passed to the binding layer, callbacks that are // invoked from JS already run in the proper scope. function makeCallback(cb) { - if (typeof cb !== 'function') { - throw new ERR_INVALID_CALLBACK(cb); - } + validateCallback(cb); return (...args) => cb(...args); } @@ -191,9 +188,7 @@ function makeCallback(cb) { // an optimization, since the data passed back to the callback needs to be // transformed anyway. function makeStatsCallback(cb) { - if (typeof cb !== 'function') { - throw new ERR_INVALID_CALLBACK(cb); - } + validateCallback(cb); return (err, stats) => { if (err) return cb(err); @@ -2014,8 +2009,8 @@ function copyFile(src, dest, mode, callback) { if (typeof mode === 'function') { callback = mode; mode = 0; - } else if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); + } else { + validateCallback(callback); } src = getValidatedPath(src, 'src'); diff --git a/lib/inspector.js b/lib/inspector.js index 007822ffa20f0d..30b2e6407ce659 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -17,7 +17,6 @@ const { ERR_INSPECTOR_NOT_ACTIVE, ERR_INSPECTOR_NOT_WORKER, ERR_INVALID_ARG_TYPE, - ERR_INVALID_CALLBACK } = require('internal/errors').codes; const { hasInspector } = internalBinding('config'); @@ -26,7 +25,10 @@ if (!hasInspector) const EventEmitter = require('events'); const { queueMicrotask } = require('internal/process/task_queues'); -const { validateString } = require('internal/validators'); +const { + validateCallback, + validateString, +} = require('internal/validators'); const { isMainThread } = require('worker_threads'); const { @@ -100,8 +102,8 @@ class Session extends EventEmitter { if (params && typeof params !== 'object') { throw new ERR_INVALID_ARG_TYPE('params', 'Object', params); } - if (callback && typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); + if (callback) { + validateCallback(callback); } if (!this[connectionSymbol]) { diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 2a8795e378f3e0..a28d61369b1c94 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -31,11 +31,11 @@ const { ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, } } = require('internal/errors'); const { + validateCallback, validateInt32, validateObject, validateString, @@ -325,8 +325,7 @@ function deriveBitsECDH(name, publicKey, privateKey, callback) { validateString(name, 'name'); validateObject(publicKey, 'publicKey'); validateObject(privateKey, 'privateKey'); - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = new ECDHBitsJob(kCryptoJobAsync, name, publicKey, privateKey); job.ondone = (error, bits) => { if (error) return FunctionPrototypeCall(callback, job, error); @@ -340,8 +339,7 @@ function deriveBitsECDH(name, publicKey, privateKey, callback) { function deriveBitsDH(publicKey, privateKey, callback) { validateObject(publicKey, 'publicKey'); validateObject(privateKey, 'privateKey'); - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = new DHBitsJob(kCryptoJobAsync, publicKey, privateKey); job.ondone = (error, bits) => { if (error) return FunctionPrototypeCall(callback, job, error); diff --git a/lib/internal/crypto/hkdf.js b/lib/internal/crypto/hkdf.js index 1b013e5ff1591c..7949fa33d2e077 100644 --- a/lib/internal/crypto/hkdf.js +++ b/lib/internal/crypto/hkdf.js @@ -13,6 +13,7 @@ const { } = internalBinding('crypto'); const { + validateCallback, validateInteger, validateString, validateUint32, @@ -41,7 +42,6 @@ const { const { codes: { - ERR_INVALID_CALLBACK, ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, ERR_MISSING_OPTION, @@ -112,8 +112,7 @@ function hkdf(hash, key, salt, info, length, callback) { length, } = validateParameters(hash, key, salt, info, length)); - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = new HKDFJob(kCryptoJobAsync, hash, key, salt, info, length); diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js index 5f29a3153b94e0..2b0d58afd663fc 100644 --- a/lib/internal/crypto/keygen.js +++ b/lib/internal/crypto/keygen.js @@ -40,6 +40,7 @@ const { customPromisifyArgs } = require('internal/util'); const { isUint32, + validateCallback, validateString, validateInteger, validateObject, @@ -50,7 +51,6 @@ const { codes: { ERR_INCOMPATIBLE_OPTION_PAIR, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_MISSING_OPTION, } } = require('internal/errors'); @@ -68,8 +68,7 @@ function generateKeyPair(type, options, callback) { callback = options; options = undefined; } - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = createJob(kCryptoJobAsync, type, options); @@ -353,8 +352,7 @@ function generateKey(type, options, callback) { options = undefined; } - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = generateKeyJob(kCryptoJobAsync, type, options); diff --git a/lib/internal/crypto/pbkdf2.js b/lib/internal/crypto/pbkdf2.js index 868e0f7fbb214e..98f4efb4f333bf 100644 --- a/lib/internal/crypto/pbkdf2.js +++ b/lib/internal/crypto/pbkdf2.js @@ -14,13 +14,13 @@ const { } = internalBinding('crypto'); const { + validateCallback, validateInteger, validateUint32, } = require('internal/validators'); const { ERR_INVALID_ARG_TYPE, - ERR_INVALID_CALLBACK, ERR_MISSING_OPTION, } = require('internal/errors').codes; @@ -41,8 +41,7 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) { ({ password, salt, iterations, keylen, digest } = check(password, salt, iterations, keylen, digest)); - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = new PBKDF2Job( kCryptoJobAsync, diff --git a/lib/internal/crypto/random.js b/lib/internal/crypto/random.js index dca43647a6635a..93b32b92007908 100644 --- a/lib/internal/crypto/random.js +++ b/lib/internal/crypto/random.js @@ -23,12 +23,14 @@ const { kMaxLength } = require('buffer'); const { codes: { ERR_INVALID_ARG_TYPE, - ERR_INVALID_CALLBACK, ERR_OUT_OF_RANGE, } } = require('internal/errors'); -const { validateNumber } = require('internal/validators'); +const { + validateNumber, + validateCallback, +} = require('internal/validators'); const { isArrayBufferView, @@ -73,8 +75,9 @@ function assertSize(size, elementSize, offset, length) { function randomBytes(size, callback) { size = assertSize(size, 1, 0, Infinity); - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } const buf = new FastBuffer(size); @@ -141,8 +144,8 @@ function randomFill(buf, offset, size, callback) { } else if (typeof size === 'function') { callback = size; size = buf.byteLength - offset; - } else if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); + } else { + validateCallback(callback); } offset = assertOffset(offset, elementSize, buf.byteLength); @@ -188,8 +191,8 @@ function randomInt(min, max, callback) { } const isSync = typeof callback === 'undefined'; - if (!isSync && typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); + if (!isSync) { + validateCallback(callback); } if (!NumberIsSafeInteger(min)) { throw new ERR_INVALID_ARG_TYPE('min', 'a safe integer', min); diff --git a/lib/internal/crypto/scrypt.js b/lib/internal/crypto/scrypt.js index 76549c88289ecc..39305c15d8a4ba 100644 --- a/lib/internal/crypto/scrypt.js +++ b/lib/internal/crypto/scrypt.js @@ -14,6 +14,7 @@ const { } = internalBinding('crypto'); const { + validateCallback, validateInteger, validateUint32, } = require('internal/validators'); @@ -22,7 +23,6 @@ const { codes: { ERR_CRYPTO_SCRYPT_INVALID_PARAMETER, ERR_CRYPTO_SCRYPT_NOT_SUPPORTED, - ERR_INVALID_CALLBACK, } } = require('internal/errors'); @@ -50,8 +50,7 @@ function scrypt(password, salt, keylen, options, callback = defaults) { const { N, r, p, maxmem } = options; ({ password, salt, keylen } = options); - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const job = new ScryptJob( kCryptoJobAsync, password, salt, N, r, p, maxmem, keylen); diff --git a/lib/internal/fs/dir.js b/lib/internal/fs/dir.js index 6eeeb84bda9d70..e63d09713bdcca 100644 --- a/lib/internal/fs/dir.js +++ b/lib/internal/fs/dir.js @@ -18,7 +18,6 @@ const { codes: { ERR_DIR_CLOSED, ERR_DIR_CONCURRENT_OPERATION, - ERR_INVALID_CALLBACK, ERR_MISSING_ARGS } } = require('internal/errors'); @@ -32,6 +31,7 @@ const { handleErrorFromBinding } = require('internal/fs/utils'); const { + validateCallback, validateUint32 } = require('internal/validators'); @@ -87,10 +87,10 @@ class Dir { if (callback === undefined) { return this[kDirReadPromisified](); - } else if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); } + validateCallback(callback); + if (this[kDirOperationQueue] !== null) { ArrayPrototypePush(this[kDirOperationQueue], () => { this[kDirReadImpl](maybeSync, callback); @@ -174,9 +174,7 @@ class Dir { } // callback - if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } + validateCallback(callback); if (this[kDirClosed] === true) { process.nextTick(callback, new ERR_DIR_CLOSED()); @@ -236,9 +234,8 @@ ObjectDefineProperty(Dir.prototype, SymbolAsyncIterator, { function opendir(path, options, callback) { callback = typeof options === 'function' ? options : callback; - if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } + validateCallback(callback); + path = getValidatedPath(path); options = getOptions(options, { encoding: 'utf8' diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index a0251ffbafecd2..e7a0cbb436b1f5 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -44,13 +44,15 @@ const { ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED, ERR_HTTP2_STATUS_INVALID, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_INVALID_HTTP_TOKEN, ERR_STREAM_WRITE_AFTER_END }, hideStackFrames } = require('internal/errors'); -const { validateString } = require('internal/validators'); +const { + validateCallback, + validateString, +} = require('internal/validators'); const { kSocket, kRequest, @@ -784,8 +786,7 @@ class Http2ServerResponse extends Stream { } createPushResponse(headers, callback) { - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); if (this[kState].closed) { process.nextTick(callback, new ERR_HTTP2_INVALID_STREAM()); return; diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 4fbee39c99ddf2..bc4bdeec5110b8 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -104,7 +104,6 @@ const { ERR_HTTP2_UNSUPPORTED_PROTOCOL, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_INVALID_CHAR, ERR_INVALID_HTTP_TOKEN, ERR_OUT_OF_RANGE, @@ -115,12 +114,13 @@ const { } = require('internal/errors'); const { isUint32, + validateCallback, validateInt32, validateInteger, validateNumber, validateString, validateUint32, - validateAbortSignal, + validateAbortSignal } = require('internal/validators'); const fsPromisesInternal = require('internal/fs/promises'); const { utcDate } = require('internal/http'); @@ -1309,8 +1309,7 @@ class Http2Session extends EventEmitter { if (payload && payload.length !== 8) { throw new ERR_HTTP2_PING_LENGTH(); } - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); const cb = pingCallback(callback); if (this.connecting || this.closed) { @@ -1407,8 +1406,9 @@ class Http2Session extends EventEmitter { assertIsObject(settings, 'settings'); validateSettings(settings); - if (callback && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback) { + validateCallback(callback); + } debugSessionObj(this, 'sending settings'); this[kState].pendingAck++; @@ -2204,8 +2204,9 @@ class Http2Stream extends Duplex { close(code = NGHTTP2_NO_ERROR, callback) { validateInteger(code, 'code', 0, kMaxInt); - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } if (this.closed) return; @@ -2607,8 +2608,7 @@ class ServerHttp2Stream extends Http2Stream { options = undefined; } - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); assertIsObject(options, 'options'); options = { ...options }; @@ -3048,8 +3048,7 @@ class Http2SecureServer extends TLSServer { setTimeout(msecs, callback) { this.timeout = msecs; if (callback !== undefined) { - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); this.on('timeout', callback); } return this; @@ -3076,8 +3075,7 @@ class Http2Server extends NETServer { setTimeout(msecs, callback) { this.timeout = msecs; if (callback !== undefined) { - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); this.on('timeout', callback); } return this; diff --git a/lib/internal/process/task_queues.js b/lib/internal/process/task_queues.js index 3cf07601a23aa4..4081acae951acd 100644 --- a/lib/internal/process/task_queues.js +++ b/lib/internal/process/task_queues.js @@ -34,11 +34,12 @@ const { symbols: { async_id_symbol, trigger_async_id_symbol } } = require('internal/async_hooks'); const { - ERR_INVALID_CALLBACK, ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; const FixedQueue = require('internal/fixed_queue'); +const { validateCallback } = require('internal/validators'); + // *Must* match Environment::TickInfo::Fields in src/env.h. const kHasTickScheduled = 0; @@ -99,8 +100,7 @@ function processTicksAndRejections() { // `nextTick()` will not enqueue any callback when the process is about to // exit since the callback would not have a chance to be executed. function nextTick(callback) { - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); if (process._exiting) return; diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js index 0dfee0c9c7b619..5254fc1553dd77 100644 --- a/lib/internal/stream_base_commons.js +++ b/lib/internal/stream_base_commons.js @@ -17,9 +17,6 @@ const { } = internalBinding('stream_wrap'); const { UV_EOF } = internalBinding('uv'); const { - codes: { - ERR_INVALID_CALLBACK - }, errnoException } = require('internal/errors'); const { owner_symbol } = require('internal/async_hooks').symbols; @@ -30,6 +27,7 @@ const { } = require('internal/timers'); const { isUint8Array } = require('internal/util/types'); const { clearTimeout } = require('timers'); +const { validateCallback } = require('internal/validators'); const kMaybeDestroy = Symbol('kMaybeDestroy'); const kUpdateTimer = Symbol('kUpdateTimer'); @@ -259,8 +257,7 @@ function setStreamTimeout(msecs, callback) { if (msecs === 0) { if (callback !== undefined) { - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); this.removeListener('timeout', callback); } } else { @@ -268,8 +265,7 @@ function setStreamTimeout(msecs, callback) { if (this[kSession]) this[kSession][kUpdateTimer](); if (callback !== undefined) { - if (typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + validateCallback(callback); this.once('timeout', callback); } } diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 30f8c9acf4ece9..900e561d32943c 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -17,11 +17,12 @@ const destroyImpl = require('internal/streams/destroy'); const { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE, - ERR_INVALID_CALLBACK, ERR_MISSING_ARGS, ERR_STREAM_DESTROYED } = require('internal/errors').codes; +const { validateCallback } = require('internal/validators'); + let EE; let PassThrough; let Readable; @@ -73,8 +74,7 @@ function popCallback(streams) { // Streams should never be an empty array. It should always contain at least // a single stream. Therefore optimize for the average case instead of // checking for length === 0 as well. - if (typeof streams[streams.length - 1] !== 'function') - throw new ERR_INVALID_CALLBACK(streams[streams.length - 1]); + validateCallback(streams[streams.length - 1]); return streams.pop(); } diff --git a/lib/internal/timers.js b/lib/internal/timers.js index 5009572f90f265..a5b5c10010e95b 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -108,10 +108,12 @@ const trigger_async_id_symbol = Symbol('triggerId'); const kHasPrimitive = Symbol('kHasPrimitive'); const { - ERR_INVALID_CALLBACK, ERR_OUT_OF_RANGE } = require('internal/errors').codes; -const { validateNumber } = require('internal/validators'); +const { + validateCallback, + validateNumber, +} = require('internal/validators'); const L = require('internal/linkedlist'); const PriorityQueue = require('internal/priority_queue'); @@ -368,9 +370,7 @@ function insert(item, msecs, start = getLibuvNow()) { function setUnrefTimeout(callback, after) { // Type checking identical to setTimeout() - if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } + validateCallback(callback); const timer = new Timeout(callback, after, undefined, false, false); insert(timer, timer._idleTimeout); diff --git a/lib/internal/url.js b/lib/internal/url.js index d718dfa9d13d1f..900b6b03cd9ec1 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -44,7 +44,6 @@ const { ERR_ARG_NOT_ITERABLE, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_INVALID_FILE_URL_HOST, ERR_INVALID_FILE_URL_PATH, ERR_INVALID_THIS, @@ -65,6 +64,8 @@ const { } = require('internal/constants'); const path = require('path'); +const { validateCallback } = require('internal/validators'); + // Lazy loaded for startup performance. let querystring; @@ -1129,9 +1130,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { if (!this || !this[searchParams] || this[searchParams][searchParams]) { throw new ERR_INVALID_THIS('URLSearchParams'); } - if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } + validateCallback(callback); let list = this[searchParams]; diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 7429db38fd77ef..6733992b9fae39 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -56,7 +56,6 @@ const L = require('internal/linkedlist'); const kInspect = require('internal/util').customInspectSymbol; const { - ERR_INVALID_CALLBACK, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_VALID_PERFORMANCE_ENTRY_TYPE, @@ -68,6 +67,8 @@ const { kHandle, } = require('internal/histogram'); +const { validateCallback } = require('internal/validators'); + const { setImmediate } = require('timers'); const kCallback = Symbol('callback'); const kTypes = Symbol('types'); @@ -341,9 +342,7 @@ class PerformanceObserverEntryList { class PerformanceObserver { constructor(callback) { - if (typeof callback !== 'function') { - throw new ERR_INVALID_CALLBACK(callback); - } + validateCallback(callback); ObjectDefineProperties(this, { [kTypes]: { enumerable: false, diff --git a/lib/readline.js b/lib/readline.js index 8995fcbbf44335..085445a4e5b598 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -64,10 +64,10 @@ const { const { ERR_INVALID_ARG_VALUE, - ERR_INVALID_CALLBACK, ERR_INVALID_CURSOR_POS, } = require('internal/errors').codes; const { + validateCallback, validateString, validateUint32, } = require('internal/validators'); @@ -1216,8 +1216,9 @@ function emitKeypressEvents(stream, iface = {}) { */ function cursorTo(stream, x, y, callback) { - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } if (typeof y === 'function') { callback = y; @@ -1242,8 +1243,9 @@ function cursorTo(stream, x, y, callback) { */ function moveCursor(stream, dx, dy, callback) { - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } if (stream == null || !(dx || dy)) { if (typeof callback === 'function') @@ -1276,8 +1278,9 @@ function moveCursor(stream, dx, dy, callback) { */ function clearLine(stream, dir, callback) { - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } if (stream === null || stream === undefined) { if (typeof callback === 'function') @@ -1298,8 +1301,9 @@ function clearLine(stream, dir, callback) { */ function clearScreenDown(stream, callback) { - if (callback !== undefined && typeof callback !== 'function') - throw new ERR_INVALID_CALLBACK(callback); + if (callback !== undefined) { + validateCallback(callback); + } if (stream === null || stream === undefined) { if (typeof callback === 'function') From eb6b38639afba2555093a86775413e681228a394 Mon Sep 17 00:00:00 2001 From: Brian White Date: Sat, 26 Dec 2020 02:49:59 -0500 Subject: [PATCH 049/161] lib: remove unused code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36632 Reviewed-By: Antoine du Hamel Reviewed-By: Michaël Zasso Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang Reviewed-By: Benjamin Gruenbaum --- lib/internal/priority_queue.js | 12 ------------ test/parallel/test-priority-queue.js | 21 --------------------- 2 files changed, 33 deletions(-) diff --git a/lib/internal/priority_queue.js b/lib/internal/priority_queue.js index a0a18f7301e3b7..84db200b1cea96 100644 --- a/lib/internal/priority_queue.js +++ b/lib/internal/priority_queue.js @@ -2,7 +2,6 @@ const { Array, - ArrayPrototypeIndexOf, Symbol, } = primordials; @@ -105,17 +104,6 @@ module.exports = class PriorityQueue { } } - remove(value) { - const heap = this[kHeap]; - const pos = ArrayPrototypeIndexOf(heap, value); - if (pos < 1) - return false; - - this.removeAt(pos); - - return true; - } - shift() { const heap = this[kHeap]; const value = heap[1]; diff --git a/test/parallel/test-priority-queue.js b/test/parallel/test-priority-queue.js index f6318ede7ffbca..b98d228b08763b 100644 --- a/test/parallel/test-priority-queue.js +++ b/test/parallel/test-priority-queue.js @@ -43,27 +43,6 @@ const PriorityQueue = require('internal/priority_queue'); assert.strictEqual(queue.shift(), undefined); } -{ - // Checks that remove works as expected. - const queue = new PriorityQueue(); - for (let i = 16; i > 0; i--) - queue.insert(i); - - const removed = [5, 10, 15]; - for (const id of removed) - assert(queue.remove(id)); - - assert(!queue.remove(100)); - assert(!queue.remove(-100)); - - for (let i = 1; i < 17; i++) { - if (removed.indexOf(i) < 0) - assert.strictEqual(queue.shift(), i); - } - - assert.strictEqual(queue.shift(), undefined); -} - { // Make a max heap with a custom sort function. const queue = new PriorityQueue((a, b) => b - a); From 651e7d27b71c756435a6e7c0c57780a9fdd94d9b Mon Sep 17 00:00:00 2001 From: Dr Date: Sun, 27 Dec 2020 20:45:36 +0800 Subject: [PATCH 050/161] doc: document http.IncomingMessage behaviour change Add to the history table that the `destroyed` value returns `true` after the incoming data is consumed. Refs: https://github.com/nodejs/node/issues/36617 Refs: https://github.com/nodejs/node/pull/33035 PR-URL: https://github.com/nodejs/node/pull/36641 Reviewed-By: Antoine du Hamel Reviewed-By: Robert Nagy --- doc/api/http.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index 28c2b232b9fe69..adabc4260b7114 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1892,6 +1892,10 @@ the request body should be sent. + + + diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 9d92700ca171f7..f5d2cc5c600658 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -4,7 +4,7 @@ "path": "console" }, "encoding": { - "commit": "1821fb5f77723b5361058c6a8ed0b71f9d2d6b8d", + "commit": "3c9820d1cc5d9d2627c26ef1268b6d54a35adf22", "path": "encoding" }, "url": { From a7f743f5cc233de66b2dca6ae3d96a22fa9b9f90 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Mon, 28 Dec 2020 18:47:19 +0900 Subject: [PATCH 066/161] test: update wpt resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/web-platform-tests/wpt/pull/26824 PR-URL: https://github.com/nodejs/node/pull/36659 Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott --- test/fixtures/wpt/README.md | 2 +- .../wpt/resources/testdriver-actions.js | 66 ++++++++++++++++--- test/fixtures/wpt/resources/testdriver.js | 22 +++++++ test/fixtures/wpt/resources/testharness.js | 29 ++++---- test/fixtures/wpt/versions.json | 2 +- 5 files changed, 94 insertions(+), 27 deletions(-) diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 8f59b55ce8af85..074caa3d711cb7 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -13,7 +13,7 @@ Last update: - console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console - encoding: https://github.com/web-platform-tests/wpt/tree/3c9820d1cc/encoding - url: https://github.com/web-platform-tests/wpt/tree/1783c9bccf/url -- resources: https://github.com/web-platform-tests/wpt/tree/001e50de41/resources +- resources: https://github.com/web-platform-tests/wpt/tree/351a99782b/resources - interfaces: https://github.com/web-platform-tests/wpt/tree/8719553b2d/interfaces - html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing - html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/264f12bc7b/html/webappapis/timers diff --git a/test/fixtures/wpt/resources/testdriver-actions.js b/test/fixtures/wpt/resources/testdriver-actions.js index f3e6388e8acd19..4dafa0c018b101 100644 --- a/test/fixtures/wpt/resources/testdriver-actions.js +++ b/test/fixtures/wpt/resources/testdriver-actions.js @@ -281,9 +281,12 @@ * pointer source * @returns {Actions} */ - pointerDown: function({button=this.ButtonType.LEFT, sourceName=null}={}) { + pointerDown: function({button=this.ButtonType.LEFT, sourceName=null, + width, height, pressure, tangentialPressure, + tiltX, tiltY, twist, altitudeAngle, azimuthAngle}={}) { let source = this.getSource("pointer", sourceName); - source.pointerDown(this, button); + source.pointerDown(this, button, width, height, pressure, tangentialPressure, + tiltX, tiltY, twist, altitudeAngle, azimuthAngle); return this; }, @@ -314,9 +317,13 @@ * @returns {Actions} */ pointerMove: function(x, y, - {origin="viewport", duration, sourceName=null}={}) { + {origin="viewport", duration, sourceName=null, + width, height, pressure, tangentialPressure, + tiltX, tiltY, twist, altitudeAngle, azimuthAngle}={}) { let source = this.getSource("pointer", sourceName); - source.pointerMove(this, x, y, duration, origin); + source.pointerMove(this, x, y, duration, origin, width, height, pressure, + tangentialPressure, tiltX, tiltY, twist, altitudeAngle, + azimuthAngle); return this; }, @@ -424,6 +431,38 @@ this.actions = new Map(); } + function setPointerProperties(action, width, height, pressure, tangentialPressure, + tiltX, tiltY, twist, altitudeAngle, azimuthAngle) { + if (width) { + action.width = width; + } + if (height) { + action.height = height; + } + if (pressure) { + action.pressure = pressure; + } + if (tangentialPressure) { + action.tangentialPressure = tangentialPressure; + } + if (tiltX) { + action.tiltX = tiltX; + } + if (tiltY) { + action.tiltY = tiltY; + } + if (twist) { + action.twist = twist; + } + if (altitudeAngle) { + action.altitudeAngle = altitudeAngle; + } + if (azimuthAngle) { + action.azimuthAngle = azimuthAngle; + } + return action; + } + PointerSource.prototype = { serialize: function(tickCount) { if (!this.actions.size) { @@ -441,12 +480,16 @@ return data; }, - pointerDown: function(actions, button) { + pointerDown: function(actions, button, width, height, pressure, tangentialPressure, + tiltX, tiltY, twist, altitudeAngle, azimuthAngle) { let tick = actions.tickIdx; if (this.actions.has(tick)) { tick = actions.addTick().tickIdx; } - this.actions.set(tick, {type: "pointerDown", button}); + let actionProperties = setPointerProperties({type: "pointerDown", button}, width, height, + pressure, tangentialPressure, tiltX, tiltY, + twist, altitudeAngle, azimuthAngle); + this.actions.set(tick, actionProperties); }, pointerUp: function(actions, button) { @@ -457,15 +500,20 @@ this.actions.set(tick, {type: "pointerUp", button}); }, - pointerMove: function(actions, x, y, duration, origin) { + pointerMove: function(actions, x, y, duration, origin, width, height, pressure, + tangentialPressure, tiltX, tiltY, twist, altitudeAngle, azimuthAngle) { let tick = actions.tickIdx; if (this.actions.has(tick)) { tick = actions.addTick().tickIdx; } - this.actions.set(tick, {type: "pointerMove", x, y, origin}); + let moveAction = {type: "pointerMove", x, y, origin}; if (duration) { - this.actions.get(tick).duration = duration; + moveAction.duration = duration; } + let actionProperties = setPointerProperties(moveAction, width, height, pressure, + tangentialPressure, tiltX, tiltY, twist, + altitudeAngle, azimuthAngle); + this.actions.set(tick, actionProperties); }, addPause: function(actions, duration) { diff --git a/test/fixtures/wpt/resources/testdriver.js b/test/fixtures/wpt/resources/testdriver.js index c53b24136c091f..f3cee9821e13f9 100644 --- a/test/fixtures/wpt/resources/testdriver.js +++ b/test/fixtures/wpt/resources/testdriver.js @@ -146,6 +146,24 @@ y: centerPoint[1]}); }, + /** + * Deletes all cookies. + * + * This matches the behaviour of the {@link + * https://w3c.github.io/webdriver/#delete-all-cookies|WebDriver + * Delete All Cookies command}. + * + * @param {WindowProxy} context - Browsing context in which + * to run the call, or null for the current + * browsing context. + * + * @returns {Promise} fulfilled after cookies are deleted, or rejected in + * the cases the WebDriver command errors + */ + delete_all_cookies: function(context=null) { + return window.test_driver_internal.delete_all_cookies(context); + }, + /** * Send keys to an element * @@ -458,6 +476,10 @@ }); }, + delete_all_cookies: function(context=null) { + return Promise.reject(new Error("unimplemented")); + }, + send_keys: function(element, keys) { if (this.in_automation) { return Promise.reject(new Error('Not implemented')); diff --git a/test/fixtures/wpt/resources/testharness.js b/test/fixtures/wpt/resources/testharness.js index d50e094117df56..f7fe7531710d23 100644 --- a/test/fixtures/wpt/resources/testharness.js +++ b/test/fixtures/wpt/resources/testharness.js @@ -2956,22 +2956,16 @@ policies and contribution forms [3]. } function sanitize_unpaired_surrogates(str) { - return str.replace(/([\ud800-\udbff])(?![\udc00-\udfff])/g, - function(_, unpaired) - { - return code_unit_str(unpaired); - }) - // This replacement is intentionally implemented without an - // ES2018 negative lookbehind assertion to support runtimes - // which do not yet implement that language feature. - .replace(/(^|[^\ud800-\udbff])([\udc00-\udfff])/g, - function(_, previous, unpaired) { - if (/[\udc00-\udfff]/.test(previous)) { - previous = code_unit_str(previous); - } - - return previous + code_unit_str(unpaired); - }); + return str.replace( + /([\ud800-\udbff]+)(?![\udc00-\udfff])|(^|[^\ud800-\udbff])([\udc00-\udfff]+)/g, + function(_, low, prefix, high) { + var output = prefix || ""; // prefix may be undefined + var string = low || high; // only one of these alternates can match + for (var i = 0; i < string.length; i++) { + output += code_unit_str(string[i]); + } + return output; + }); } function sanitize_all_unpaired_surrogates(tests) { @@ -3612,6 +3606,9 @@ policies and contribution forms [3]. function AssertionError(message) { + if (typeof message == "string") { + message = sanitize_unpaired_surrogates(message); + } this.message = message; this.stack = this.get_stack(); } diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index f5d2cc5c600658..b6a871ea9da93f 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -12,7 +12,7 @@ "path": "url" }, "resources": { - "commit": "001e50de41dc35820774b27e31f77a165f4c0b9b", + "commit": "351a99782b9677706b5dc0dd78e85978fa4ab130", "path": "resources" }, "interfaces": { From 9eff709c23603757a061fa58913c319602b9ddb3 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Mon, 28 Dec 2020 18:48:05 +0900 Subject: [PATCH 067/161] test: update wpt interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/web-platform-tests/wpt/pull/26992 PR-URL: https://github.com/nodejs/node/pull/36659 Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott --- test/fixtures/wpt/README.md | 2 +- test/fixtures/wpt/interfaces/dom.idl | 39 +++++++++++++------------- test/fixtures/wpt/interfaces/html.idl | 40 ++++----------------------- test/fixtures/wpt/versions.json | 2 +- 4 files changed, 27 insertions(+), 56 deletions(-) diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 074caa3d711cb7..fc609bfca90b5a 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -14,7 +14,7 @@ Last update: - encoding: https://github.com/web-platform-tests/wpt/tree/3c9820d1cc/encoding - url: https://github.com/web-platform-tests/wpt/tree/1783c9bccf/url - resources: https://github.com/web-platform-tests/wpt/tree/351a99782b/resources -- interfaces: https://github.com/web-platform-tests/wpt/tree/8719553b2d/interfaces +- interfaces: https://github.com/web-platform-tests/wpt/tree/b4be9a3fdf/interfaces - html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing - html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/264f12bc7b/html/webappapis/timers - hr-time: https://github.com/web-platform-tests/wpt/tree/a5d1774ecf/hr-time diff --git a/test/fixtures/wpt/interfaces/dom.idl b/test/fixtures/wpt/interfaces/dom.idl index ffc5b063219d4d..bd8a17a379311b 100644 --- a/test/fixtures/wpt/interfaces/dom.idl +++ b/test/fixtures/wpt/interfaces/dom.idl @@ -9,7 +9,7 @@ interface Event { readonly attribute DOMString type; readonly attribute EventTarget? target; - readonly attribute EventTarget? srcElement; // historical + readonly attribute EventTarget? srcElement; // legacy readonly attribute EventTarget? currentTarget; sequence composedPath(); @@ -20,12 +20,12 @@ interface Event { readonly attribute unsigned short eventPhase; undefined stopPropagation(); - attribute boolean cancelBubble; // historical alias of .stopPropagation + attribute boolean cancelBubble; // legacy alias of .stopPropagation() undefined stopImmediatePropagation(); readonly attribute boolean bubbles; readonly attribute boolean cancelable; - attribute boolean returnValue; // historical + attribute boolean returnValue; // legacy undefined preventDefault(); readonly attribute boolean defaultPrevented; readonly attribute boolean composed; @@ -33,7 +33,7 @@ interface Event { [LegacyUnforgeable] readonly attribute boolean isTrusted; readonly attribute DOMHighResTimeStamp timeStamp; - undefined initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false); // historical + undefined initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false); // legacy }; dictionary EventInit { @@ -43,7 +43,7 @@ dictionary EventInit { }; partial interface Window { - [Replaceable] readonly attribute any event; // historical + [Replaceable] readonly attribute (Event or undefined) event; // legacy }; [Exposed=(Window,Worker)] @@ -52,7 +52,7 @@ interface CustomEvent : Event { readonly attribute any detail; - undefined initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null); // historical + undefined initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null); // legacy }; dictionary CustomEventInit : EventInit { @@ -79,6 +79,7 @@ dictionary EventListenerOptions { dictionary AddEventListenerOptions : EventListenerOptions { boolean passive = false; boolean once = false; + AbortSignal signal; }; [Exposed=(Window,Worker)] @@ -201,14 +202,14 @@ interface Node : EventTarget { const unsigned short ATTRIBUTE_NODE = 2; const unsigned short TEXT_NODE = 3; const unsigned short CDATA_SECTION_NODE = 4; - const unsigned short ENTITY_REFERENCE_NODE = 5; // historical - const unsigned short ENTITY_NODE = 6; // historical + const unsigned short ENTITY_REFERENCE_NODE = 5; // legacy + const unsigned short ENTITY_NODE = 6; // legacy const unsigned short PROCESSING_INSTRUCTION_NODE = 7; const unsigned short COMMENT_NODE = 8; const unsigned short DOCUMENT_NODE = 9; const unsigned short DOCUMENT_TYPE_NODE = 10; const unsigned short DOCUMENT_FRAGMENT_NODE = 11; - const unsigned short NOTATION_NODE = 12; // historical + const unsigned short NOTATION_NODE = 12; // legacy readonly attribute unsigned short nodeType; readonly attribute DOMString nodeName; @@ -232,7 +233,7 @@ interface Node : EventTarget { [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); boolean isEqualNode(Node? otherNode); - boolean isSameNode(Node? otherNode); // historical alias of === + boolean isSameNode(Node? otherNode); // legacy alias of === const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; @@ -266,8 +267,8 @@ interface Document : Node { readonly attribute USVString documentURI; readonly attribute DOMString compatMode; readonly attribute DOMString characterSet; - readonly attribute DOMString charset; // historical alias of .characterSet - readonly attribute DOMString inputEncoding; // historical alias of .characterSet + readonly attribute DOMString charset; // legacy alias of .characterSet + readonly attribute DOMString inputEncoding; // legacy alias of .characterSet readonly attribute DOMString contentType; readonly attribute DocumentType? doctype; @@ -290,7 +291,7 @@ interface Document : Node { [NewObject] Attr createAttribute(DOMString localName); [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); - [NewObject] Event createEvent(DOMString interface); // historical + [NewObject] Event createEvent(DOMString interface); // legacy [NewObject] Range createRange(); @@ -372,14 +373,14 @@ interface Element : Node { Element? closest(DOMString selectors); boolean matches(DOMString selectors); - boolean webkitMatchesSelector(DOMString selectors); // historical alias of .matches + boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches HTMLCollection getElementsByTagName(DOMString qualifiedName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // historical - undefined insertAdjacentText(DOMString where, DOMString data); // historical + [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // legacy + undefined insertAdjacentText(DOMString where, DOMString data); // legacy }; dictionary ShadowRootInit { @@ -545,14 +546,14 @@ callback interface NodeFilter { const unsigned long SHOW_ATTRIBUTE = 0x2; const unsigned long SHOW_TEXT = 0x4; const unsigned long SHOW_CDATA_SECTION = 0x8; - const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical - const unsigned long SHOW_ENTITY = 0x20; // historical + const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // legacy + const unsigned long SHOW_ENTITY = 0x20; // legacy const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40; const unsigned long SHOW_COMMENT = 0x80; const unsigned long SHOW_DOCUMENT = 0x100; const unsigned long SHOW_DOCUMENT_TYPE = 0x200; const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400; - const unsigned long SHOW_NOTATION = 0x800; // historical + const unsigned long SHOW_NOTATION = 0x800; // legacy unsigned short acceptNode(Node node); }; diff --git a/test/fixtures/wpt/interfaces/html.idl b/test/fixtures/wpt/interfaces/html.idl index bf8da3733ec26f..dfe4e1e586b5a2 100644 --- a/test/fixtures/wpt/interfaces/html.idl +++ b/test/fixtures/wpt/interfaces/html.idl @@ -1701,8 +1701,7 @@ interface Window : EventTarget { // the user agent readonly attribute Navigator navigator; - [SecureContext] readonly attribute ApplicationCache applicationCache; - readonly attribute boolean originIsolated; + readonly attribute boolean originAgentCluster; // user prompts undefined alert(); @@ -1801,39 +1800,6 @@ interface BeforeUnloadEvent : Event { attribute DOMString returnValue; }; -[SecureContext, - Exposed=Window] -interface ApplicationCache : EventTarget { - - // update status - const unsigned short UNCACHED = 0; - const unsigned short IDLE = 1; - const unsigned short CHECKING = 2; - const unsigned short DOWNLOADING = 3; - const unsigned short UPDATEREADY = 4; - const unsigned short OBSOLETE = 5; - readonly attribute unsigned short status; - - // updates - undefined update(); - undefined abort(); - undefined swapCache(); - - // events - attribute EventHandler onchecking; - attribute EventHandler onerror; - attribute EventHandler onnoupdate; - attribute EventHandler ondownloading; - attribute EventHandler onprogress; - attribute EventHandler onupdateready; - attribute EventHandler oncached; - attribute EventHandler onobsolete; -}; - -interface mixin NavigatorOnLine { - readonly attribute boolean onLine; -}; - [Exposed=(Window,Worker)] interface ErrorEvent : Event { constructor(DOMString type, optional ErrorEventInit eventInitDict = {}); @@ -2048,6 +2014,10 @@ interface mixin NavigatorLanguage { readonly attribute FrozenArray languages; }; +interface mixin NavigatorOnLine { + readonly attribute boolean onLine; +}; + interface mixin NavigatorContentUtils { [SecureContext] undefined registerProtocolHandler(DOMString scheme, USVString url); [SecureContext] undefined unregisterProtocolHandler(DOMString scheme, USVString url); diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index b6a871ea9da93f..3cbb5f8f99bbdb 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -16,7 +16,7 @@ "path": "resources" }, "interfaces": { - "commit": "8719553b2dd8f0f39d38253ccac2ee9ab4d6c87b", + "commit": "b4be9a3fdf18459a924f88e49bc55d8b30faa93a", "path": "interfaces" }, "html/webappapis/microtask-queuing": { From 181bd0510f91506be0b69071a51fa750e43f0956 Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Thu, 31 Dec 2020 10:29:49 +0300 Subject: [PATCH 068/161] doc: improve ALS.enterWith and exit descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36705 Refs: https://github.com/nodejs/node/issues/36683 Reviewed-By: James M Snell Reviewed-By: Gerhard Stöbich Reviewed-By: Rich Trott --- doc/api/async_hooks.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 08111b67a8507e..d8c3f63c3e876d 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -1000,7 +1000,7 @@ added: --> Creates a new instance of `AsyncLocalStorage`. Store is only provided within a -`run` method call. +`run` or after `enterWith` method call. ### `asyncLocalStorage.disable()` @@ -2698,6 +2721,7 @@ cases: [`subprocess.kill()`]: child_process.md#child_process_subprocess_kill_signal [`v8.setFlagsFromString()`]: v8.md#v8_v8_setflagsfromstring_flags [debugger]: debugger.md +[deprecation code]: deprecations.md [note on process I/O]: process.md#process_a_note_on_process_i_o [process.cpuUsage]: #process_process_cpuusage_previousvalue [process_emit_warning]: #process_process_emitwarning_warning_type_code_ctor From 214dbac8ff501ffb776045ef3d4f879db8aa406b Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 31 Dec 2020 15:02:48 -0800 Subject: [PATCH 072/161] doc: clarify undocumented stream properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/28592 Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/36715 Reviewed-By: Matteo Collina Reviewed-By: Rich Trott Reviewed-By: Robert Nagy Reviewed-By: Michaël Zasso --- doc/api/stream.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index e0e1145dad1048..e3cc88c2e32c1f 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -75,8 +75,7 @@ object mode is not safe. Both [`Writable`][] and [`Readable`][] streams will store data in an internal -buffer that can be retrieved using `writable.writableBuffer` or -`readable.readableBuffer`, respectively. +buffer. The amount of data potentially buffered depends on the `highWaterMark` option passed into the stream's constructor. For normal streams, the `highWaterMark` @@ -120,6 +119,11 @@ writing data *to* the socket. Because data may be written to the socket at a faster or slower rate than data is received, each side should operate (and buffer) independently of the other. +The mechanics of the internal buffering are an internal implementation detail +and may be changed at any time. However, for certain advanced implementations, +the internal buffers can be retrieved using `writable.writableBuffer` or +`readable.readableBuffer`. Use of these undocumented properties is discouraged. + ## API for stream consumers From 8b43388903b2721ee75ae5cded06e71b2c9d99d5 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 15 Dec 2020 11:52:17 -0800 Subject: [PATCH 073/161] src: reduce duplicated boilerplate with new env utility fn Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/36536 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Joyee Cheung --- src/README.md | 6 +----- src/cares_wrap.cc | 27 ++++----------------------- src/crypto/crypto_cipher.cc | 5 +---- src/crypto/crypto_context.cc | 7 ++----- src/crypto/crypto_dh.cc | 4 +--- src/crypto/crypto_ecdh.cc | 4 +--- src/crypto/crypto_hash.cc | 4 +--- src/crypto/crypto_hmac.cc | 4 +--- src/crypto/crypto_sig.cc | 8 ++------ src/crypto/crypto_util.h | 8 +------- src/env-inl.h | 18 ++++++++++++++++++ src/env.h | 8 ++++++++ src/fs_event_wrap.cc | 6 +----- src/inspector_js_api.cc | 10 ++++------ src/js_stream.cc | 8 +------- src/js_udp_wrap.cc | 8 +------- src/module_wrap.cc | 6 ++---- src/node_contextify.cc | 12 +----------- src/node_dir.cc | 10 +--------- src/node_file.cc | 16 ++-------------- src/node_http2.cc | 14 ++------------ src/node_http_parser.cc | 5 +---- src/node_messaging.cc | 26 +++++++++----------------- src/node_perf.cc | 3 +-- src/node_serdes.cc | 14 ++------------ src/node_sockaddr.cc | 6 +----- src/node_stat_watcher.cc | 7 +------ src/node_trace_events.cc | 5 +---- src/node_util.cc | 6 +----- src/node_wasi.cc | 6 +----- src/node_watchdog.cc | 9 +-------- src/node_worker.cc | 7 +------ src/node_zlib.cc | 7 +------ src/pipe_wrap.cc | 14 ++------------ src/process_wrap.cc | 7 +------ src/quic/node_quic_socket.cc | 14 ++------------ src/quic/node_quic_stream.cc | 9 +-------- src/signal_wrap.cc | 8 +------- src/stream_pipe.cc | 9 +-------- src/stream_wrap.cc | 15 ++------------- src/tcp_wrap.cc | 13 ++----------- src/udp_wrap.cc | 15 ++------------- src/uv.cc | 9 ++++----- 43 files changed, 95 insertions(+), 312 deletions(-) diff --git a/src/README.md b/src/README.md index 2be97e28b8fbea..aec56e7a7ba05a 100644 --- a/src/README.md +++ b/src/README.md @@ -405,11 +405,7 @@ void Initialize(Local target, env->SetProtoMethodNoSideEffect(channel_wrap, "getServers", GetServers); - Local channel_wrap_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "ChannelWrap"); - channel_wrap->SetClassName(channel_wrap_string); - target->Set(env->context(), channel_wrap_string, - channel_wrap->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "ChannelWrap", channel_wrap); } // Run the `Initialize` function when loading this module through diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 71766fa39171af..2bf4211b118602 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -2345,32 +2345,17 @@ void Initialize(Local target, Local aiw = BaseObject::MakeLazilyInitializedJSTemplate(env); aiw->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local addrInfoWrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "GetAddrInfoReqWrap"); - aiw->SetClassName(addrInfoWrapString); - target->Set(env->context(), - addrInfoWrapString, - aiw->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "GetAddrInfoReqWrap", aiw); Local niw = BaseObject::MakeLazilyInitializedJSTemplate(env); niw->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local nameInfoWrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "GetNameInfoReqWrap"); - niw->SetClassName(nameInfoWrapString); - target->Set(env->context(), - nameInfoWrapString, - niw->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "GetNameInfoReqWrap", niw); Local qrw = BaseObject::MakeLazilyInitializedJSTemplate(env); qrw->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local queryWrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "QueryReqWrap"); - qrw->SetClassName(queryWrapString); - target->Set(env->context(), - queryWrapString, - qrw->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "QueryReqWrap", qrw); Local channel_wrap = env->NewFunctionTemplate(ChannelWrap::New); @@ -2397,11 +2382,7 @@ void Initialize(Local target, env->SetProtoMethod(channel_wrap, "setLocalAddress", SetLocalAddress); env->SetProtoMethod(channel_wrap, "cancel", Cancel); - Local channelWrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "ChannelWrap"); - channel_wrap->SetClassName(channelWrapString); - target->Set(env->context(), channelWrapString, - channel_wrap->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "ChannelWrap", channel_wrap); } } // anonymous namespace diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc index f3939d3477c6ca..ddbf7114b673cd 100644 --- a/src/crypto/crypto_cipher.cc +++ b/src/crypto/crypto_cipher.cc @@ -265,10 +265,7 @@ void CipherBase::Initialize(Environment* env, Local target) { env->SetProtoMethodNoSideEffect(t, "getAuthTag", GetAuthTag); env->SetProtoMethod(t, "setAuthTag", SetAuthTag); env->SetProtoMethod(t, "setAAD", SetAAD); - - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "CipherBase"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "CipherBase", t); env->SetMethodNoSideEffect(target, "getSSLCiphers", GetSSLCiphers); env->SetMethodNoSideEffect(target, "getCiphers", GetCiphers); diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc index 612d21948495d4..874ae1c27c83ed 100644 --- a/src/crypto/crypto_context.cc +++ b/src/crypto/crypto_context.cc @@ -252,9 +252,6 @@ void SecureContext::Initialize(Environment* env, Local target) { t->InstanceTemplate()->SetInternalFieldCount( SecureContext::kInternalFieldCount); t->Inherit(BaseObject::GetConstructorTemplate(env)); - Local secureContextString = - FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"); - t->SetClassName(secureContextString); env->SetProtoMethod(t, "init", Init); env->SetProtoMethod(t, "setKey", SetKey); @@ -313,8 +310,8 @@ void SecureContext::Initialize(Environment* env, Local target) { Local(), static_cast(ReadOnly | DontDelete)); - target->Set(env->context(), secureContextString, - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "SecureContext", t); + env->set_secure_context_constructor_template(t); env->SetMethodNoSideEffect(target, "getRootCertificates", diff --git a/src/crypto/crypto_dh.cc b/src/crypto/crypto_dh.cc index a2720301cab356..b40f06f4500cd8 100644 --- a/src/crypto/crypto_dh.cc +++ b/src/crypto/crypto_dh.cc @@ -93,9 +93,7 @@ void DiffieHellman::Initialize(Environment* env, Local target) { Local(), attributes); - target->Set(env->context(), - name, - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, name, t); }; make(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellman"), New); diff --git a/src/crypto/crypto_ecdh.cc b/src/crypto/crypto_ecdh.cc index 277a5a731d37ae..efeb08b908e427 100644 --- a/src/crypto/crypto_ecdh.cc +++ b/src/crypto/crypto_ecdh.cc @@ -52,9 +52,7 @@ void ECDH::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "setPublicKey", SetPublicKey); env->SetProtoMethod(t, "setPrivateKey", SetPrivateKey); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "ECDH", t); env->SetMethodNoSideEffect(target, "ECDHConvertKey", ECDH::ConvertKey); env->SetMethodNoSideEffect(target, "getCurves", ECDH::GetCurves); diff --git a/src/crypto/crypto_hash.cc b/src/crypto/crypto_hash.cc index d49a7c5d022f0b..664ffb847215af 100644 --- a/src/crypto/crypto_hash.cc +++ b/src/crypto/crypto_hash.cc @@ -50,9 +50,7 @@ void Hash::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", HashUpdate); env->SetProtoMethod(t, "digest", HashDigest); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Hash"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Hash", t); env->SetMethodNoSideEffect(target, "getHashes", GetHashes); diff --git a/src/crypto/crypto_hmac.cc b/src/crypto/crypto_hmac.cc index ff7c1603020b50..055541196d26e1 100644 --- a/src/crypto/crypto_hmac.cc +++ b/src/crypto/crypto_hmac.cc @@ -48,9 +48,7 @@ void Hmac::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", HmacUpdate); env->SetProtoMethod(t, "digest", HmacDigest); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Hmac"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Hmac", t); HmacJob::Initialize(env, target); } diff --git a/src/crypto/crypto_sig.cc b/src/crypto/crypto_sig.cc index 59a9569ce8143c..a5a95878a9eeec 100644 --- a/src/crypto/crypto_sig.cc +++ b/src/crypto/crypto_sig.cc @@ -276,9 +276,7 @@ void Sign::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", SignUpdate); env->SetProtoMethod(t, "sign", SignFinal); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Sign"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Sign", t); env->SetMethod(target, "signOneShot", Sign::SignSync); @@ -396,9 +394,7 @@ void Verify::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", VerifyUpdate); env->SetProtoMethod(t, "verify", VerifyFinal); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Verify"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Verify", t); env->SetMethod(target, "verifyOneShot", Verify::VerifySync); } diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h index a8aa4a707f423a..3f245910ed83d1 100644 --- a/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h @@ -349,17 +349,11 @@ class CryptoJob : public AsyncWrap, public ThreadPoolWork { Environment* env, v8::Local target) { v8::Local job = env->NewFunctionTemplate(new_fn); - v8::Local class_name = - OneByteString(env->isolate(), CryptoJobTraits::JobName); - job->SetClassName(class_name); job->Inherit(AsyncWrap::GetConstructorTemplate(env)); job->InstanceTemplate()->SetInternalFieldCount( AsyncWrap::kInternalFieldCount); env->SetProtoMethod(job, "run", Run); - target->Set( - env->context(), - class_name, - job->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, CryptoJobTraits::JobName, job); } private: diff --git a/src/env-inl.h b/src/env-inl.h index e6a4067cd2547c..98badcd0362627 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -1028,6 +1028,24 @@ inline void Environment::SetInstanceMethod(v8::Local that, t->SetClassName(name_string); } +inline void Environment::SetConstructorFunction( + v8::Local that, + const char* name, + v8::Local tmpl) { + SetConstructorFunction(that, OneByteString(isolate(), name), tmpl); +} + +inline void Environment::SetConstructorFunction( + v8::Local that, + v8::Local name, + v8::Local tmpl) { + tmpl->SetClassName(name); + that->Set( + context(), + name, + tmpl->GetFunction(context()).ToLocalChecked()).Check(); +} + void Environment::AddCleanupHook(CleanupCallback fn, void* arg) { auto insertion_info = cleanup_hooks_.emplace(CleanupHookCallback { fn, arg, cleanup_hook_counter_++ diff --git a/src/env.h b/src/env.h index 8dc624b06fedfe..b930eb11c2595a 100644 --- a/src/env.h +++ b/src/env.h @@ -1236,6 +1236,14 @@ class Environment : public MemoryRetainer { const char* name, v8::FunctionCallback callback); + inline void SetConstructorFunction(v8::Local that, + const char* name, + v8::Local tmpl); + + inline void SetConstructorFunction(v8::Local that, + v8::Local name, + v8::Local tmpl); + void AtExit(void (*cb)(void* arg), void* arg); void RunAtExitCallbacks(); diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index faa650b7a10cf9..b79da7e83622c9 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -95,11 +95,9 @@ void FSEventWrap::Initialize(Local target, void* priv) { Environment* env = Environment::GetCurrent(context); - auto fsevent_string = FIXED_ONE_BYTE_STRING(env->isolate(), "FSEvent"); Local t = env->NewFunctionTemplate(New); t->InstanceTemplate()->SetInternalFieldCount( FSEventWrap::kInternalFieldCount); - t->SetClassName(fsevent_string); t->Inherit(HandleWrap::GetConstructorTemplate(env)); env->SetProtoMethod(t, "start", Start); @@ -116,9 +114,7 @@ void FSEventWrap::Initialize(Local target, Local(), static_cast(ReadOnly | DontDelete | DontEnum)); - target->Set(env->context(), - fsevent_string, - t->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "FSEvent", t); } diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index c0791ce3194ca4..8de1f8e7b0a88d 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -102,19 +102,17 @@ class JSBindingsConnection : public AsyncWrap { } static void Bind(Environment* env, Local target) { - Local class_name = ConnectionType::GetClassName(env); Local tmpl = env->NewFunctionTemplate(JSBindingsConnection::New); tmpl->InstanceTemplate()->SetInternalFieldCount( JSBindingsConnection::kInternalFieldCount); - tmpl->SetClassName(class_name); tmpl->Inherit(AsyncWrap::GetConstructorTemplate(env)); env->SetProtoMethod(tmpl, "dispatch", JSBindingsConnection::Dispatch); env->SetProtoMethod(tmpl, "disconnect", JSBindingsConnection::Disconnect); - target->Set(env->context(), - class_name, - tmpl->GetFunction(env->context()).ToLocalChecked()) - .ToChecked(); + env->SetConstructorFunction( + target, + ConnectionType::GetClassName(env), + tmpl); } static void New(const FunctionCallbackInfo& info) { diff --git a/src/js_stream.cc b/src/js_stream.cc index e4da0ce747e3a0..399e073efba697 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -19,7 +19,6 @@ using v8::HandleScope; using v8::Int32; using v8::Local; using v8::Object; -using v8::String; using v8::Value; @@ -200,9 +199,6 @@ void JSStream::Initialize(Local target, Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); - Local jsStreamString = - FIXED_ONE_BYTE_STRING(env->isolate(), "JSStream"); - t->SetClassName(jsStreamString); t->InstanceTemplate() ->SetInternalFieldCount(StreamBase::kInternalFieldCount); t->Inherit(AsyncWrap::GetConstructorTemplate(env)); @@ -213,9 +209,7 @@ void JSStream::Initialize(Local target, env->SetProtoMethod(t, "emitEOF", EmitEOF); StreamBase::AddMethods(env, t); - target->Set(env->context(), - jsStreamString, - t->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "JSStream", t); } } // namespace node diff --git a/src/js_udp_wrap.cc b/src/js_udp_wrap.cc index c51683141186f0..6a9bda5cad1ecb 100644 --- a/src/js_udp_wrap.cc +++ b/src/js_udp_wrap.cc @@ -16,7 +16,6 @@ using v8::HandleScope; using v8::Int32; using v8::Local; using v8::Object; -using v8::String; using v8::Value; // JSUDPWrap is a testing utility used by test/common/udppair.js @@ -195,9 +194,6 @@ void JSUDPWrap::Initialize(Local target, Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); - Local js_udp_wrap_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "JSUDPWrap"); - t->SetClassName(js_udp_wrap_string); t->InstanceTemplate() ->SetInternalFieldCount(UDPWrapBase::kUDPWrapBaseField + 1); t->Inherit(AsyncWrap::GetConstructorTemplate(env)); @@ -207,9 +203,7 @@ void JSUDPWrap::Initialize(Local target, env->SetProtoMethod(t, "onSendDone", OnSendDone); env->SetProtoMethod(t, "onAfterBind", OnAfterBind); - target->Set(env->context(), - js_udp_wrap_string, - t->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "JSUDPWrap", t); } diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 9302fa6f68d837..0ac36d4aa6373f 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -722,10 +722,8 @@ void ModuleWrap::Initialize(Local target, Local context, void* priv) { Environment* env = Environment::GetCurrent(context); - Isolate* isolate = env->isolate(); Local tpl = env->NewFunctionTemplate(New); - tpl->SetClassName(FIXED_ONE_BYTE_STRING(isolate, "ModuleWrap")); tpl->InstanceTemplate()->SetInternalFieldCount( ModuleWrap::kInternalFieldCount); tpl->Inherit(BaseObject::GetConstructorTemplate(env)); @@ -741,8 +739,8 @@ void ModuleWrap::Initialize(Local target, env->SetProtoMethodNoSideEffect(tpl, "getStaticDependencySpecifiers", GetStaticDependencySpecifiers); - target->Set(env->context(), FIXED_ONE_BYTE_STRING(isolate, "ModuleWrap"), - tpl->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "ModuleWrap", tpl); + env->SetMethod(target, "setImportModuleDynamicallyCallback", SetImportModuleDynamicallyCallback); diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 0accd99c0c4c5e..a0acdb75eede98 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1282,21 +1282,11 @@ void MicrotaskQueueWrap::New(const FunctionCallbackInfo& args) { void MicrotaskQueueWrap::Init(Environment* env, Local target) { HandleScope scope(env->isolate()); - Local class_name = - FIXED_ONE_BYTE_STRING(env->isolate(), "MicrotaskQueue"); - Local tmpl = env->NewFunctionTemplate(New); tmpl->InstanceTemplate()->SetInternalFieldCount( ContextifyScript::kInternalFieldCount); - tmpl->SetClassName(class_name); - - if (target->Set(env->context(), - class_name, - tmpl->GetFunction(env->context()).ToLocalChecked()) - .IsNothing()) { - return; - } env->set_microtask_queue_ctor_template(tmpl); + env->SetConstructorFunction(target, "MicrotaskQueue", tmpl); } diff --git a/src/node_dir.cc b/src/node_dir.cc index ac5739b99325c5..a8bb2a7083c4fc 100644 --- a/src/node_dir.cc +++ b/src/node_dir.cc @@ -39,7 +39,6 @@ using v8::Null; using v8::Number; using v8::Object; using v8::ObjectTemplate; -using v8::String; using v8::Value; #define TRACE_NAME(name) "fs_dir.sync." #name @@ -349,7 +348,6 @@ void Initialize(Local target, Local context, void* priv) { Environment* env = Environment::GetCurrent(context); - Isolate* isolate = env->isolate(); env->SetMethod(target, "opendir", OpenDir); @@ -360,13 +358,7 @@ void Initialize(Local target, env->SetProtoMethod(dir, "close", DirHandle::Close); Local dirt = dir->InstanceTemplate(); dirt->SetInternalFieldCount(DirHandle::kInternalFieldCount); - Local handleString = - FIXED_ONE_BYTE_STRING(isolate, "DirHandle"); - dir->SetClassName(handleString); - target - ->Set(context, handleString, - dir->GetFunction(env->context()).ToLocalChecked()) - .FromJust(); + env->SetConstructorFunction(target, "DirHandle", dir); env->set_dir_instance_template(dirt); } diff --git a/src/node_file.cc b/src/node_file.cc index 5abdc6a941c0d2..ac1d6aa74aa0b5 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -2471,13 +2471,7 @@ void Initialize(Local target, fst->InstanceTemplate()->SetInternalFieldCount( FSReqBase::kInternalFieldCount); fst->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local wrapString = - FIXED_ONE_BYTE_STRING(isolate, "FSReqCallback"); - fst->SetClassName(wrapString); - target - ->Set(context, wrapString, - fst->GetFunction(env->context()).ToLocalChecked()) - .Check(); + env->SetConstructorFunction(target, "FSReqCallback", fst); // Create FunctionTemplate for FileHandleReadWrap. There’s no need // to do anything in the constructor, so we only store the instance template. @@ -2508,14 +2502,8 @@ void Initialize(Local target, env->SetProtoMethod(fd, "releaseFD", FileHandle::ReleaseFD); Local fdt = fd->InstanceTemplate(); fdt->SetInternalFieldCount(StreamBase::kInternalFieldCount); - Local handleString = - FIXED_ONE_BYTE_STRING(isolate, "FileHandle"); - fd->SetClassName(handleString); StreamBase::AddMethods(env, fd); - target - ->Set(context, handleString, - fd->GetFunction(env->context()).ToLocalChecked()) - .Check(); + env->SetConstructorFunction(target, "FileHandle", fd); env->set_fd_constructor_template(fdt); // Create FunctionTemplate for FileHandle::CloseReq diff --git a/src/node_http2.cc b/src/node_http2.cc index 1e2da918bf5b69..930167418e18db 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -3054,9 +3054,6 @@ void Initialize(Local target, env->SetMethod(target, "packSettings", PackSettings); env->SetMethod(target, "setCallbackFunctions", SetCallbackFunctions); - Local http2SessionClassName = - FIXED_ONE_BYTE_STRING(isolate, "Http2Session"); - Local ping = FunctionTemplate::New(env->isolate()); ping->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Ping")); ping->Inherit(AsyncWrap::GetConstructorTemplate(env)); @@ -3065,14 +3062,12 @@ void Initialize(Local target, env->set_http2ping_constructor_template(pingt); Local setting = FunctionTemplate::New(env->isolate()); - setting->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Setting")); setting->Inherit(AsyncWrap::GetConstructorTemplate(env)); Local settingt = setting->InstanceTemplate(); settingt->SetInternalFieldCount(AsyncWrap::kInternalFieldCount); env->set_http2settings_constructor_template(settingt); Local stream = FunctionTemplate::New(env->isolate()); - stream->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Stream")); env->SetProtoMethod(stream, "id", Http2Stream::GetID); env->SetProtoMethod(stream, "destroy", Http2Stream::Destroy); env->SetProtoMethod(stream, "priority", Http2Stream::Priority); @@ -3087,13 +3082,10 @@ void Initialize(Local target, Local streamt = stream->InstanceTemplate(); streamt->SetInternalFieldCount(StreamBase::kInternalFieldCount); env->set_http2stream_constructor_template(streamt); - target->Set(context, - FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Stream"), - stream->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Http2Stream", stream); Local session = env->NewFunctionTemplate(Http2Session::New); - session->SetClassName(http2SessionClassName); session->InstanceTemplate()->SetInternalFieldCount( Http2Session::kInternalFieldCount); session->Inherit(AsyncWrap::GetConstructorTemplate(env)); @@ -3119,9 +3111,7 @@ void Initialize(Local target, env->SetProtoMethod( session, "remoteSettings", Http2Session::RefreshSettings); - target->Set(context, - http2SessionClassName, - session->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Http2Session", session); Local constants = Object::New(isolate); diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 706e6132db6212..affc66585ed89a 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -956,7 +956,6 @@ void InitializeHttpParser(Local target, Local t = env->NewFunctionTemplate(Parser::New); t->InstanceTemplate()->SetInternalFieldCount(Parser::kInternalFieldCount); - t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "HTTPParser")); t->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "REQUEST"), Integer::New(env->isolate(), HTTP_REQUEST)); @@ -999,9 +998,7 @@ void InitializeHttpParser(Local target, env->SetProtoMethod(t, "unconsume", Parser::Unconsume); env->SetProtoMethod(t, "getCurrentBuffer", Parser::GetCurrentBuffer); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "HTTPParser"), - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "HTTPParser", t); } } // anonymous namespace diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 5f054c41c8eb04..78fb46ab6f2803 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -1415,32 +1415,24 @@ static void InitMessaging(Local target, Environment* env = Environment::GetCurrent(context); { - Local message_channel_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "MessageChannel"); - Local templ = env->NewFunctionTemplate(MessageChannel); - templ->SetClassName(message_channel_string); - target->Set(context, - message_channel_string, - templ->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction( + target, + "MessageChannel", + env->NewFunctionTemplate(MessageChannel)); } { - Local js_transferable_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "JSTransferable"); Local t = env->NewFunctionTemplate(JSTransferable::New); t->Inherit(BaseObject::GetConstructorTemplate(env)); - t->SetClassName(js_transferable_string); t->InstanceTemplate()->SetInternalFieldCount( JSTransferable::kInternalFieldCount); - target->Set(context, - js_transferable_string, - t->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "JSTransferable", t); } - target->Set(context, - env->message_port_constructor_string(), - GetMessagePortConstructorTemplate(env) - ->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction( + target, + env->message_port_constructor_string(), + GetMessagePortConstructorTemplate(env)); // These are not methods on the MessagePort prototype, because // the browser equivalents do not provide them. diff --git a/src/node_perf.cc b/src/node_perf.cc index 1eddb00f48a6d2..4d977d4ba61789 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -705,8 +705,7 @@ void Initialize(Local target, env->SetProtoMethod(eldh, "enable", ELDHistogramEnable); env->SetProtoMethod(eldh, "disable", ELDHistogramDisable); env->SetProtoMethod(eldh, "reset", ELDHistogramReset); - target->Set(context, eldh_classname, - eldh->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, eldh_classname, eldh); } } // namespace performance diff --git a/src/node_serdes.cc b/src/node_serdes.cc index b51d315989ce71..879253f9bc2ebc 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -475,13 +475,8 @@ void Initialize(Local target, "_setTreatArrayBufferViewsAsHostObjects", SerializerContext::SetTreatArrayBufferViewsAsHostObjects); - Local serializerString = - FIXED_ONE_BYTE_STRING(env->isolate(), "Serializer"); - ser->SetClassName(serializerString); ser->ReadOnlyPrototype(); - target->Set(env->context(), - serializerString, - ser->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Serializer", ser); Local des = env->NewFunctionTemplate(DeserializerContext::New); @@ -503,14 +498,9 @@ void Initialize(Local target, env->SetProtoMethod(des, "readDouble", DeserializerContext::ReadDouble); env->SetProtoMethod(des, "_readRawBytes", DeserializerContext::ReadRawBytes); - Local deserializerString = - FIXED_ONE_BYTE_STRING(env->isolate(), "Deserializer"); des->SetLength(1); des->ReadOnlyPrototype(); - des->SetClassName(deserializerString); - target->Set(env->context(), - deserializerString, - des->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Deserializer", des); } } // anonymous namespace diff --git a/src/node_sockaddr.cc b/src/node_sockaddr.cc index 8d7c93255b0d81..3734453314a087 100644 --- a/src/node_sockaddr.cc +++ b/src/node_sockaddr.cc @@ -18,7 +18,6 @@ using v8::FunctionTemplate; using v8::Local; using v8::MaybeLocal; using v8::Object; -using v8::String; using v8::Value; namespace { @@ -675,11 +674,9 @@ void SocketAddressBlockListWrap::Initialize( void* priv) { Environment* env = Environment::GetCurrent(context); - Local name = FIXED_ONE_BYTE_STRING(env->isolate(), "BlockList"); Local t = env->NewFunctionTemplate(SocketAddressBlockListWrap::New); t->InstanceTemplate()->SetInternalFieldCount(BaseObject::kInternalFieldCount); - t->SetClassName(name); env->SetProtoMethod(t, "addAddress", SocketAddressBlockListWrap::AddAddress); env->SetProtoMethod(t, "addRange", SocketAddressBlockListWrap::AddRange); @@ -688,8 +685,7 @@ void SocketAddressBlockListWrap::Initialize( env->SetProtoMethod(t, "getRules", SocketAddressBlockListWrap::GetRules); env->set_blocklist_instance_template(t->InstanceTemplate()); - target->Set(env->context(), name, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + env->SetConstructorFunction(target, "BlockList", t); NODE_DEFINE_CONSTANT(target, AF_INET); NODE_DEFINE_CONSTANT(target, AF_INET6); diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index 70903525baa735..344ea6bb7ea2e6 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -38,7 +38,6 @@ using v8::HandleScope; using v8::Integer; using v8::Local; using v8::Object; -using v8::String; using v8::Uint32; using v8::Value; @@ -49,15 +48,11 @@ void StatWatcher::Initialize(Environment* env, Local target) { Local t = env->NewFunctionTemplate(StatWatcher::New); t->InstanceTemplate()->SetInternalFieldCount( StatWatcher::kInternalFieldCount); - Local statWatcherString = - FIXED_ONE_BYTE_STRING(env->isolate(), "StatWatcher"); - t->SetClassName(statWatcherString); t->Inherit(HandleWrap::GetConstructorTemplate(env)); env->SetProtoMethod(t, "start", StatWatcher::Start); - target->Set(env->context(), statWatcherString, - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "StatWatcher", t); } diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 9cefaa9227031d..af60aff4ab7bbe 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -138,10 +138,7 @@ void NodeCategorySet::Initialize(Local target, env->SetProtoMethod(category_set, "enable", NodeCategorySet::Enable); env->SetProtoMethod(category_set, "disable", NodeCategorySet::Disable); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "CategorySet"), - category_set->GetFunction(env->context()).ToLocalChecked()) - .Check(); + env->SetConstructorFunction(target, "CategorySet", category_set); Local isTraceCategoryEnabled = FIXED_ONE_BYTE_STRING(env->isolate(), "isTraceCategoryEnabled"); diff --git a/src/node_util.cc b/src/node_util.cc index 3eefa73739aa3c..3f829081cb37ff 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -352,19 +352,15 @@ void Initialize(Local target, env->should_abort_on_uncaught_toggle().GetJSArray()) .FromJust()); - Local weak_ref_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "WeakReference"); Local weak_ref = env->NewFunctionTemplate(WeakReference::New); weak_ref->InstanceTemplate()->SetInternalFieldCount( WeakReference::kInternalFieldCount); - weak_ref->SetClassName(weak_ref_string); weak_ref->Inherit(BaseObject::GetConstructorTemplate(env)); env->SetProtoMethod(weak_ref, "get", WeakReference::Get); env->SetProtoMethod(weak_ref, "incRef", WeakReference::IncRef); env->SetProtoMethod(weak_ref, "decRef", WeakReference::DecRef); - target->Set(context, weak_ref_string, - weak_ref->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "WeakReference", weak_ref); env->SetMethod(target, "guessHandleType", GuessHandleType); } diff --git a/src/node_wasi.cc b/src/node_wasi.cc index 4dd534af4167ee..67d3966e2013a1 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc @@ -1676,9 +1676,7 @@ static void Initialize(Local target, Environment* env = Environment::GetCurrent(context); Local tmpl = env->NewFunctionTemplate(WASI::New); - auto wasi_wrap_string = FIXED_ONE_BYTE_STRING(env->isolate(), "WASI"); tmpl->InstanceTemplate()->SetInternalFieldCount(WASI::kInternalFieldCount); - tmpl->SetClassName(wasi_wrap_string); tmpl->Inherit(BaseObject::GetConstructorTemplate(env)); env->SetProtoMethod(tmpl, "args_get", WASI::ArgsGet); @@ -1731,9 +1729,7 @@ static void Initialize(Local target, env->SetInstanceMethod(tmpl, "_setMemory", WASI::_SetMemory); - target->Set(env->context(), - wasi_wrap_string, - tmpl->GetFunction(context).ToLocalChecked()).ToChecked(); + env->SetConstructorFunction(target, "WASI", tmpl); } diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index 8bd3b283b5329d..ff2a0229087138 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -124,19 +124,12 @@ void TraceSigintWatchdog::Init(Environment* env, Local target) { Local constructor = env->NewFunctionTemplate(New); constructor->InstanceTemplate()->SetInternalFieldCount( TraceSigintWatchdog::kInternalFieldCount); - Local js_sigint_watch_dog = - FIXED_ONE_BYTE_STRING(env->isolate(), "TraceSigintWatchdog"); - constructor->SetClassName(js_sigint_watch_dog); constructor->Inherit(HandleWrap::GetConstructorTemplate(env)); env->SetProtoMethod(constructor, "start", Start); env->SetProtoMethod(constructor, "stop", Stop); - target - ->Set(env->context(), - js_sigint_watch_dog, - constructor->GetFunction(env->context()).ToLocalChecked()) - .Check(); + env->SetConstructorFunction(target, "TraceSigintWatchdog", constructor); } void TraceSigintWatchdog::New(const FunctionCallbackInfo& args) { diff --git a/src/node_worker.cc b/src/node_worker.cc index 7369e13768e2d9..d163ec2461da07 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -815,12 +815,7 @@ void InitWorker(Local target, env->SetProtoMethod(w, "loopIdleTime", Worker::LoopIdleTime); env->SetProtoMethod(w, "loopStartTime", Worker::LoopStartTime); - Local workerString = - FIXED_ONE_BYTE_STRING(env->isolate(), "Worker"); - w->SetClassName(workerString); - target->Set(env->context(), - workerString, - w->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Worker", w); } { diff --git a/src/node_zlib.cc b/src/node_zlib.cc index efb11debf8f40d..2a2466052c92a5 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -54,7 +54,6 @@ using v8::Int32; using v8::Integer; using v8::Local; using v8::Object; -using v8::String; using v8::Uint32Array; using v8::Value; @@ -1262,11 +1261,7 @@ struct MakeClass { env->SetProtoMethod(z, "params", Stream::Params); env->SetProtoMethod(z, "reset", Stream::Reset); - Local zlibString = OneByteString(env->isolate(), name); - z->SetClassName(zlibString); - target->Set(env->context(), - zlibString, - z->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, name, z); } }; diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 1396395463dfed..7ec3c66a78bb95 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -43,7 +43,6 @@ using v8::Int32; using v8::Local; using v8::MaybeLocal; using v8::Object; -using v8::String; using v8::Value; MaybeLocal PipeWrap::Instantiate(Environment* env, @@ -69,8 +68,6 @@ void PipeWrap::Initialize(Local target, Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); - Local pipeString = FIXED_ONE_BYTE_STRING(env->isolate(), "Pipe"); - t->SetClassName(pipeString); t->InstanceTemplate() ->SetInternalFieldCount(StreamBase::kInternalFieldCount); @@ -87,20 +84,13 @@ void PipeWrap::Initialize(Local target, env->SetProtoMethod(t, "fchmod", Fchmod); - target->Set(env->context(), - pipeString, - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Pipe", t); env->set_pipe_constructor_template(t); // Create FunctionTemplate for PipeConnectWrap. auto cwt = BaseObject::MakeLazilyInitializedJSTemplate(env); cwt->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local wrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "PipeConnectWrap"); - cwt->SetClassName(wrapString); - target->Set(env->context(), - wrapString, - cwt->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "PipeConnectWrap", cwt); // Define constants Local constants = Object::New(env->isolate()); diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 3d1065c9922183..7628a1264c57f4 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -54,18 +54,13 @@ class ProcessWrap : public HandleWrap { Local constructor = env->NewFunctionTemplate(New); constructor->InstanceTemplate()->SetInternalFieldCount( ProcessWrap::kInternalFieldCount); - Local processString = - FIXED_ONE_BYTE_STRING(env->isolate(), "Process"); - constructor->SetClassName(processString); constructor->Inherit(HandleWrap::GetConstructorTemplate(env)); env->SetProtoMethod(constructor, "spawn", Spawn); env->SetProtoMethod(constructor, "kill", Kill); - target->Set(env->context(), - processString, - constructor->GetFunction(context).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "Process", constructor); } SET_NO_MEMORY_INFO() diff --git a/src/quic/node_quic_socket.cc b/src/quic/node_quic_socket.cc index abbdd50e47040b..810705014ca94d 100644 --- a/src/quic/node_quic_socket.cc +++ b/src/quic/node_quic_socket.cc @@ -39,7 +39,6 @@ using v8::Number; using v8::Object; using v8::ObjectTemplate; using v8::PropertyAttribute; -using v8::String; using v8::Value; namespace quic { @@ -1154,10 +1153,8 @@ void QuicEndpoint::Initialize( Local target, Local context) { Isolate* isolate = env->isolate(); - Local class_name = FIXED_ONE_BYTE_STRING(isolate, "QuicEndpoint"); Local endpoint = env->NewFunctionTemplate(NewQuicEndpoint); endpoint->Inherit(BaseObject::GetConstructorTemplate(env)); - endpoint->SetClassName(class_name); endpoint->InstanceTemplate()->SetInternalFieldCount( QuicEndpoint::kInternalFieldCount); env->SetProtoMethod(endpoint, @@ -1165,11 +1162,7 @@ void QuicEndpoint::Initialize( QuicEndpointWaitForPendingCallbacks); endpoint->InstanceTemplate()->Set(env->owner_symbol(), Null(isolate)); - target->Set( - context, - class_name, - endpoint->GetFunction(context).ToLocalChecked()) - .FromJust(); + env->SetConstructorFunction(target, "QuicEndpoint", endpoint); } void QuicSocket::Initialize( @@ -1177,10 +1170,8 @@ void QuicSocket::Initialize( Local target, Local context) { Isolate* isolate = env->isolate(); - Local class_name = FIXED_ONE_BYTE_STRING(isolate, "QuicSocket"); Local socket = env->NewFunctionTemplate(NewQuicSocket); socket->Inherit(AsyncWrap::GetConstructorTemplate(env)); - socket->SetClassName(class_name); socket->InstanceTemplate()->SetInternalFieldCount( QuicSocket::kInternalFieldCount); socket->InstanceTemplate()->Set(env->owner_symbol(), Null(isolate)); @@ -1197,8 +1188,7 @@ void QuicSocket::Initialize( "setDiagnosticPacketLoss", QuicSocketSetDiagnosticPacketLoss); socket->Inherit(HandleWrap::GetConstructorTemplate(env)); - target->Set(context, class_name, - socket->GetFunction(env->context()).ToLocalChecked()).FromJust(); + env->SetConstructorFunction(target, "QuicSocket", socket); Local sendwrap_ctor = FunctionTemplate::New(isolate); sendwrap_ctor->Inherit(AsyncWrap::GetConstructorTemplate(env)); diff --git a/src/quic/node_quic_stream.cc b/src/quic/node_quic_stream.cc index d63e66988ac2ac..57976ae50d9898 100644 --- a/src/quic/node_quic_stream.cc +++ b/src/quic/node_quic_stream.cc @@ -26,12 +26,10 @@ using v8::Array; using v8::Context; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Isolate; using v8::Local; using v8::Object; using v8::ObjectTemplate; using v8::PropertyAttribute; -using v8::String; using v8::Value; namespace quic { @@ -525,10 +523,7 @@ void QuicStream::Initialize( Environment* env, Local target, Local context) { - Isolate* isolate = env->isolate(); - Local class_name = FIXED_ONE_BYTE_STRING(isolate, "QuicStream"); Local stream = FunctionTemplate::New(env->isolate()); - stream->SetClassName(class_name); stream->Inherit(AsyncWrap::GetConstructorTemplate(env)); StreamBase::AddMethods(env, stream); Local streamt = stream->InstanceTemplate(); @@ -543,9 +538,7 @@ void QuicStream::Initialize( env->SetProtoMethod(stream, "submitTrailers", QuicStreamSubmitTrailers); env->SetProtoMethod(stream, "submitPush", QuicStreamSubmitPush); env->set_quicserverstream_instance_template(streamt); - target->Set(env->context(), - class_name, - stream->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "QuicStream", stream); env->SetMethod(target, "openBidirectionalStream", OpenBidirectionalStream); env->SetMethod(target, "openUnidirectionalStream", OpenUnidirectionalStream); diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 2be7ac9834100b..49ea849f637cf7 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -35,7 +35,6 @@ using v8::HandleScope; using v8::Integer; using v8::Local; using v8::Object; -using v8::String; using v8::Value; void DecreaseSignalHandlerCount(int signum); @@ -55,17 +54,12 @@ class SignalWrap : public HandleWrap { Local constructor = env->NewFunctionTemplate(New); constructor->InstanceTemplate()->SetInternalFieldCount( SignalWrap::kInternalFieldCount); - Local signalString = - FIXED_ONE_BYTE_STRING(env->isolate(), "Signal"); - constructor->SetClassName(signalString); constructor->Inherit(HandleWrap::GetConstructorTemplate(env)); env->SetProtoMethod(constructor, "start", Start); env->SetProtoMethod(constructor, "stop", Stop); - target->Set(env->context(), signalString, - constructor->GetFunction(env->context()).ToLocalChecked()) - .Check(); + env->SetConstructorFunction(target, "Signal", constructor); } SET_NO_MEMORY_INFO() diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 1422f9e0ea548e..afd7ec36eef294 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -13,7 +13,6 @@ using v8::FunctionTemplate; using v8::HandleScope; using v8::Local; using v8::Object; -using v8::String; using v8::Value; StreamPipe::StreamPipe(StreamBase* source, @@ -293,20 +292,14 @@ void InitializeStreamPipe(Local target, // Create FunctionTemplate for FileHandle::CloseReq Local pipe = env->NewFunctionTemplate(StreamPipe::New); - Local stream_pipe_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "StreamPipe"); env->SetProtoMethod(pipe, "unpipe", StreamPipe::Unpipe); env->SetProtoMethod(pipe, "start", StreamPipe::Start); env->SetProtoMethod(pipe, "isClosed", StreamPipe::IsClosed); env->SetProtoMethod(pipe, "pendingWrites", StreamPipe::PendingWrites); pipe->Inherit(AsyncWrap::GetConstructorTemplate(env)); - pipe->SetClassName(stream_pipe_string); pipe->InstanceTemplate()->SetInternalFieldCount( StreamPipe::kInternalFieldCount); - target - ->Set(context, stream_pipe_string, - pipe->GetFunction(context).ToLocalChecked()) - .Check(); + env->SetConstructorFunction(target, "StreamPipe", pipe); } } // anonymous namespace diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index bd396110fccade..a1fa5e94b73711 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -49,7 +49,6 @@ using v8::Object; using v8::PropertyAttribute; using v8::ReadOnly; using v8::Signature; -using v8::String; using v8::Value; @@ -67,9 +66,6 @@ void LibuvStreamWrap::Initialize(Local target, Local sw = FunctionTemplate::New(env->isolate(), is_construct_call_callback); sw->InstanceTemplate()->SetInternalFieldCount(StreamReq::kInternalFieldCount); - Local wrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "ShutdownWrap"); - sw->SetClassName(wrapString); // we need to set handle and callback to null, // so that those fields are created and functions @@ -88,22 +84,15 @@ void LibuvStreamWrap::Initialize(Local target, sw->Inherit(AsyncWrap::GetConstructorTemplate(env)); - target->Set(env->context(), - wrapString, - sw->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "ShutdownWrap", sw); env->set_shutdown_wrap_template(sw->InstanceTemplate()); Local ww = FunctionTemplate::New(env->isolate(), is_construct_call_callback); ww->InstanceTemplate()->SetInternalFieldCount( StreamReq::kInternalFieldCount); - Local writeWrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "WriteWrap"); - ww->SetClassName(writeWrapString); ww->Inherit(AsyncWrap::GetConstructorTemplate(env)); - target->Set(env->context(), - writeWrapString, - ww->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "WriteWrap", ww); env->set_write_wrap_template(ww->InstanceTemplate()); NODE_DEFINE_CONSTANT(target, kReadBytesOrError); diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index fa45bd118d4724..cd7174984e2e36 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -74,8 +74,6 @@ void TCPWrap::Initialize(Local target, Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); - Local tcpString = FIXED_ONE_BYTE_STRING(env->isolate(), "TCP"); - t->SetClassName(tcpString); t->InstanceTemplate()->SetInternalFieldCount(StreamBase::kInternalFieldCount); // Init properties @@ -103,21 +101,14 @@ void TCPWrap::Initialize(Local target, env->SetProtoMethod(t, "setSimultaneousAccepts", SetSimultaneousAccepts); #endif - target->Set(env->context(), - tcpString, - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "TCP", t); env->set_tcp_constructor_template(t); // Create FunctionTemplate for TCPConnectWrap. Local cwt = BaseObject::MakeLazilyInitializedJSTemplate(env); cwt->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local wrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "TCPConnectWrap"); - cwt->SetClassName(wrapString); - target->Set(env->context(), - wrapString, - cwt->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "TCPConnectWrap", cwt); // Define constants Local constants = Object::New(env->isolate()); diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 26bafebcb22c14..e746f62c5edd81 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -43,7 +43,6 @@ using v8::Object; using v8::PropertyAttribute; using v8::ReadOnly; using v8::Signature; -using v8::String; using v8::Uint32; using v8::Undefined; using v8::Value; @@ -134,9 +133,6 @@ void UDPWrap::Initialize(Local target, Local t = env->NewFunctionTemplate(New); t->InstanceTemplate()->SetInternalFieldCount( UDPWrapBase::kInternalFieldCount); - Local udpString = - FIXED_ONE_BYTE_STRING(env->isolate(), "UDP"); - t->SetClassName(udpString); enum PropertyAttribute attributes = static_cast(ReadOnly | DontDelete); @@ -182,9 +178,7 @@ void UDPWrap::Initialize(Local target, t->Inherit(HandleWrap::GetConstructorTemplate(env)); - target->Set(env->context(), - udpString, - t->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "UDP", t); env->set_udp_constructor_function( t->GetFunction(env->context()).ToLocalChecked()); @@ -192,12 +186,7 @@ void UDPWrap::Initialize(Local target, Local swt = BaseObject::MakeLazilyInitializedJSTemplate(env); swt->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local sendWrapString = - FIXED_ONE_BYTE_STRING(env->isolate(), "SendWrap"); - swt->SetClassName(sendWrapString); - target->Set(env->context(), - sendWrapString, - swt->GetFunction(env->context()).ToLocalChecked()).Check(); + env->SetConstructorFunction(target, "SendWrap", swt); Local constants = Object::New(env->isolate()); NODE_DEFINE_CONSTANT(constants, UV_UDP_IPV6ONLY); diff --git a/src/uv.cc b/src/uv.cc index bf50c88111fa90..e4b428f339b578 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -106,11 +106,10 @@ void Initialize(Local target, void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(isolate, "errname"), - env->NewFunctionTemplate(ErrName) - ->GetFunction(env->context()) - .ToLocalChecked()).Check(); + env->SetConstructorFunction( + target, + "errname", + env->NewFunctionTemplate(ErrName)); // TODO(joyeecheung): This should be deprecated in user land in favor of // `util.getSystemErrorName(err)`. From 9bc2cec848f0b4a40388f598e35767aba8033741 Mon Sep 17 00:00:00 2001 From: Thiago Padilha Date: Mon, 2 Sep 2019 15:51:29 -0300 Subject: [PATCH 074/161] child_process: add 'overlapped' stdio flag The 'overlapped' value sets the UV_OVERLAPPED_PIPE libuv flag in the child process stdio. Fixes: https://github.com/nodejs/node/issues/29238 PR-URL: https://github.com/nodejs/node/pull/29412 Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell --- doc/api/child_process.md | 22 +++-- lib/internal/child_process.js | 6 +- node.gyp | 18 ++++ src/env.h | 1 + src/process_wrap.cc | 5 ++ test/overlapped-checker/main_unix.c | 51 +++++++++++ test/overlapped-checker/main_win.c | 85 +++++++++++++++++++ .../test-child-process-stdio-overlapped.js | 75 ++++++++++++++++ 8 files changed, 255 insertions(+), 8 deletions(-) create mode 100644 test/overlapped-checker/main_unix.c create mode 100644 test/overlapped-checker/main_win.c create mode 100644 test/parallel/test-child-process-stdio-overlapped.js diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 02ea48df44d16d..0f022eb9482710 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -660,6 +660,9 @@ subprocess.unref(); - -##### Checklist - +For code changes: +1. Include tests for any bug fixes or new features. +2. Update documentation if relevant. +3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes. -- [ ] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes -- [ ] tests and/or benchmarks are included -- [ ] documentation is changed or added -- [ ] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines) - - ## Technology Sponsors diff --git a/tools/node_modules/eslint/lib/eslint/eslint.js b/tools/node_modules/eslint/lib/eslint/eslint.js index a51ffbfe41a637..0bd7a41c6fd2bc 100644 --- a/tools/node_modules/eslint/lib/eslint/eslint.js +++ b/tools/node_modules/eslint/lib/eslint/eslint.js @@ -272,7 +272,7 @@ function processOptions({ errors.push("'rulePaths' must be an array of non-empty strings."); } if (typeof useEslintrc !== "boolean") { - errors.push("'useElintrc' must be a boolean."); + errors.push("'useEslintrc' must be a boolean."); } if (errors.length > 0) { @@ -563,7 +563,7 @@ class ESLint { /** * Returns the formatter representing the given formatter name. - * @param {string} [name] The name of the formattter to load. + * @param {string} [name] The name of the formatter to load. * The following values are allowed: * - `undefined` ... Load `stylish` builtin formatter. * - A builtin formatter name ... Load the builtin formatter. diff --git a/tools/node_modules/eslint/lib/rules/arrow-body-style.js b/tools/node_modules/eslint/lib/rules/arrow-body-style.js index 7b318ea8b3a165..b2167fde77bc7e 100644 --- a/tools/node_modules/eslint/lib/rules/arrow-body-style.js +++ b/tools/node_modules/eslint/lib/rules/arrow-body-style.js @@ -191,7 +191,7 @@ module.exports = { } /* - * If the first token of the reutrn value is `{` or the return value is a sequence expression, + * If the first token of the return value is `{` or the return value is a sequence expression, * enclose the return value by parentheses to avoid syntax error. */ if (astUtils.isOpeningBraceToken(firstValueToken) || blockBody[0].argument.type === "SequenceExpression" || (funcInfo.hasInOperator && isInsideForLoopInitializer(node))) { diff --git a/tools/node_modules/eslint/lib/rules/callback-return.js b/tools/node_modules/eslint/lib/rules/callback-return.js index ba13c9a6481768..fa66e6383b7cc7 100644 --- a/tools/node_modules/eslint/lib/rules/callback-return.js +++ b/tools/node_modules/eslint/lib/rules/callback-return.js @@ -59,9 +59,9 @@ module.exports = { } /** - * Check to see if a node contains only identifers + * Check to see if a node contains only identifiers * @param {ASTNode} node The node to check - * @returns {boolean} Whether or not the node contains only identifers + * @returns {boolean} Whether or not the node contains only identifiers */ function containsOnlyIdentifiers(node) { if (node.type === "Identifier") { diff --git a/tools/node_modules/eslint/lib/rules/dot-location.js b/tools/node_modules/eslint/lib/rules/dot-location.js index 0a739b1712b902..a8d5a760562d3e 100644 --- a/tools/node_modules/eslint/lib/rules/dot-location.js +++ b/tools/node_modules/eslint/lib/rules/dot-location.js @@ -46,7 +46,7 @@ module.exports = { const sourceCode = context.getSourceCode(); /** - * Reports if the dot between object and property is on the correct loccation. + * Reports if the dot between object and property is on the correct location. * @param {ASTNode} node The `MemberExpression` node. * @returns {void} */ diff --git a/tools/node_modules/eslint/lib/rules/func-call-spacing.js b/tools/node_modules/eslint/lib/rules/func-call-spacing.js index 8fe690d4a6ba21..132a5833143844 100644 --- a/tools/node_modules/eslint/lib/rules/func-call-spacing.js +++ b/tools/node_modules/eslint/lib/rules/func-call-spacing.js @@ -131,7 +131,7 @@ module.exports = { return null; } - // If `?.` exsits, it doesn't hide no-undexpected-multiline errors + // If `?.` exists, it doesn't hide no-unexpected-multiline errors if (node.optional) { return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], "?."); } @@ -177,7 +177,7 @@ module.exports = { /* * Only autofix if there is no newline * https://github.com/eslint/eslint/issues/7787 - * But if `?.` exsits, it doesn't hide no-undexpected-multiline errors + * But if `?.` exists, it doesn't hide no-unexpected-multiline errors */ if (!node.optional) { return null; diff --git a/tools/node_modules/eslint/lib/rules/multiline-ternary.js b/tools/node_modules/eslint/lib/rules/multiline-ternary.js index 6668bff4824842..98360b9cad4676 100644 --- a/tools/node_modules/eslint/lib/rules/multiline-ternary.js +++ b/tools/node_modules/eslint/lib/rules/multiline-ternary.js @@ -27,19 +27,22 @@ module.exports = { enum: ["always", "always-multiline", "never"] } ], + messages: { expectedTestCons: "Expected newline between test and consequent of ternary expression.", expectedConsAlt: "Expected newline between consequent and alternate of ternary expression.", unexpectedTestCons: "Unexpected newline between test and consequent of ternary expression.", unexpectedConsAlt: "Unexpected newline between consequent and alternate of ternary expression." - } + }, + + fixable: "whitespace" }, create(context) { + const sourceCode = context.getSourceCode(); const option = context.options[0]; const multiline = option !== "never"; const allowSingleLine = option === "always-multiline"; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- // Public @@ -59,6 +62,8 @@ module.exports = { const areTestAndConsequentOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, firstTokenOfConsequent); const areConsequentAndAlternateOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, firstTokenOfAlternate); + const hasComments = !!sourceCode.getCommentsInside(node).length; + if (!multiline) { if (!areTestAndConsequentOnSameLine) { context.report({ @@ -67,7 +72,24 @@ module.exports = { start: firstTokenOfTest.loc.start, end: lastTokenOfTest.loc.end }, - messageId: "unexpectedTestCons" + messageId: "unexpectedTestCons", + fix: fixer => { + if (hasComments) { + return null; + } + const fixers = []; + const areTestAndQuestionOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, questionToken); + const areQuestionAndConsOnSameLine = astUtils.isTokenOnSameLine(questionToken, firstTokenOfConsequent); + + if (!areTestAndQuestionOnSameLine) { + fixers.push(fixer.removeRange([lastTokenOfTest.range[1], questionToken.range[0]])); + } + if (!areQuestionAndConsOnSameLine) { + fixers.push(fixer.removeRange([questionToken.range[1], firstTokenOfConsequent.range[0]])); + } + + return fixers; + } }); } @@ -78,7 +100,24 @@ module.exports = { start: firstTokenOfConsequent.loc.start, end: lastTokenOfConsequent.loc.end }, - messageId: "unexpectedConsAlt" + messageId: "unexpectedConsAlt", + fix: fixer => { + if (hasComments) { + return null; + } + const fixers = []; + const areConsAndColonOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, colonToken); + const areColonAndAltOnSameLine = astUtils.isTokenOnSameLine(colonToken, firstTokenOfAlternate); + + if (!areConsAndColonOnSameLine) { + fixers.push(fixer.removeRange([lastTokenOfConsequent.range[1], colonToken.range[0]])); + } + if (!areColonAndAltOnSameLine) { + fixers.push(fixer.removeRange([colonToken.range[1], firstTokenOfAlternate.range[0]])); + } + + return fixers; + } }); } } else { @@ -93,7 +132,16 @@ module.exports = { start: firstTokenOfTest.loc.start, end: lastTokenOfTest.loc.end }, - messageId: "expectedTestCons" + messageId: "expectedTestCons", + fix: fixer => (hasComments ? null : ( + fixer.replaceTextRange( + [ + lastTokenOfTest.range[1], + questionToken.range[0] + ], + "\n" + ) + )) }); } @@ -104,7 +152,16 @@ module.exports = { start: firstTokenOfConsequent.loc.start, end: lastTokenOfConsequent.loc.end }, - messageId: "expectedConsAlt" + messageId: "expectedConsAlt", + fix: (fixer => (hasComments ? null : ( + fixer.replaceTextRange( + [ + lastTokenOfConsequent.range[1], + colonToken.range[0] + ], + "\n" + ) + ))) }); } } diff --git a/tools/node_modules/eslint/lib/rules/no-constant-condition.js b/tools/node_modules/eslint/lib/rules/no-constant-condition.js index 7d324634244cb9..3c2d68cbf6caf1 100644 --- a/tools/node_modules/eslint/lib/rules/no-constant-condition.js +++ b/tools/node_modules/eslint/lib/rules/no-constant-condition.js @@ -106,10 +106,15 @@ module.exports = { */ return operator === node.operator && ( - isLogicalIdentity(node.left, node.operator) || - isLogicalIdentity(node.right, node.operator) + isLogicalIdentity(node.left, operator) || + isLogicalIdentity(node.right, operator) ); + case "AssignmentExpression": + return ["||=", "&&="].includes(node.operator) && + operator === node.operator.slice(0, -1) && + isLogicalIdentity(node.right, operator); + // no default } return false; @@ -177,7 +182,15 @@ module.exports = { } case "AssignmentExpression": - return (node.operator === "=") && isConstant(node.right, inBooleanPosition); + if (node.operator === "=") { + return isConstant(node.right, inBooleanPosition); + } + + if (["||=", "&&="].includes(node.operator) && inBooleanPosition) { + return isLogicalIdentity(node.right, node.operator.slice(0, -1)); + } + + return false; case "SequenceExpression": return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition); diff --git a/tools/node_modules/eslint/lib/rules/no-control-regex.js b/tools/node_modules/eslint/lib/rules/no-control-regex.js index 146c4f22d01257..6feeb6419d566d 100644 --- a/tools/node_modules/eslint/lib/rules/no-control-regex.js +++ b/tools/node_modules/eslint/lib/rules/no-control-regex.js @@ -8,7 +8,6 @@ const RegExpValidator = require("regexpp").RegExpValidator; const collector = new (class { constructor() { - this.ecmaVersion = 2018; this._source = ""; this._controlChars = []; this._validator = new RegExpValidator(this); diff --git a/tools/node_modules/eslint/lib/rules/no-extend-native.js b/tools/node_modules/eslint/lib/rules/no-extend-native.js index db365b50924d7a..2a804b563980be 100644 --- a/tools/node_modules/eslint/lib/rules/no-extend-native.js +++ b/tools/node_modules/eslint/lib/rules/no-extend-native.js @@ -138,7 +138,7 @@ module.exports = { } /* - * `identifierNode.parent` is a MamberExpression `*.prototype`. + * `identifierNode.parent` is a MemberExpression `*.prototype`. * If it's an optional member access, it may be wrapped by a `ChainExpression` node. */ const prototypeNode = diff --git a/tools/node_modules/eslint/lib/rules/no-import-assign.js b/tools/node_modules/eslint/lib/rules/no-import-assign.js index 7a349bb730bdcd..41060d8ac9e0b2 100644 --- a/tools/node_modules/eslint/lib/rules/no-import-assign.js +++ b/tools/node_modules/eslint/lib/rules/no-import-assign.js @@ -97,10 +97,10 @@ function isIterationVariable(node) { * - `Object.defineProperties` * - `Object.freeze` * - `Object.setPrototypeOf` - * - `Refrect.defineProperty` - * - `Refrect.deleteProperty` - * - `Refrect.set` - * - `Refrect.setPrototypeOf` + * - `Reflect.defineProperty` + * - `Reflect.deleteProperty` + * - `Reflect.set` + * - `Reflect.setPrototypeOf` * @param {ASTNode} node The node to check. * @param {Scope} scope A `escope.Scope` object to find variable (whichever). * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function. diff --git a/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js b/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js index 48b7188d49f9c5..6136ebb9e0be11 100644 --- a/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js +++ b/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ const RegExpValidator = require("regexpp").RegExpValidator; -const validator = new RegExpValidator({ ecmaVersion: 2018 }); +const validator = new RegExpValidator(); const validFlags = /[gimuys]/gu; const undefined1 = void 0; diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-exports.js b/tools/node_modules/eslint/lib/rules/no-restricted-exports.js index 6031e26de2c7e8..f0df0ffaedb649 100644 --- a/tools/node_modules/eslint/lib/rules/no-restricted-exports.js +++ b/tools/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -45,7 +45,7 @@ module.exports = { /** * Checks and reports given exported identifier. - * @param {ASTNode} node exported `Identifer` node to check. + * @param {ASTNode} node exported `Identifier` node to check. * @returns {void} */ function checkExportedName(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-this-before-super.js b/tools/node_modules/eslint/lib/rules/no-this-before-super.js index 44288c0c97136e..5bfba66fc65c32 100644 --- a/tools/node_modules/eslint/lib/rules/no-this-before-super.js +++ b/tools/node_modules/eslint/lib/rules/no-this-before-super.js @@ -171,7 +171,7 @@ module.exports = { /** * Removes the top of stack item. * - * And this treverses all segments of this code path then reports every + * And this traverses all segments of this code path then reports every * invalid node. * @param {CodePath} codePath A code path which was ended. * @returns {void} diff --git a/tools/node_modules/eslint/lib/rules/no-useless-escape.js b/tools/node_modules/eslint/lib/rules/no-useless-escape.js index 8057e44ddab463..512c93a8bc0820 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-escape.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-escape.js @@ -109,9 +109,9 @@ module.exports = { * @returns {void} */ function report(node, startOffset, character) { - const start = sourceCode.getLocFromIndex(sourceCode.getIndexFromLoc(node.loc.start) + startOffset); - const rangeStart = sourceCode.getIndexFromLoc(node.loc.start) + startOffset; + const rangeStart = node.range[0] + startOffset; const range = [rangeStart, rangeStart + 1]; + const start = sourceCode.getLocFromIndex(rangeStart); context.report({ node, @@ -172,7 +172,7 @@ module.exports = { } if (isUnnecessaryEscape && !isQuoteEscape) { - report(node, match.index + 1, match[0].slice(1)); + report(node, match.index, match[0].slice(1)); } } @@ -206,7 +206,7 @@ module.exports = { return; } - const value = isTemplateElement ? node.value.raw : node.raw.slice(1, -1); + const value = isTemplateElement ? sourceCode.getText(node) : node.raw; const pattern = /\\[^\d]/gu; let match; diff --git a/tools/node_modules/eslint/lib/rules/one-var.js b/tools/node_modules/eslint/lib/rules/one-var.js index b370c6d5e19858..e3df8320f8b130 100644 --- a/tools/node_modules/eslint/lib/rules/one-var.js +++ b/tools/node_modules/eslint/lib/rules/one-var.js @@ -5,6 +5,25 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is in a statement list. + * @param {ASTNode} node node to check + * @returns {boolean} `true` if the given node is in a statement list + */ +function isInStatementList(node) { + return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -268,8 +287,8 @@ module.exports = { /** * Fixer to join VariableDeclaration's into a single declaration - * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join - * @returns {Function} The fixer function + * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join + * @returns {Function} The fixer function */ function joinDeclarations(declarations) { const declaration = declarations[0]; @@ -297,10 +316,17 @@ module.exports = { /** * Fixer to split a VariableDeclaration into individual declarations - * @param {VariableDeclaration} declaration The `VariableDeclaration` to split - * @returns {Function} The fixer function + * @param {VariableDeclaration} declaration The `VariableDeclaration` to split + * @returns {Function|null} The fixer function */ function splitDeclarations(declaration) { + const { parent } = declaration; + + // don't autofix code such as: if (foo) var x, y; + if (!isInStatementList(parent.type === "ExportNamedDeclaration" ? parent : declaration)) { + return null; + } + return fixer => declaration.declarations.map(declarator => { const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator); diff --git a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js index b2d3c8a0b0193e..413f7272cc15f2 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js +++ b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -279,7 +279,7 @@ module.exports = { * @param {ASTNode} node the AssignmentExpression node * @returns {void} */ - function checkAssigmentExpression(node) { + function checkAssignmentExpression(node) { if (node.operator === "=") { performCheck(node.left, node.right, node); } @@ -291,7 +291,7 @@ module.exports = { return { VariableDeclarator: checkVariableDeclarator, - AssignmentExpression: checkAssigmentExpression + AssignmentExpression: checkAssignmentExpression }; } }; diff --git a/tools/node_modules/eslint/lib/rules/prefer-reflect.js b/tools/node_modules/eslint/lib/rules/prefer-reflect.js index fb2de923bea379..156d61251c4877 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-reflect.js +++ b/tools/node_modules/eslint/lib/rules/prefer-reflect.js @@ -105,10 +105,10 @@ module.exports = { CallExpression(node) { const methodName = (node.callee.property || {}).name; const isReflectCall = (node.callee.object || {}).name === "Reflect"; - const hasReflectSubsitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); + const hasReflectSubstitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); const userConfiguredException = exceptions.indexOf(methodName) !== -1; - if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { + if (hasReflectSubstitute && !isReflectCall && !userConfiguredException) { report(node, existingNames[methodName], reflectSubstitutes[methodName]); } }, diff --git a/tools/node_modules/eslint/lib/rules/space-unary-ops.js b/tools/node_modules/eslint/lib/rules/space-unary-ops.js index f417eea58d8eb6..57f6e784501d2d 100644 --- a/tools/node_modules/eslint/lib/rules/space-unary-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-unary-ops.js @@ -1,5 +1,5 @@ /** - * @fileoverview This rule shoud require or disallow spaces before or after unary operations. + * @fileoverview This rule should require or disallow spaces before or after unary operations. * @author Marcin Kumorek */ "use strict"; diff --git a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js index 1fd6340df7c7e4..679eebb4c458d7 100644 --- a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js +++ b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -82,7 +82,7 @@ function startsWithUpperCase(s) { /** * Checks whether or not a node is a constructor. * @param {ASTNode} node A function node to check. - * @returns {boolean} Wehether or not a node is a constructor. + * @returns {boolean} Whether or not a node is a constructor. */ function isES5Constructor(node) { return (node.id && startsWithUpperCase(node.id.name)); @@ -1574,7 +1574,7 @@ module.exports = { }, /* - * Determine if a node has a possiblity to be an Error object + * Determine if a node has a possibility to be an Error object * @param {ASTNode} node ASTNode to check * @returns {boolean} True if there is a chance it contains an Error obj */ diff --git a/tools/node_modules/eslint/lib/shared/deprecation-warnings.js b/tools/node_modules/eslint/lib/shared/deprecation-warnings.js index e1481a2e9aa0b8..1438eaa69bff86 100644 --- a/tools/node_modules/eslint/lib/shared/deprecation-warnings.js +++ b/tools/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -15,7 +15,7 @@ const lodash = require("lodash"); // Private //------------------------------------------------------------------------------ -// Defitions for deprecation warnings. +// Definitions for deprecation warnings. const deprecationWarningMessages = { ESLINT_LEGACY_ECMAFEATURES: "The 'ecmaFeatures' config file property is deprecated and has no effect.", diff --git a/tools/node_modules/eslint/lib/shared/types.js b/tools/node_modules/eslint/lib/shared/types.js index 8ad3b1b64ce1e3..c3b76e42d5f075 100644 --- a/tools/node_modules/eslint/lib/shared/types.js +++ b/tools/node_modules/eslint/lib/shared/types.js @@ -46,9 +46,9 @@ module.exports = {}; /** * @typedef {Object} OverrideConfigData * @property {Record} [env] The environment settings. - * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [excludedFiles] The glob patterns for excluded files. * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. - * @property {string | string[]} files The glob pattarns for target files. + * @property {string | string[]} files The glob patterns for target files. * @property {Record} [globals] The global variable settings. * @property {boolean} [noInlineConfig] The flag that disables directive comments. * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. diff --git a/tools/node_modules/eslint/node_modules/import-fresh/license b/tools/node_modules/eslint/node_modules/import-fresh/license index e7af2f77107d73..fa7ceba3eb4a96 100644 --- a/tools/node_modules/eslint/node_modules/import-fresh/license +++ b/tools/node_modules/eslint/node_modules/import-fresh/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/tools/node_modules/eslint/node_modules/import-fresh/package.json b/tools/node_modules/eslint/node_modules/import-fresh/package.json index 893bb4a523fbca..5a30f8061505fc 100644 --- a/tools/node_modules/eslint/node_modules/import-fresh/package.json +++ b/tools/node_modules/eslint/node_modules/import-fresh/package.json @@ -2,7 +2,7 @@ "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/import-fresh/issues" @@ -27,6 +27,7 @@ "index.js", "index.d.ts" ], + "funding": "https://github.com/sponsors/sindresorhus", "homepage": "https://github.com/sindresorhus/import-fresh#readme", "keywords": [ "require", @@ -47,5 +48,5 @@ "heapdump": "node heapdump.js", "test": "xo && ava && tsd" }, - "version": "3.2.2" + "version": "3.3.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/import-fresh/readme.md b/tools/node_modules/eslint/node_modules/import-fresh/readme.md index 0bfa1c90443e83..bd14c79c632336 100644 --- a/tools/node_modules/eslint/node_modules/import-fresh/readme.md +++ b/tools/node_modules/eslint/node_modules/import-fresh/readme.md @@ -1,17 +1,15 @@ -# import-fresh [![Build Status](https://travis-ci.org/sindresorhus/import-fresh.svg?branch=master)](https://travis-ci.org/sindresorhus/import-fresh) +# import-fresh > Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching) Useful for testing purposes when you need to freshly import a module. - ## Install ``` $ npm install import-fresh ``` - ## Usage ```js @@ -36,14 +34,12 @@ importFresh('./foo')(); //=> 1 ``` - ## import-fresh for enterprise Available as part of the Tidelift Subscription. The maintainers of import-fresh and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-import-fresh?utm_source=npm-import-fresh&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - ## Related - [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache diff --git a/tools/node_modules/eslint/node_modules/require-from-string/index.js b/tools/node_modules/eslint/node_modules/require-from-string/index.js new file mode 100644 index 00000000000000..cb5595fde96fbb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/require-from-string/index.js @@ -0,0 +1,34 @@ +'use strict'; + +var Module = require('module'); +var path = require('path'); + +module.exports = function requireFromString(code, filename, opts) { + if (typeof filename === 'object') { + opts = filename; + filename = undefined; + } + + opts = opts || {}; + filename = filename || ''; + + opts.appendPaths = opts.appendPaths || []; + opts.prependPaths = opts.prependPaths || []; + + if (typeof code !== 'string') { + throw new Error('code must be a string, not ' + typeof code); + } + + var paths = Module._nodeModulePaths(path.dirname(filename)); + + var parent = module.parent; + var m = new Module(filename, parent); + m.filename = filename; + m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths); + m._compile(code, filename); + + var exports = m.exports; + parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1); + + return exports; +}; diff --git a/tools/node_modules/eslint/node_modules/require-from-string/license b/tools/node_modules/eslint/node_modules/require-from-string/license new file mode 100644 index 00000000000000..1aeb74fd25e171 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/require-from-string/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/require-from-string/package.json b/tools/node_modules/eslint/node_modules/require-from-string/package.json new file mode 100644 index 00000000000000..4ca96a63470da5 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/require-from-string/package.json @@ -0,0 +1,35 @@ +{ + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/require-from-string/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Require module from string", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/floatdrop/require-from-string#readme", + "keywords": [], + "license": "MIT", + "name": "require-from-string", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/require-from-string.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/require-from-string/readme.md b/tools/node_modules/eslint/node_modules/require-from-string/readme.md new file mode 100644 index 00000000000000..88b3236f895d36 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/require-from-string/readme.md @@ -0,0 +1,56 @@ +# require-from-string [![Build Status](https://travis-ci.org/floatdrop/require-from-string.svg?branch=master)](https://travis-ci.org/floatdrop/require-from-string) + +Load module from string in Node. + +## Install + +``` +$ npm install --save require-from-string +``` + + +## Usage + +```js +var requireFromString = require('require-from-string'); + +requireFromString('module.exports = 1'); +//=> 1 +``` + + +## API + +### requireFromString(code, [filename], [options]) + +#### code + +*Required* +Type: `string` + +Module code. + +#### filename +Type: `string` +Default: `''` + +Optional filename. + + +#### options +Type: `object` + +##### appendPaths +Type: `Array` + +List of `paths`, that will be appended to module `paths`. Useful, when you want +to be able require modules from these paths. + +##### prependPaths +Type: `Array` + +Same as `appendPaths`, but paths will be prepended. + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/tools/node_modules/eslint/node_modules/table/README.md b/tools/node_modules/eslint/node_modules/table/README.md index a0ec411a6deefc..b3942042c18cef 100644 --- a/tools/node_modules/eslint/node_modules/table/README.md +++ b/tools/node_modules/eslint/node_modules/table/README.md @@ -56,8 +56,9 @@ npm install table Table data is described using an array (rows) of array (cells). ```js -import tableImport from 'table'; -const { table } = tableImport; +import { + table +} from 'table'; // Using commonjs? // const {table} = require('table'); @@ -487,7 +488,7 @@ table(data, config); | 2A | 2B | 2C | +----+----+----+ -# void (no borders; see "borderless table" section of the documentation) +# void (no borders; see "bordless table" section of the documentation) 0A 0B 0C diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js index e5f4f3eec7932e..8f77c6304a4e55 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js @@ -50,7 +50,7 @@ const makeColumns = (rows, columns = {}, columnDefault = {}) => { alignment: 'left', paddingLeft: 1, paddingRight: 1, - truncate: Infinity, + truncate: Number.POSITIVE_INFINITY, width: maximumColumnWidthIndex[index], wrapWord: false }, columnDefault, columns[index]); diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow index 9a27375cb0df60..f661220cc43592 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow @@ -34,7 +34,7 @@ const makeColumns = (rows, columns = {}, columnDefault = {}) => { alignment: 'left', paddingLeft: 1, paddingRight: 1, - truncate: Infinity, + truncate: Number.POSITIVE_INFINITY, width: maximumColumnWidthIndex[index], wrapWord: false, }, columnDefault, columns[index]); diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js index 600aa66de280fe..f36fdf3ba384f0 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js @@ -47,7 +47,7 @@ const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { alignment: 'left', paddingLeft: 1, paddingRight: 1, - truncate: Infinity, + truncate: Number.POSITIVE_INFINITY, wrapWord: false }, columnDefault, columns[index]); }); diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow index 7c3ae068bb24ba..5f361c3919757b 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow @@ -31,7 +31,7 @@ const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { alignment: 'left', paddingLeft: 1, paddingRight: 1, - truncate: Infinity, + truncate: Number.POSITIVE_INFINITY, wrapWord: false, }, columnDefault, columns[index]); }); diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json index 1a4a9981833029..0918dcc7648812 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json +++ b/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json @@ -4,111 +4,17 @@ "type": "object", "properties": { "border": { - "$ref": "#/definitions/borders" + "$ref": "shared.json#/definitions/borders" }, "columns": { - "$ref": "#/definitions/columns" + "$ref": "shared.json#/definitions/columns" }, "columnDefault": { - "$ref": "#/definitions/column" + "$ref": "shared.json#/definitions/column" }, "drawHorizontalLine": { "typeof": "function" } }, - "additionalProperties": false, - "definitions": { - "columns": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": [ - "left", - "right", - "center" - ] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - } - } + "additionalProperties": false } diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/shared.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/shared.json new file mode 100644 index 00000000000000..7d03f9269455a5 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/schemas/shared.json @@ -0,0 +1,98 @@ +{ + "$id": "shared.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": [ + "left", + "right", + "center" + ] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json index 35199844fd433e..24dfa56282541a 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json +++ b/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json @@ -4,111 +4,17 @@ "type": "object", "properties": { "border": { - "$ref": "#/definitions/borders" + "$ref": "shared.json#/definitions/borders" }, "columns": { - "$ref": "#/definitions/columns" + "$ref": "shared.json#/definitions/columns" }, "columnDefault": { - "$ref": "#/definitions/column" + "$ref": "shared.json#/definitions/column" }, "columnCount": { "type": "number" } }, - "additionalProperties": false, - "definitions": { - "columns": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": [ - "left", - "right", - "center" - ] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - } - } + "additionalProperties": false } diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js index fb58f344a45d9a..cdf7530d2231ee 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js @@ -1,754 +1,43 @@ -'use strict'; -var equal = require('ajv/lib/compile/equal'); -var validate = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - var refVal = []; - var refVal1 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0)); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data.topBody !== undefined) { - var errs_1 = errors; - if (!refVal2(data.topBody, (dataPath || '') + '.topBody', data, 'topBody', rootData)) { - if (vErrors === null) vErrors = refVal2.errors; - else vErrors = vErrors.concat(refVal2.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.topJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.topJoin, (dataPath || '') + '.topJoin', data, 'topJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.topLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.topLeft, (dataPath || '') + '.topLeft', data, 'topLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.topRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.topRight, (dataPath || '') + '.topRight', data, 'topRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomBody !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomBody, (dataPath || '') + '.bottomBody', data, 'bottomBody', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomJoin, (dataPath || '') + '.bottomJoin', data, 'bottomJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomLeft, (dataPath || '') + '.bottomLeft', data, 'bottomLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomRight, (dataPath || '') + '.bottomRight', data, 'bottomRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bodyLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bodyLeft, (dataPath || '') + '.bodyLeft', data, 'bodyLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bodyRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bodyRight, (dataPath || '') + '.bodyRight', data, 'bodyRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bodyJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bodyJoin, (dataPath || '') + '.bodyJoin', data, 'bodyJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinBody !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinBody, (dataPath || '') + '.joinBody', data, 'joinBody', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinLeft, (dataPath || '') + '.joinLeft', data, 'joinLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinRight, (dataPath || '') + '.joinRight', data, 'joinRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinJoin, (dataPath || '') + '.joinJoin', data, 'joinJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal1.schema = { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }; - refVal1.errors = null; - refVal[1] = refVal1; - var refVal2 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if (typeof data !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal2.schema = { - "type": "string" - }; - refVal2.errors = null; - refVal[2] = refVal2; - var refVal3 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || pattern0.test(key0)); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - for (var key0 in data) { - if (pattern0.test(key0)) { - var errs_1 = errors; - if (!refVal4(data[key0], (dataPath || '') + '[\'' + key0 + '\']', data, key0, rootData)) { - if (vErrors === null) vErrors = refVal4.errors; - else vErrors = vErrors.concat(refVal4.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal3.schema = { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }; - refVal3.errors = null; - refVal[3] = refVal3; - var refVal4 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight'); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var data1 = data.alignment; - if (data1 !== undefined) { - var errs_1 = errors; - if (typeof data1 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.alignment', - schemaPath: '#/properties/alignment/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema1 = validate.schema.properties.alignment.enum; - var valid1; - valid1 = false; - for (var i1 = 0; i1 < schema1.length; i1++) - if (equal(data1, schema1[i1])) { - valid1 = true; - break; - } if (!valid1) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.alignment', - schemaPath: '#/properties/alignment/enum', - params: { - allowedValues: schema1 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.width !== undefined) { - var errs_1 = errors; - if ((typeof data.width !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.width', - schemaPath: '#/properties/width/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.wrapWord !== undefined) { - var errs_1 = errors; - if (typeof data.wrapWord !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.wrapWord', - schemaPath: '#/properties/wrapWord/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.truncate !== undefined) { - var errs_1 = errors; - if ((typeof data.truncate !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.truncate', - schemaPath: '#/properties/truncate/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.paddingLeft !== undefined) { - var errs_1 = errors; - if ((typeof data.paddingLeft !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.paddingLeft', - schemaPath: '#/properties/paddingLeft/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.paddingRight !== undefined) { - var errs_1 = errors; - if ((typeof data.paddingRight !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.paddingRight', - schemaPath: '#/properties/paddingRight/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal4.schema = { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": ["left", "right", "center"] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }; - refVal4.errors = null; - refVal[4] = refVal4; - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=config.json */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || key0 == 'border' || key0 == 'columns' || key0 == 'columnDefault' || key0 == 'drawHorizontalLine'); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data.border !== undefined) { - var errs_1 = errors; - if (!refVal1(data.border, (dataPath || '') + '.border', data, 'border', rootData)) { - if (vErrors === null) vErrors = refVal1.errors; - else vErrors = vErrors.concat(refVal1.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.columns !== undefined) { - var errs_1 = errors; - if (!refVal3(data.columns, (dataPath || '') + '.columns', data, 'columns', rootData)) { - if (vErrors === null) vErrors = refVal3.errors; - else vErrors = vErrors.concat(refVal3.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.columnDefault !== undefined) { - var errs_1 = errors; - if (!refVal[4](data.columnDefault, (dataPath || '') + '.columnDefault', data, 'columnDefault', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.drawHorizontalLine !== undefined) { - var errs_1 = errors; - var errs__1 = errors; - var valid1; - valid1 = typeof data.drawHorizontalLine == "function"; - if (!valid1) { - if (errs__1 == errors) { - var err = { - keyword: 'typeof', - dataPath: (dataPath || '') + '.drawHorizontalLine', - schemaPath: '#/properties/drawHorizontalLine/typeof', - params: { - keyword: 'typeof' - }, - message: 'should pass "typeof" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - for (var i1 = errs__1; i1 < errors; i1++) { - var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '.drawHorizontalLine'; - if (ruleErr1.schemaPath === undefined) { - ruleErr1.schemaPath = "#/properties/drawHorizontalLine/typeof"; - } - } - } - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validators = _interopRequireDefault(require("../dist/validators")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eslint-disable-next-line import/default + +/** + * @param {string} schemaId + * @param {formatData~config} config + * @returns {undefined} + */ +const validateConfig = (schemaId, config = {}) => { + const validate = _validators.default[schemaId]; + + if (!validate(config)) { + const errors = validate.errors.map(error => { + return { + dataPath: error.dataPath, + message: error.message, + params: error.params, + schemaPath: error.schemaPath }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; -})(); -validate.schema = { - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "#/definitions/borders" - }, - "columns": { - "$ref": "#/definitions/columns" - }, - "columnDefault": { - "$ref": "#/definitions/column" - }, - "drawHorizontalLine": { - "typeof": "function" - } - }, - "additionalProperties": false, - "definitions": { - "columns": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": ["left", "right", "center"] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - } + }); + /* eslint-disable no-console */ + + console.log('config', config); + console.log('errors', errors); + /* eslint-enable no-console */ + + throw new Error('Invalid config.'); } }; -validate.errors = null; -module.exports = validate; \ No newline at end of file + +var _default = validateConfig; +exports.default = _default; +//# sourceMappingURL=validateConfig.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow index f0966bd7e797d0..a8eb2e2ed91fdc 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow @@ -1,12 +1,5 @@ // eslint-disable-next-line import/default -import validateConfig from '../dist/validateConfig'; -// eslint-disable-next-line import/default -import validateStreamConfig from '../dist/validateStreamConfig'; - -const validate = { - 'config.json': validateConfig, - 'streamConfig.json': validateStreamConfig, -}; +import validators from '../dist/validators'; /** * @param {string} schemaId @@ -14,8 +7,9 @@ const validate = { * @returns {undefined} */ export default (schemaId, config = {}) => { - if (!validate[schemaId](config)) { - const errors = validate[schemaId].errors.map((error) => { + const validate = validators[schemaId]; + if (!validate(config)) { + const errors = validate.errors.map((error) => { return { dataPath: error.dataPath, message: error.message, diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js deleted file mode 100644 index 2c81a1636df753..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/validateStreamConfig.js +++ /dev/null @@ -1,741 +0,0 @@ -'use strict'; -var equal = require('ajv/lib/compile/equal'); -var validate = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - var refVal = []; - var refVal1 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0)); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data.topBody !== undefined) { - var errs_1 = errors; - if (!refVal2(data.topBody, (dataPath || '') + '.topBody', data, 'topBody', rootData)) { - if (vErrors === null) vErrors = refVal2.errors; - else vErrors = vErrors.concat(refVal2.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.topJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.topJoin, (dataPath || '') + '.topJoin', data, 'topJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.topLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.topLeft, (dataPath || '') + '.topLeft', data, 'topLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.topRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.topRight, (dataPath || '') + '.topRight', data, 'topRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomBody !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomBody, (dataPath || '') + '.bottomBody', data, 'bottomBody', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomJoin, (dataPath || '') + '.bottomJoin', data, 'bottomJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomLeft, (dataPath || '') + '.bottomLeft', data, 'bottomLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bottomRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bottomRight, (dataPath || '') + '.bottomRight', data, 'bottomRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bodyLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bodyLeft, (dataPath || '') + '.bodyLeft', data, 'bodyLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bodyRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bodyRight, (dataPath || '') + '.bodyRight', data, 'bodyRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.bodyJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.bodyJoin, (dataPath || '') + '.bodyJoin', data, 'bodyJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinBody !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinBody, (dataPath || '') + '.joinBody', data, 'joinBody', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinLeft !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinLeft, (dataPath || '') + '.joinLeft', data, 'joinLeft', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinRight !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinRight, (dataPath || '') + '.joinRight', data, 'joinRight', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.joinJoin !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.joinJoin, (dataPath || '') + '.joinJoin', data, 'joinJoin', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal1.schema = { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }; - refVal1.errors = null; - refVal[1] = refVal1; - var refVal2 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if (typeof data !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal2.schema = { - "type": "string" - }; - refVal2.errors = null; - refVal[2] = refVal2; - var refVal3 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || pattern0.test(key0)); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - for (var key0 in data) { - if (pattern0.test(key0)) { - var errs_1 = errors; - if (!refVal4(data[key0], (dataPath || '') + '[\'' + key0 + '\']', data, key0, rootData)) { - if (vErrors === null) vErrors = refVal4.errors; - else vErrors = vErrors.concat(refVal4.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal3.schema = { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }; - refVal3.errors = null; - refVal[3] = refVal3; - var refVal4 = (function() { - var pattern0 = new RegExp('^[0-9]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || key0 == 'alignment' || key0 == 'width' || key0 == 'wrapWord' || key0 == 'truncate' || key0 == 'paddingLeft' || key0 == 'paddingRight'); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var data1 = data.alignment; - if (data1 !== undefined) { - var errs_1 = errors; - if (typeof data1 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.alignment', - schemaPath: '#/properties/alignment/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema1 = validate.schema.properties.alignment.enum; - var valid1; - valid1 = false; - for (var i1 = 0; i1 < schema1.length; i1++) - if (equal(data1, schema1[i1])) { - valid1 = true; - break; - } if (!valid1) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.alignment', - schemaPath: '#/properties/alignment/enum', - params: { - allowedValues: schema1 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.width !== undefined) { - var errs_1 = errors; - if ((typeof data.width !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.width', - schemaPath: '#/properties/width/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.wrapWord !== undefined) { - var errs_1 = errors; - if (typeof data.wrapWord !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.wrapWord', - schemaPath: '#/properties/wrapWord/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.truncate !== undefined) { - var errs_1 = errors; - if ((typeof data.truncate !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.truncate', - schemaPath: '#/properties/truncate/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.paddingLeft !== undefined) { - var errs_1 = errors; - if ((typeof data.paddingLeft !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.paddingLeft', - schemaPath: '#/properties/paddingLeft/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.paddingRight !== undefined) { - var errs_1 = errors; - if ((typeof data.paddingRight !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.paddingRight', - schemaPath: '#/properties/paddingRight/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal4.schema = { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": ["left", "right", "center"] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }; - refVal4.errors = null; - refVal[4] = refVal4; - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=streamConfig.json */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - for (var key0 in data) { - var isAdditional0 = !(false || key0 == 'border' || key0 == 'columns' || key0 == 'columnDefault' || key0 == 'columnCount'); - if (isAdditional0) { - valid1 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/additionalProperties', - params: { - additionalProperty: '' + key0 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data.border !== undefined) { - var errs_1 = errors; - if (!refVal1(data.border, (dataPath || '') + '.border', data, 'border', rootData)) { - if (vErrors === null) vErrors = refVal1.errors; - else vErrors = vErrors.concat(refVal1.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.columns !== undefined) { - var errs_1 = errors; - if (!refVal3(data.columns, (dataPath || '') + '.columns', data, 'columns', rootData)) { - if (vErrors === null) vErrors = refVal3.errors; - else vErrors = vErrors.concat(refVal3.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.columnDefault !== undefined) { - var errs_1 = errors; - if (!refVal[4](data.columnDefault, (dataPath || '') + '.columnDefault', data, 'columnDefault', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.columnCount !== undefined) { - var errs_1 = errors; - if ((typeof data.columnCount !== "number")) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.columnCount', - schemaPath: '#/properties/columnCount/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; -})(); -validate.schema = { - "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "#/definitions/borders" - }, - "columns": { - "$ref": "#/definitions/columns" - }, - "columnDefault": { - "$ref": "#/definitions/column" - }, - "columnCount": { - "type": "number" - } - }, - "additionalProperties": false, - "definitions": { - "columns": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": ["left", "right", "center"] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - } - } -}; -validate.errors = null; -module.exports = validate; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validators.js b/tools/node_modules/eslint/node_modules/table/dist/validators.js new file mode 100644 index 00000000000000..c03925ab5d323d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/validators.js @@ -0,0 +1,1472 @@ +"use strict"; +exports["config.json"] = validate43; +const schema13 = { + "$id": "config.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "shared.json#/definitions/borders" + }, + "columns": { + "$ref": "shared.json#/definitions/columns" + }, + "columnDefault": { + "$ref": "shared.json#/definitions/column" + }, + "drawHorizontalLine": { + "typeof": "function" + } + }, + "additionalProperties": false +}; +const schema15 = { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false +}; +const schema16 = { + "type": "string" +}; + +function validate46(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (typeof data !== "string") { + const err0 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "string" + }, + message: "should be string" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + validate46.errors = vErrors; + return errors === 0; +} + +function validate45(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(schema15.properties.hasOwnProperty(key0))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.topBody !== undefined) { + if (!(validate46(data.topBody, { + dataPath: dataPath + "/topBody", + parentData: data, + parentDataProperty: "topBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topJoin !== undefined) { + if (!(validate46(data.topJoin, { + dataPath: dataPath + "/topJoin", + parentData: data, + parentDataProperty: "topJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topLeft !== undefined) { + if (!(validate46(data.topLeft, { + dataPath: dataPath + "/topLeft", + parentData: data, + parentDataProperty: "topLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topRight !== undefined) { + if (!(validate46(data.topRight, { + dataPath: dataPath + "/topRight", + parentData: data, + parentDataProperty: "topRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomBody !== undefined) { + if (!(validate46(data.bottomBody, { + dataPath: dataPath + "/bottomBody", + parentData: data, + parentDataProperty: "bottomBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomJoin !== undefined) { + if (!(validate46(data.bottomJoin, { + dataPath: dataPath + "/bottomJoin", + parentData: data, + parentDataProperty: "bottomJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomLeft !== undefined) { + if (!(validate46(data.bottomLeft, { + dataPath: dataPath + "/bottomLeft", + parentData: data, + parentDataProperty: "bottomLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomRight !== undefined) { + if (!(validate46(data.bottomRight, { + dataPath: dataPath + "/bottomRight", + parentData: data, + parentDataProperty: "bottomRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyLeft !== undefined) { + if (!(validate46(data.bodyLeft, { + dataPath: dataPath + "/bodyLeft", + parentData: data, + parentDataProperty: "bodyLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyRight !== undefined) { + if (!(validate46(data.bodyRight, { + dataPath: dataPath + "/bodyRight", + parentData: data, + parentDataProperty: "bodyRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyJoin !== undefined) { + if (!(validate46(data.bodyJoin, { + dataPath: dataPath + "/bodyJoin", + parentData: data, + parentDataProperty: "bodyJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinBody !== undefined) { + if (!(validate46(data.joinBody, { + dataPath: dataPath + "/joinBody", + parentData: data, + parentDataProperty: "joinBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinLeft !== undefined) { + if (!(validate46(data.joinLeft, { + dataPath: dataPath + "/joinLeft", + parentData: data, + parentDataProperty: "joinLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinRight !== undefined) { + if (!(validate46(data.joinRight, { + dataPath: dataPath + "/joinRight", + parentData: data, + parentDataProperty: "joinRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinJoin !== undefined) { + if (!(validate46(data.joinJoin, { + dataPath: dataPath + "/joinJoin", + parentData: data, + parentDataProperty: "joinJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + } else { + const err1 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + validate45.errors = vErrors; + return errors === 0; +} +const schema17 = { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false +}; +const pattern0 = new RegExp("^[0-9]+$", "u"); +const schema18 = { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": ["left", "right", "center"] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false +}; +const func0 = require("ajv/dist/compile/equal"); + +function validate64(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!((((((key0 === "alignment") || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.alignment !== undefined) { + let data0 = data.alignment; + if (typeof data0 !== "string") { + const err1 = { + keyword: "type", + dataPath: dataPath + "/alignment", + schemaPath: "#/properties/alignment/type", + params: { + type: "string" + }, + message: "should be string" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + if (!(((data0 === "left") || (data0 === "right")) || (data0 === "center"))) { + const err2 = { + keyword: "enum", + dataPath: dataPath + "/alignment", + schemaPath: "#/properties/alignment/enum", + params: { + allowedValues: schema18.properties.alignment.enum + }, + message: "should be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.width !== undefined) { + let data1 = data.width; + if (!((typeof data1 == "number") && (isFinite(data1)))) { + const err3 = { + keyword: "type", + dataPath: dataPath + "/width", + schemaPath: "#/properties/width/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.wrapWord !== undefined) { + if (typeof data.wrapWord !== "boolean") { + const err4 = { + keyword: "type", + dataPath: dataPath + "/wrapWord", + schemaPath: "#/properties/wrapWord/type", + params: { + type: "boolean" + }, + message: "should be boolean" + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + if (data.truncate !== undefined) { + let data3 = data.truncate; + if (!((typeof data3 == "number") && (isFinite(data3)))) { + const err5 = { + keyword: "type", + dataPath: dataPath + "/truncate", + schemaPath: "#/properties/truncate/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + if (data.paddingLeft !== undefined) { + let data4 = data.paddingLeft; + if (!((typeof data4 == "number") && (isFinite(data4)))) { + const err6 = { + keyword: "type", + dataPath: dataPath + "/paddingLeft", + schemaPath: "#/properties/paddingLeft/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + if (data.paddingRight !== undefined) { + let data5 = data.paddingRight; + if (!((typeof data5 == "number") && (isFinite(data5)))) { + const err7 = { + keyword: "type", + dataPath: dataPath + "/paddingRight", + schemaPath: "#/properties/paddingRight/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } + } else { + const err8 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + validate64.errors = vErrors; + return errors === 0; +} + +function validate63(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(pattern0.test(key0))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + for (const key1 in data) { + if (pattern0.test(key1)) { + if (!(validate64(data[key1], { + dataPath: dataPath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), + parentData: data, + parentDataProperty: key1, + rootData + }))) { + vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); + errors = vErrors.length; + } + } + } + } else { + const err1 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + validate63.errors = vErrors; + return errors === 0; +} + +function validate67(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!((((((key0 === "alignment") || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.alignment !== undefined) { + let data0 = data.alignment; + if (typeof data0 !== "string") { + const err1 = { + keyword: "type", + dataPath: dataPath + "/alignment", + schemaPath: "#/properties/alignment/type", + params: { + type: "string" + }, + message: "should be string" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + if (!(((data0 === "left") || (data0 === "right")) || (data0 === "center"))) { + const err2 = { + keyword: "enum", + dataPath: dataPath + "/alignment", + schemaPath: "#/properties/alignment/enum", + params: { + allowedValues: schema18.properties.alignment.enum + }, + message: "should be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.width !== undefined) { + let data1 = data.width; + if (!((typeof data1 == "number") && (isFinite(data1)))) { + const err3 = { + keyword: "type", + dataPath: dataPath + "/width", + schemaPath: "#/properties/width/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.wrapWord !== undefined) { + if (typeof data.wrapWord !== "boolean") { + const err4 = { + keyword: "type", + dataPath: dataPath + "/wrapWord", + schemaPath: "#/properties/wrapWord/type", + params: { + type: "boolean" + }, + message: "should be boolean" + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + if (data.truncate !== undefined) { + let data3 = data.truncate; + if (!((typeof data3 == "number") && (isFinite(data3)))) { + const err5 = { + keyword: "type", + dataPath: dataPath + "/truncate", + schemaPath: "#/properties/truncate/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + if (data.paddingLeft !== undefined) { + let data4 = data.paddingLeft; + if (!((typeof data4 == "number") && (isFinite(data4)))) { + const err6 = { + keyword: "type", + dataPath: dataPath + "/paddingLeft", + schemaPath: "#/properties/paddingLeft/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + if (data.paddingRight !== undefined) { + let data5 = data.paddingRight; + if (!((typeof data5 == "number") && (isFinite(data5)))) { + const err7 = { + keyword: "type", + dataPath: dataPath + "/paddingRight", + schemaPath: "#/properties/paddingRight/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } + } else { + const err8 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + validate67.errors = vErrors; + return errors === 0; +} + +function validate43(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + /*# sourceURL="config.json" */ ; + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawHorizontalLine"))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.border !== undefined) { + if (!(validate45(data.border, { + dataPath: dataPath + "/border", + parentData: data, + parentDataProperty: "border", + rootData + }))) { + vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors); + errors = vErrors.length; + } + } + if (data.columns !== undefined) { + if (!(validate63(data.columns, { + dataPath: dataPath + "/columns", + parentData: data, + parentDataProperty: "columns", + rootData + }))) { + vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors); + errors = vErrors.length; + } + } + if (data.columnDefault !== undefined) { + if (!(validate67(data.columnDefault, { + dataPath: dataPath + "/columnDefault", + parentData: data, + parentDataProperty: "columnDefault", + rootData + }))) { + vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.errors); + errors = vErrors.length; + } + } + if (data.drawHorizontalLine !== undefined) { + if (typeof data.drawHorizontalLine != "function") { + const err1 = { + keyword: "typeof", + dataPath: dataPath + "/drawHorizontalLine", + schemaPath: "#/properties/drawHorizontalLine/typeof", + params: {}, + message: "should pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + } else { + const err2 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + validate43.errors = vErrors; + return errors === 0; +} +exports["streamConfig.json"] = validate69; +const schema20 = { + "$id": "streamConfig.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "shared.json#/definitions/borders" + }, + "columns": { + "$ref": "shared.json#/definitions/columns" + }, + "columnDefault": { + "$ref": "shared.json#/definitions/column" + }, + "columnCount": { + "type": "number" + } + }, + "additionalProperties": false +}; + +function validate70(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(schema15.properties.hasOwnProperty(key0))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.topBody !== undefined) { + if (!(validate46(data.topBody, { + dataPath: dataPath + "/topBody", + parentData: data, + parentDataProperty: "topBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topJoin !== undefined) { + if (!(validate46(data.topJoin, { + dataPath: dataPath + "/topJoin", + parentData: data, + parentDataProperty: "topJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topLeft !== undefined) { + if (!(validate46(data.topLeft, { + dataPath: dataPath + "/topLeft", + parentData: data, + parentDataProperty: "topLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topRight !== undefined) { + if (!(validate46(data.topRight, { + dataPath: dataPath + "/topRight", + parentData: data, + parentDataProperty: "topRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomBody !== undefined) { + if (!(validate46(data.bottomBody, { + dataPath: dataPath + "/bottomBody", + parentData: data, + parentDataProperty: "bottomBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomJoin !== undefined) { + if (!(validate46(data.bottomJoin, { + dataPath: dataPath + "/bottomJoin", + parentData: data, + parentDataProperty: "bottomJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomLeft !== undefined) { + if (!(validate46(data.bottomLeft, { + dataPath: dataPath + "/bottomLeft", + parentData: data, + parentDataProperty: "bottomLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomRight !== undefined) { + if (!(validate46(data.bottomRight, { + dataPath: dataPath + "/bottomRight", + parentData: data, + parentDataProperty: "bottomRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyLeft !== undefined) { + if (!(validate46(data.bodyLeft, { + dataPath: dataPath + "/bodyLeft", + parentData: data, + parentDataProperty: "bodyLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyRight !== undefined) { + if (!(validate46(data.bodyRight, { + dataPath: dataPath + "/bodyRight", + parentData: data, + parentDataProperty: "bodyRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyJoin !== undefined) { + if (!(validate46(data.bodyJoin, { + dataPath: dataPath + "/bodyJoin", + parentData: data, + parentDataProperty: "bodyJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinBody !== undefined) { + if (!(validate46(data.joinBody, { + dataPath: dataPath + "/joinBody", + parentData: data, + parentDataProperty: "joinBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinLeft !== undefined) { + if (!(validate46(data.joinLeft, { + dataPath: dataPath + "/joinLeft", + parentData: data, + parentDataProperty: "joinLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinRight !== undefined) { + if (!(validate46(data.joinRight, { + dataPath: dataPath + "/joinRight", + parentData: data, + parentDataProperty: "joinRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinJoin !== undefined) { + if (!(validate46(data.joinJoin, { + dataPath: dataPath + "/joinJoin", + parentData: data, + parentDataProperty: "joinJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + } else { + const err1 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + validate70.errors = vErrors; + return errors === 0; +} + +function validate87(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(pattern0.test(key0))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + for (const key1 in data) { + if (pattern0.test(key1)) { + if (!(validate64(data[key1], { + dataPath: dataPath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), + parentData: data, + parentDataProperty: key1, + rootData + }))) { + vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); + errors = vErrors.length; + } + } + } + } else { + const err1 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + validate87.errors = vErrors; + return errors === 0; +} + +function validate90(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!((((((key0 === "alignment") || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.alignment !== undefined) { + let data0 = data.alignment; + if (typeof data0 !== "string") { + const err1 = { + keyword: "type", + dataPath: dataPath + "/alignment", + schemaPath: "#/properties/alignment/type", + params: { + type: "string" + }, + message: "should be string" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + if (!(((data0 === "left") || (data0 === "right")) || (data0 === "center"))) { + const err2 = { + keyword: "enum", + dataPath: dataPath + "/alignment", + schemaPath: "#/properties/alignment/enum", + params: { + allowedValues: schema18.properties.alignment.enum + }, + message: "should be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.width !== undefined) { + let data1 = data.width; + if (!((typeof data1 == "number") && (isFinite(data1)))) { + const err3 = { + keyword: "type", + dataPath: dataPath + "/width", + schemaPath: "#/properties/width/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.wrapWord !== undefined) { + if (typeof data.wrapWord !== "boolean") { + const err4 = { + keyword: "type", + dataPath: dataPath + "/wrapWord", + schemaPath: "#/properties/wrapWord/type", + params: { + type: "boolean" + }, + message: "should be boolean" + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + if (data.truncate !== undefined) { + let data3 = data.truncate; + if (!((typeof data3 == "number") && (isFinite(data3)))) { + const err5 = { + keyword: "type", + dataPath: dataPath + "/truncate", + schemaPath: "#/properties/truncate/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + if (data.paddingLeft !== undefined) { + let data4 = data.paddingLeft; + if (!((typeof data4 == "number") && (isFinite(data4)))) { + const err6 = { + keyword: "type", + dataPath: dataPath + "/paddingLeft", + schemaPath: "#/properties/paddingLeft/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + if (data.paddingRight !== undefined) { + let data5 = data.paddingRight; + if (!((typeof data5 == "number") && (isFinite(data5)))) { + const err7 = { + keyword: "type", + dataPath: dataPath + "/paddingRight", + schemaPath: "#/properties/paddingRight/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } + } else { + const err8 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + validate90.errors = vErrors; + return errors === 0; +} + +function validate69(data, { + dataPath = "", + parentData, + parentDataProperty, + rootData = data +} = {}) { + /*# sourceURL="streamConfig.json" */ ; + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount"))) { + const err0 = { + keyword: "additionalProperties", + dataPath, + schemaPath: "#/additionalProperties", + params: { + additionalProperty: key0 + }, + message: "should NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } else { + vErrors.push(err0); + } + errors++; + } + } + if (data.border !== undefined) { + if (!(validate70(data.border, { + dataPath: dataPath + "/border", + parentData: data, + parentDataProperty: "border", + rootData + }))) { + vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors); + errors = vErrors.length; + } + } + if (data.columns !== undefined) { + if (!(validate87(data.columns, { + dataPath: dataPath + "/columns", + parentData: data, + parentDataProperty: "columns", + rootData + }))) { + vErrors = vErrors === null ? validate87.errors : vErrors.concat(validate87.errors); + errors = vErrors.length; + } + } + if (data.columnDefault !== undefined) { + if (!(validate90(data.columnDefault, { + dataPath: dataPath + "/columnDefault", + parentData: data, + parentDataProperty: "columnDefault", + rootData + }))) { + vErrors = vErrors === null ? validate90.errors : vErrors.concat(validate90.errors); + errors = vErrors.length; + } + } + if (data.columnCount !== undefined) { + let data3 = data.columnCount; + if (!((typeof data3 == "number") && (isFinite(data3)))) { + const err1 = { + keyword: "type", + dataPath: dataPath + "/columnCount", + schemaPath: "#/properties/columnCount/type", + params: { + type: "number" + }, + message: "should be number" + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + } else { + const err2 = { + keyword: "type", + dataPath, + schemaPath: "#/type", + params: { + type: "object" + }, + message: "should be object" + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + validate69.errors = vErrors; + return errors === 0; +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js new file mode 100644 index 00000000000000..2b0d6683eefe29 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.tonic_example.js @@ -0,0 +1,20 @@ +var Ajv = require("ajv") +var ajv = new Ajv({allErrors: true}) + +var schema = { + properties: { + foo: {type: "string"}, + bar: {type: "number", maximum: 3}, + }, +} + +var validate = ajv.compile(schema) + +test({foo: "abc", bar: 2}) +test({foo: 2, bar: 4}) + +function test(data) { + var valid = validate(data) + if (valid) console.log("Valid!") + else console.log("Invalid: " + ajv.errorsText(validate.errors)) +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE new file mode 100644 index 00000000000000..96ee719987f778 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md new file mode 100644 index 00000000000000..ee3c1ab7da9997 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md @@ -0,0 +1,406 @@ +Ajv logo + +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for Node.js and browser. Supports draft-06/07/2019-09 (draft-04 is supported in [version 6](https://github.com/ajv-validator/ajv/tree/v6)). + +[![build](https://github.com/ajv-validator/ajv/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + +## Platinum sponsors + +[](https://www.mozilla.org)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) + +## Using version 7 + +Ajv version 7 is released with these changes: + +- support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./docs/json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./docs/json-schema.md#unevaluateditems), [dynamic recursive references](./docs/validation.md#extending-recursive-schemas) and other [additional keywords](./docs/json-schema.md#json-schema-draft-2019-09). +- to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. +- to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe and to allow code optimization (compiled schema code size is reduced by more than 10%). +- to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package was updated to use the new API (in [v4.0.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v4.0.0)) +- schemas are compiled to ES6 code (ES5 code generation is also supported with an option). +- to improve reliability and maintainability the code is migrated to TypeScript. + +**Please note**: + +- the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using [Ajv v6](https://github.com/ajv-validator/ajv/tree/v6) that will be supported until 02/28/2021). +- all formats are separated to ajv-formats package - they have to be explicitly added if you use them. + +See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) for the details. + +To install the new version: + +```bash +npm install ajv +``` + +See [Getting started](#usage) for code example. + +## Contributing + +100+ people contributed to Ajv. You are very welcome to join by implementing new features that are valuable to many users and by improving documentation. + +Please do not be disappointed if your suggestion is not accepted - it is important to maintain the balance between the library size, performance and functionality. If it seems that a feature would benefit only a small number of users, its addition may be delayed until there is more support from the users community - so please submit the issue first to explain why this feature is important. + +Please include documentation and test coverage with any new feature implementations. + +To run tests: + +```bash +npm install +git submodule update --init +npm test +``` + +`npm run build` - compiles typescript to `dist` folder. + +Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](./docs/components.md). + +## Contents + +- [Platinum sponsors](#platinum-sponsors) +- [Using version 7](#using-version-7) +- [Contributing](#contributing) +- [Mozilla MOSS grant and OpenJS Foundation](#mozilla-moss-grant-and-openjs-foundation) +- [Sponsors](#sponsors) +- [Performance](#performance) +- [Features](#features) +- [Getting started](#usage) +- [Frequently Asked Questions](./docs/faq.md) +- [Using in browser](#using-in-browser) + - [Content Security Policy](./docs/security.md#content-security-policy) +- [Command line interface](#command-line-interface) +- [API reference](./docs/api.md) + - [Methods](./docs/api.md#ajv-constructor-and-methods) + - [Options](./docs/api.md#options) + - [Validation errors](./docs/api.md#validation-errors) +- NEW: [Strict mode](./docs/strict-mode.md#strict-mode) + - [Prohibit ignored keywords](./docs/strict-mode.md#prohibit-ignored-keywords) + - [Prevent unexpected validation](./docs/strict-mode.md#prevent-unexpected-validation) + - [Strict types](./docs/strict-mode.md#strict-types) + - [Strict number validation](./docs/strict-mode.md#strict-number-validation) +- [Data validation](./docs/validation.md) + - [Validation basics](./docs/validation.md#validation-basics): [JSON Schema keywords](./docs/validation.md#validation-keywords), [annotations](./docs/validation.md#annotation-keywords), [formats](./docs/validation.md#formats) + - [Modular schemas](./docs/validation.md#modular-schemas): [combining with \$ref](./docs/validation.md#ref), [\$data reference](./docs/validation.md#data-reference), [$merge and $patch](./docs/validation.md#merge-and-patch-keywords) + - [Asynchronous schema compilation](./docs/validation.md#asynchronous-schema-compilation) + - [Standalone validation code](./docs/standalone.md) + - [Asynchronous validation](./docs/validation.md#asynchronous-validation) + - [Modifying data](./docs/validation.md#modifying-data-during-validation): [additional properties](./docs/validation.md#removing-additional-properties), [defaults](./docs/validation.md#assigning-defaults), [type coercion](./docs/validation.md#coercing-data-types) +- [Extending Ajv](#extending-ajv) + - User-defined keywords: + - [basics](./docs/validation.md#user-defined-keywords) + - [guide](./docs/keywords.md) + - [Plugins](#plugins) + - [Related packages](#related-packages) +- [Security considerations](./docs/security.md) + - [Security contact](./docs/security.md#security-contact) + - [Untrusted schemas](./docs/security.md#untrusted-schemas) + - [Circular references in objects](./docs/security.md#circular-references-in-javascript-objects) + - [Trusted schemas](./docs/security.md#security-risks-of-trusted-schemas) + - [ReDoS attack](./docs/security.md#redos-attack) + - [Content Security Policy](./docs/security.md#content-security-policy) +- [Some packages using Ajv](#some-packages-using-ajv) +- [Changes history](#changes-history) +- [Support, Code of conduct, Contacts, License](#open-source-software-support) + +## Mozilla MOSS grant and OpenJS Foundation + +[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) + +Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition (RFC8927)](https://datatracker.ietf.org/doc/rfc8927/). + +Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. + +This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. + +I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: + +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective️](https://opencollective.com/ajv) + +Thank you. + +#### Open Collective sponsors + + + + + + + + + + + + + + +## Performance + +Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + +## Features + +- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) standards (draft-04 is supported in v6): + - all validation keywords (see [JSON Schema validation keywords](./docs/json-schema.md)) + - keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). + - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs + - [formats](#formats) defined by JSON Schema draft-07 standard (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin) and additional formats (can be turned off) + - [validates schemas against meta-schema](./docs/api.md#api-validateschema) +- supports [browsers](#using-in-browser) and Node.js 0.10-14.x +- [asynchronous loading](./docs/validation.md#asynchronous-schema-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](./docs/api.md#options) +- [error messages with parameters](./docs/api.md#validation-errors) describing error reasons to allow error message generation +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package +- [removing-additional-properties](./docs/validation.md#removing-additional-properties) +- [assigning defaults](./docs/validation.md#assigning-defaults) to missing properties and items +- [coercing data](./docs/validation.md#coercing-data-types) to the types specified in `type` keywords +- [user-defined keywords](#user-defined-keywords) +- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` +- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). +- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package +- [\$data reference](./docs/validation.md#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](./docs/api.md#asynchronous-validation) of user-defined formats and keywords + +## Install + +To install version 7: + +``` +npm install ajv +``` + +## Getting started + +Try it in the Node.js REPL: https://runkit.com/npm/ajv + +In JavaScript: + +```javascript +// or ESM/TypeScript import +import Ajv from "ajv" +// Node.js require: +const Ajv = require("ajv").default + +const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} +const validate = ajv.compile(schema) +const valid = validate(data) +if (!valid) console.log(validate.errors) +``` + +In TypeScript: + +```typescript +import Ajv, {JSONSchemaType, DefinedError} from "ajv" + +const ajv = new Ajv() + +type MyData = {foo: number} + +// Optional schema type annotation for schema to match MyData type. +// To use JSONSchemaType set `strictNullChecks: true` in tsconfig `compilerOptions`. +const schema: JSONSchemaType = { + type: "object", + properties: { + foo: {type: "number", minimum: 0}, + }, + required: ["foo"], + additionalProperties: false, +} + +// validate is a type guard for MyData - type is inferred from schema type +const validate = ajv.compile(schema) + +// or, if you did not use type annotation for the schema, +// type parameter can be used to make it type guard: +// const validate = ajv.compile(schema) + +const data: any = {foo: 1} + +if (validate(data)) { + // data is MyData here + console.log(data.foo) +} else { + // The type cast is needed to allow user-defined keywords and errors + // You can extend this type to include your error types as needed. + for (const err of validate.errors as DefinedError[]) { + switch (err.keyword) { + case "minimum": + // err type is narrowed here to have "minimum" error params properties + console.log(err.params.limit) + break + // ... + } + } +} +``` + +See [this test](./spec/types/json-schema.spec.ts) for an advanced example, [API reference](./docs/api.md) and [Options](./docs/api.md#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema itself as a key for Map) or another function passed via options), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +**Please note**: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](./docs/api.md#validation-errors) + +## Using in browser + +See [Content Security Policy](./docs/security.md#content-security-policy) to decide the best approach how to use Ajv in the browser. + +Whether you use Ajv or compiled schemas, it is recommended that you bundle them together with your code. + +If you need to use Ajv in several bundles you can create a separate UMD bundles using `npm run bundle` script. + +Then you need to load Ajv with support of JSON Schema draft-07 in the browser: + +```html + + +``` + +or to load the bundle that supports JSONSchema draft-2019-09: + +```html + + +``` + +This bundle can be used with different module systems; it creates global `ajv` (or `ajv2019`) if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +**Please note**: some frameworks, e.g. Dojo, may redefine global require in a way that is not compatible with CommonJS module format. In this case Ajv bundle has to be loaded before the framework and then you can use global `ajv` (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: + +- compiling JSON Schemas to test their validity +- generating [standalone validation code](./docs/standalone.md) that exports validation function(s) to be used without Ajv +- migrating schemas to draft-07 and draft-2019-09 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) +- validating data file(s) against JSON Schema +- testing expected validity of data against JSON Schema +- referenced schemas +- user-defined meta-schemas, validation keywords and formats +- files in JSON, JSON5, YAML, and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + +## Extending Ajv + +### User defined keywords + +See section in [data validation](./docs/validation.md#user-defined-keywords) and the [detailed guide](./docs/keywords.md). + +### Plugins + +Ajv can be extended with plugins that add keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: + +- it exports a function that accepts ajv instance as the first parameter - it allows using plugins with [ajv-cli](#command-line-interface). +- this function returns the same instance to allow chaining. +- this function can accept an optional configuration as the second parameter. + +You can import `Plugin` interface from ajv if you use Typescript. + +If you have published a useful plugin please submit a PR to add it to the next section. + +### Related packages + +- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats +- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface +- [ajv-formats](https://github.com/ajv-validator/ajv-formats) - formats defined in JSON Schema specification +- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for defining error messages in the schema +- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages +- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas +- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with additional validation keywords (select, typeof, etc.) +- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch +- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't included in [ajv-formats](https://github.com/ajv-validator/ajv-formats) (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`) + +## Some packages using Ajv + +- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator +- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema +- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file +- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages +- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX +- [Spectral](https://github.com/stoplightio/spectral) - the customizable linting utility for JSON/YAML, OpenAPI, AsyncAPI, and JSON Schema + +## Changes history + +See https://github.com/ajv-validator/ajv/releases + +**Please note**: [Changes in version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) + +[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +## Code of conduct + +Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md). + +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + +## License + +[MIT](./LICENSE) diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js new file mode 100644 index 00000000000000..afb7be6c262230 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const context_1 = require("./compile/context"); +exports.KeywordCxt = context_1.default; +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +const core_1 = require("./core"); +const draft7_1 = require("./vocabularies/draft7"); +const dynamic_1 = require("./vocabularies/dynamic"); +const next_1 = require("./vocabularies/next"); +const unevaluated_1 = require("./vocabularies/unevaluated"); +const json_schema_2019_09_1 = require("./refs/json-schema-2019-09"); +const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"; +class Ajv2019 extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + this.addVocabulary(dynamic_1.default); + draft7_1.default.forEach((v) => this.addVocabulary(v)); + this.addVocabulary(next_1.default); + this.addVocabulary(unevaluated_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2019_09_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +exports.default = Ajv2019; +//# sourceMappingURL=2019.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js new file mode 100644 index 00000000000000..be8275b51a8082 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const context_1 = require("./compile/context"); +exports.KeywordCxt = context_1.default; +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +const core_1 = require("./core"); +const draft7_1 = require("./vocabularies/draft7"); +const draft7MetaSchema = require("./refs/json-schema-draft-07.json"); +const META_SUPPORT_DATA = ["/properties"]; +const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; +class Ajv extends core_1.default { + _addVocabularies() { + super._addVocabularies(); + draft7_1.default.forEach((v) => this.addVocabulary(v)); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + const metaSchema = $data + ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) + : draft7MetaSchema; + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +exports.default = Ajv; +//# sourceMappingURL=ajv.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js new file mode 100644 index 00000000000000..24ad5c1fe3861a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js @@ -0,0 +1,143 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; +class _CodeOrName { +} +exports._CodeOrName = _CodeOrName; +exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; +class Name extends _CodeOrName { + constructor(s) { + super(); + if (!exports.IDENTIFIER.test(s)) + throw new Error("CodeGen: name must be a valid identifier"); + this.str = s; + } + toString() { + return this.str; + } + emptyStr() { + return false; + } + get names() { + return { [this.str]: 1 }; + } +} +exports.Name = Name; +class _Code extends _CodeOrName { + constructor(code) { + super(); + this._items = typeof code === "string" ? [code] : code; + } + toString() { + return this.str; + } + emptyStr() { + if (this._items.length > 1) + return false; + const item = this._items[0]; + return item === "" || item === '""'; + } + get str() { + var _a; + return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, ""))); + } + get names() { + var _a; + return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => { + if (c instanceof Name) + names[c.str] = (names[c.str] || 0) + 1; + return names; + }, {}))); + } +} +exports._Code = _Code; +exports.nil = new _Code(""); +function _(strs, ...args) { + const code = [strs[0]]; + let i = 0; + while (i < args.length) { + addCodeArg(code, args[i]); + code.push(strs[++i]); + } + return new _Code(code); +} +exports._ = _; +const plus = new _Code("+"); +function str(strs, ...args) { + const expr = [safeStringify(strs[0])]; + let i = 0; + while (i < args.length) { + expr.push(plus); + addCodeArg(expr, args[i]); + expr.push(plus, safeStringify(strs[++i])); + } + optimize(expr); + return new _Code(expr); +} +exports.str = str; +function addCodeArg(code, arg) { + if (arg instanceof _Code) + code.push(...arg._items); + else if (arg instanceof Name) + code.push(arg); + else + code.push(interpolate(arg)); +} +exports.addCodeArg = addCodeArg; +function optimize(expr) { + let i = 1; + while (i < expr.length - 1) { + if (expr[i] === plus) { + const res = mergeExprItems(expr[i - 1], expr[i + 1]); + if (res !== undefined) { + expr.splice(i - 1, 3, res); + continue; + } + expr[i++] = "+"; + } + i++; + } +} +function mergeExprItems(a, b) { + if (b === '""') + return a; + if (a === '""') + return b; + if (typeof a == "string") { + if (b instanceof Name || a[a.length - 1] !== '"') + return; + if (typeof b != "string") + return `${a.slice(0, -1)}${b}"`; + if (b[0] === '"') + return a.slice(0, -1) + b.slice(1); + return; + } + if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) + return `"${a}${b.slice(1)}`; + return; +} +function strConcat(c1, c2) { + return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`; +} +exports.strConcat = strConcat; +// TODO do not allow arrays here +function interpolate(x) { + return typeof x == "number" || typeof x == "boolean" || x === null + ? x + : safeStringify(Array.isArray(x) ? x.join(",") : x); +} +function stringify(x) { + return new _Code(safeStringify(x)); +} +exports.stringify = stringify; +function safeStringify(x) { + return JSON.stringify(x) + .replace(/\u2028/g, "\\u2028") + .replace(/\u2029/g, "\\u2029"); +} +exports.safeStringify = safeStringify; +function getProperty(key) { + return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`; +} +exports.getProperty = getProperty; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js new file mode 100644 index 00000000000000..6695ba041c45d6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js @@ -0,0 +1,682 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; +const code_1 = require("./code"); +const scope_1 = require("./scope"); +var code_2 = require("./code"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } }); +Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return code_2.nil; } }); +Object.defineProperty(exports, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return code_2.stringify; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return code_2.Name; } }); +var scope_2 = require("./scope"); +Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } }); +Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } }); +Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } }); +Object.defineProperty(exports, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } }); +exports.operators = { + GT: new code_1._Code(">"), + GTE: new code_1._Code(">="), + LT: new code_1._Code("<"), + LTE: new code_1._Code("<="), + EQ: new code_1._Code("==="), + NEQ: new code_1._Code("!=="), + NOT: new code_1._Code("!"), + OR: new code_1._Code("||"), + AND: new code_1._Code("&&"), +}; +class Node { + optimizeNodes() { + return this; + } + optimizeNames(_names, _constants) { + return this; + } +} +class Def extends Node { + constructor(varKind, name, rhs) { + super(); + this.varKind = varKind; + this.name = name; + this.rhs = rhs; + } + render({ es5, _n }) { + const varKind = es5 ? scope_1.varKinds.var : this.varKind; + const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; + return `${varKind} ${this.name}${rhs};` + _n; + } + optimizeNames(names, constants) { + if (!names[this.name.str]) + return; + if (this.rhs) + this.rhs = optimizeExpr(this.rhs, names, constants); + return this; + } + get names() { + return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; + } +} +class Assign extends Node { + constructor(lhs, rhs, sideEffects) { + super(); + this.lhs = lhs; + this.rhs = rhs; + this.sideEffects = sideEffects; + } + render({ _n }) { + return `${this.lhs} = ${this.rhs};` + _n; + } + optimizeNames(names, constants) { + if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) + return; + this.rhs = optimizeExpr(this.rhs, names, constants); + return this; + } + get names() { + const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; + return addExprNames(names, this.rhs); + } +} +class Label extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + return `${this.label}:` + _n; + } +} +class Break extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + const label = this.label ? ` ${this.label}` : ""; + return `break${label};` + _n; + } +} +class Throw extends Node { + constructor(error) { + super(); + this.error = error; + } + render({ _n }) { + return `throw ${this.error};` + _n; + } + get names() { + return this.error.names; + } +} +class AnyCode extends Node { + constructor(code) { + super(); + this.code = code; + } + render({ _n }) { + return `${this.code};` + _n; + } + optimizeNodes() { + return `${this.code}` ? this : undefined; + } + optimizeNames(names, constants) { + this.code = optimizeExpr(this.code, names, constants); + return this; + } + get names() { + return this.code instanceof code_1._CodeOrName ? this.code.names : {}; + } +} +class ParentNode extends Node { + constructor(nodes = []) { + super(); + this.nodes = nodes; + } + render(opts) { + return this.nodes.reduce((code, n) => code + n.render(opts), ""); + } + optimizeNodes() { + const { nodes } = this; + let i = nodes.length; + while (i--) { + const n = nodes[i].optimizeNodes(); + if (Array.isArray(n)) + nodes.splice(i, 1, ...n); + else if (n) + nodes[i] = n; + else + nodes.splice(i, 1); + } + return nodes.length > 0 ? this : undefined; + } + optimizeNames(names, constants) { + const { nodes } = this; + let i = nodes.length; + while (i--) { + // iterating backwards improves 1-pass optimization + const n = nodes[i]; + if (n.optimizeNames(names, constants)) + continue; + subtractNames(names, n.names); + nodes.splice(i, 1); + } + return nodes.length > 0 ? this : undefined; + } + get names() { + return this.nodes.reduce((names, n) => addNames(names, n.names), {}); + } +} +class BlockNode extends ParentNode { + render(opts) { + return "{" + opts._n + super.render(opts) + "}" + opts._n; + } +} +class Root extends ParentNode { +} +class Else extends BlockNode { +} +Else.kind = "else"; +class If extends BlockNode { + constructor(condition, nodes) { + super(nodes); + this.condition = condition; + } + render(opts) { + let code = `if(${this.condition})` + super.render(opts); + if (this.else) + code += "else " + this.else.render(opts); + return code; + } + optimizeNodes() { + super.optimizeNodes(); + const cond = this.condition; + if (cond === true) + return this.nodes; // else is ignored here + let e = this.else; + if (e) { + const ns = e.optimizeNodes(); + e = this.else = Array.isArray(ns) ? new Else(ns) : ns; + } + if (e) { + if (cond === false) + return e instanceof If ? e : e.nodes; + if (this.nodes.length) + return this; + return new If(not(cond), e instanceof If ? [e] : e.nodes); + } + if (cond === false || !this.nodes.length) + return undefined; + return this; + } + optimizeNames(names, constants) { + var _a; + this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); + if (!(super.optimizeNames(names, constants) || this.else)) + return; + this.condition = optimizeExpr(this.condition, names, constants); + return this; + } + get names() { + const names = super.names; + addExprNames(names, this.condition); + if (this.else) + addNames(names, this.else.names); + return names; + } +} +If.kind = "if"; +class For extends BlockNode { +} +For.kind = "for"; +class ForLoop extends For { + constructor(iteration) { + super(); + this.iteration = iteration; + } + render(opts) { + return `for(${this.iteration})` + super.render(opts); + } + optimizeNames(names, constants) { + if (!super.optimizeNames(names, constants)) + return; + this.iteration = optimizeExpr(this.iteration, names, constants); + return this; + } + get names() { + return addNames(super.names, this.iteration.names); + } +} +class ForRange extends For { + constructor(varKind, name, from, to) { + super(); + this.varKind = varKind; + this.name = name; + this.from = from; + this.to = to; + } + render(opts) { + const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; + const { name, from, to } = this; + return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); + } + get names() { + const names = addExprNames(super.names, this.from); + return addExprNames(names, this.to); + } +} +class ForIter extends For { + constructor(loop, varKind, name, iterable) { + super(); + this.loop = loop; + this.varKind = varKind; + this.name = name; + this.iterable = iterable; + } + render(opts) { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); + } + optimizeNames(names, constants) { + if (!super.optimizeNames(names, constants)) + return; + this.iterable = optimizeExpr(this.iterable, names, constants); + return this; + } + get names() { + return addNames(super.names, this.iterable.names); + } +} +class Func extends BlockNode { + constructor(name, args, async) { + super(); + this.name = name; + this.args = args; + this.async = async; + } + render(opts) { + const _async = this.async ? "async " : ""; + return `${_async}function ${this.name}(${this.args})` + super.render(opts); + } +} +Func.kind = "func"; +class Return extends ParentNode { + render(opts) { + return "return " + super.render(opts); + } +} +Return.kind = "return"; +class Try extends BlockNode { + render(opts) { + let code = "try" + super.render(opts); + if (this.catch) + code += this.catch.render(opts); + if (this.finally) + code += this.finally.render(opts); + return code; + } + optimizeNodes() { + var _a, _b; + super.optimizeNodes(); + (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); + return this; + } + optimizeNames(names, constants) { + var _a, _b; + super.optimizeNames(names, constants); + (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); + return this; + } + get names() { + const names = super.names; + if (this.catch) + addNames(names, this.catch.names); + if (this.finally) + addNames(names, this.finally.names); + return names; + } +} +class Catch extends BlockNode { + constructor(error) { + super(); + this.error = error; + } + render(opts) { + return `catch(${this.error})` + super.render(opts); + } +} +Catch.kind = "catch"; +class Finally extends BlockNode { + render(opts) { + return "finally" + super.render(opts); + } +} +Finally.kind = "finally"; +class CodeGen { + constructor(extScope, opts = {}) { + this._values = {}; + this._blockStarts = []; + this._constants = {}; + this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; + this._extScope = extScope; + this._scope = new scope_1.Scope({ parent: extScope }); + this._nodes = [new Root()]; + } + toString() { + return this._root.render(this.opts); + } + // returns unique name in the internal scope + name(prefix) { + return this._scope.name(prefix); + } + // reserves unique name in the external scope + scopeName(prefix) { + return this._extScope.name(prefix); + } + // reserves unique name in the external scope and assigns value to it + scopeValue(prefixOrName, value) { + const name = this._extScope.value(prefixOrName, value); + const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); + vs.add(name); + return name; + } + getScopeValue(prefix, keyOrRef) { + return this._extScope.getValue(prefix, keyOrRef); + } + // return code that assigns values in the external scope to the names that are used internally + // (same names that were returned by gen.scopeName or gen.scopeValue) + scopeRefs(scopeName) { + return this._extScope.scopeRefs(scopeName, this._values); + } + scopeCode() { + return this._extScope.scopeCode(this._values); + } + _def(varKind, nameOrPrefix, rhs, constant) { + const name = this._scope.toName(nameOrPrefix); + if (rhs !== undefined && constant) + this._constants[name.str] = rhs; + this._leafNode(new Def(varKind, name, rhs)); + return name; + } + // `const` declaration (`var` in es5 mode) + const(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); + } + // `let` declaration with optional assignment (`var` in es5 mode) + let(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); + } + // `var` declaration with optional assignment + var(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); + } + // assignment code + assign(lhs, rhs, sideEffects) { + return this._leafNode(new Assign(lhs, rhs, sideEffects)); + } + // appends passed SafeExpr to code or executes Block + code(c) { + if (typeof c == "function") + c(); + else if (c !== code_1.nil) + this._leafNode(new AnyCode(c)); + return this; + } + // returns code for object literal for the passed argument list of key-value pairs + object(...keyValues) { + const code = ["{"]; + for (const [key, value] of keyValues) { + if (code.length > 1) + code.push(","); + code.push(key); + if (key !== value || this.opts.es5) { + code.push(":"); + code_1.addCodeArg(code, value); + } + } + code.push("}"); + return new code_1._Code(code); + } + // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) + if(condition, thenBody, elseBody) { + this._blockNode(new If(condition)); + if (thenBody && elseBody) { + this.code(thenBody).else().code(elseBody).endIf(); + } + else if (thenBody) { + this.code(thenBody).endIf(); + } + else if (elseBody) { + throw new Error('CodeGen: "else" body without "then" body'); + } + return this; + } + // `else if` clause - invalid without `if` or after `else` clauses + elseIf(condition) { + return this._elseNode(new If(condition)); + } + // `else` clause - only valid after `if` or `else if` clauses + else() { + return this._elseNode(new Else()); + } + // end `if` statement (needed if gen.if was used only with condition) + endIf() { + return this._endBlockNode(If, Else); + } + _for(node, forBody) { + this._blockNode(node); + if (forBody) + this.code(forBody).endFor(); + return this; + } + // a generic `for` clause (or statement if `forBody` is passed) + for(iteration, forBody) { + return this._for(new ForLoop(iteration), forBody); + } + // `for` statement for a range of values + forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { + const name = this._scope.toName(nameOrPrefix); + return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); + } + // `for-of` statement (in es5 mode replace with a normal for loop) + forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { + const name = this._scope.toName(nameOrPrefix); + if (this.opts.es5) { + const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); + return this.forRange("_i", 0, code_1._ `${arr}.length`, (i) => { + this.var(name, code_1._ `${arr}[${i}]`); + forBody(name); + }); + } + return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); + } + // `for-in` statement. + // With option `ownProperties` replaced with a `for-of` loop for object keys + forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { + if (this.opts.ownProperties) { + return this.forOf(nameOrPrefix, code_1._ `Object.keys(${obj})`, forBody); + } + const name = this._scope.toName(nameOrPrefix); + return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); + } + // end `for` loop + endFor() { + return this._endBlockNode(For); + } + // `label` statement + label(label) { + return this._leafNode(new Label(label)); + } + // `break` statement + break(label) { + return this._leafNode(new Break(label)); + } + // `return` statement + return(value) { + const node = new Return(); + this._blockNode(node); + this.code(value); + if (node.nodes.length !== 1) + throw new Error('CodeGen: "return" should have one node'); + return this._endBlockNode(Return); + } + // `try` statement + try(tryBody, catchCode, finallyCode) { + if (!catchCode && !finallyCode) + throw new Error('CodeGen: "try" without "catch" and "finally"'); + const node = new Try(); + this._blockNode(node); + this.code(tryBody); + if (catchCode) { + const error = this.name("e"); + this._currNode = node.catch = new Catch(error); + catchCode(error); + } + if (finallyCode) { + this._currNode = node.finally = new Finally(); + this.code(finallyCode); + } + return this._endBlockNode(Catch, Finally); + } + // `throw` statement + throw(error) { + return this._leafNode(new Throw(error)); + } + // start self-balancing block + block(body, nodeCount) { + this._blockStarts.push(this._nodes.length); + if (body) + this.code(body).endBlock(nodeCount); + return this; + } + // end the current self-balancing block + endBlock(nodeCount) { + const len = this._blockStarts.pop(); + if (len === undefined) + throw new Error("CodeGen: not in self-balancing block"); + const toClose = this._nodes.length - len; + if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { + throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); + } + this._nodes.length = len; + return this; + } + // `function` heading (or definition if funcBody is passed) + func(name, args = code_1.nil, async, funcBody) { + this._blockNode(new Func(name, args, async)); + if (funcBody) + this.code(funcBody).endFunc(); + return this; + } + // end function definition + endFunc() { + return this._endBlockNode(Func); + } + optimize(n = 1) { + while (n-- > 0) { + this._root.optimizeNodes(); + this._root.optimizeNames(this._root.names, this._constants); + } + } + _leafNode(node) { + this._currNode.nodes.push(node); + return this; + } + _blockNode(node) { + this._currNode.nodes.push(node); + this._nodes.push(node); + } + _endBlockNode(N1, N2) { + const n = this._currNode; + if (n instanceof N1 || (N2 && n instanceof N2)) { + this._nodes.pop(); + return this; + } + throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); + } + _elseNode(node) { + const n = this._currNode; + if (!(n instanceof If)) { + throw new Error('CodeGen: "else" without "if"'); + } + this._currNode = n.else = node; + return this; + } + get _root() { + return this._nodes[0]; + } + get _currNode() { + const ns = this._nodes; + return ns[ns.length - 1]; + } + set _currNode(node) { + const ns = this._nodes; + ns[ns.length - 1] = node; + } +} +exports.CodeGen = CodeGen; +function addNames(names, from) { + for (const n in from) + names[n] = (names[n] || 0) + (from[n] || 0); + return names; +} +function addExprNames(names, from) { + return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; +} +function optimizeExpr(expr, names, constants) { + if (expr instanceof code_1.Name) + return replaceName(expr); + if (!canOptimize(expr)) + return expr; + return new code_1._Code(expr._items.reduce((items, c) => { + if (c instanceof code_1.Name) + c = replaceName(c); + if (c instanceof code_1._Code) + items.push(...c._items); + else + items.push(c); + return items; + }, [])); + function replaceName(n) { + const c = constants[n.str]; + if (c === undefined || names[n.str] !== 1) + return n; + delete names[n.str]; + return c; + } + function canOptimize(e) { + return (e instanceof code_1._Code && + e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined)); + } +} +function subtractNames(names, from) { + for (const n in from) + names[n] = (names[n] || 0) - (from[n] || 0); +} +function not(x) { + return typeof x == "boolean" || typeof x == "number" || x === null ? !x : code_1._ `!${par(x)}`; +} +exports.not = not; +const andCode = mappend(exports.operators.AND); +// boolean AND (&&) expression with the passed arguments +function and(...args) { + return args.reduce(andCode); +} +exports.and = and; +const orCode = mappend(exports.operators.OR); +// boolean OR (||) expression with the passed arguments +function or(...args) { + return args.reduce(orCode); +} +exports.or = or; +function mappend(op) { + return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : code_1._ `${par(x)} ${op} ${par(y)}`); +} +function par(x) { + return x instanceof code_1.Name ? x : code_1._ `(${x})`; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js new file mode 100644 index 00000000000000..ef1b1670127d50 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js @@ -0,0 +1,137 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = void 0; +const code_1 = require("./code"); +class ValueError extends Error { + constructor(name) { + super(`CodeGen: "code" for ${name} not defined`); + this.value = name.value; + } +} +exports.varKinds = { + const: new code_1.Name("const"), + let: new code_1.Name("let"), + var: new code_1.Name("var"), +}; +class Scope { + constructor({ prefixes, parent } = {}) { + this._names = {}; + this._prefixes = prefixes; + this._parent = parent; + } + toName(nameOrPrefix) { + return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); + } + name(prefix) { + return new code_1.Name(this._newName(prefix)); + } + _newName(prefix) { + const ng = this._names[prefix] || this._nameGroup(prefix); + return `${prefix}${ng.index++}`; + } + _nameGroup(prefix) { + var _a, _b; + if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) { + throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); + } + return (this._names[prefix] = { prefix, index: 0 }); + } +} +exports.Scope = Scope; +class ValueScopeName extends code_1.Name { + constructor(prefix, nameStr) { + super(nameStr); + this.prefix = prefix; + } + setValue(value, { property, itemIndex }) { + this.value = value; + this.scopePath = code_1._ `.${new code_1.Name(property)}[${itemIndex}]`; + } +} +exports.ValueScopeName = ValueScopeName; +const line = code_1._ `\n`; +class ValueScope extends Scope { + constructor(opts) { + super(opts); + this._values = {}; + this._scope = opts.scope; + this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; + } + get() { + return this._scope; + } + name(prefix) { + return new ValueScopeName(prefix, this._newName(prefix)); + } + value(nameOrPrefix, value) { + var _a; + if (value.ref === undefined) + throw new Error("CodeGen: ref must be passed in value"); + const name = this.toName(nameOrPrefix); + const { prefix } = name; + const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; + let vs = this._values[prefix]; + if (vs) { + const _name = vs.get(valueKey); + if (_name) + return _name; + } + else { + vs = this._values[prefix] = new Map(); + } + vs.set(valueKey, name); + const s = this._scope[prefix] || (this._scope[prefix] = []); + const itemIndex = s.length; + s[itemIndex] = value.ref; + name.setValue(value, { property: prefix, itemIndex }); + return name; + } + getValue(prefix, keyOrRef) { + const vs = this._values[prefix]; + if (!vs) + return; + return vs.get(keyOrRef); + } + scopeRefs(scopeName, values = this._values) { + return this._reduceValues(values, (name) => { + if (name.scopePath === undefined) + throw new Error(`CodeGen: name "${name}" has no value`); + return code_1._ `${scopeName}${name.scopePath}`; + }); + } + scopeCode(values = this._values, usedValues, getCode) { + return this._reduceValues(values, (name) => { + if (name.value === undefined) + throw new Error(`CodeGen: name "${name}" has no value`); + return name.value.code; + }, usedValues, getCode); + } + _reduceValues(values, valueCode, usedValues = {}, getCode) { + let code = code_1.nil; + for (const prefix in values) { + const vs = values[prefix]; + if (!vs) + continue; + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Set()); + vs.forEach((name) => { + if (nameSet.has(name)) + return; + nameSet.add(name); + let c = valueCode(name); + if (c) { + const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; + code = code_1._ `${code}${def} ${name} = ${c};${this.opts._n}`; + } + else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) { + code = code_1._ `${code}${c}${this.opts._n}`; + } + else { + throw new ValueError(name); + } + }); + } + return code; + } +} +exports.ValueScope = ValueScope; +//# sourceMappingURL=scope.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/context.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/context.js new file mode 100644 index 00000000000000..fc3e3f7e1d9005 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/context.js @@ -0,0 +1,240 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getData = void 0; +const dataType_1 = require("./validate/dataType"); +const util_1 = require("./util"); +const errors_1 = require("./errors"); +const codegen_1 = require("./codegen"); +const names_1 = require("./names"); +const subschema_1 = require("./subschema"); +class KeywordCxt { + constructor(it, def, keyword) { + validateKeywordUsage(it, def, keyword); + this.gen = it.gen; + this.allErrors = it.allErrors; + this.keyword = keyword; + this.data = it.data; + this.schema = it.schema[keyword]; + this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; + this.schemaValue = util_1.schemaRefOrVal(it, this.schema, keyword, this.$data); + this.schemaType = def.schemaType; + this.parentSchema = it.schema; + this.params = {}; + this.it = it; + this.def = def; + if (this.$data) { + this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); + } + else { + this.schemaCode = this.schemaValue; + if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) { + throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); + } + } + if ("code" in def ? def.trackErrors : def.errors !== false) { + this.errsCount = it.gen.const("_errs", names_1.default.errors); + } + } + result(condition, successAction, failAction) { + this.gen.if(codegen_1.not(condition)); + if (failAction) + failAction(); + else + this.error(); + if (successAction) { + this.gen.else(); + successAction(); + if (this.allErrors) + this.gen.endIf(); + } + else { + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + } + pass(condition, failAction) { + this.result(condition, undefined, failAction); + } + fail(condition) { + if (condition === undefined) { + this.error(); + if (!this.allErrors) + this.gen.if(false); // this branch will be removed by gen.optimize + return; + } + this.gen.if(condition); + this.error(); + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + fail$data(condition) { + if (!this.$data) + return this.fail(condition); + const { schemaCode } = this; + this.fail(codegen_1._ `${schemaCode} !== undefined && (${codegen_1.or(this.invalid$data(), condition)})`); + } + error(append) { + ; + (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error || errors_1.keywordError); + } + $dataError() { + errors_1.reportError(this, this.def.$dataError || errors_1.keyword$DataError); + } + reset() { + if (this.errsCount === undefined) + throw new Error('add "trackErrors" to keyword definition'); + errors_1.resetErrorsCount(this.gen, this.errsCount); + } + ok(cond) { + if (!this.allErrors) + this.gen.if(cond); + } + setParams(obj, assign) { + if (assign) + Object.assign(this.params, obj); + else + this.params = obj; + } + block$data(valid, codeBlock, $dataValid = codegen_1.nil) { + this.gen.block(() => { + this.check$data(valid, $dataValid); + codeBlock(); + }); + } + check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { + if (!this.$data) + return; + const { gen, schemaCode, schemaType, def } = this; + gen.if(codegen_1.or(codegen_1._ `${schemaCode} === undefined`, $dataValid)); + if (valid !== codegen_1.nil) + gen.assign(valid, true); + if (schemaType.length || def.validateSchema) { + gen.elseIf(this.invalid$data()); + this.$dataError(); + if (valid !== codegen_1.nil) + gen.assign(valid, false); + } + gen.else(); + } + invalid$data() { + const { gen, schemaCode, schemaType, def, it } = this; + return codegen_1.or(wrong$DataType(), invalid$DataSchema()); + function wrong$DataType() { + if (schemaType.length) { + /* istanbul ignore if */ + if (!(schemaCode instanceof codegen_1.Name)) + throw new Error("ajv implementation error"); + const st = Array.isArray(schemaType) ? schemaType : [schemaType]; + return codegen_1._ `${dataType_1.checkDataTypes(st, schemaCode, it.opts.strict, dataType_1.DataType.Wrong)}`; + } + return codegen_1.nil; + } + function invalid$DataSchema() { + if (def.validateSchema) { + const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone + return codegen_1._ `!${validateSchemaRef}(${schemaCode})`; + } + return codegen_1.nil; + } + } + subschema(appl, valid) { + return subschema_1.applySubschema(this.it, appl, valid); + } + mergeEvaluated(schemaCxt, toName) { + const { it, gen } = this; + if (!it.opts.unevaluated) + return; + if (it.props !== true && schemaCxt.props !== undefined) { + it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); + } + if (it.items !== true && schemaCxt.items !== undefined) { + it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); + } + } + mergeValidEvaluated(schemaCxt, valid) { + const { it, gen } = this; + if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { + gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); + return true; + } + } +} +exports.default = KeywordCxt; +function validSchemaType(schema, schemaType, allowUndefined = false) { + // TODO add tests + return (!schemaType.length || + schemaType.some((st) => st === "array" + ? Array.isArray(schema) + : st === "object" + ? schema && typeof schema == "object" && !Array.isArray(schema) + : typeof schema == st || (allowUndefined && typeof schema == "undefined"))); +} +function validateKeywordUsage({ schema, opts, self }, def, keyword) { + /* istanbul ignore if */ + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error"); + } + const deps = def.dependencies; + if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); + } + if (def.validateSchema) { + const valid = def.validateSchema(schema[keyword]); + if (!valid) { + const msg = "keyword value is invalid: " + self.errorsText(def.validateSchema.errors); + if (opts.validateSchema === "log") + self.logger.error(msg); + else + throw new Error(msg); + } + } +} +const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; +const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; +function getData($data, { dataLevel, dataNames, dataPathArr }) { + let jsonPointer; + let data; + if ($data === "") + return names_1.default.rootData; + if ($data[0] === "/") { + if (!JSON_POINTER.test($data)) + throw new Error(`Invalid JSON-pointer: ${$data}`); + jsonPointer = $data; + data = names_1.default.rootData; + } + else { + const matches = RELATIVE_JSON_POINTER.exec($data); + if (!matches) + throw new Error(`Invalid JSON-pointer: ${$data}`); + const up = +matches[1]; + jsonPointer = matches[2]; + if (jsonPointer === "#") { + if (up >= dataLevel) + throw new Error(errorMsg("property/index", up)); + return dataPathArr[dataLevel - up]; + } + if (up > dataLevel) + throw new Error(errorMsg("data", up)); + data = dataNames[dataLevel - up]; + if (!jsonPointer) + return data; + } + let expr = data; + const segments = jsonPointer.split("/"); + for (const segment of segments) { + if (segment) { + data = codegen_1._ `${data}${codegen_1.getProperty(util_1.unescapeJsonPointer(segment))}`; + expr = codegen_1._ `${expr} && ${data}`; + } + } + return expr; + function errorMsg(pointerType, up) { + return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; + } +} +exports.getData = getData; +//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/equal.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/equal.js new file mode 100644 index 00000000000000..e5b45c3ca8d4c8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/equal.js @@ -0,0 +1,5 @@ +"use strict"; +// do NOT remove this file - it would break pre-compiled schemas +// https://github.com/ajv-validator/ajv/issues/889 +module.exports = require("fast-deep-equal"); +//# sourceMappingURL=equal.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/error_classes.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/error_classes.js new file mode 100644 index 00000000000000..753d657af035c2 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/error_classes.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = void 0; +const resolve_1 = require("./resolve"); +class ValidationError extends Error { + constructor(errors) { + super("validation failed"); + this.errors = errors; + this.ajv = this.validation = true; + } +} +exports.ValidationError = ValidationError; +class MissingRefError extends Error { + constructor(baseId, ref) { + super(`can't resolve reference ${ref} from id ${baseId}`); + this.missingRef = resolve_1.resolveUrl(baseId, ref); + this.missingSchema = resolve_1.normalizeId(resolve_1.getFullPath(this.missingRef)); + } +} +exports.MissingRefError = MissingRefError; +module.exports = { + ValidationError, + MissingRefError, +}; +//# sourceMappingURL=error_classes.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/errors.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/errors.js new file mode 100644 index 00000000000000..f248e67c2c7866 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/errors.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; +const codegen_1 = require("./codegen"); +const names_1 = require("./names"); +exports.keywordError = { + message: ({ keyword }) => codegen_1.str `should pass "${keyword}" keyword validation`, +}; +exports.keyword$DataError = { + message: ({ keyword, schemaType }) => schemaType + ? codegen_1.str `"${keyword}" keyword must be ${schemaType} ($data)` + : codegen_1.str `"${keyword}" keyword is invalid ($data)`, +}; +function reportError(cxt, error, overrideAllErrors) { + const { it } = cxt; + const { gen, compositeRule, allErrors } = it; + const errObj = errorObjectCode(cxt, error); + if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) { + addError(gen, errObj); + } + else { + returnErrors(it, codegen_1._ `[${errObj}]`); + } +} +exports.reportError = reportError; +function reportExtraError(cxt, error) { + const { it } = cxt; + const { gen, compositeRule, allErrors } = it; + const errObj = errorObjectCode(cxt, error); + addError(gen, errObj); + if (!(compositeRule || allErrors)) { + returnErrors(it, names_1.default.vErrors); + } +} +exports.reportExtraError = reportExtraError; +function resetErrorsCount(gen, errsCount) { + gen.assign(names_1.default.errors, errsCount); + gen.if(codegen_1._ `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign(codegen_1._ `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); +} +exports.resetErrorsCount = resetErrorsCount; +function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) { + /* istanbul ignore if */ + if (errsCount === undefined) + throw new Error("ajv implementation error"); + const err = gen.name("err"); + gen.forRange("i", errsCount, names_1.default.errors, (i) => { + gen.const(err, codegen_1._ `${names_1.default.vErrors}[${i}]`); + gen.if(codegen_1._ `${err}.dataPath === undefined`, () => gen.assign(codegen_1._ `${err}.dataPath`, codegen_1.strConcat(names_1.default.dataPath, it.errorPath))); + gen.assign(codegen_1._ `${err}.schemaPath`, codegen_1.str `${it.errSchemaPath}/${keyword}`); + if (it.opts.verbose) { + gen.assign(codegen_1._ `${err}.schema`, schemaValue); + gen.assign(codegen_1._ `${err}.data`, data); + } + }); +} +exports.extendErrors = extendErrors; +function addError(gen, errObj) { + const err = gen.const("err", errObj); + gen.if(codegen_1._ `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, codegen_1._ `[${err}]`), codegen_1._ `${names_1.default.vErrors}.push(${err})`); + gen.code(codegen_1._ `${names_1.default.errors}++`); +} +function returnErrors(it, errs) { + const { gen, validateName, schemaEnv } = it; + if (schemaEnv.$async) { + gen.throw(codegen_1._ `new ${it.ValidationError}(${errs})`); + } + else { + gen.assign(codegen_1._ `${validateName}.errors`, errs); + gen.return(false); + } +} +const E = { + keyword: new codegen_1.Name("keyword"), + schemaPath: new codegen_1.Name("schemaPath"), + params: new codegen_1.Name("params"), + propertyName: new codegen_1.Name("propertyName"), + message: new codegen_1.Name("message"), + schema: new codegen_1.Name("schema"), + parentSchema: new codegen_1.Name("parentSchema"), +}; +function errorObjectCode(cxt, error) { + const { keyword, data, schemaValue, it: { gen, createErrors, topSchemaRef, schemaPath, errorPath, errSchemaPath, propertyName, opts }, } = cxt; + if (createErrors === false) + return codegen_1._ `{}`; + const { params, message } = error; + const keyValues = [ + [E.keyword, keyword], + [names_1.default.dataPath, codegen_1.strConcat(names_1.default.dataPath, errorPath)], + [E.schemaPath, codegen_1.str `${errSchemaPath}/${keyword}`], + [E.params, typeof params == "function" ? params(cxt) : params || codegen_1._ `{}`], + ]; + if (propertyName) + keyValues.push([E.propertyName, propertyName]); + if (opts.messages !== false) { + const msg = typeof message == "function" ? message(cxt) : message; + keyValues.push([E.message, msg]); + } + if (opts.verbose) { + keyValues.push([E.schema, schemaValue], [E.parentSchema, codegen_1._ `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); + } + return gen.object(...keyValues); +} +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js new file mode 100644 index 00000000000000..b9d9bfb09974ce --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js @@ -0,0 +1,230 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; +const codegen_1 = require("./codegen"); +const error_classes_1 = require("./error_classes"); +const names_1 = require("./names"); +const resolve_1 = require("./resolve"); +const util_1 = require("./util"); +const validate_1 = require("./validate"); +const URI = require("uri-js"); +class SchemaEnv { + constructor(env) { + var _a; + this.refs = {}; + this.dynamicAnchors = {}; + let schema; + if (typeof env.schema == "object") + schema = env.schema; + this.schema = env.schema; + this.root = env.root || this; + this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : resolve_1.normalizeId(schema === null || schema === void 0 ? void 0 : schema.$id); + this.localRefs = env.localRefs; + this.meta = env.meta; + this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; + this.refs = {}; + } +} +exports.SchemaEnv = SchemaEnv; +// let codeSize = 0 +// let nodeCount = 0 +// Compiles schema in SchemaEnv +function compileSchema(sch) { + // TODO refactor - remove compilations + const _sch = getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const rootId = resolve_1.getFullPath(sch.root.baseId); // TODO if getFullPath removed 1 tests fails + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + let _ValidationError; + if (sch.$async) { + _ValidationError = gen.scopeValue("Error", { + ref: error_classes_1.ValidationError, + code: codegen_1._ `require("ajv/dist/compile/error_classes").ValidationError`, + }); + } + const validateName = gen.scopeName("validate"); + sch.validateName = validateName; + const schemaCxt = { + gen, + allErrors: this.opts.allErrors, + data: names_1.default.data, + parentData: names_1.default.parentData, + parentDataProperty: names_1.default.parentDataProperty, + dataNames: [names_1.default.data], + dataPathArr: [codegen_1.nil], + dataLevel: 0, + dataTypes: [], + topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true + ? { ref: sch.schema, code: codegen_1.stringify(sch.schema) } + : { ref: sch.schema }), + validateName, + ValidationError: _ValidationError, + schema: sch.schema, + schemaEnv: sch, + strictSchema: true, + rootId, + baseId: sch.baseId || rootId, + schemaPath: codegen_1.nil, + errSchemaPath: "#", + errorPath: codegen_1._ `""`, + opts: this.opts, + self: this, + }; + let sourceCode; + try { + this._compilations.add(sch); + validate_1.validateFunctionCode(schemaCxt); + gen.optimize(this.opts.code.optimize); + // gen.optimize(1) + const validateCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; + // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) + if (this.opts.code.process) + sourceCode = this.opts.code.process(sourceCode, sch); + // console.log("\n\n\n *** \n", sourceCode) + const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); + const validate = makeValidate(this, this.scope.get()); + this.scope.value(validateName, { ref: validate }); + validate.errors = null; + validate.schema = sch.schema; + validate.schemaEnv = sch; + if (sch.$async) + validate.$async = true; + if (this.opts.code.source === true) { + validate.source = { validateName, validateCode, scopeValues: gen._values }; + } + if (this.opts.unevaluated) { + const { props, items } = schemaCxt; + validate.evaluated = { + props: props instanceof codegen_1.Name ? undefined : props, + items: items instanceof codegen_1.Name ? undefined : items, + dynamicProps: props instanceof codegen_1.Name, + dynamicItems: items instanceof codegen_1.Name, + }; + if (validate.source) + validate.source.evaluated = codegen_1.stringify(validate.evaluated); + } + sch.validate = validate; + return sch; + } + catch (e) { + delete sch.validate; + delete sch.validateName; + if (sourceCode) + this.logger.error("Error compiling schema, function code:", sourceCode); + // console.log("\n\n\n *** \n", sourceCode, this.opts) + throw e; + } + finally { + this._compilations.delete(sch); + } +} +exports.compileSchema = compileSchema; +function resolveRef(root, baseId, ref) { + var _a; + ref = resolve_1.resolveUrl(baseId, ref); + const schOrFunc = root.refs[ref]; + if (schOrFunc) + return schOrFunc; + let _sch = resolve.call(this, root, ref); + if (_sch === undefined) { + const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv + if (schema) + _sch = new SchemaEnv({ schema, root, baseId }); + } + if (_sch === undefined) + return; + return (root.refs[ref] = inlineOrCompile.call(this, _sch)); +} +exports.resolveRef = resolveRef; +function inlineOrCompile(sch) { + if (resolve_1.inlineRef(sch.schema, this.opts.inlineRefs)) + return sch.schema; + return sch.validate ? sch : compileSchema.call(this, sch); +} +// Index of schema compilation in the currently compiled list +function getCompilingSchema(schEnv) { + for (const sch of this._compilations) { + if (sameSchemaEnv(sch, schEnv)) + return sch; + } +} +function sameSchemaEnv(s1, s2) { + return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; +} +// resolve and compile the references ($ref) +// TODO returns AnySchemaObject (if the schema can be inlined) or validation function +function resolve(root, // information about the root schema for the current schema +ref // reference to resolve +) { + let sch; + while (typeof (sch = this.refs[ref]) == "string") + ref = sch; + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); +} +// Resolve schema, its root and baseId +function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it +ref // reference to resolve +) { + const p = URI.parse(ref); + const refPath = resolve_1._getFullPath(p); + const baseId = resolve_1.getFullPath(root.baseId); + // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests + if (Object.keys(root.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root); + } + const id = resolve_1.normalizeId(refPath); + const schOrRef = this.refs[id] || this.schemas[id]; + if (typeof schOrRef == "string") { + const sch = resolveSchema.call(this, root, schOrRef); + if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") + return; + return getJsonPointer.call(this, p, sch); + } + if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") + return; + if (!schOrRef.validate) + compileSchema.call(this, schOrRef); + if (id === resolve_1.normalizeId(ref)) + return new SchemaEnv({ schema: schOrRef.schema, root, baseId }); + return getJsonPointer.call(this, p, schOrRef); +} +exports.resolveSchema = resolveSchema; +const PREVENT_SCOPE_CHANGE = new Set([ + "properties", + "patternProperties", + "enum", + "dependencies", + "definitions", +]); +function getJsonPointer(parsedRef, { baseId, schema, root }) { + var _a; + if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") + return; + for (const part of parsedRef.fragment.slice(1).split("/")) { + if (typeof schema == "boolean") + return; + schema = schema[util_1.unescapeFragment(part)]; + if (schema === undefined) + return; + // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? + if (!PREVENT_SCOPE_CHANGE.has(part) && typeof schema == "object" && schema.$id) { + baseId = resolve_1.resolveUrl(baseId, schema.$id); + } + } + let env; + if (typeof schema != "boolean" && schema.$ref && !util_1.schemaHasRulesButRef(schema, this.RULES)) { + const $ref = resolve_1.resolveUrl(baseId, schema.$ref); + env = resolveSchema.call(this, root, $ref); + } + // even though resolution failed we need to return SchemaEnv to throw exception + // so that compileAsync loads missing schema. + env = env || new SchemaEnv({ schema, root, baseId }); + if (env.schema !== env.root.schema) + return env; + return undefined; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js new file mode 100644 index 00000000000000..d40037194ae3d9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("./codegen"); +const names = { + // validation function arguments + data: new codegen_1.Name("data"), + // args passed from referencing schema + valCxt: new codegen_1.Name("valCxt"), + dataPath: new codegen_1.Name("dataPath"), + parentData: new codegen_1.Name("parentData"), + parentDataProperty: new codegen_1.Name("parentDataProperty"), + rootData: new codegen_1.Name("rootData"), + dynamicAnchors: new codegen_1.Name("dynamicAnchors"), + // function scoped variables + vErrors: new codegen_1.Name("vErrors"), + errors: new codegen_1.Name("errors"), + this: new codegen_1.Name("this"), + // "globals" + self: new codegen_1.Name("self"), + scope: new codegen_1.Name("scope"), +}; +exports.default = names; +//# sourceMappingURL=names.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js new file mode 100644 index 00000000000000..37eb9a8654c43d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js @@ -0,0 +1,152 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; +const util_1 = require("./util"); +const equal = require("fast-deep-equal"); +const traverse = require("json-schema-traverse"); +const URI = require("uri-js"); +// TODO refactor to use keyword definitions +const SIMPLE_INLINED = new Set([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum", + "const", +]); +function inlineRef(schema, limit = true) { + if (typeof schema == "boolean") + return true; + if (limit === true) + return !hasRef(schema); + if (!limit) + return false; + return countKeys(schema) <= limit; +} +exports.inlineRef = inlineRef; +const REF_KEYWORDS = new Set([ + "$ref", + "$recursiveRef", + "$recursiveAnchor", + "$dynamicRef", + "$dynamicAnchor", +]); +function hasRef(schema) { + for (const key in schema) { + if (REF_KEYWORDS.has(key)) + return true; + const sch = schema[key]; + if (Array.isArray(sch) && sch.some(hasRef)) + return true; + if (typeof sch == "object" && hasRef(sch)) + return true; + } + return false; +} +function countKeys(schema) { + let count = 0; + for (const key in schema) { + if (key === "$ref") + return Infinity; + count++; + if (SIMPLE_INLINED.has(key)) + continue; + if (typeof schema[key] == "object") { + util_1.eachItem(schema[key], (sch) => (count += countKeys(sch))); + } + if (count === Infinity) + return Infinity; + } + return count; +} +function getFullPath(id = "", normalize) { + if (normalize !== false) + id = normalizeId(id); + const p = URI.parse(id); + return _getFullPath(p); +} +exports.getFullPath = getFullPath; +function _getFullPath(p) { + return URI.serialize(p).split("#")[0] + "#"; +} +exports._getFullPath = _getFullPath; +const TRAILING_SLASH_HASH = /#\/?$/; +function normalizeId(id) { + return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; +} +exports.normalizeId = normalizeId; +function resolveUrl(baseId, id) { + id = normalizeId(id); + return URI.resolve(baseId, id); +} +exports.resolveUrl = resolveUrl; +const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; +function getSchemaRefs(schema) { + if (typeof schema == "boolean") + return {}; + const schemaId = normalizeId(schema.$id); + const baseIds = { "": schemaId }; + const pathPrefix = getFullPath(schemaId, false); + const localRefs = {}; + const schemaRefs = new Set(); + traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { + if (parentJsonPtr === undefined) + return; + const fullPath = pathPrefix + jsonPtr; + let baseId = baseIds[parentJsonPtr]; + if (typeof sch.$id == "string") + baseId = addRef.call(this, sch.$id); + addAnchor.call(this, sch.$anchor); + addAnchor.call(this, sch.$dynamicAnchor); + baseIds[jsonPtr] = baseId; + function addRef(ref) { + ref = normalizeId(baseId ? URI.resolve(baseId, ref) : ref); + if (schemaRefs.has(ref)) + throw ambiguos(ref); + schemaRefs.add(ref); + let schOrRef = this.refs[ref]; + if (typeof schOrRef == "string") + schOrRef = this.refs[schOrRef]; + if (typeof schOrRef == "object") { + checkAmbiguosRef(sch, schOrRef.schema, ref); + } + else if (ref !== normalizeId(fullPath)) { + if (ref[0] === "#") { + checkAmbiguosRef(sch, localRefs[ref], ref); + localRefs[ref] = sch; + } + else { + this.refs[ref] = fullPath; + } + } + return ref; + } + function addAnchor(anchor) { + if (typeof anchor == "string") { + if (!ANCHOR.test(anchor)) + throw new Error(`invalid anchor "${anchor}"`); + addRef.call(this, `#${anchor}`); + } + } + }); + return localRefs; + function checkAmbiguosRef(sch1, sch2, ref) { + if (sch2 !== undefined && !equal(sch1, sch2)) + throw ambiguos(ref); + } + function ambiguos(ref) { + return new Error(`reference "${ref}" resolves to more than one schema`); + } +} +exports.getSchemaRefs = getSchemaRefs; +//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/rules.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/rules.js new file mode 100644 index 00000000000000..11c114a4c33477 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/rules.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRules = exports.isJSONType = void 0; +const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; +const jsonTypes = new Set(_jsonTypes); +function isJSONType(x) { + return typeof x == "string" && jsonTypes.has(x); +} +exports.isJSONType = isJSONType; +function getRules() { + const groups = { + number: { type: "number", rules: [] }, + string: { type: "string", rules: [] }, + array: { type: "array", rules: [] }, + object: { type: "object", rules: [] }, + }; + return { + types: { ...groups, integer: true, boolean: true, null: true }, + rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], + post: { rules: [] }, + all: { type: true, $comment: true }, + keywords: { type: true, $comment: true }, + }; +} +exports.getRules = getRules; +//# sourceMappingURL=rules.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js new file mode 100644 index 00000000000000..df69e4cc54bf7e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/subschema.js @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applySubschema = exports.Type = void 0; +const validate_1 = require("./validate"); +const util_1 = require("./util"); +const codegen_1 = require("./codegen"); +var Type; +(function (Type) { + Type[Type["Num"] = 0] = "Num"; + Type[Type["Str"] = 1] = "Str"; +})(Type = exports.Type || (exports.Type = {})); +function applySubschema(it, appl, valid) { + const subschema = getSubschema(it, appl); + extendSubschemaData(subschema, it, appl); + extendSubschemaMode(subschema, appl); + const nextContext = { ...it, ...subschema, items: undefined, props: undefined }; + validate_1.subschemaCode(nextContext, valid); + return nextContext; +} +exports.applySubschema = applySubschema; +function getSubschema(it, { keyword, schemaProp, schema, strictSchema, schemaPath, errSchemaPath, topSchemaRef, }) { + if (keyword !== undefined && schema !== undefined) { + throw new Error('both "keyword" and "schema" passed, only one allowed'); + } + if (keyword !== undefined) { + const sch = it.schema[keyword]; + return schemaProp === undefined + ? { + schema: sch, + schemaPath: codegen_1._ `${it.schemaPath}${codegen_1.getProperty(keyword)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + } + : { + schema: sch[schemaProp], + schemaPath: codegen_1._ `${it.schemaPath}${codegen_1.getProperty(keyword)}${codegen_1.getProperty(schemaProp)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}/${util_1.escapeFragment(schemaProp)}`, + }; + } + if (schema !== undefined) { + if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); + } + return { + schema, + strictSchema, + schemaPath, + topSchemaRef, + errSchemaPath, + }; + } + throw new Error('either "keyword" or "schema" must be passed'); +} +function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { + if (data !== undefined && dataProp !== undefined) { + throw new Error('both "data" and "dataProp" passed, only one allowed'); + } + const { gen } = it; + if (dataProp !== undefined) { + const { errorPath, dataPathArr, opts } = it; + const nextData = gen.let("data", codegen_1._ `${it.data}${codegen_1.getProperty(dataProp)}`, true); + dataContextProps(nextData); + subschema.errorPath = codegen_1.str `${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}`; + subschema.parentDataProperty = codegen_1._ `${dataProp}`; + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; + } + if (data !== undefined) { + const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? + dataContextProps(nextData); + if (propertyName !== undefined) + subschema.propertyName = propertyName; + // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr + } + if (dataTypes) + subschema.dataTypes = dataTypes; + function dataContextProps(_nextData) { + subschema.data = _nextData; + subschema.dataLevel = it.dataLevel + 1; + subschema.dataTypes = []; + subschema.parentData = it.data; + subschema.dataNames = [...it.dataNames, _nextData]; + } +} +function extendSubschemaMode(subschema, { compositeRule, createErrors, allErrors, strictSchema }) { + if (compositeRule !== undefined) + subschema.compositeRule = compositeRule; + if (createErrors !== undefined) + subschema.createErrors = createErrors; + if (allErrors !== undefined) + subschema.allErrors = allErrors; + subschema.strictSchema = strictSchema; // not inherited +} +function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { + // let path + if (dataProp instanceof codegen_1.Name) { + const isNumber = dataPropType === Type.Num; + return jsPropertySyntax + ? isNumber + ? codegen_1._ `"[" + ${dataProp} + "]"` + : codegen_1._ `"['" + ${dataProp} + "']"` + : isNumber + ? codegen_1._ `"/" + ${dataProp}` + : codegen_1._ `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer + } + return jsPropertySyntax ? codegen_1.getProperty(dataProp).toString() : "/" + util_1.escapeJsonPointer(dataProp); +} +//# sourceMappingURL=subschema.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js new file mode 100644 index 00000000000000..ba946089f7a780 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/ucs2length.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// https://mathiasbynens.be/notes/javascript-encoding +// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode +function ucs2length(str) { + const len = str.length; + let length = 0; + let pos = 0; + let value; + while (pos < len) { + length++; + value = str.charCodeAt(pos++); + if (value >= 0xd800 && value <= 0xdbff && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xfc00) === 0xdc00) + pos++; // low surrogate + } + } + return length; +} +exports.default = ucs2length; +//# sourceMappingURL=ucs2length.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js new file mode 100644 index 00000000000000..e0c90c7e1475ab --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js @@ -0,0 +1,141 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; +const codegen_1 = require("./codegen"); +const validate_1 = require("./validate"); +// TODO refactor to use Set +function toHash(arr) { + const hash = {}; + for (const item of arr) + hash[item] = true; + return hash; +} +exports.toHash = toHash; +function alwaysValidSchema(it, schema) { + if (typeof schema == "boolean") + return schema; + if (Object.keys(schema).length === 0) + return true; + checkUnknownRules(it, schema); + return !schemaHasRules(schema, it.self.RULES.all); +} +exports.alwaysValidSchema = alwaysValidSchema; +function checkUnknownRules(it, schema = it.schema) { + const { opts, self } = it; + if (!opts.strict) + return; + if (typeof schema === "boolean") + return; + const rules = self.RULES.keywords; + for (const key in schema) { + if (!rules[key]) + validate_1.checkStrictMode(it, `unknown keyword: "${key}"`); + } +} +exports.checkUnknownRules = checkUnknownRules; +function schemaHasRules(schema, rules) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (rules[key]) + return true; + return false; +} +exports.schemaHasRules = schemaHasRules; +function schemaHasRulesButRef(schema, RULES) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (key !== "$ref" && RULES.all[key]) + return true; + return false; +} +exports.schemaHasRulesButRef = schemaHasRulesButRef; +function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { + if (!$data) { + if (typeof schema == "number" || typeof schema == "boolean") + return schema; + if (typeof schema == "string") + return codegen_1._ `${schema}`; + } + return codegen_1._ `${topSchemaRef}${schemaPath}${codegen_1.getProperty(keyword)}`; +} +exports.schemaRefOrVal = schemaRefOrVal; +function unescapeFragment(str) { + return unescapeJsonPointer(decodeURIComponent(str)); +} +exports.unescapeFragment = unescapeFragment; +function escapeFragment(str) { + return encodeURIComponent(escapeJsonPointer(str)); +} +exports.escapeFragment = escapeFragment; +function escapeJsonPointer(str) { + if (typeof str == "number") + return `${str}`; + return str.replace(/~/g, "~0").replace(/\//g, "~1"); +} +exports.escapeJsonPointer = escapeJsonPointer; +function unescapeJsonPointer(str) { + return str.replace(/~1/g, "/").replace(/~0/g, "~"); +} +exports.unescapeJsonPointer = unescapeJsonPointer; +function eachItem(xs, f) { + if (Array.isArray(xs)) { + for (const x of xs) + f(x); + } + else { + f(xs); + } +} +exports.eachItem = eachItem; +function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) { + return (gen, from, to, toName) => { + const res = to === undefined + ? from + : to instanceof codegen_1.Name + ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) + : from instanceof codegen_1.Name + ? (mergeToName(gen, to, from), from) + : mergeValues(from, to); + return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; + }; +} +exports.mergeEvaluated = { + props: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if(codegen_1._ `${to} !== true && ${from} !== undefined`, () => { + gen.if(codegen_1._ `${from} === true`, () => gen.assign(to, true), () => gen.code(codegen_1._ `Object.assign(${to}, ${from})`)); + }), + mergeToName: (gen, from, to) => gen.if(codegen_1._ `${to} !== true`, () => { + if (from === true) { + gen.assign(to, true); + } + else { + gen.assign(to, codegen_1._ `${to} || {}`); + setEvaluated(gen, to, from); + } + }), + mergeValues: (from, to) => (from === true ? true : { ...from, ...to }), + resultToName: evaluatedPropsToName, + }), + items: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if(codegen_1._ `${to} !== true && ${from} !== undefined`, () => gen.assign(to, codegen_1._ `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), + mergeToName: (gen, from, to) => gen.if(codegen_1._ `${to} !== true`, () => gen.assign(to, from === true ? true : codegen_1._ `${to} > ${from} ? ${to} : ${from}`)), + mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), + resultToName: (gen, items) => gen.var("items", items), + }), +}; +function evaluatedPropsToName(gen, ps) { + if (ps === true) + return gen.var("props", true); + const props = gen.var("props", codegen_1._ `{}`); + if (ps !== undefined) + setEvaluated(gen, props, ps); + return props; +} +exports.evaluatedPropsToName = evaluatedPropsToName; +function setEvaluated(gen, props, ps) { + Object.keys(ps).forEach((p) => gen.assign(codegen_1._ `${props}${codegen_1.getProperty(p)}`, true)); +} +exports.setEvaluated = setEvaluated; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js new file mode 100644 index 00000000000000..7a3ebde278aecc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; +function schemaHasRulesForType({ schema, self }, type) { + const group = self.RULES.types[type]; + return group && group !== true && shouldUseGroup(schema, group); +} +exports.schemaHasRulesForType = schemaHasRulesForType; +function shouldUseGroup(schema, group) { + return group.rules.some((rule) => shouldUseRule(schema, rule)); +} +exports.shouldUseGroup = shouldUseGroup; +function shouldUseRule(schema, rule) { + var _a; + return (schema[rule.keyword] !== undefined || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); +} +exports.shouldUseRule = shouldUseRule; +//# sourceMappingURL=applicability.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js new file mode 100644 index 00000000000000..52919a9940ed5f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; +const errors_1 = require("../errors"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const boolError = { + message: "boolean schema is false", +}; +function topBoolOrEmptySchema(it) { + const { gen, schema, validateName } = it; + if (schema === false) { + falseSchemaError(it, false); + } + else if (typeof schema == "object" && schema.$async === true) { + gen.return(names_1.default.data); + } + else { + gen.assign(codegen_1._ `${validateName}.errors`, null); + gen.return(true); + } +} +exports.topBoolOrEmptySchema = topBoolOrEmptySchema; +function boolOrEmptySchema(it, valid) { + const { gen, schema } = it; + if (schema === false) { + gen.var(valid, false); // TODO var + falseSchemaError(it); + } + else { + gen.var(valid, true); // TODO var + } +} +exports.boolOrEmptySchema = boolOrEmptySchema; +function falseSchemaError(it, overrideAllErrors) { + const { gen, data } = it; + // TODO maybe some other interface should be used for non-keyword validation errors... + const cxt = { + gen, + keyword: "false schema", + data, + schema: false, + schemaCode: false, + schemaValue: false, + params: {}, + it, + }; + errors_1.reportError(cxt, boolError, overrideAllErrors); +} +//# sourceMappingURL=boolSchema.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js new file mode 100644 index 00000000000000..89dee09ad5619d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js @@ -0,0 +1,202 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; +const rules_1 = require("../rules"); +const applicability_1 = require("./applicability"); +const errors_1 = require("../errors"); +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +var DataType; +(function (DataType) { + DataType[DataType["Correct"] = 0] = "Correct"; + DataType[DataType["Wrong"] = 1] = "Wrong"; +})(DataType = exports.DataType || (exports.DataType = {})); +function getSchemaTypes(schema) { + const types = getJSONTypes(schema.type); + const hasNull = types.includes("null"); + if (hasNull) { + if (schema.nullable === false) + throw new Error("type: null contradicts nullable: false"); + } + else { + if (!types.length && schema.nullable !== undefined) { + throw new Error('"nullable" cannot be used without "type"'); + } + if (schema.nullable === true) + types.push("null"); + } + return types; +} +exports.getSchemaTypes = getSchemaTypes; +function getJSONTypes(ts) { + const types = Array.isArray(ts) ? ts : ts ? [ts] : []; + if (types.every(rules_1.isJSONType)) + return types; + throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); +} +exports.getJSONTypes = getJSONTypes; +function coerceAndCheckDataType(it, types) { + const { gen, data, opts } = it; + const coerceTo = coerceToTypes(types, opts.coerceTypes); + const checkTypes = types.length > 0 && + !(coerceTo.length === 0 && types.length === 1 && applicability_1.schemaHasRulesForType(it, types[0])); + if (checkTypes) { + const wrongType = checkDataTypes(types, data, opts.strict, DataType.Wrong); + gen.if(wrongType, () => { + if (coerceTo.length) + coerceData(it, types, coerceTo); + else + reportTypeError(it); + }); + } + return checkTypes; +} +exports.coerceAndCheckDataType = coerceAndCheckDataType; +const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); +function coerceToTypes(types, coerceTypes) { + return coerceTypes + ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) + : []; +} +function coerceData(it, types, coerceTo) { + const { gen, data, opts } = it; + const dataType = gen.let("dataType", codegen_1._ `typeof ${data}`); + const coerced = gen.let("coerced", codegen_1._ `undefined`); + if (opts.coerceTypes === "array") { + gen.if(codegen_1._ `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen + .assign(data, codegen_1._ `${data}[0]`) + .assign(dataType, codegen_1._ `typeof ${data}`) + .if(checkDataTypes(types, data, opts.strict), () => gen.assign(coerced, data))); + } + gen.if(codegen_1._ `${coerced} !== undefined`); + for (const t of coerceTo) { + if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { + coerceSpecificType(t); + } + } + gen.else(); + reportTypeError(it); + gen.endIf(); + gen.if(codegen_1._ `${coerced} !== undefined`, () => { + gen.assign(data, coerced); + assignParentData(it, coerced); + }); + function coerceSpecificType(t) { + switch (t) { + case "string": + gen + .elseIf(codegen_1._ `${dataType} == "number" || ${dataType} == "boolean"`) + .assign(coerced, codegen_1._ `"" + ${data}`) + .elseIf(codegen_1._ `${data} === null`) + .assign(coerced, codegen_1._ `""`); + return; + case "number": + gen + .elseIf(codegen_1._ `${dataType} == "boolean" || ${data} === null + || (${dataType} == "string" && ${data} && ${data} == +${data})`) + .assign(coerced, codegen_1._ `+${data}`); + return; + case "integer": + gen + .elseIf(codegen_1._ `${dataType} === "boolean" || ${data} === null + || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`) + .assign(coerced, codegen_1._ `+${data}`); + return; + case "boolean": + gen + .elseIf(codegen_1._ `${data} === "false" || ${data} === 0 || ${data} === null`) + .assign(coerced, false) + .elseIf(codegen_1._ `${data} === "true" || ${data} === 1`) + .assign(coerced, true); + return; + case "null": + gen.elseIf(codegen_1._ `${data} === "" || ${data} === 0 || ${data} === false`); + gen.assign(coerced, null); + return; + case "array": + gen + .elseIf(codegen_1._ `${dataType} === "string" || ${dataType} === "number" + || ${dataType} === "boolean" || ${data} === null`) + .assign(coerced, codegen_1._ `[${data}]`); + } + } +} +function assignParentData({ gen, parentData, parentDataProperty }, expr) { + // TODO use gen.property + gen.if(codegen_1._ `${parentData} !== undefined`, () => gen.assign(codegen_1._ `${parentData}[${parentDataProperty}]`, expr)); +} +function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { + const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; + let cond; + switch (dataType) { + case "null": + return codegen_1._ `${data} ${EQ} null`; + case "array": + cond = codegen_1._ `Array.isArray(${data})`; + break; + case "object": + cond = codegen_1._ `${data} && typeof ${data} == "object" && !Array.isArray(${data})`; + break; + case "integer": + cond = numCond(codegen_1._ `!(${data} % 1) && !isNaN(${data})`); + break; + case "number": + cond = numCond(); + break; + default: + return codegen_1._ `typeof ${data} ${EQ} ${dataType}`; + } + return correct === DataType.Correct ? cond : codegen_1.not(cond); + function numCond(_cond = codegen_1.nil) { + return codegen_1.and(codegen_1._ `typeof ${data} == "number"`, _cond, strictNums ? codegen_1._ `isFinite(${data})` : codegen_1.nil); + } +} +exports.checkDataType = checkDataType; +function checkDataTypes(dataTypes, data, strictNums, correct) { + if (dataTypes.length === 1) { + return checkDataType(dataTypes[0], data, strictNums, correct); + } + let cond; + const types = util_1.toHash(dataTypes); + if (types.array && types.object) { + const notObj = codegen_1._ `typeof ${data} != "object"`; + cond = types.null ? notObj : codegen_1._ `!${data} || ${notObj}`; + delete types.null; + delete types.array; + delete types.object; + } + else { + cond = codegen_1.nil; + } + if (types.number) + delete types.integer; + for (const t in types) + cond = codegen_1.and(cond, checkDataType(t, data, strictNums, correct)); + return cond; +} +exports.checkDataTypes = checkDataTypes; +const typeError = { + message: ({ schema }) => codegen_1.str `should be ${schema}`, + params: ({ schema, schemaValue }) => typeof schema == "string" ? codegen_1._ `{type: ${schema}}` : codegen_1._ `{type: ${schemaValue}}`, +}; +function reportTypeError(it) { + const cxt = getTypeErrorContext(it); + errors_1.reportError(cxt, typeError); +} +exports.reportTypeError = reportTypeError; +function getTypeErrorContext(it) { + const { gen, data, schema } = it; + const schemaCode = util_1.schemaRefOrVal(it, schema, "type"); + return { + gen, + keyword: "type", + data, + schema: schema.type, + schemaCode, + schemaValue: schemaCode, + parentSchema: schema, + params: {}, + it, + }; +} +//# sourceMappingURL=dataType.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js new file mode 100644 index 00000000000000..542e05a494748e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assignDefaults = void 0; +const codegen_1 = require("../codegen"); +const _1 = require("."); +function assignDefaults(it, ty) { + const { properties, items } = it.schema; + if (ty === "object" && properties) { + for (const key in properties) { + assignDefault(it, key, properties[key].default); + } + } + else if (ty === "array" && Array.isArray(items)) { + items.forEach((sch, i) => assignDefault(it, i, sch.default)); + } +} +exports.assignDefaults = assignDefaults; +function assignDefault(it, prop, defaultValue) { + const { gen, compositeRule, data, opts } = it; + if (defaultValue === undefined) + return; + const childData = codegen_1._ `${data}${codegen_1.getProperty(prop)}`; + if (compositeRule) { + _1.checkStrictMode(it, `default is ignored for: ${childData}`); + return; + } + let condition = codegen_1._ `${childData} === undefined`; + if (opts.useDefaults === "empty") { + condition = codegen_1._ `${condition} || ${childData} === null || ${childData} === ""`; + } + // `${childData} === undefined` + + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") + gen.if(condition, codegen_1._ `${childData} = ${codegen_1.stringify(defaultValue)}`); +} +//# sourceMappingURL=defaults.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js new file mode 100644 index 00000000000000..0db360a2cfc3e9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js @@ -0,0 +1,185 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkStrictMode = exports.schemaCxtHasRules = exports.subschemaCode = exports.validateFunctionCode = void 0; +const boolSchema_1 = require("./boolSchema"); +const dataType_1 = require("./dataType"); +const iterate_1 = require("./iterate"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const resolve_1 = require("../resolve"); +const util_1 = require("../util"); +// schema compilation - generates validation function, subschemaCode (below) is used for subschemas +function validateFunctionCode(it) { + if (isSchemaObj(it)) { + checkKeywords(it); + if (schemaCxtHasRules(it)) { + topSchemaObjCode(it); + return; + } + } + validateFunction(it, () => boolSchema_1.topBoolOrEmptySchema(it)); +} +exports.validateFunctionCode = validateFunctionCode; +function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { + if (opts.code.es5) { + gen.func(validateName, codegen_1._ `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { + gen.code(codegen_1._ `"use strict"; ${funcSourceUrl(schema, opts)}`); + destructureValCxtES5(gen, opts); + gen.code(body); + }); + } + else { + gen.func(validateName, codegen_1._ `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); + } +} +function destructureValCxt(opts) { + return codegen_1._ `{${names_1.default.dataPath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? codegen_1._ `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; +} +function destructureValCxtES5(gen, opts) { + gen.if(names_1.default.valCxt, () => { + gen.var(names_1.default.dataPath, codegen_1._ `${names_1.default.valCxt}.${names_1.default.dataPath}`); + gen.var(names_1.default.parentData, codegen_1._ `${names_1.default.valCxt}.${names_1.default.parentData}`); + gen.var(names_1.default.parentDataProperty, codegen_1._ `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); + gen.var(names_1.default.rootData, codegen_1._ `${names_1.default.valCxt}.${names_1.default.rootData}`); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, codegen_1._ `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); + }, () => { + gen.var(names_1.default.dataPath, codegen_1._ `""`); + gen.var(names_1.default.parentData, codegen_1._ `undefined`); + gen.var(names_1.default.parentDataProperty, codegen_1._ `undefined`); + gen.var(names_1.default.rootData, names_1.default.data); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, codegen_1._ `{}`); + }); +} +function topSchemaObjCode(it) { + const { schema, opts, gen } = it; + validateFunction(it, () => { + if (opts.$comment && schema.$comment) + commentKeyword(it); + checkNoDefault(it); + gen.let(names_1.default.vErrors, null); + gen.let(names_1.default.errors, 0); + if (opts.unevaluated) + resetEvaluated(it); + typeAndKeywords(it); + returnResults(it); + }); + return; +} +function resetEvaluated(it) { + // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated + const { gen, validateName } = it; + it.evaluated = gen.const("evaluated", codegen_1._ `${validateName}.evaluated`); + gen.if(codegen_1._ `${it.evaluated}.dynamicProps`, () => gen.assign(codegen_1._ `${it.evaluated}.props`, codegen_1._ `undefined`)); + gen.if(codegen_1._ `${it.evaluated}.dynamicItems`, () => gen.assign(codegen_1._ `${it.evaluated}.items`, codegen_1._ `undefined`)); +} +function funcSourceUrl(schema, opts) { + return typeof schema == "object" && schema.$id && (opts.code.source || opts.code.process) + ? codegen_1._ `/*# sourceURL=${schema.$id} */` + : codegen_1.nil; +} +// schema compilation - this function is used recursively to generate code for sub-schemas +function subschemaCode(it, valid) { + if (isSchemaObj(it)) { + checkKeywords(it); + if (schemaCxtHasRules(it)) { + subSchemaObjCode(it, valid); + return; + } + } + boolSchema_1.boolOrEmptySchema(it, valid); +} +exports.subschemaCode = subschemaCode; +function schemaCxtHasRules({ schema, self }) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (self.RULES.all[key]) + return true; + return false; +} +exports.schemaCxtHasRules = schemaCxtHasRules; +function isSchemaObj(it) { + return typeof it.schema != "boolean"; +} +function subSchemaObjCode(it, valid) { + const { schema, gen, opts } = it; + if (opts.$comment && schema.$comment) + commentKeyword(it); + updateContext(it); + checkAsync(it); + const errsCount = gen.const("_errs", names_1.default.errors); + typeAndKeywords(it, errsCount); + // TODO var + gen.var(valid, codegen_1._ `${errsCount} === ${names_1.default.errors}`); +} +function checkKeywords(it) { + util_1.checkUnknownRules(it); + checkRefsAndKeywords(it); +} +function typeAndKeywords(it, errsCount) { + const types = dataType_1.getSchemaTypes(it.schema); + const checkedTypes = dataType_1.coerceAndCheckDataType(it, types); + iterate_1.schemaKeywords(it, types, !checkedTypes, errsCount); +} +function checkRefsAndKeywords(it) { + const { schema, errSchemaPath, opts, self } = it; + if (schema.$ref && opts.ignoreKeywordsWithRef && util_1.schemaHasRulesButRef(schema, self.RULES)) { + self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); + } +} +function checkNoDefault(it) { + const { schema, opts } = it; + if (schema.default !== undefined && opts.useDefaults && opts.strict) { + checkStrictMode(it, "default is ignored in the schema root"); + } +} +function updateContext(it) { + if (it.schema.$id) + it.baseId = resolve_1.resolveUrl(it.baseId, it.schema.$id); +} +function checkAsync(it) { + if (it.schema.$async && !it.schemaEnv.$async) + throw new Error("async schema in sync schema"); +} +function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { + const msg = schema.$comment; + if (opts.$comment === true) { + gen.code(codegen_1._ `${names_1.default.self}.logger.log(${msg})`); + } + else if (typeof opts.$comment == "function") { + const schemaPath = codegen_1.str `${errSchemaPath}/$comment`; + const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); + gen.code(codegen_1._ `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); + } +} +function returnResults(it) { + const { gen, schemaEnv, validateName, ValidationError, opts } = it; + if (schemaEnv.$async) { + // TODO assign unevaluated + gen.if(codegen_1._ `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw(codegen_1._ `new ${ValidationError}(${names_1.default.vErrors})`)); + } + else { + gen.assign(codegen_1._ `${validateName}.errors`, names_1.default.vErrors); + if (opts.unevaluated) + assignEvaluated(it); + gen.return(codegen_1._ `${names_1.default.errors} === 0`); + } +} +function assignEvaluated({ gen, evaluated, props, items }) { + if (props instanceof codegen_1.Name) + gen.assign(codegen_1._ `${evaluated}.props`, props); + if (items instanceof codegen_1.Name) + gen.assign(codegen_1._ `${evaluated}.items`, items); +} +function checkStrictMode(it, msg, mode = it.opts.strict) { + if (!mode) + return; + msg = `strict mode: ${msg}`; + if (mode === true) + throw new Error(msg); + it.self.logger.warn(msg); +} +exports.checkStrictMode = checkStrictMode; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js new file mode 100644 index 00000000000000..6ffdd11c523edc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/iterate.js @@ -0,0 +1,109 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.schemaKeywords = void 0; +const applicability_1 = require("./applicability"); +const dataType_1 = require("./dataType"); +const defaults_1 = require("./defaults"); +const dataType_2 = require("./dataType"); +const keyword_1 = require("./keyword"); +const util_1 = require("../util"); +const _1 = require("."); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +function schemaKeywords(it, types, typeErrors, errsCount) { + const { gen, schema, data, allErrors, opts, self } = it; + const { RULES } = self; + if (schema.$ref && (opts.ignoreKeywordsWithRef || !util_1.schemaHasRulesButRef(schema, RULES))) { + gen.block(() => keyword_1.keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast + return; + } + checkStrictTypes(it, types); + gen.block(() => { + for (const group of RULES.rules) + groupKeywords(group); + groupKeywords(RULES.post); + }); + function groupKeywords(group) { + if (!applicability_1.shouldUseGroup(schema, group)) + return; + if (group.type) { + gen.if(dataType_1.checkDataType(group.type, data, opts.strict)); + iterateKeywords(it, group); + if (types.length === 1 && types[0] === group.type && typeErrors) { + gen.else(); + dataType_2.reportTypeError(it); + } + gen.endIf(); + } + else { + iterateKeywords(it, group); + } + // TODO make it "ok" call? + if (!allErrors) + gen.if(codegen_1._ `${names_1.default.errors} === ${errsCount || 0}`); + } +} +exports.schemaKeywords = schemaKeywords; +function iterateKeywords(it, group) { + const { gen, schema, opts: { useDefaults }, } = it; + if (useDefaults) + defaults_1.assignDefaults(it, group.type); + gen.block(() => { + for (const rule of group.rules) { + if (applicability_1.shouldUseRule(schema, rule)) { + keyword_1.keywordCode(it, rule.keyword, rule.definition, group.type); + } + } + }); +} +function checkStrictTypes(it, types) { + if (it.schemaEnv.meta || !it.opts.strictTypes) + return; + checkContextTypes(it, types); + if (!it.opts.allowUnionTypes) + checkMultipleTypes(it, types); + checkKeywordTypes(it, it.dataTypes); +} +function checkContextTypes(it, types) { + if (!types.length) + return; + if (!it.dataTypes.length) { + it.dataTypes = types; + return; + } + types.forEach((t) => { + if (!includesType(it.dataTypes, t)) { + strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); + } + }); + it.dataTypes = it.dataTypes.filter((t) => includesType(types, t)); +} +function checkMultipleTypes(it, ts) { + if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { + strictTypesError(it, "use allowUnionTypes to allow union type keyword"); + } +} +function checkKeywordTypes(it, ts) { + const rules = it.self.RULES.all; + for (const keyword in rules) { + const rule = rules[keyword]; + if (typeof rule == "object" && applicability_1.shouldUseRule(it.schema, rule)) { + const { type } = rule.definition; + if (type.length && !type.some((t) => hasApplicableType(ts, t))) { + strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); + } + } + } +} +function hasApplicableType(schTs, kwdT) { + return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")); +} +function includesType(ts, t) { + return ts.includes(t) || (t === "integer" && ts.includes("number")); +} +function strictTypesError(it, msg) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; + msg += ` at "${schemaPath}" (strictTypes)`; + _1.checkStrictMode(it, msg, it.opts.strictTypes); +} +//# sourceMappingURL=iterate.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js new file mode 100644 index 00000000000000..2d67b195aaaa7d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js @@ -0,0 +1,107 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.keywordCode = void 0; +const context_1 = require("../context"); +const errors_1 = require("../errors"); +const code_1 = require("../../vocabularies/code"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +function keywordCode(it, keyword, def, ruleType) { + const cxt = new context_1.default(it, def, keyword); + if ("code" in def) { + def.code(cxt, ruleType); + } + else if (cxt.$data && def.validate) { + funcKeywordCode(cxt, def); + } + else if ("macro" in def) { + macroKeywordCode(cxt, def); + } + else if (def.compile || def.validate) { + funcKeywordCode(cxt, def); + } +} +exports.keywordCode = keywordCode; +function macroKeywordCode(cxt, def) { + const { gen, keyword, schema, parentSchema, it } = cxt; + const macroSchema = def.macro.call(it.self, schema, parentSchema, it); + const schemaRef = useKeyword(gen, keyword, macroSchema); + if (it.opts.validateSchema !== false) + it.self.validateSchema(macroSchema, true); + const valid = gen.name("valid"); + cxt.subschema({ + schema: macroSchema, + schemaPath: codegen_1.nil, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true, + }, valid); + cxt.pass(valid, () => cxt.error(true)); +} +function funcKeywordCode(cxt, def) { + var _a; + const { gen, keyword, schema, parentSchema, $data, it } = cxt; + checkAsync(it, def); + const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; + const validateRef = useKeyword(gen, keyword, validate); + const valid = gen.let("valid"); + cxt.block$data(valid, validateKeyword); + cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); + function validateKeyword() { + if (def.errors === false) { + assignValid(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => cxt.error()); + } + else { + const ruleErrs = def.async ? validateAsync() : validateSync(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => addErrs(cxt, ruleErrs)); + } + } + function validateAsync() { + const ruleErrs = gen.let("ruleErrs", null); + gen.try(() => assignValid(codegen_1._ `await `), (e) => gen.assign(valid, false).if(codegen_1._ `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, codegen_1._ `${e}.errors`), () => gen.throw(e))); + return ruleErrs; + } + function validateSync() { + const validateErrs = codegen_1._ `${validateRef}.errors`; + gen.assign(validateErrs, null); + assignValid(codegen_1.nil); + return validateErrs; + } + function assignValid(_await = def.async ? codegen_1._ `await ` : codegen_1.nil) { + const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; + const passSchema = !(("compile" in def && !$data) || def.schema === false); + gen.assign(valid, codegen_1._ `${_await}${code_1.callValidateCode(cxt, validateRef, passCxt, passSchema)}`, def.modifying); + } + function reportErrs(errors) { + var _a; + gen.if(codegen_1.not((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); + } +} +function modifyData(cxt) { + const { gen, data, it } = cxt; + gen.if(it.parentData, () => gen.assign(data, codegen_1._ `${it.parentData}[${it.parentDataProperty}]`)); +} +function addErrs(cxt, errs) { + const { gen } = cxt; + gen.if(codegen_1._ `Array.isArray(${errs})`, () => { + gen + .assign(names_1.default.vErrors, codegen_1._ `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`) + .assign(names_1.default.errors, codegen_1._ `${names_1.default.vErrors}.length`); + errors_1.extendErrors(cxt); + }, () => cxt.error()); +} +function checkAsync({ schemaEnv }, def) { + if (def.async && !schemaEnv.$async) + throw new Error("async keyword in sync schema"); +} +function useKeyword(gen, keyword, result) { + if (result === undefined) + throw new Error(`keyword "${keyword}" failed to compile`); + return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: codegen_1.stringify(result) }); +} +//# sourceMappingURL=keyword.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js new file mode 100644 index 00000000000000..23aae7ea64e951 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js @@ -0,0 +1,586 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const context_1 = require("./compile/context"); +exports.KeywordCxt = context_1.default; +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +const error_classes_1 = require("./compile/error_classes"); +const rules_1 = require("./compile/rules"); +const compile_1 = require("./compile"); +const codegen_2 = require("./compile/codegen"); +const resolve_1 = require("./compile/resolve"); +const dataType_1 = require("./compile/validate/dataType"); +const util_1 = require("./compile/util"); +const $dataRefSchema = require("./refs/data.json"); +const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; +const EXT_SCOPE_NAMES = new Set([ + "validate", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error", +]); +const removedOptions = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + schemaId: "JSON Schema draft-04 is not supported in Ajv v7.", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + strictNumbers: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", +}; +const deprecatedOptions = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.', +}; +function requiredOptions(o) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const strict = (_a = o.strict) !== null && _a !== void 0 ? _a : true; + const strictLog = strict ? "log" : false; + const _optz = (_b = o.code) === null || _b === void 0 ? void 0 : _b.optimize; + const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; + return { + strict, + strictTypes: (_c = o.strictTypes) !== null && _c !== void 0 ? _c : strictLog, + strictTuples: (_d = o.strictTuples) !== null && _d !== void 0 ? _d : strictLog, + code: o.code ? { ...o.code, optimize } : { optimize }, + loopRequired: (_e = o.loopRequired) !== null && _e !== void 0 ? _e : Infinity, + loopEnum: (_f = o.loopEnum) !== null && _f !== void 0 ? _f : Infinity, + meta: (_g = o.meta) !== null && _g !== void 0 ? _g : true, + messages: (_h = o.messages) !== null && _h !== void 0 ? _h : true, + inlineRefs: (_j = o.inlineRefs) !== null && _j !== void 0 ? _j : true, + addUsedSchema: (_k = o.addUsedSchema) !== null && _k !== void 0 ? _k : true, + validateSchema: (_l = o.validateSchema) !== null && _l !== void 0 ? _l : true, + validateFormats: (_m = o.validateFormats) !== null && _m !== void 0 ? _m : true, + }; +} +class Ajv { + constructor(opts = {}) { + this.schemas = {}; + this.refs = {}; + this.formats = {}; + this._compilations = new Set(); + this._loading = {}; + this._cache = new Map(); + opts = this.opts = { ...opts, ...requiredOptions(opts) }; + const { es5, lines } = this.opts.code; + this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); + this.logger = getLogger(opts.logger); + const formatOpt = opts.validateFormats; + opts.validateFormats = false; + this.RULES = rules_1.getRules(); + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); + this._metaOpts = getMetaSchemaOptions.call(this); + if (opts.formats) + addInitialFormats.call(this); + this._addVocabularies(); + this._addDefaultMetaSchema(); + if (opts.keywords) + addInitialKeywords.call(this, opts.keywords); + if (typeof opts.meta == "object") + this.addMetaSchema(opts.meta); + addInitialSchemas.call(this); + opts.validateFormats = formatOpt; + } + _addVocabularies() { + this.addKeyword("$async"); + } + _addDefaultMetaSchema() { + const { $data, meta } = this.opts; + if (meta && $data) + this.addMetaSchema($dataRefSchema, $dataRefSchema.$id, false); + } + defaultMeta() { + const { meta } = this.opts; + return (this.opts.defaultMeta = typeof meta == "object" ? meta.$id || meta : undefined); + } + validate(schemaKeyRef, // key, ref or schema object + data // to be validated + ) { + let v; + if (typeof schemaKeyRef == "string") { + v = this.getSchema(schemaKeyRef); + if (!v) + throw new Error(`no schema with key or ref "${schemaKeyRef}"`); + } + else { + v = this.compile(schemaKeyRef); + } + const valid = v(data); + if (!("$async" in v)) + this.errors = v.errors; + return valid; + } + compile(schema, _meta) { + const sch = this._addSchema(schema, _meta); + return (sch.validate || this._compileSchemaEnv(sch)); + } + compileAsync(schema, meta) { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function"); + } + const { loadSchema } = this.opts; + return runCompileAsync.call(this, schema, meta); + async function runCompileAsync(_schema, _meta) { + await loadMetaSchema.call(this, _schema.$schema); + const sch = this._addSchema(_schema, _meta); + return sch.validate || _compileAsync.call(this, sch); + } + async function loadMetaSchema($ref) { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, { $ref }, true); + } + } + async function _compileAsync(sch) { + try { + return this._compileSchemaEnv(sch); + } + catch (e) { + if (!(e instanceof error_classes_1.MissingRefError)) + throw e; + checkLoaded.call(this, e); + await loadMissingSchema.call(this, e.missingSchema); + return _compileAsync.call(this, sch); + } + } + function checkLoaded({ missingSchema: ref, missingRef }) { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); + } + } + async function loadMissingSchema(ref) { + const _schema = await _loadSchema.call(this, ref); + if (!this.refs[ref]) + await loadMetaSchema.call(this, _schema.$schema); + if (!this.refs[ref]) + this.addSchema(_schema, ref, meta); + } + async function _loadSchema(ref) { + const p = this._loading[ref]; + if (p) + return p; + try { + return await (this._loading[ref] = loadSchema(ref)); + } + finally { + delete this._loading[ref]; + } + } + } + // Adds schema to the instance + addSchema(schema, // If array is passed, `key` will be ignored + key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. + ) { + if (Array.isArray(schema)) { + for (const sch of schema) + this.addSchema(sch, undefined, _meta, _validateSchema); + return this; + } + let id; + if (typeof schema === "object") { + id = schema.$id; + if (id !== undefined && typeof id != "string") + throw new Error("schema id must be string"); + } + key = resolve_1.normalizeId(key || id); + this._checkUnique(key); + this.schemas[key] = this._addSchema(schema, _meta, _validateSchema, true); + return this; + } + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema(schema, key, // schema key + _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema + ) { + this.addSchema(schema, key, true, _validateSchema); + return this; + } + // Validate schema against its meta-schema + validateSchema(schema, throwOrLogError) { + if (typeof schema == "boolean") + return true; + let $schema; + $schema = schema.$schema; + if ($schema !== undefined && typeof $schema != "string") { + throw new Error("$schema must be a string"); + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); + if (!$schema) { + this.logger.warn("meta-schema not available"); + this.errors = null; + return true; + } + const valid = this.validate($schema, schema); + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText(); + if (this.opts.validateSchema === "log") + this.logger.error(message); + else + throw new Error(message); + } + return valid; + } + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef) { + let sch; + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") + keyRef = sch; + if (sch === undefined) { + const root = new compile_1.SchemaEnv({ schema: {} }); + sch = compile_1.resolveSchema.call(this, root, keyRef); + if (!sch) + return; + this.refs[keyRef] = sch; + } + return (sch.validate || this._compileSchemaEnv(sch)); + } + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef) { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef); + this._removeAllSchemas(this.refs, schemaKeyRef); + return this; + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas); + this._removeAllSchemas(this.refs); + this._cache.clear(); + return this; + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef); + if (typeof sch == "object") + this._cache.delete(sch.schema); + delete this.schemas[schemaKeyRef]; + delete this.refs[schemaKeyRef]; + return this; + } + case "object": { + const cacheKey = schemaKeyRef; + this._cache.delete(cacheKey); + let id = schemaKeyRef.$id; + if (id) { + id = resolve_1.normalizeId(id); + delete this.schemas[id]; + delete this.refs[id]; + } + return this; + } + default: + throw new Error("ajv.removeSchema: invalid parameter"); + } + } + // add "vocabulary" - a collection of keywords + addVocabulary(definitions) { + for (const def of definitions) + this.addKeyword(def); + return this; + } + addKeyword(kwdOrDef, def // deprecated + ) { + let keyword; + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef; + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword"); + def.keyword = keyword; + } + } + else if (typeof kwdOrDef == "object" && def === undefined) { + def = kwdOrDef; + keyword = def.keyword; + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array"); + } + } + else { + throw new Error("invalid addKeywords parameters"); + } + checkKeyword.call(this, keyword, def); + if (!def) { + util_1.eachItem(keyword, (kwd) => addRule.call(this, kwd)); + return this; + } + keywordMetaschema.call(this, def); + const definition = { + ...def, + type: dataType_1.getJSONTypes(def.type), + schemaType: dataType_1.getJSONTypes(def.schemaType), + }; + util_1.eachItem(keyword, definition.type.length === 0 + ? (k) => addRule.call(this, k, definition) + : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); + return this; + } + getKeyword(keyword) { + const rule = this.RULES.all[keyword]; + return typeof rule == "object" ? rule.definition : !!rule; + } + // Remove keyword + removeKeyword(keyword) { + // TODO return type should be Ajv + const { RULES } = this; + delete RULES.keywords[keyword]; + delete RULES.all[keyword]; + for (const group of RULES.rules) { + const i = group.rules.findIndex((rule) => rule.keyword === keyword); + if (i >= 0) + group.rules.splice(i, 1); + } + return this; + } + // Add format + addFormat(name, format) { + if (typeof format == "string") + format = new RegExp(format); + this.formats[name] = format; + return this; + } + errorsText(errors = this.errors, // optional array of validation errors + { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` + ) { + if (!errors || errors.length === 0) + return "No errors"; + return errors + .map((e) => `${dataVar}${e.dataPath} ${e.message}`) + .reduce((text, msg) => text + separator + msg); + } + $dataMetaSchema(metaSchema, keywordsJsonPointers) { + const rules = this.RULES.all; + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1); // first segment is an empty string + let keywords = metaSchema; + for (const seg of segments) + keywords = keywords[seg]; + for (const key in rules) { + const rule = rules[key]; + if (typeof rule != "object") + continue; + const { $data } = rule.definition; + const schema = keywords[key]; + if ($data && schema) + keywords[key] = schemaOrData(schema); + } + } + return metaSchema; + } + _removeAllSchemas(schemas, regex) { + for (const keyRef in schemas) { + const sch = schemas[keyRef]; + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas[keyRef]; + } + else if (sch && !sch.meta) { + this._cache.delete(sch.schema); + delete schemas[keyRef]; + } + } + } + } + _addSchema(schema, meta, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { + if (typeof schema != "object" && typeof schema != "boolean") { + throw new Error("schema must be object or boolean"); + } + let sch = this._cache.get(schema); + if (sch !== undefined) + return sch; + const localRefs = resolve_1.getSchemaRefs.call(this, schema); + sch = new compile_1.SchemaEnv({ schema, meta, localRefs }); + this._cache.set(sch.schema, sch); + const id = sch.baseId; + if (addSchema && !id.startsWith("#")) { + // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) + if (id) + this._checkUnique(id); + this.refs[id] = sch; + } + if (validateSchema) + this.validateSchema(schema, true); + return sch; + } + _checkUnique(id) { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`); + } + } + _compileSchemaEnv(sch) { + if (sch.meta) + this._compileMetaSchema(sch); + else + compile_1.compileSchema.call(this, sch); + /* istanbul ignore if */ + if (!sch.validate) + throw new Error("ajv implementation error"); + return sch.validate; + } + _compileMetaSchema(sch) { + const currentOpts = this.opts; + this.opts = this._metaOpts; + try { + compile_1.compileSchema.call(this, sch); + } + finally { + this.opts = currentOpts; + } + } +} +exports.default = Ajv; +Ajv.ValidationError = error_classes_1.ValidationError; +Ajv.MissingRefError = error_classes_1.MissingRefError; +function checkOptions(checkOpts, options, msg, log = "error") { + for (const key in checkOpts) { + const opt = key; + if (opt in options) + this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); + } +} +function getSchEnv(keyRef) { + keyRef = resolve_1.normalizeId(keyRef); // TODO tests fail without this line + return this.schemas[keyRef] || this.refs[keyRef]; +} +function addInitialSchemas() { + const optsSchemas = this.opts.schemas; + if (!optsSchemas) + return; + if (Array.isArray(optsSchemas)) + this.addSchema(optsSchemas); + else + for (const key in optsSchemas) + this.addSchema(optsSchemas[key], key); +} +function addInitialFormats() { + for (const name in this.opts.formats) { + const format = this.opts.formats[name]; + if (format) + this.addFormat(name, format); + } +} +function addInitialKeywords(defs) { + if (Array.isArray(defs)) { + this.addVocabulary(defs); + return; + } + this.logger.warn("keywords option as map is deprecated, pass array"); + for (const keyword in defs) { + const def = defs[keyword]; + if (!def.keyword) + def.keyword = keyword; + this.addKeyword(def); + } +} +function getMetaSchemaOptions() { + const metaOpts = { ...this.opts }; + for (const opt of META_IGNORE_OPTIONS) + delete metaOpts[opt]; + return metaOpts; +} +const noLogs = { log() { }, warn() { }, error() { } }; +function getLogger(logger) { + if (logger === false) + return noLogs; + if (logger === undefined) + return console; + if (logger.log && logger.warn && logger.error) + return logger; + throw new Error("logger must implement log, warn and error methods"); +} +const KEYWORD_NAME = /^[a-z_$][a-z0-9_$-]*$/i; +function checkKeyword(keyword, def) { + const { RULES } = this; + util_1.eachItem(keyword, (kwd) => { + if (RULES.keywords[kwd]) + throw new Error(`Keyword ${kwd} is already defined`); + if (!KEYWORD_NAME.test(kwd)) + throw new Error(`Keyword ${kwd} has invalid name`); + }); + if (!def) + return; + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function'); + } +} +function addRule(keyword, definition, dataType) { + var _a; + const post = definition === null || definition === void 0 ? void 0 : definition.post; + if (dataType && post) + throw new Error('keyword with "post" flag cannot have "type"'); + const { RULES } = this; + let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); + if (!ruleGroup) { + ruleGroup = { type: dataType, rules: [] }; + RULES.rules.push(ruleGroup); + } + RULES.keywords[keyword] = true; + if (!definition) + return; + const rule = { + keyword, + definition: { + ...definition, + type: dataType_1.getJSONTypes(definition.type), + schemaType: dataType_1.getJSONTypes(definition.schemaType), + }, + }; + if (definition.before) + addBeforeRule.call(this, ruleGroup, rule, definition.before); + else + ruleGroup.rules.push(rule); + RULES.all[keyword] = rule; + (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); +} +function addBeforeRule(ruleGroup, rule, before) { + const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); + if (i >= 0) { + ruleGroup.rules.splice(i, 0, rule); + } + else { + ruleGroup.rules.push(rule); + this.logger.warn(`rule ${before} is not defined`); + } +} +function keywordMetaschema(def) { + let { metaSchema } = def; + if (metaSchema === undefined) + return; + if (def.$data && this.opts.$data) + metaSchema = schemaOrData(metaSchema); + def.validateSchema = this.compile(metaSchema, true); +} +const $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", +}; +function schemaOrData(schema) { + return { anyOf: [schema, $dataRef] }; +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/data.json new file mode 100644 index 00000000000000..9ffc9f5ce05484 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js new file mode 100644 index 00000000000000..14775366ed69fa --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const metaSchema = require("./schema.json"); +const metaApplicator = require("./meta/applicator.json"); +const metaContent = require("./meta/content.json"); +const metaCore = require("./meta/core.json"); +const metaFormat = require("./meta/format.json"); +const metaMetadata = require("./meta/meta-data.json"); +const metaValidation = require("./meta/validation.json"); +const META_SUPPORT_DATA = ["/properties"]; +function addMetaSchema2019($data) { + ; + [ + metaSchema, + metaApplicator, + metaContent, + metaCore, + with$data(this, metaFormat), + metaMetadata, + with$data(this, metaValidation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); + return this; + function with$data(ajv, sch) { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } +} +exports.default = addMetaSchema2019; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 00000000000000..c5e91cf2ac8469 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 00000000000000..b8f63734343046 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 00000000000000..f71adbff04fe9e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 00000000000000..03ccfce26efeaf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 00000000000000..0e194326fa133b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 00000000000000..7027a1279a014a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json new file mode 100644 index 00000000000000..54eb7157afed69 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json new file mode 100644 index 00000000000000..5410064ba8df93 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": {} +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json new file mode 100644 index 00000000000000..6a74851043623c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json new file mode 100644 index 00000000000000..3968abd5d97e7b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js new file mode 100644 index 00000000000000..c49bde936bcb33 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_1 = require("../compile/codegen/scope"); +const code_1 = require("../compile/codegen/code"); +function standaloneCode(ajv, refsOrFunc) { + if (!ajv.opts.code.source) { + throw new Error("moduleCode: ajv instance must have code.source option"); + } + const { _n } = ajv.scope.opts; + return typeof refsOrFunc == "function" + ? funcExportCode(refsOrFunc.source) + : refsOrFunc !== undefined + ? multiExportsCode(refsOrFunc, getValidate) + : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema)); + function getValidate(id) { + const v = ajv.getSchema(id); + if (!v) + throw new Error(`moduleCode: no schema with id ${id}`); + return v; + } + function funcExportCode(source) { + const usedValues = {}; + const n = source === null || source === void 0 ? void 0 : source.validateName; + const vCode = validateCode(usedValues, source); + return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; + } + function multiExportsCode(schemas, getValidateFunc) { + var _a; + const usedValues = {}; + let code = code_1._ `"use strict";`; + for (const name in schemas) { + const v = getValidateFunc(schemas[name]); + if (v) { + const vCode = validateCode(usedValues, v.source); + code = code_1._ `${code}${_n}exports${code_1.getProperty(name)} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`; + } + } + return `${code}`; + } + function validateCode(usedValues, s) { + if (!s) + throw new Error('moduleCode: function does not have "source" property'); + const { prefix } = s.validateName; + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Set()); + nameSet.add(s.validateName); + const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); + const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); + return s.evaluated ? code_1._ `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; + function refValidateCode(n) { + var _a; + const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref; + if (n.prefix === "validate" && typeof vRef == "function") { + const v = vRef; + return validateCode(usedValues, v.source); + } + else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { + const { validate, validateName } = vRef; + const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); + const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; + return code_1._ `${def} ${n} = {validate: ${validateName}};${_n}${vCode}`; + } + return undefined; + } + } +} +exports.default = standaloneCode; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js new file mode 100644 index 00000000000000..aa43ac5617e992 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("../core"); +const _1 = require("."); +const requireFromString = require("require-from-string"); +class AjvPack { + constructor(ajv) { + this.ajv = ajv; + } + validate(schemaKeyRef, data) { + return core_1.default.prototype.validate.call(this, schemaKeyRef, data); + } + compile(schema, meta) { + return this.getStandalone(this.ajv.compile(schema, meta)); + } + getSchema(keyRef) { + const v = this.ajv.getSchema(keyRef); + if (!v) + return undefined; + return this.getStandalone(v); + } + getStandalone(v) { + return requireFromString(_1.default(this.ajv, v)); + } + addSchema(...args) { + this.ajv.addSchema.call(this.ajv, ...args); + return this; + } + addKeyword(...args) { + this.ajv.addKeyword.call(this.ajv, ...args); + return this; + } +} +exports.default = AjvPack; +//# sourceMappingURL=instance.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/index.js new file mode 100644 index 00000000000000..aa219d8f2aa44d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/json-schema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/json-schema.js new file mode 100644 index 00000000000000..2d8f98dc534255 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/json-schema.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=json-schema.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js new file mode 100644 index 00000000000000..76f8aab9f5ce13 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const subschema_1 = require("../../compile/subschema"); +const util_1 = require("../../compile/util"); +const validate_1 = require("../../compile/validate"); +const error = { + message: ({ params: { len } }) => codegen_1.str `should NOT have more than ${len} items`, + params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`, +}; +const def = { + keyword: "additionalItems", + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error, + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + const { items } = parentSchema; + if (!Array.isArray(items)) { + validate_1.checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas'); + return; + } + it.items = true; + const len = gen.const("len", codegen_1._ `${data}.length`); + if (schema === false) { + cxt.setParams({ len: items.length }); + cxt.pass(codegen_1._ `${len} <= ${items.length}`); + } + else if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", codegen_1._ `${len} <= ${items.length}`); // TODO var + gen.if(codegen_1.not(valid), () => validateItems(valid)); + cxt.ok(valid); + } + function validateItems(valid) { + gen.forRange("i", items.length, len, (i) => { + cxt.subschema({ keyword: "additionalItems", dataProp: i, dataPropType: subschema_1.Type.Num }, valid); + if (!it.allErrors) + gen.if(codegen_1.not(valid), () => gen.break()); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=additionalItems.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js new file mode 100644 index 00000000000000..226c2a7a13ba49 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const subschema_1 = require("../../compile/subschema"); +const util_1 = require("../../compile/util"); +const error = { + message: "should NOT have additional properties", + params: ({ params }) => codegen_1._ `{additionalProperty: ${params.additionalProperty}}`, +}; +const def = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, data, errsCount, it } = cxt; + /* istanbul ignore if */ + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, opts } = it; + it.props = true; + if (opts.removeAdditional !== "all" && util_1.alwaysValidSchema(it, schema)) + return; + const props = code_1.allSchemaProperties(parentSchema.properties); + const patProps = code_1.allSchemaProperties(parentSchema.patternProperties); + checkAdditionalProperties(); + cxt.ok(codegen_1._ `${errsCount} === ${names_1.default.errors}`); + function checkAdditionalProperties() { + gen.forIn("key", data, (key) => { + if (!props.length && !patProps.length) + additionalPropertyCode(key); + else + gen.if(isAdditional(key), () => additionalPropertyCode(key)); + }); + } + function isAdditional(key) { + let definedProp; + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = util_1.schemaRefOrVal(it, parentSchema.properties, "properties"); + definedProp = codegen_1._ `${propsSchema}.hasOwnProperty(${key})`; + } + else if (props.length) { + definedProp = codegen_1.or(...props.map((p) => codegen_1._ `${key} === ${p}`)); + } + else { + definedProp = codegen_1.nil; + } + if (patProps.length) { + definedProp = codegen_1.or(definedProp, ...patProps.map((p) => codegen_1._ `${code_1.usePattern(gen, p)}.test(${key})`)); + } + return codegen_1._ `!(${definedProp})`; + } + function deleteAdditional(key) { + gen.code(codegen_1._ `delete ${data}[${key}]`); + } + function additionalPropertyCode(key) { + if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { + deleteAdditional(key); + return; + } + if (schema === false) { + cxt.setParams({ additionalProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) { + const valid = gen.name("valid"); + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false); + gen.if(codegen_1.not(valid), () => { + cxt.reset(); + deleteAdditional(key); + }); + } + else { + applyAdditionalSchema(key, valid); + if (!allErrors) + gen.if(codegen_1.not(valid), () => gen.break()); + } + } + } + function applyAdditionalSchema(key, valid, errors) { + const subschema = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: subschema_1.Type.Str, + strictSchema: it.strictSchema, + }; + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false, + }); + } + cxt.subschema(subschema, valid); + } + }, +}; +exports.default = def; +//# sourceMappingURL=additionalProperties.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js new file mode 100644 index 00000000000000..acda3d16b4109a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: "allOf", + schemaType: "array", + code(cxt) { + const { gen, schema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const valid = gen.name("valid"); + schema.forEach((sch, i) => { + if (util_1.alwaysValidSchema(it, sch)) + return; + const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); + cxt.ok(valid); + cxt.mergeEvaluated(schCxt); + }); + }, +}; +exports.default = def; +//# sourceMappingURL=allOf.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js new file mode 100644 index 00000000000000..e209708a548e39 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code(cxt) { + const { gen, schema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const alwaysValid = schema.some((sch) => util_1.alwaysValidSchema(it, sch)); + if (alwaysValid && !it.opts.unevaluated) + return; + const valid = gen.let("valid", false); + const schValid = gen.name("_valid"); + gen.block(() => schema.forEach((_sch, i) => { + const schCxt = cxt.subschema({ + keyword: "anyOf", + schemaProp: i, + compositeRule: true, + }, schValid); + gen.assign(valid, codegen_1._ `${valid} || ${schValid}`); + const merged = cxt.mergeValidEvaluated(schCxt, schValid); + // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) + // or if all properties and items were evaluated (it.props === true && it.items === true) + if (!merged) + gen.if(codegen_1.not(valid)); + })); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); + }, + error: { + message: "should match some schema in anyOf", + }, +}; +exports.default = def; +//# sourceMappingURL=anyOf.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js new file mode 100644 index 00000000000000..cece62b848fe40 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js @@ -0,0 +1,89 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const subschema_1 = require("../../compile/subschema"); +const util_1 = require("../../compile/util"); +const validate_1 = require("../../compile/validate"); +const error = { + message: ({ params: { min, max } }) => max === undefined + ? codegen_1.str `should contain at least ${min} valid item(s)` + : codegen_1.str `should contain at least ${min} and no more than ${max} valid item(s)`, + params: ({ params: { min, max } }) => max === undefined ? codegen_1._ `{minContains: ${min}}` : codegen_1._ `{minContains: ${min}, maxContains: ${max}}`, +}; +const def = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + let min; + let max; + const { minContains, maxContains } = parentSchema; + if (it.opts.next) { + min = minContains === undefined ? 1 : minContains; + max = maxContains; + } + else { + min = 1; + } + const len = gen.const("len", codegen_1._ `${data}.length`); + cxt.setParams({ min, max }); + if (max === undefined && min === 0) { + validate_1.checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); + return; + } + if (max !== undefined && min > max) { + validate_1.checkStrictMode(it, `"minContains" > "maxContains" is always invalid`); + cxt.fail(); + return; + } + if (util_1.alwaysValidSchema(it, schema)) { + let cond = codegen_1._ `${len} >= ${min}`; + if (max !== undefined) + cond = codegen_1._ `${cond} && ${len} <= ${max}`; + cxt.pass(cond); + return; + } + it.items = true; + const valid = gen.name("valid"); + if (max === undefined && min === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())); + } + else { + gen.let(valid, false); + const schValid = gen.name("_valid"); + const count = gen.let("count", 0); + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); + } + cxt.result(valid, () => cxt.reset()); + function validateItems(_valid, block) { + gen.forRange("i", 0, len, (i) => { + cxt.subschema({ + keyword: "contains", + dataProp: i, + dataPropType: subschema_1.Type.Num, + compositeRule: true, + }, _valid); + block(); + }); + } + function checkLimits(count) { + gen.code(codegen_1._ `${count}++`); + if (max === undefined) { + gen.if(codegen_1._ `${count} >= ${min}`, () => gen.assign(valid, true).break()); + } + else { + gen.if(codegen_1._ `${count} > ${max}`, () => gen.assign(valid, false).break()); + if (min === 1) + gen.assign(valid, true); + else + gen.if(codegen_1._ `${count} >= ${min}`, () => gen.assign(valid, true)); + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=contains.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js new file mode 100644 index 00000000000000..9ec12ab16cf4d9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +exports.error = { + message: ({ params: { property, depsCount, deps } }) => { + const property_ies = depsCount === 1 ? "property" : "properties"; + return codegen_1.str `should have ${property_ies} ${deps} when property ${property} is present`; + }, + params: ({ params: { property, depsCount, deps, missingProperty } }) => codegen_1._ `{property: ${property}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}`, +}; +const def = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error: exports.error, + code(cxt) { + const [propDeps, schDeps] = splitDependencies(cxt); + validatePropertyDeps(cxt, propDeps); + validateSchemaDeps(cxt, schDeps); + }, +}; +function splitDependencies({ schema }) { + const propertyDeps = {}; + const schemaDeps = {}; + for (const key in schema) { + if (key === "__proto__") + continue; + const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; + deps[key] = schema[key]; + } + return [propertyDeps, schemaDeps]; +} +function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { + const { gen, data, it } = cxt; + if (Object.keys(propertyDeps).length === 0) + return; + const missing = gen.let("missing"); + for (const prop in propertyDeps) { + const deps = propertyDeps[prop]; + if (deps.length === 0) + continue; + const hasProperty = code_1.propertyInData(data, prop, it.opts.ownProperties); + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", "), + }); + if (it.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + code_1.checkReportMissingProp(cxt, depProp); + } + }); + } + else { + gen.if(codegen_1._ `${hasProperty} && (${code_1.checkMissingProp(cxt, deps, missing)})`); + code_1.reportMissingProp(cxt, missing); + gen.else(); + } + } +} +exports.validatePropertyDeps = validatePropertyDeps; +function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { + const { gen, data, keyword, it } = cxt; + const valid = gen.name("valid"); + for (const prop in schemaDeps) { + if (util_1.alwaysValidSchema(it, schemaDeps[prop])) + continue; + gen.if(code_1.propertyInData(data, prop, it.opts.ownProperties), () => { + const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); + cxt.mergeValidEvaluated(schCxt, valid); + }, () => gen.var(valid, true) // TODO var + ); + cxt.ok(valid); + } +} +exports.validateSchemaDeps = validateSchemaDeps; +exports.default = def; +//# sourceMappingURL=dependencies.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js new file mode 100644 index 00000000000000..5801980ae6ed1b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependencies_1 = require("./dependencies"); +const def = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => dependencies_1.validateSchemaDeps(cxt), +}; +exports.default = def; +//# sourceMappingURL=dependentSchemas.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js new file mode 100644 index 00000000000000..79bfee85984373 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const validate_1 = require("../../compile/validate"); +const error = { + message: ({ params }) => codegen_1.str `should match "${params.ifClause}" schema`, + params: ({ params }) => codegen_1._ `{failingKeyword: ${params.ifClause}}`, +}; +const def = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error, + code(cxt) { + const { gen, parentSchema, it } = cxt; + if (parentSchema.then === undefined && parentSchema.else === undefined) { + validate_1.checkStrictMode(it, '"if" without "then" and "else" is ignored'); + } + const hasThen = hasSchema(it, "then"); + const hasElse = hasSchema(it, "else"); + if (!hasThen && !hasElse) + return; + const valid = gen.let("valid", true); + const schValid = gen.name("_valid"); + validateIf(); + cxt.reset(); + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause"); + cxt.setParams({ ifClause }); + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); + } + else if (hasThen) { + gen.if(schValid, validateClause("then")); + } + else { + gen.if(codegen_1.not(schValid), validateClause("else")); + } + cxt.pass(valid, () => cxt.error(true)); + function validateIf() { + const schCxt = cxt.subschema({ + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false, + }, schValid); + cxt.mergeEvaluated(schCxt); + } + function validateClause(keyword, ifClause) { + return () => { + const schCxt = cxt.subschema({ keyword }, schValid); + gen.assign(valid, schValid); + cxt.mergeValidEvaluated(schCxt, valid); + if (ifClause) + gen.assign(ifClause, codegen_1._ `${keyword}`); + else + cxt.setParams({ ifClause: keyword }); + }; + } + }, +}; +function hasSchema(it, keyword) { + const schema = it.schema[keyword]; + return schema !== undefined && !util_1.alwaysValidSchema(it, schema); +} +exports.default = def; +//# sourceMappingURL=if.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js new file mode 100644 index 00000000000000..a4fa1704022aa3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const additionalItems_1 = require("./additionalItems"); +const items_1 = require("./items"); +const contains_1 = require("./contains"); +const dependencies_1 = require("./dependencies"); +const propertyNames_1 = require("./propertyNames"); +const additionalProperties_1 = require("./additionalProperties"); +const properties_1 = require("./properties"); +const patternProperties_1 = require("./patternProperties"); +const not_1 = require("./not"); +const anyOf_1 = require("./anyOf"); +const oneOf_1 = require("./oneOf"); +const allOf_1 = require("./allOf"); +const if_1 = require("./if"); +const thenElse_1 = require("./thenElse"); +const applicator = [ + // any + not_1.default, + anyOf_1.default, + oneOf_1.default, + allOf_1.default, + if_1.default, + thenElse_1.default, + // array + additionalItems_1.default, + items_1.default, + contains_1.default, + // object + propertyNames_1.default, + additionalProperties_1.default, + dependencies_1.default, + properties_1.default, + patternProperties_1.default, +]; +exports.default = applicator; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js new file mode 100644 index 00000000000000..e398dfbc7af2f1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const subschema_1 = require("../../compile/subschema"); +const util_1 = require("../../compile/util"); +const validate_1 = require("../../compile/validate"); +const def = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + const len = gen.const("len", codegen_1._ `${data}.length`); + if (Array.isArray(schema)) { + if (it.opts.unevaluated && schema.length && it.items !== true) { + it.items = util_1.mergeEvaluated.items(gen, schema.length, it.items); + } + validateTuple(schema); + } + else { + it.items = true; + if (!util_1.alwaysValidSchema(it, schema)) + validateArray(); + } + function validateTuple(schArr) { + if (it.opts.strictTuples && !fullTupleSchema(schema.length, parentSchema)) { + const msg = `"items" is ${schArr.length}-tuple, but minItems or maxItems/additionalItems are not specified or different`; + validate_1.checkStrictMode(it, msg, it.opts.strictTuples); + } + const valid = gen.name("valid"); + schArr.forEach((sch, i) => { + if (util_1.alwaysValidSchema(it, sch)) + return; + gen.if(codegen_1._ `${len} > ${i}`, () => cxt.subschema({ + keyword: "items", + schemaProp: i, + dataProp: i, + strictSchema: it.strictSchema, + }, valid)); + cxt.ok(valid); + }); + } + function validateArray() { + const valid = gen.name("valid"); + gen.forRange("i", 0, len, (i) => { + cxt.subschema({ + keyword: "items", + dataProp: i, + dataPropType: subschema_1.Type.Num, + strictSchema: it.strictSchema, + }, valid); + if (!it.allErrors) + gen.if(codegen_1.not(valid), () => gen.break()); + }); + cxt.ok(valid); + } + }, +}; +function fullTupleSchema(len, sch) { + return len === sch.minItems && (len === sch.maxItems || sch.additionalItems === false); +} +exports.default = def; +//# sourceMappingURL=items.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js new file mode 100644 index 00000000000000..6e7f363be09bb6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt) { + const { gen, schema, it } = cxt; + if (util_1.alwaysValidSchema(it, schema)) { + cxt.fail(); + return; + } + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false, + }, valid); + cxt.result(valid, () => cxt.error(), () => cxt.reset()); + }, + error: { + message: "should NOT be valid", + }, +}; +exports.default = def; +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js new file mode 100644 index 00000000000000..21135cd7ecfb3d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: "should match exactly one schema in oneOf", + params: ({ params }) => codegen_1._ `{passingSchemas: ${params.passing}}`, +}; +const def = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error, + code(cxt) { + const { gen, schema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const schArr = schema; + const valid = gen.let("valid", false); + const passing = gen.let("passing", null); + const schValid = gen.name("_valid"); + cxt.setParams({ passing }); + // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas + gen.block(validateOneOf); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); + function validateOneOf() { + schArr.forEach((sch, i) => { + let schCxt; + if (util_1.alwaysValidSchema(it, sch)) { + gen.var(schValid, true); + } + else { + schCxt = cxt.subschema({ + keyword: "oneOf", + schemaProp: i, + compositeRule: true, + }, schValid); + } + if (i > 0) { + gen + .if(codegen_1._ `${schValid} && ${valid}`) + .assign(valid, false) + .assign(passing, codegen_1._ `[${passing}, ${i}]`) + .else(); + } + gen.if(schValid, () => { + gen.assign(valid, true); + gen.assign(passing, i); + if (schCxt) + cxt.mergeEvaluated(schCxt, codegen_1.Name); + }); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=oneOf.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js new file mode 100644 index 00000000000000..25e9e4f5fbaf88 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const subschema_1 = require("../../compile/subschema"); +const validate_1 = require("../../compile/validate"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema, data, parentSchema, it } = cxt; + const { opts } = it; + const patterns = code_1.schemaProperties(it, schema); + // TODO mark properties matching patterns with always valid schemas as evaluated + if (patterns.length === 0) + return; + const checkProperties = opts.strict && !opts.allowMatchingProperties && parentSchema.properties; + const valid = gen.name("valid"); + if (it.props !== true && !(it.props instanceof codegen_1.Name)) { + it.props = util_1.evaluatedPropsToName(gen, it.props); + } + const { props } = it; + validatePatternProperties(); + function validatePatternProperties() { + for (const pat of patterns) { + if (checkProperties) + checkMatchingProperties(pat); + if (it.allErrors) { + validateProperties(pat); + } + else { + gen.var(valid, true); // TODO var + validateProperties(pat); + gen.if(valid); + } + } + } + function checkMatchingProperties(pat) { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + validate_1.checkStrictMode(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); + } + } + } + function validateProperties(pat) { + gen.forIn("key", data, (key) => { + gen.if(codegen_1._ `${code_1.usePattern(gen, pat)}.test(${key})`, () => { + cxt.subschema({ + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: subschema_1.Type.Str, + strictSchema: it.strictSchema, + }, valid); + if (it.opts.unevaluated && props !== true) { + gen.assign(codegen_1._ `${props}[${key}]`, true); + } + else if (!it.allErrors) { + // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) + // or if all properties were evaluated (props === true) + gen.if(codegen_1.not(valid), () => gen.break()); + } + }); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=patternProperties.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js new file mode 100644 index 00000000000000..23dadd7b7ce409 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const context_1 = require("../../compile/context"); +const code_1 = require("../code"); +const util_1 = require("../../compile/util"); +const additionalProperties_1 = require("./additionalProperties"); +const def = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { + additionalProperties_1.default.code(new context_1.default(it, additionalProperties_1.default, "additionalProperties")); + } + const allProps = code_1.allSchemaProperties(schema); + if (it.opts.unevaluated && allProps.length && it.props !== true) { + it.props = util_1.mergeEvaluated.props(gen, util_1.toHash(allProps), it.props); + } + const properties = allProps.filter((p) => !util_1.alwaysValidSchema(it, schema[p])); + if (properties.length === 0) + return; + const valid = gen.name("valid"); + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop); + } + else { + gen.if(code_1.propertyInData(data, prop, it.opts.ownProperties)); + applyPropertySchema(prop); + if (!it.allErrors) + gen.else().var(valid, true); + gen.endIf(); + } + cxt.ok(valid); + } + function hasDefault(prop) { + return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; + } + function applyPropertySchema(prop) { + cxt.subschema({ + keyword: "properties", + schemaProp: prop, + dataProp: prop, + strictSchema: it.strictSchema, + }, valid); + } + }, +}; +exports.default = def; +//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js new file mode 100644 index 00000000000000..9467ce79e18733 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params }) => codegen_1.str `property name '${params.propertyName}' is invalid`, + params: ({ params }) => codegen_1._ `{propertyName: ${params.propertyName}}`, +}; +const def = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error, + code(cxt) { + const { gen, schema, data, it } = cxt; + if (util_1.alwaysValidSchema(it, schema)) + return; + const valid = gen.name("valid"); + gen.forIn("key", data, (key) => { + cxt.setParams({ propertyName: key }); + cxt.subschema({ + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true, + strictSchema: it.strictSchema, + }, valid); + gen.if(codegen_1.not(valid), () => { + cxt.error(true); + if (!it.allErrors) + gen.break(); + }); + }); + cxt.ok(valid); + }, +}; +exports.default = def; +//# sourceMappingURL=propertyNames.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js new file mode 100644 index 00000000000000..f5138c08111ce9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_1 = require("../../compile/validate"); +const def = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({ keyword, parentSchema, it }) { + if (parentSchema.if === undefined) + validate_1.checkStrictMode(it, `"${keyword}" without "if" is ignored`); + }, +}; +exports.default = def; +//# sourceMappingURL=thenElse.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js new file mode 100644 index 00000000000000..7f877151522f51 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; +const codegen_1 = require("../compile/codegen"); +const util_1 = require("../compile/util"); +const names_1 = require("../compile/names"); +function checkReportMissingProp(cxt, prop) { + const { gen, data, it } = cxt; + gen.if(noPropertyInData(data, prop, it.opts.ownProperties), () => { + cxt.setParams({ missingProperty: codegen_1._ `${prop}` }, true); + cxt.error(); + }); +} +exports.checkReportMissingProp = checkReportMissingProp; +function checkMissingProp({ data, it: { opts } }, properties, missing) { + return codegen_1.or(...properties.map((prop) => codegen_1._ `${noPropertyInData(data, prop, opts.ownProperties)} && (${missing} = ${prop})`)); +} +exports.checkMissingProp = checkMissingProp; +function reportMissingProp(cxt, missing) { + cxt.setParams({ missingProperty: missing }, true); + cxt.error(); +} +exports.reportMissingProp = reportMissingProp; +function isOwnProperty(data, property) { + return codegen_1._ `Object.prototype.hasOwnProperty.call(${data}, ${property})`; +} +function propertyInData(data, property, ownProperties) { + const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} !== undefined`; + return ownProperties ? codegen_1._ `${cond} && ${isOwnProperty(data, property)}` : cond; +} +exports.propertyInData = propertyInData; +function noPropertyInData(data, property, ownProperties) { + const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} === undefined`; + return ownProperties ? codegen_1._ `${cond} || !${isOwnProperty(data, property)}` : cond; +} +exports.noPropertyInData = noPropertyInData; +function allSchemaProperties(schemaMap) { + return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; +} +exports.allSchemaProperties = allSchemaProperties; +function schemaProperties(it, schemaMap) { + return allSchemaProperties(schemaMap).filter((p) => !util_1.alwaysValidSchema(it, schemaMap[p])); +} +exports.schemaProperties = schemaProperties; +function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { + const dataAndSchema = passSchema ? codegen_1._ `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; + const valCxt = [ + [names_1.default.dataPath, codegen_1.strConcat(names_1.default.dataPath, errorPath)], + [names_1.default.parentData, it.parentData], + [names_1.default.parentDataProperty, it.parentDataProperty], + [names_1.default.rootData, names_1.default.rootData], + ]; + if (it.opts.dynamicRef) + valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); + const args = codegen_1._ `${dataAndSchema}, ${gen.object(...valCxt)}`; + return context !== codegen_1.nil ? codegen_1._ `${func}.call(${context}, ${args})` : codegen_1._ `${func}(${args})`; +} +exports.callValidateCode = callValidateCode; +function usePattern(gen, pattern) { + return gen.scopeValue("pattern", { + key: pattern, + ref: new RegExp(pattern, "u"), + code: codegen_1._ `new RegExp(${pattern}, "u")`, + }); +} +exports.usePattern = usePattern; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js new file mode 100644 index 00000000000000..313598aab87eb6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const def = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); + }, +}; +exports.default = def; +//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js new file mode 100644 index 00000000000000..d3981d4b58dcdb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const id_1 = require("./id"); +const ref_1 = require("./ref"); +const core = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + "definitions", + id_1.default, + ref_1.default, +]; +exports.default = core; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js new file mode 100644 index 00000000000000..b56fbcc511710d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callRef = exports.getValidate = void 0; +const error_classes_1 = require("../../compile/error_classes"); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const compile_1 = require("../../compile"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "$ref", + schemaType: "string", + code(cxt) { + const { gen, schema, it } = cxt; + const { baseId, schemaEnv: env, validateName, opts, self } = it; + // TODO See comment in dynamicRef.ts + // This has to be improved to resolve #815. + if (schema === "#" || schema === "#/") + return callRootRef(); + const schOrEnv = compile_1.resolveRef.call(self, env.root, baseId, schema); + if (schOrEnv === undefined) + throw new error_classes_1.MissingRefError(baseId, schema); + if (schOrEnv instanceof compile_1.SchemaEnv) + return callValidate(schOrEnv); + return inlineRefSchema(schOrEnv); + function callRootRef() { + if (env === env.root) + return callRef(cxt, validateName, env, env.$async); + const rootName = gen.scopeValue("root", { ref: env.root }); + return callRef(cxt, codegen_1._ `${rootName}.validate`, env.root, env.root.$async); + } + function callValidate(sch) { + const v = getValidate(cxt, sch); + callRef(cxt, v, sch, sch.$async); + } + function inlineRefSchema(sch) { + const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: codegen_1.stringify(sch) } : { ref: sch }); + const valid = gen.name("valid"); + const schCxt = cxt.subschema({ + schema: sch, + strictSchema: true, + dataTypes: [], + schemaPath: codegen_1.nil, + topSchemaRef: schName, + errSchemaPath: schema, + }, valid); + cxt.mergeEvaluated(schCxt); + cxt.ok(valid); + } + }, +}; +function getValidate(cxt, sch) { + const { gen } = cxt; + return sch.validate + ? gen.scopeValue("validate", { ref: sch.validate }) + : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.validate`; +} +exports.getValidate = getValidate; +function callRef(cxt, v, sch, $async) { + const { gen, it } = cxt; + const { allErrors, schemaEnv: env, opts } = it; + const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; + if ($async) + callAsyncRef(); + else + callSyncRef(); + function callAsyncRef() { + if (!env.$async) + throw new Error("async schema referenced by sync schema"); + const valid = gen.let("valid"); + gen.try(() => { + gen.code(codegen_1._ `await ${code_1.callValidateCode(cxt, v, passCxt)}`); + addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result + if (!allErrors) + gen.assign(valid, true); + }, (e) => { + gen.if(codegen_1._ `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); + addErrorsFrom(e); + if (!allErrors) + gen.assign(valid, false); + }); + cxt.ok(valid); + } + function callSyncRef() { + cxt.result(code_1.callValidateCode(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); + } + function addErrorsFrom(source) { + const errs = codegen_1._ `${source}.errors`; + gen.assign(names_1.default.vErrors, codegen_1._ `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged + gen.assign(names_1.default.errors, codegen_1._ `${names_1.default.vErrors}.length`); + } + function addEvaluatedFrom(source) { + var _a; + if (!it.opts.unevaluated) + return; + const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; + // TODO refactor + if (it.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== undefined) { + it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); + } + } + else { + const props = gen.var("props", codegen_1._ `${source}.evaluated.props`); + it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); + } + } + if (it.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== undefined) { + it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); + } + } + else { + const items = gen.var("items", codegen_1._ `${source}.evaluated.items`); + it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); + } + } + } +} +exports.callRef = callRef; +exports.default = def; +//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js new file mode 100644 index 00000000000000..a9755d2fbd605e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("./core"); +const validation_1 = require("./validation"); +const applicator_1 = require("./applicator"); +const format_1 = require("./format"); +const metadata_1 = require("./metadata"); +const draft7Vocabularies = [ + core_1.default, + validation_1.default, + applicator_1.default, + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary, +]; +exports.default = draft7Vocabularies; +//# sourceMappingURL=draft7.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js new file mode 100644 index 00000000000000..8beea65ce6511e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dynamicAnchor = void 0; +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const compile_1 = require("../../compile"); +const ref_1 = require("../core/ref"); +const def = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema), +}; +function dynamicAnchor(cxt, anchor) { + const { gen, it } = cxt; + it.schemaEnv.root.dynamicAnchors[anchor] = true; + const v = codegen_1._ `${names_1.default.dynamicAnchors}${codegen_1.getProperty(anchor)}`; + const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt); + gen.if(codegen_1._ `!${v}`, () => gen.assign(v, validate)); +} +exports.dynamicAnchor = dynamicAnchor; +function _getValidate(cxt) { + const { schemaEnv, schema, self } = cxt.it; + const { root, baseId, localRefs, meta } = schemaEnv.root; + const sch = new compile_1.SchemaEnv({ schema, root, baseId, localRefs, meta }); + compile_1.compileSchema.call(self, sch); + return ref_1.getValidate(cxt, sch); +} +exports.default = def; +//# sourceMappingURL=dynamicAnchor.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js new file mode 100644 index 00000000000000..6e67b1cc9b8912 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dynamicRef = void 0; +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const ref_1 = require("../core/ref"); +const def = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +}; +function dynamicRef(cxt, ref) { + const { gen, keyword, it } = cxt; + if (ref[0] !== "#") + throw new Error(`"${keyword}" only supports hash fragment reference`); + const anchor = ref.slice(1); + if (it.allErrors) { + _dynamicRef(); + } + else { + const valid = gen.let("valid", false); + _dynamicRef(valid); + cxt.ok(valid); + } + function _dynamicRef(valid) { + // TODO the assumption here is that `recursiveRef: #` always points to the root + // of the schema object, which is not correct, because there may be $id that + // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. + // Because of that 2 tests in recursiveRef.json fail. + // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). + // (This problem is not tested in JSON-Schema-Test-Suite) + if (it.schemaEnv.root.dynamicAnchors[anchor]) { + const v = gen.let("_v", codegen_1._ `${names_1.default.dynamicAnchors}${codegen_1.getProperty(anchor)}`); + gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)); + } + else { + _callRef(it.validateName, valid)(); + } + } + function _callRef(validate, valid) { + return valid + ? () => gen.block(() => { + ref_1.callRef(cxt, validate); + gen.let(valid, true); + }) + : () => ref_1.callRef(cxt, validate); + } +} +exports.dynamicRef = dynamicRef; +exports.default = def; +//# sourceMappingURL=dynamicRef.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js new file mode 100644 index 00000000000000..f2388a7571c900 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicAnchor_1 = require("./dynamicAnchor"); +const dynamicRef_1 = require("./dynamicRef"); +const recursiveAnchor_1 = require("./recursiveAnchor"); +const recursiveRef_1 = require("./recursiveRef"); +const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default]; +exports.default = dynamic; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js new file mode 100644 index 00000000000000..3e0bb6146a55c9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicAnchor_1 = require("./dynamicAnchor"); +const validate_1 = require("../../compile/validate"); +const def = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) + dynamicAnchor_1.dynamicAnchor(cxt, ""); + else + validate_1.checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored"); + }, +}; +exports.default = def; +//# sourceMappingURL=recursiveAnchor.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js new file mode 100644 index 00000000000000..f421c4cbe27623 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicRef_1 = require("./dynamicRef"); +const def = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => dynamicRef_1.dynamicRef(cxt, cxt.schema), +}; +exports.default = def; +//# sourceMappingURL=recursiveRef.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js new file mode 100644 index 00000000000000..d4d3fba0029359 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js new file mode 100644 index 00000000000000..69c6d2a9bc6b06 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => codegen_1.str `should match format "${schemaCode}"`, + params: ({ schemaCode }) => codegen_1._ `{format: ${schemaCode}}`, +}; +const def = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error, + code(cxt, ruleType) { + const { gen, data, $data, schema, schemaCode, it } = cxt; + const { opts, errSchemaPath, schemaEnv, self } = it; + if (!opts.validateFormats) + return; + if ($data) + validate$DataFormat(); + else + validateFormat(); + function validate$DataFormat() { + const fmts = gen.scopeValue("formats", { + ref: self.formats, + code: opts.code.formats, + }); + const fDef = gen.const("fDef", codegen_1._ `${fmts}[${schemaCode}]`); + const fType = gen.let("fType"); + const format = gen.let("format"); + // TODO simplify + gen.if(codegen_1._ `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, codegen_1._ `${fDef}.type || "string"`).assign(format, codegen_1._ `${fDef}.validate`), () => gen.assign(fType, codegen_1._ `"string"`).assign(format, fDef)); + cxt.fail$data(codegen_1.or(unknownFmt(), invalidFmt())); + function unknownFmt() { + if (opts.strict === false) + return codegen_1.nil; + return codegen_1._ `${schemaCode} && !${format}`; + } + function invalidFmt() { + const callFormat = schemaEnv.$async + ? codegen_1._ `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` + : codegen_1._ `${format}(${data})`; + const validData = codegen_1._ `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; + return codegen_1._ `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; + } + } + function validateFormat() { + const formatDef = self.formats[schema]; + if (!formatDef) { + unknownFormat(); + return; + } + if (formatDef === true) + return; + const [fmtType, format, fmtRef] = getFormat(formatDef); + if (fmtType === ruleType) + cxt.pass(validCondition()); + function unknownFormat() { + if (opts.strict === false) { + self.logger.warn(unknownMsg()); + return; + } + throw new Error(unknownMsg()); + function unknownMsg() { + return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; + } + } + function getFormat(fmtDef) { + const fmt = gen.scopeValue("formats", { + key: schema, + ref: fmtDef, + code: opts.code.formats ? codegen_1._ `${opts.code.formats}${codegen_1.getProperty(schema)}` : undefined, + }); + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, codegen_1._ `${fmt}.validate`]; + } + return ["string", fmtDef, fmt]; + } + function validCondition() { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) + throw new Error("async format in sync schema"); + return codegen_1._ `await ${fmtRef}(${data})`; + } + return typeof format == "function" ? codegen_1._ `${fmtRef}(${data})` : codegen_1._ `${fmtRef}.test(${data})`; + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js new file mode 100644 index 00000000000000..d19023d24525c8 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const format_1 = require("./format"); +const format = [format_1.default]; +exports.default = format; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js new file mode 100644 index 00000000000000..f07bf28b5a0e6c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.contentVocabulary = exports.metadataVocabulary = void 0; +exports.metadataVocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples", +]; +exports.contentVocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema", +]; +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/next.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/next.js new file mode 100644 index 00000000000000..c861b32433810e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/next.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependentRequired_1 = require("./validation/dependentRequired"); +const dependentSchemas_1 = require("./applicator/dependentSchemas"); +const limitContains_1 = require("./validation/limitContains"); +const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default]; +exports.default = next; +//# sourceMappingURL=next.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js new file mode 100644 index 00000000000000..30e316748de25f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const unevaluatedProperties_1 = require("./unevaluatedProperties"); +const unevaluatedItems_1 = require("./unevaluatedItems"); +const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default]; +exports.default = unevaluated; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js new file mode 100644 index 00000000000000..6ae74763f94ba3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const subschema_1 = require("../../compile/subschema"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { len } }) => codegen_1.str `should NOT have more than ${len} items`, + params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`, +}; +const def = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error, + code(cxt) { + const { gen, schema, data, it } = cxt; + const items = it.items || 0; + if (items === true) + return; + const len = gen.const("len", codegen_1._ `${data}.length`); + if (schema === false) { + cxt.setParams({ len: items }); + cxt.fail(codegen_1._ `${len} > ${items}`); + } + else if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", codegen_1._ `${len} <= ${items}`); + gen.if(codegen_1.not(valid), () => validateItems(valid, items)); + cxt.ok(valid); + } + it.items = true; + function validateItems(valid, from) { + gen.forRange("i", from, len, (i) => { + cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: subschema_1.Type.Num }, valid); + if (!it.allErrors) + gen.if(codegen_1.not(valid), () => gen.break()); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=unevaluatedItems.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js new file mode 100644 index 00000000000000..ce77b261cab7ec --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const names_1 = require("../../compile/names"); +const subschema_1 = require("../../compile/subschema"); +const error = { + message: "should NOT have unevaluated properties", + params: ({ params }) => codegen_1._ `{unevaluatedProperty: ${params.unevaluatedProperty}}`, +}; +const def = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error, + code(cxt) { + const { gen, schema, data, errsCount, it } = cxt; + /* istanbul ignore if */ + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, props } = it; + if (props instanceof codegen_1.Name) { + gen.if(codegen_1._ `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)))); + } + else if (props !== true) { + gen.forIn("key", data, (key) => props === undefined + ? unevaluatedPropCode(key) + : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))); + } + it.props = true; + cxt.ok(codegen_1._ `${errsCount} === ${names_1.default.errors}`); + function unevaluatedPropCode(key) { + if (schema === false) { + cxt.setParams({ unevaluatedProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (!util_1.alwaysValidSchema(it, schema)) { + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: subschema_1.Type.Str, + strictSchema: it.strictSchema, + }, valid); + if (!allErrors) + gen.if(codegen_1.not(valid), () => gen.break()); + } + } + function unevaluatedDynamic(evaluatedProps, key) { + return codegen_1._ `!${evaluatedProps} || !${evaluatedProps}[${key}]`; + } + function unevaluatedStatic(evaluatedProps, key) { + const ps = []; + for (const p in evaluatedProps) { + if (evaluatedProps[p] === true) + ps.push(codegen_1._ `${key} !== ${p}`); + } + return codegen_1.and(...ps); + } + }, +}; +exports.default = def; +//# sourceMappingURL=unevaluatedProperties.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js new file mode 100644 index 00000000000000..24ac5a43e26c1a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const equal = require("fast-deep-equal"); +const error = { + message: "should be equal to constant", + params: ({ schemaCode }) => codegen_1._ `{allowedValue: ${schemaCode}}`, +}; +const def = { + keyword: "const", + $data: true, + error, + code(cxt) { + const eql = cxt.gen.scopeValue("func", { + ref: equal, + code: codegen_1._ `require("ajv/dist/compile/equal")`, + }); + // TODO optimize for scalar values in schema + cxt.fail$data(codegen_1._ `!${eql}(${cxt.data}, ${cxt.schemaCode})`); + }, +}; +exports.default = def; +//# sourceMappingURL=const.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js new file mode 100644 index 00000000000000..27c4eb26050fc3 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependencies_1 = require("../applicator/dependencies"); +const def = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error: dependencies_1.error, + code: (cxt) => dependencies_1.validatePropertyDeps(cxt), +}; +exports.default = def; +//# sourceMappingURL=dependentRequired.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js new file mode 100644 index 00000000000000..ffc7f84622d815 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const equal = require("fast-deep-equal"); +const error = { + message: "should be equal to one of the allowed values", + params: ({ schemaCode }) => codegen_1._ `{allowedValues: ${schemaCode}}`, +}; +const def = { + keyword: "enum", + schemaType: "array", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, schemaCode, it } = cxt; + if (!$data && schema.length === 0) + throw new Error("enum must have non-empty array"); + const useLoop = schema.length >= it.opts.loopEnum; + const eql = cxt.gen.scopeValue("func", { + ref: equal, + code: codegen_1._ `require("ajv/dist/compile/equal")`, + }); + let valid; + if (useLoop || $data) { + valid = gen.let("valid"); + cxt.block$data(valid, loopEnum); + } + else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const vSchema = gen.const("vSchema", schemaCode); + valid = codegen_1.or(...schema.map((_x, i) => equalCode(vSchema, i))); + } + cxt.pass(valid); + function loopEnum() { + gen.assign(valid, false); + gen.forOf("v", schemaCode, (v) => gen.if(codegen_1._ `${eql}(${data}, ${v})`, () => gen.assign(valid, true).break())); + } + function equalCode(vSchema, i) { + const sch = schema[i]; + return sch && typeof sch === "object" + ? codegen_1._ `${eql}(${data}, ${vSchema}[${i}])` + : codegen_1._ `${data} === ${sch}`; + } + }, +}; +exports.default = def; +//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js new file mode 100644 index 00000000000000..9a7b711c1b2ca1 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const limitNumber_1 = require("./limitNumber"); +const multipleOf_1 = require("./multipleOf"); +const limitLength_1 = require("./limitLength"); +const pattern_1 = require("./pattern"); +const limitProperties_1 = require("./limitProperties"); +const required_1 = require("./required"); +const limitItems_1 = require("./limitItems"); +const uniqueItems_1 = require("./uniqueItems"); +const const_1 = require("./const"); +const enum_1 = require("./enum"); +const validation = [ + // number + limitNumber_1.default, + multipleOf_1.default, + // string + limitLength_1.default, + pattern_1.default, + // object + limitProperties_1.default, + required_1.default, + // array + limitItems_1.default, + uniqueItems_1.default, + // any + { keyword: "nullable", schemaType: "boolean" }, + const_1.default, + enum_1.default, +]; +exports.default = validation; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js new file mode 100644 index 00000000000000..155654b0518166 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_1 = require("../../compile/validate"); +const def = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({ keyword, parentSchema, it }) { + if (parentSchema.contains === undefined) { + validate_1.checkStrictMode(it, `"${keyword}" without "contains" is ignored`); + } + }, +}; +exports.default = def; +//# sourceMappingURL=limitContains.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js new file mode 100644 index 00000000000000..fbcf8f87543d2b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxItems" ? "more" : "fewer"; + return codegen_1.str `should NOT have ${comp} than ${schemaCode} items`; + }, + params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data(codegen_1._ `${data}.length ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitItems.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js new file mode 100644 index 00000000000000..8102ddb13029b9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const ucs2length_1 = require("../../compile/ucs2length"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxLength" ? "more" : "fewer"; + return codegen_1.str `should NOT have ${comp} than ${schemaCode} characters`; + }, + params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode, it } = cxt; + const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; + let len; + if (it.opts.unicode === false) { + len = codegen_1._ `${data}.length`; + } + else { + const u2l = cxt.gen.scopeValue("func", { + ref: ucs2length_1.default, + code: codegen_1._ `require("ajv/dist/compile/ucs2length").default`, + }); + len = codegen_1._ `${u2l}(${data})`; + } + cxt.fail$data(codegen_1._ `${len} ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitLength.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js new file mode 100644 index 00000000000000..a86bfef7b3ba29 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const ops = codegen_1.operators; +const KWDs = { + maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, + minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, + exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, + exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }, +}; +const error = { + message: ({ keyword, schemaCode }) => codegen_1.str `should be ${KWDs[keyword].okStr} ${schemaCode}`, + params: ({ keyword, schemaCode }) => codegen_1._ `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, +}; +const def = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + cxt.fail$data(codegen_1._ `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitNumber.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js new file mode 100644 index 00000000000000..19a558ea674e5a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxProperties" ? "more" : "fewer"; + return codegen_1.str `should NOT have ${comp} than ${schemaCode} items`; + }, + params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data(codegen_1._ `Object.keys(${data}).length ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitProperties.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js new file mode 100644 index 00000000000000..6c6fd44a568a6b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => codegen_1.str `should be multiple of ${schemaCode}`, + params: ({ schemaCode }) => codegen_1._ `{multipleOf: ${schemaCode}}`, +}; +const def = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { gen, data, schemaCode, it } = cxt; + // const bdt = bad$DataType(schemaCode, def.schemaType, $data) + const prec = it.opts.multipleOfPrecision; + const res = gen.let("res"); + const invalid = prec + ? codegen_1._ `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` + : codegen_1._ `${res} !== parseInt(${res})`; + cxt.fail$data(codegen_1._ `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); + }, +}; +exports.default = def; +//# sourceMappingURL=multipleOf.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js new file mode 100644 index 00000000000000..d17780db31664b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => codegen_1.str `should match pattern "${schemaCode}"`, + params: ({ schemaCode }) => codegen_1._ `{pattern: ${schemaCode}}`, +}; +const def = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, schemaCode } = cxt; + const regExp = $data ? codegen_1._ `(new RegExp(${schemaCode}, "u"))` : code_1.usePattern(gen, schema); // TODO regexp should be wrapped in try/catch + cxt.fail$data(codegen_1._ `!${regExp}.test(${data})`); + }, +}; +exports.default = def; +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js new file mode 100644 index 00000000000000..2d385229fbcd17 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ params: { missingProperty } }) => codegen_1.str `should have required property '${missingProperty}'`, + params: ({ params: { missingProperty } }) => codegen_1._ `{missingProperty: ${missingProperty}}`, +}; +const def = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error, + code(cxt) { + const { gen, schema, schemaCode, data, $data, it } = cxt; + const { opts } = it; + if (!$data && schema.length === 0) + return; + const useLoop = schema.length >= opts.loopRequired; + if (it.allErrors) + allErrorsMode(); + else + exitOnErrorMode(); + function allErrorsMode() { + if (useLoop || $data) { + cxt.block$data(codegen_1.nil, loopAllRequired); + } + else { + for (const prop of schema) { + code_1.checkReportMissingProp(cxt, prop); + } + } + } + function exitOnErrorMode() { + const missing = gen.let("missing"); + if (useLoop || $data) { + const valid = gen.let("valid", true); + cxt.block$data(valid, () => loopUntilMissing(missing, valid)); + cxt.ok(valid); + } + else { + gen.if(code_1.checkMissingProp(cxt, schema, missing)); + code_1.reportMissingProp(cxt, missing); + gen.else(); + } + } + function loopAllRequired() { + gen.forOf("prop", schemaCode, (prop) => { + cxt.setParams({ missingProperty: prop }); + gen.if(code_1.noPropertyInData(data, prop, opts.ownProperties), () => cxt.error()); + }); + } + function loopUntilMissing(missing, valid) { + cxt.setParams({ missingProperty: missing }); + gen.forOf(missing, schemaCode, () => { + gen.assign(valid, code_1.propertyInData(data, missing, opts.ownProperties)); + gen.if(codegen_1.not(valid), () => { + cxt.error(); + gen.break(); + }); + }, codegen_1.nil); + } + }, +}; +exports.default = def; +//# sourceMappingURL=required.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js new file mode 100644 index 00000000000000..68d31a13cbee51 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dataType_1 = require("../../compile/validate/dataType"); +const codegen_1 = require("../../compile/codegen"); +const equal = require("fast-deep-equal"); +const error = { + message: ({ params: { i, j } }) => codegen_1.str `should NOT have duplicate items (items ## ${j} and ${i} are identical)`, + params: ({ params: { i, j } }) => codegen_1._ `{i: ${i}, j: ${j}}`, +}; +const def = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; + if (!$data && !schema) + return; + const valid = gen.let("valid"); + const itemTypes = parentSchema.items ? dataType_1.getSchemaTypes(parentSchema.items) : []; + cxt.block$data(valid, validateUniqueItems, codegen_1._ `${schemaCode} === false`); + cxt.ok(valid); + function validateUniqueItems() { + const i = gen.let("i", codegen_1._ `${data}.length`); + const j = gen.let("j"); + cxt.setParams({ i, j }); + gen.assign(valid, true); + gen.if(codegen_1._ `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); + } + function canOptimize() { + return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); + } + function loopN(i, j) { + const item = gen.name("item"); + const wrongType = dataType_1.checkDataTypes(itemTypes, item, it.opts.strict, dataType_1.DataType.Wrong); + const indices = gen.const("indices", codegen_1._ `{}`); + gen.for(codegen_1._ `;${i}--;`, () => { + gen.let(item, codegen_1._ `${data}[${i}]`); + gen.if(wrongType, codegen_1._ `continue`); + if (itemTypes.length > 1) + gen.if(codegen_1._ `typeof ${item} == "string"`, codegen_1._ `${item} += "_"`); + gen + .if(codegen_1._ `typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j, codegen_1._ `${indices}[${item}]`); + cxt.error(); + gen.assign(valid, false).break(); + }) + .code(codegen_1._ `${indices}[${item}] = ${i}`); + }); + } + function loopN2(i, j) { + const eql = cxt.gen.scopeValue("func", { + ref: equal, + code: codegen_1._ `require("ajv/dist/compile/equal")`, + }); + const outer = gen.name("outer"); + gen.label(outer).for(codegen_1._ `;${i}--;`, () => gen.for(codegen_1._ `${j} = ${i}; ${j}--;`, () => gen.if(codegen_1._ `${eql}(${data}[${i}], ${data}[${j}])`, () => { + cxt.error(); + gen.assign(valid, false).break(outer); + }))); + } + }, +}; +exports.default = def; +//# sourceMappingURL=uniqueItems.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/compile/equal.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/compile/equal.js new file mode 100644 index 00000000000000..b67591643e6e1f --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/compile/equal.js @@ -0,0 +1,3 @@ +// do NOT remove this file - it would break pre-compiled schemas +// https://github.com/ajv-validator/ajv/issues/889 +module.exports = require("fast-deep-equal") diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/data.json new file mode 100644 index 00000000000000..9ffc9f5ce05484 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 00000000000000..c5e91cf2ac8469 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 00000000000000..b8f63734343046 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 00000000000000..f71adbff04fe9e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 00000000000000..03ccfce26efeaf --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 00000000000000..0e194326fa133b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 00000000000000..7027a1279a014a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json new file mode 100644 index 00000000000000..54eb7157afed69 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json new file mode 100644 index 00000000000000..5410064ba8df93 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": {} +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json new file mode 100644 index 00000000000000..6a74851043623c --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json new file mode 100644 index 00000000000000..3968abd5d97e7b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json new file mode 100644 index 00000000000000..977045fa8c2dbd --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json @@ -0,0 +1,121 @@ +{ + "author": { + "name": "Evgeny Poberezkin" + }, + "bugs": { + "url": "https://github.com/ajv-validator/ajv/issues" + }, + "bundleDependencies": false, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "deprecated": false, + "description": "Another JSON Schema Validator", + "devDependencies": { + "@ajv-validator/config": "^0.3.0", + "@types/chai": "^4.2.12", + "@types/mocha": "^8.0.3", + "@types/node": "^14.0.27", + "@types/require-from-string": "^1.2.0", + "@typescript-eslint/eslint-plugin": "^3.8.0", + "@typescript-eslint/parser": "^3.8.0", + "ajv-formats": "^1.5.0", + "browserify": "^17.0.0", + "chai": "^4.0.1", + "cross-env": "^7.0.2", + "eslint": "^7.8.1", + "eslint-config-prettier": "^7.0.0", + "glob": "^7.0.0", + "husky": "^4.2.5", + "if-node-version": "^1.0.0", + "js-beautify": "^1.7.3", + "json-schema-test": "^2.0.0", + "karma": "^5.0.0", + "karma-chrome-launcher": "^3.0.0", + "karma-mocha": "^2.0.0", + "lint-staged": "^10.2.11", + "mocha": "^8.0.1", + "nyc": "^15.0.0", + "prettier": "^2.0.5", + "terser": "^5.2.1", + "ts-node": "^9.0.0", + "tsify": "^5.0.2", + "typescript": "^4.0.0" + }, + "files": [ + "lib/", + "docs/", + "dist/", + "scripts/", + ".tonic_example.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + }, + "homepage": "https://github.com/ajv-validator/ajv", + "husky": { + "hooks": { + "pre-commit": "lint-staged && npm test" + } + }, + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "license": "MIT", + "lint-staged": { + "*.{md,json,yaml,js,ts}": "prettier --write" + }, + "main": "dist/ajv.js", + "name": "ajv", + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": "@ajv-validator/config/prettierrc.json", + "repository": { + "type": "git", + "url": "git+https://github.com/ajv-validator/ajv.git" + }, + "scripts": { + "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts", + "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019", + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" scripts --ignore-pattern spec/JSON-Schema-Test-Suite", + "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", + "prepublish": "npm run build", + "prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"", + "prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"", + "test": "npm link && npm link ajv && npm run json-tests && npm run eslint && npm run test-cov", + "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", + "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", + "test-ci": "AJV_FULL_TEST=true npm test", + "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", + "test-cov": "nyc npm run test-spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-karma": "karma start", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot" + }, + "tonicExampleFilename": ".tonic_example.js", + "types": "dist/ajv.d.ts", + "version": "7.0.2" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/bundle.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/bundle.js new file mode 100644 index 00000000000000..62560f24a0bb3b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/bundle.js @@ -0,0 +1,48 @@ +"use strict" + +const fs = require("fs") +const path = require("path") +const browserify = require("browserify") +const {minify} = require("terser") + +const [sourceFile, outFile, globalName] = process.argv.slice(2) + +const json = require(path.join(__dirname, "..", "package.json")) +const bundleDir = path.join(__dirname, "..", "bundle") +if (!fs.existsSync(bundleDir)) fs.mkdirSync(bundleDir) + +browserify({standalone: globalName}) + .require(path.join(__dirname, "../dist", sourceFile), {expose: sourceFile}) + .bundle(saveAndMinify) + +async function saveAndMinify(err, buf) { + if (err) { + console.error("browserify error:", err) + process.exit(1) + } + + const bundlePath = path.join(bundleDir, outFile) + const opts = { + ecma: 2018, + warnings: true, + compress: { + pure_getters: true, + keep_infinity: true, + unsafe_methods: true, + }, + format: { + preamble: `/* ${json.name} ${json.version} (${globalName}): ${json.description} */`, + }, + sourceMap: { + filename: outFile + ".min.js", + url: outFile + ".min.js.map", + }, + } + + const result = await minify(buf.toString(), opts) + + fs.writeFileSync(bundlePath + ".bundle.js", buf) + fs.writeFileSync(bundlePath + ".min.js", result.code) + fs.writeFileSync(bundlePath + ".min.js.map", result.map) + if (result.warnings) result.warnings.forEach((msg) => console.warn("terser.minify warning:", msg)) +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/jsontests.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/jsontests.js new file mode 100644 index 00000000000000..88423d81bd6d34 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/jsontests.js @@ -0,0 +1,31 @@ +"use strict" + +const testSuitePaths = { + draft6: "spec/JSON-Schema-Test-Suite/tests/draft6/", + draft7: "spec/JSON-Schema-Test-Suite/tests/draft7/", + draft2019: "spec/JSON-Schema-Test-Suite/tests/draft2019-09/", + tests: "spec/tests/", + security: "spec/security/", + extras: "spec/extras/", + async: "spec/async/", +} + +const glob = require("glob") +const fs = require("fs") + +for (const suite in testSuitePaths) { + const p = testSuitePaths[suite] + const files = glob.sync(`${p}{**/,}*.json`) + if (files.length === 0) { + console.error(`Missing folder ${p}\nTry: git submodule update --init\n`) + process.exit(1) + } + const code = files + .map((f) => { + const name = f.replace(p, "").replace(/\.json$/, "") + const testPath = f.replace(/^spec/, "..") + return `\n {name: "${name}", test: require("${testPath}")},` + }) + .reduce((list, f) => list + f) + fs.writeFileSync(`./spec/_json/${suite}.js`, `module.exports = [${code}\n]\n`) +} diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/prepare-tests b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/prepare-tests new file mode 100755 index 00000000000000..1b0789632dcc23 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/prepare-tests @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +set -e + +mkdir -p .browser + +echo +echo Preparing browser tests: + +find spec -type f -name '*.spec.*s' | \ +xargs -I {} sh -c \ +'export f="{}"; echo $f; ./node_modules/.bin/browserify $f -p [ tsify -p ./spec/tsconfig.json ] -x ajv -u buffer -o $(echo $f | sed -e "s/spec/.browser/" | sed -e "s/.spec.ts/.spec.js/");' diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles new file mode 100755 index 00000000000000..d91d01c034a813 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-bundles @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -e + +if [[ $GITHUB_REF == refs/tags/v* ]]; then + npm run bundle + + echo "About to publish $GITHUB_REF to ajv-dist..." + + git config --global user.name "$GIT_USER_NAME" + git config --global user.email "$GIT_USER_EMAIL" + + git clone https://${GH_TOKEN_PUBLIC}@github.com/ajv-validator/ajv-dist.git ../ajv-dist + + rm -rf ../ajv-dist/dist + mkdir ../ajv-dist/dist + cp ./bundle/*.* ../ajv-dist/dist + cd ../ajv-dist + + VERSION=${GITHUB_REF#refs/tags/v} + + sed -E "s/\"version\": \"([^\"]*)\"/\"version\": \"$VERSION\"/" package.json > new_package.json + mv new_package.json package.json + + if [[ `git status --porcelain` ]]; then + echo "Changes detected. Updating master branch..." + git add -A + git commit -m "$VERSION: updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" + git push --quiet origin master > /dev/null 2>&1 + fi + + echo "Publishing tag..." + git tag "v$VERSION" + git push --tags > /dev/null 2>&1 + + echo "Done" +fi diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages new file mode 100755 index 00000000000000..34e488a948aa94 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/scripts/publish-gh-pages @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -ex + +echo "About to publish $GITHUB_REF to gh-pages..." + +rm -rf ../gh-pages + +git config --global user.name "$GIT_USER_NAME" +git config --global user.email "$GIT_USER_EMAIL" +git clone -b gh-pages --single-branch https://${GH_TOKEN_PUBLIC}@github.com/ajv-validator/ajv.git ../gh-pages +SOURCE=../gh-pages/_source +mkdir -p $SOURCE +cp *.md $SOURCE +cp -R docs $SOURCE +cp LICENSE $SOURCE +cd ../gh-pages +node ./generate + +# remove logo from README +sed -E "s/]+ajv_logo[^>]+>//" index.md > new-index.md +mv new-index.md index.md + +if [[ `git status --porcelain` ]]; then + echo "Changes detected. Updating gh-pages branch..." + git add -A + git commit -m "updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID" + git push --quiet origin gh-pages > /dev/null 2>&1 +fi + +echo "Done" diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/LICENSE b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/LICENSE new file mode 100644 index 00000000000000..7f1543566f6abb --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/README.md b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/README.md new file mode 100644 index 00000000000000..f3e60073a15c18 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/README.md @@ -0,0 +1,95 @@ +# json-schema-traverse +Traverse JSON Schema passing each schema object to callback + +[![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild) +[![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse) +[![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) + + +## Install + +``` +npm install json-schema-traverse +``` + + +## Usage + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + properties: { + foo: {type: 'string'}, + bar: {type: 'integer'} + } +}; + +traverse(schema, {cb}); +// cb is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} + +// Or: + +traverse(schema, {cb: {pre, post}}); +// pre is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} +// +// post is called 3 times with: +// 1. {type: 'string'} +// 2. {type: 'integer'} +// 3. root schema + +``` + +Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. + +Callback is passed these parameters: + +- _schema_: the current schema object +- _JSON pointer_: from the root schema to the current schema object +- _root schema_: the schema passed to `traverse` object +- _parent JSON pointer_: from the root schema to the parent schema object (see below) +- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) +- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema +- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` + + +## Traverse objects in all unknown keywords + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + mySchema: { + minimum: 1, + maximum: 2 + } +}; + +traverse(schema, {allKeys: true, cb}); +// cb is called 2 times with: +// 1. root schema +// 2. mySchema +``` + +Without option `allKeys: true` callback will be called only with root schema. + + +## Enterprise support + +json-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + +## License + +[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/index.js new file mode 100644 index 00000000000000..e521bfa858a7ee --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var traverse = module.exports = function (schema, opts, cb) { + // Legacy support for v0.3.1 and earlier. + if (typeof opts == 'function') { + cb = opts; + opts = {}; + } + + cb = opts.cb || cb; + var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; + var post = cb.post || function() {}; + + _traverse(opts, pre, post, schema, '', schema); +}; + + +traverse.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true, + if: true, + then: true, + else: true +}; + +traverse.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true +}; + +traverse.propsKeywords = { + $defs: true, + definitions: true, + properties: true, + patternProperties: true, + dependencies: true +}; + +traverse.skipKeywords = { + default: true, + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true +}; + + +function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema && typeof schema == 'object' && !Array.isArray(schema)) { + pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema) { + var sch = schema[key]; + if (Array.isArray(sch)) { + if (key in traverse.arrayKeywords) { + for (var i=0; i=10.0.0" @@ -82,9 +83,9 @@ "scripts": { "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && npm run create-validators && flow-copy-source src dist", "create-readme": "gitdown ./.README/README.md --output-file ./README.md", - "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -c ajv-keywords/keywords/typeof -o dist/validateConfig.js && ajv compile --all-errors --inline-refs=false -s src/schemas/streamConfig -c ajv-keywords/keywords/typeof -o dist/validateStreamConfig.js", + "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > dist/validators.js", "lint": "npm run build && eslint ./src ./test && flow", "test": "mocha --require @babel/register" }, - "version": "6.0.4" + "version": "6.0.6" } \ No newline at end of file diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index 707c2d7e12fa64..80e0105bdcffaf 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -154,5 +154,5 @@ "test:cli": "mocha", "webpack": "node Makefile.js webpack" }, - "version": "7.16.0" + "version": "7.17.0" } \ No newline at end of file From eca2df0909d1429465c63ca9d14d7ae21e8b8194 Mon Sep 17 00:00:00 2001 From: Mary Marchini Date: Wed, 9 Sep 2020 12:10:35 -0700 Subject: [PATCH 084/161] meta: notify slack when someone force pushes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notify #nodejs-dev on the OpenJS Foundation slack when someone force-pushes, removing one manual step from force-pushing. PR-URL: https://github.com/nodejs/node/pull/35131 Reviewed-By: Michael Dawson Reviewed-By: Daijiro Wachi Reviewed-By: Trivikram Kamat Reviewed-By: Anna Henningsen Reviewed-By: Juan José Arboleda Reviewed-By: Rich Trott --- .github/workflows/notify-force-push.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/notify-force-push.yml diff --git a/.github/workflows/notify-force-push.yml b/.github/workflows/notify-force-push.yml new file mode 100644 index 00000000000000..079141bba2a8d8 --- /dev/null +++ b/.github/workflows/notify-force-push.yml @@ -0,0 +1,25 @@ +on: + push: + branches: + - master + +name: Notify on Force Push +jobs: + slackNotification: + name: Slack Notification + if: ${{ github.event.forced && github.repository == 'nodejs/node' }} + runs-on: ubuntu-latest + steps: + - name: Slack Notification + uses: rtCamp/action-slack-notify@master + env: + SLACK_COLOR: '#DE512A' + SLACK_ICON: https://github.com/nodejs.png?size=48 + SLACK_TITLE: '${{ github.actor }} force-pushed to ${{ github.ref }}' + SLACK_MESSAGE: | + A commit was force-pushed to by + + Before: + After: + SLACK_USERNAME: nodejs-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} From 8f672ebbd60feb04c9485867f42e756eafe51d3c Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Mon, 4 Jan 2021 19:48:52 +0100 Subject: [PATCH 085/161] doc: add YAML metadata for process.memoryUsage.rss Refs: https://github.com/nodejs/node/pull/34291 PR-URL: https://github.com/nodejs/node/pull/36781 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott --- doc/api/process.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/process.md b/doc/api/process.md index 8b598e8b608097..d7c91a840cbe08 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1617,6 +1617,9 @@ informations about memory usage which can be slow depending on the program memory allocations. ## `process.memoryUsage.rss()` + * Returns: {integer} From bff201a66d1c9e65d08efa6efd8ffc374f5544aa Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 2 Jan 2021 11:01:37 -0800 Subject: [PATCH 086/161] util: remove unreachable defensive coding Now that we are using primordials in the first part of isIdenticalTypedArrayType(), the defensive coding to get the correct result (when Symbol.toStringTag is manipulated) is no longer reachable or necessary. Remove the code. Refs: https://coverage.nodejs.org/coverage-873d21cdc1266273/lib/internal/util/comparisons.js.html#L135 PR-URL: https://github.com/nodejs/node/pull/36744 Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig --- lib/internal/util/comparisons.js | 45 +++----------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 0bc46257e829fc..ed8ddf6ad321d8 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -44,15 +44,6 @@ const { isSymbolObject, isFloat32Array, isFloat64Array, - isUint8Array, - isUint8ClampedArray, - isUint16Array, - isUint32Array, - isInt8Array, - isInt16Array, - isInt32Array, - isBigInt64Array, - isBigUint64Array } = types; const { getOwnNonIndexProperties, @@ -126,38 +117,6 @@ function isEqualBoxedPrimitive(val1, val2) { assert.fail(`Unknown boxed type ${val1}`); } -function isIdenticalTypedArrayType(a, b) { - // Fast path to reduce type checks in the common case. - const check = types[`is${TypedArrayPrototypeGetSymbolToStringTag(a)}`]; - if (check !== undefined && check(a)) { - return check(b); - } - // Manipulated Symbol.toStringTag. - for (const check of [ - isUint16Array, - isUint32Array, - isInt8Array, - isInt16Array, - isInt32Array, - isFloat32Array, - isFloat64Array, - isBigInt64Array, - isBigUint64Array, - isUint8ClampedArray, - isUint8Array - ]) { - if (check(a)) { - return check(b); - } - } - /* c8 ignore next 4 */ - assert.fail( - 'Unknown TypedArray type checking ' + - `${TypedArrayPrototypeGetSymbolToStringTag(a)} ${a}\n` + - `and ${TypedArrayPrototypeGetSymbolToStringTag(b)} ${b}` - ); -} - // Notes: Type tags are historical [[Class]] properties that can be set by // FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS // and retrieved using Object.prototype.toString.call(obj) in JS @@ -241,8 +200,10 @@ function innerDeepEqual(val1, val2, strict, memos) { return false; } } else if (isArrayBufferView(val1)) { - if (!isIdenticalTypedArrayType(val1, val2)) + if (TypedArrayPrototypeGetSymbolToStringTag(val1) !== + TypedArrayPrototypeGetSymbolToStringTag(val2)) { return false; + } if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) { if (!areSimilarFloatArrays(val1, val2)) { return false; From 9b7d2c25238cdb4fed45151e967b6138b82c4986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 5 Jan 2021 08:02:28 +0100 Subject: [PATCH 087/161] test: guard large string decoder allocation Use common.enoughTestMem to avoid "Array buffer allocation failed" error on low memory devices. Fixes: https://github.com/nodejs/node/issues/36792 PR-URL: https://github.com/nodejs/node/pull/36795 Reviewed-By: Gireesh Punathil Reviewed-By: Pooja D P Reviewed-By: Antoine du Hamel --- test/parallel/test-string-decoder.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index 043816bdbb1568..be876f46e5af02 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -201,12 +201,14 @@ assert.throws( } ); -assert.throws( - () => new StringDecoder().write(Buffer.alloc(0x1fffffe8 + 1).fill('a')), - { - code: 'ERR_STRING_TOO_LONG', - } -); +if (common.enoughTestMem) { + assert.throws( + () => new StringDecoder().write(Buffer.alloc(0x1fffffe8 + 1).fill('a')), + { + code: 'ERR_STRING_TOO_LONG', + } + ); +} // Test verifies that StringDecoder will correctly decode the given input // buffer with the given encoding to the expected output. It will attempt all From b2c1aeb694011d1fe0583f73fa02ec8599ec6640 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 3 Jan 2021 06:32:51 -0800 Subject: [PATCH 088/161] doc: revise process.memoryUsage() text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some general edits, but also adding an explanation of why one might choose process.memoryUsage.rss() over process.memoryUsage().rss. PR-URL: https://github.com/nodejs/node/pull/36757 Reviewed-By: Gerhard Stöbich Reviewed-By: Michaël Zasso Reviewed-By: Gireesh Punathil Reviewed-By: Yash Ladha Reviewed-By: Daijiro Wachi --- doc/api/process.md | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index d7c91a840cbe08..5b6e4c5e99fead 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1575,26 +1575,19 @@ changes: * `external` {integer} * `arrayBuffers` {integer} -The `process.memoryUsage()` method returns an object describing the memory usage -of the Node.js process measured in bytes. - -For example, the code: +Returns an object describing the memory usage of the Node.js process measured in +bytes. ```js console.log(process.memoryUsage()); -``` - -Will generate: - - -```js -{ - rss: 4935680, - heapTotal: 1826816, - heapUsed: 650472, - external: 49879, - arrayBuffers: 9386 -} +// Prints: +// { +// rss: 4935680, +// heapTotal: 1826816, +// heapUsed: 650472, +// external: 49879, +// arrayBuffers: 9386 +// } ``` * `heapTotal` and `heapUsed` refer to V8's memory usage. @@ -1612,8 +1605,8 @@ Will generate: When using [`Worker`][] threads, `rss` will be a value that is valid for the entire process, while the other fields will only refer to the current thread. -The `process.memoryUsage()` method iterate over each page to gather -informations about memory usage which can be slow depending on the +The `process.memoryUsage()` method iterates over each page to gather +information about memory usage which might be slow depending on the program memory allocations. ## `process.memoryUsage.rss()` @@ -1630,7 +1623,8 @@ The Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the process, including all C++ and JavaScript objects and code. -This is the same value as the one returned by `process.memoryUsage()`. +This is the same value as the `rss` property provided by `process.memoryUsage()` +but `process.memoryUsage.rss()` is faster. ```js console.log(process.memoryUsage.rss()); From d48e00e5a30cc2f936209e586f2731ccdb811a17 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 3 Jan 2021 06:41:24 -0800 Subject: [PATCH 089/161] test: fix test-memory-usage.js for IBMi Newly added process.memoryUsage.rss() will presumably return 0 on IBMi the same way process.memoryUsage().rss does. Allow IBMi to skip the new assertion. The test was using a mix of `assert()` and `assert.ok()`. This change makes it consistently use `assert.ok()`. PR-URL: https://github.com/nodejs/node/pull/36758 Reviewed-By: Richard Lau Reviewed-By: Gireesh Punathil Reviewed-By: Daijiro Wachi Reviewed-By: Michael Dawson --- test/parallel/test-memory-usage.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index 609244f5fc07fc..8e5ea4de5bf587 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -26,8 +26,11 @@ const assert = require('assert'); const r = process.memoryUsage(); // On IBMi, the rss memory always returns zero -if (!common.isIBMi) +if (!common.isIBMi) { assert.ok(r.rss > 0); + assert.ok(process.memoryUsage.rss() > 0); +} + assert.ok(r.heapTotal > 0); assert.ok(r.heapUsed > 0); assert.ok(r.external > 0); @@ -39,10 +42,8 @@ if (r.arrayBuffers > 0) { const ab = new ArrayBuffer(size); const after = process.memoryUsage(); - assert(after.external - r.external >= size, - `${after.external} - ${r.external} >= ${size}`); + assert.ok(after.external - r.external >= size, + `${after.external} - ${r.external} >= ${size}`); assert.strictEqual(after.arrayBuffers - r.arrayBuffers, size, `${after.arrayBuffers} - ${r.arrayBuffers} === ${size}`); } - -assert(process.memoryUsage.rss() > 0); From 67dd48ed05cf31324035f39850d20f22ec087049 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Tue, 5 Jan 2021 16:45:29 +0100 Subject: [PATCH 090/161] doc: add panva to collaborators PR-URL: https://github.com/nodejs/node/pull/36802 Reviewed-By: Rich Trott Reviewed-By: Matteo Collina Reviewed-By: Richard Lau --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9b41c451da114e..466b9ac23309ea 100644 --- a/README.md +++ b/README.md @@ -371,6 +371,8 @@ For information about the governance of the Node.js project, see **Ali Ijaz Sheikh** <ofrobots@google.com> (he/him) * [oyyd](https://github.com/oyyd) - **Ouyang Yadong** <oyydoibh@gmail.com> (he/him) +* [panva](https://github.com/panva) - +**Filip Skokan** <panva.ip@gmail.com> * [PoojaDurgad](https://github.com/PoojaDurgad) - **Pooja D P** <Pooja.D.P@ibm.com> (she/her) * [psmarshall](https://github.com/psmarshall) - From b996e3b4b58b8d16846f86acb0098826de0e03f5 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Tue, 29 Dec 2020 15:20:41 +0100 Subject: [PATCH 091/161] stream: do not use _stream_* anymore Remove all leftover usage of _stream_* and keep all of them as legacy. We do not deprecate the old modules to avoid disrupition and ease maintainance. PR-URL: https://github.com/nodejs/node/pull/36684 Reviewed-By: Robert Nagy Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- lib/_stream_duplex.js | 5 ++--- lib/_stream_passthrough.js | 5 ++--- lib/_stream_readable.js | 5 ++--- lib/_stream_transform.js | 5 ++--- lib/_stream_writable.js | 5 ++--- test/parallel/test-stream-aliases-legacy.js | 14 ++++++++++++++ test/parallel/test-stream-pipe-after-end.js | 3 +-- test/parallel/test-stream-pipe-needDrain.js | 3 +-- .../test-stream2-base64-single-char-read-end.js | 3 +-- test/parallel/test-stream2-basic.js | 3 +-- test/parallel/test-stream2-compatibility.js | 3 +-- test/parallel/test-stream2-decode-partial.js | 2 +- test/parallel/test-stream2-objects.js | 3 +-- test/parallel/test-stream2-readable-from-list.js | 2 +- .../test-stream2-readable-non-empty-end.js | 2 +- .../parallel/test-stream2-readable-wrap-destroy.js | 2 +- test/parallel/test-stream2-readable-wrap-empty.js | 2 +- test/parallel/test-stream2-readable-wrap-error.js | 2 +- test/parallel/test-stream2-readable-wrap.js | 3 +-- test/parallel/test-stream2-set-encoding.js | 2 +- test/parallel/test-stream2-transform.js | 3 +-- test/parallel/test-stream2-writable.js | 3 +-- 22 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 test/parallel/test-stream-aliases-legacy.js diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index 9e46d02ddcb3d3..c32d589ae196fd 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -1,6 +1,5 @@ 'use strict'; -// TODO(mcollina): deprecate this file +// Keep this file as an alias for the full stream module. -const Duplex = require('internal/streams/duplex'); -module.exports = Duplex; +module.exports = require('stream').Duplex; diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js index dbf8646e009931..f1c775202805ef 100644 --- a/lib/_stream_passthrough.js +++ b/lib/_stream_passthrough.js @@ -1,6 +1,5 @@ 'use strict'; -// TODO(mcollina): deprecate this file +// Keep this file as an alias for the full stream module. -const PassThrough = require('internal/streams/passthrough'); -module.exports = PassThrough; +module.exports = require('stream').PassThrough; diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index c31dde30645726..4729e7fde3e393 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -1,6 +1,5 @@ 'use strict'; -// TODO(mcollina): deprecate this file +// Keep this file as an alias for the full stream module. -const Readable = require('internal/streams/readable'); -module.exports = Readable; +module.exports = require('stream').Readable; diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 50150638d9db8c..4901f296692d11 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -1,6 +1,5 @@ 'use strict'; -// TODO(mcollina): deprecate this file +// Keep this file as an alias for the full stream module. -const Transform = require('internal/streams/transform'); -module.exports = Transform; +module.exports = require('stream').Transform; diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index e328a9434c85a9..d6f1974422d3f3 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -1,6 +1,5 @@ 'use strict'; -// TODO(mcollina): deprecate this file +// Keep this file as an alias for the full stream module. -const Writable = require('internal/streams/writable'); -module.exports = Writable; +module.exports = require('stream').Writable; diff --git a/test/parallel/test-stream-aliases-legacy.js b/test/parallel/test-stream-aliases-legacy.js new file mode 100644 index 00000000000000..2c87f0ad0fa4a4 --- /dev/null +++ b/test/parallel/test-stream-aliases-legacy.js @@ -0,0 +1,14 @@ +'use strict'; + +require('../common'); + +const assert = require('assert'); +const stream = require('stream'); + +// Verify that all individual aliases are left in place. + +assert.strictEqual(stream.Readable, require('_stream_readable')); +assert.strictEqual(stream.Writable, require('_stream_writable')); +assert.strictEqual(stream.Duplex, require('_stream_duplex')); +assert.strictEqual(stream.Transform, require('_stream_transform')); +assert.strictEqual(stream.PassThrough, require('_stream_passthrough')); diff --git a/test/parallel/test-stream-pipe-after-end.js b/test/parallel/test-stream-pipe-after-end.js index 2eb714b2ca7d3e..045d27e0855374 100644 --- a/test/parallel/test-stream-pipe-after-end.js +++ b/test/parallel/test-stream-pipe-after-end.js @@ -22,8 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const Readable = require('_stream_readable'); -const Writable = require('_stream_writable'); +const { Readable, Writable } = require('stream'); class TestReadable extends Readable { constructor(opt) { diff --git a/test/parallel/test-stream-pipe-needDrain.js b/test/parallel/test-stream-pipe-needDrain.js index 0836c81da22438..7faf45417a5f4a 100644 --- a/test/parallel/test-stream-pipe-needDrain.js +++ b/test/parallel/test-stream-pipe-needDrain.js @@ -2,8 +2,7 @@ const common = require('../common'); const assert = require('assert'); -const Readable = require('_stream_readable'); -const Writable = require('_stream_writable'); +const { Readable, Writable } = require('stream'); // Pipe should pause temporarily if writable needs drain. { diff --git a/test/parallel/test-stream2-base64-single-char-read-end.js b/test/parallel/test-stream2-base64-single-char-read-end.js index 10259e280454c0..2e1eb15f9fd010 100644 --- a/test/parallel/test-stream2-base64-single-char-read-end.js +++ b/test/parallel/test-stream2-base64-single-char-read-end.js @@ -21,8 +21,7 @@ 'use strict'; require('../common'); -const R = require('_stream_readable'); -const W = require('_stream_writable'); +const { Readable: R, Writable: W } = require('stream'); const assert = require('assert'); const src = new R({ encoding: 'base64' }); diff --git a/test/parallel/test-stream2-basic.js b/test/parallel/test-stream2-basic.js index 7121f7bda75b02..862e45417626c8 100644 --- a/test/parallel/test-stream2-basic.js +++ b/test/parallel/test-stream2-basic.js @@ -22,8 +22,7 @@ 'use strict'; const common = require('../common'); -const R = require('_stream_readable'); -const W = require('_stream_writable'); +const { Readable: R, Writable: W } = require('stream'); const assert = require('assert'); const EE = require('events').EventEmitter; diff --git a/test/parallel/test-stream2-compatibility.js b/test/parallel/test-stream2-compatibility.js index bd0314ec1a9918..d760db8b32271c 100644 --- a/test/parallel/test-stream2-compatibility.js +++ b/test/parallel/test-stream2-compatibility.js @@ -21,8 +21,7 @@ 'use strict'; require('../common'); -const R = require('_stream_readable'); -const W = require('_stream_writable'); +const { Readable: R, Writable: W } = require('stream'); const assert = require('assert'); let ondataCalled = 0; diff --git a/test/parallel/test-stream2-decode-partial.js b/test/parallel/test-stream2-decode-partial.js index 9b1baf7fd677f4..9d9ae21bfec7ae 100644 --- a/test/parallel/test-stream2-decode-partial.js +++ b/test/parallel/test-stream2-decode-partial.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); -const Readable = require('_stream_readable'); +const { Readable } = require('stream'); const assert = require('assert'); let buf = ''; diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index f58ea4a32a1e7d..a6723daca6c761 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -22,8 +22,7 @@ 'use strict'; const common = require('../common'); -const Readable = require('_stream_readable'); -const Writable = require('_stream_writable'); +const { Readable, Writable } = require('stream'); const assert = require('assert'); function toArray(callback) { diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index 6564a01691f09e..d5d113304e4925 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -23,7 +23,7 @@ 'use strict'; require('../common'); const assert = require('assert'); -const fromList = require('_stream_readable')._fromList; +const fromList = require('stream').Readable._fromList; const BufferList = require('internal/streams/buffer_list'); const util = require('util'); diff --git a/test/parallel/test-stream2-readable-non-empty-end.js b/test/parallel/test-stream2-readable-non-empty-end.js index ba289fb91275e3..417f2c3b0e92e3 100644 --- a/test/parallel/test-stream2-readable-non-empty-end.js +++ b/test/parallel/test-stream2-readable-non-empty-end.js @@ -22,7 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const Readable = require('_stream_readable'); +const { Readable } = require('stream'); let len = 0; const chunks = new Array(10); diff --git a/test/parallel/test-stream2-readable-wrap-destroy.js b/test/parallel/test-stream2-readable-wrap-destroy.js index b0f4714c741202..e310ae09e6ff53 100644 --- a/test/parallel/test-stream2-readable-wrap-destroy.js +++ b/test/parallel/test-stream2-readable-wrap-destroy.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -const Readable = require('_stream_readable'); +const { Readable } = require('stream'); const EE = require('events').EventEmitter; const oldStream = new EE(); diff --git a/test/parallel/test-stream2-readable-wrap-empty.js b/test/parallel/test-stream2-readable-wrap-empty.js index 1489717f3e49c3..3dbbdaa9b5afbf 100644 --- a/test/parallel/test-stream2-readable-wrap-empty.js +++ b/test/parallel/test-stream2-readable-wrap-empty.js @@ -22,7 +22,7 @@ 'use strict'; const common = require('../common'); -const Readable = require('_stream_readable'); +const { Readable } = require('stream'); const EE = require('events').EventEmitter; const oldStream = new EE(); diff --git a/test/parallel/test-stream2-readable-wrap-error.js b/test/parallel/test-stream2-readable-wrap-error.js index a05ae8179b06ef..2d2c26e2cadc46 100644 --- a/test/parallel/test-stream2-readable-wrap-error.js +++ b/test/parallel/test-stream2-readable-wrap-error.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -const Readable = require('_stream_readable'); +const { Readable } = require('stream'); const EE = require('events').EventEmitter; class LegacyStream extends EE { diff --git a/test/parallel/test-stream2-readable-wrap.js b/test/parallel/test-stream2-readable-wrap.js index 69f055fd7e535e..eebe72bc0dd8ad 100644 --- a/test/parallel/test-stream2-readable-wrap.js +++ b/test/parallel/test-stream2-readable-wrap.js @@ -22,8 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const Readable = require('_stream_readable'); -const Writable = require('_stream_writable'); +const { Readable, Writable } = require('stream'); const EE = require('events').EventEmitter; function runTest(highWaterMark, objectMode, produce) { diff --git a/test/parallel/test-stream2-set-encoding.js b/test/parallel/test-stream2-set-encoding.js index 0095fa544db114..2d35b161bf0143 100644 --- a/test/parallel/test-stream2-set-encoding.js +++ b/test/parallel/test-stream2-set-encoding.js @@ -22,7 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const R = require('_stream_readable'); +const { Readable: R } = require('stream'); class TestReader extends R { constructor(n, opts) { diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index ad9e1a2237bd72..fe27c1c1b6ddcf 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -22,8 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const PassThrough = require('_stream_passthrough'); -const Transform = require('_stream_transform'); +const { PassThrough, Transform } = require('stream'); { // Verify writable side consumption diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index 03835bb1bd0465..3d16fb62df3313 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -22,8 +22,7 @@ 'use strict'; const common = require('../common'); -const W = require('_stream_writable'); -const D = require('_stream_duplex'); +const { Writable: W, Duplex: D } = require('stream'); const assert = require('assert'); class TestWriter extends W { From baa8064bd004669f6d979391c9297514fc753f2e Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Sat, 2 Jan 2021 12:22:49 +0530 Subject: [PATCH 092/161] util: refactor inspect.js to use more primodials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36730 Reviewed-By: Michaël Zasso Reviewed-By: Rich Trott Reviewed-By: Antoine du Hamel Reviewed-By: Trivikram Kamat Reviewed-By: Pooja D P --- lib/internal/util/inspect.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 2672ccb50bfa1c..b03380030a6be5 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -4,6 +4,7 @@ const { Array, ArrayIsArray, ArrayPrototypeFilter, + ArrayPrototypeForEach, ArrayPrototypePush, ArrayPrototypeSort, ArrayPrototypeUnshift, @@ -462,12 +463,13 @@ function strEscape(str) { // instead wrap the text in double quotes. If double quotes exist, check for // backticks. If they do not exist, use those as fallback instead of the // double quotes. - if (str.includes("'")) { + if (StringPrototypeIncludes(str, "'")) { // This invalidates the charCode and therefore can not be matched for // anymore. - if (!str.includes('"')) { + if (!StringPrototypeIncludes(str, '"')) { singleQuote = -1; - } else if (!str.includes('`') && !str.includes('${')) { + } else if (!StringPrototypeIncludes(str, '`') && + !StringPrototypeIncludes(str, '${')) { singleQuote = -2; } if (singleQuote !== 39) { @@ -488,7 +490,7 @@ function strEscape(str) { let last = 0; const lastIndex = str.length; for (let i = 0; i < lastIndex; i++) { - const point = str.charCodeAt(i); + const point = StringPrototypeCharCodeAt(str, i); if (point === singleQuote || point === 92 || point < 32 || @@ -609,13 +611,13 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) { if (depth === 0) { keySet = new SafeSet(); } else { - keys.forEach((key) => keySet.add(key)); + ArrayPrototypeForEach(keys, (key) => keySet.add(key)); } // Get all own property names and symbols. keys = ObjectGetOwnPropertyNames(obj); const symbols = ObjectGetOwnPropertySymbols(obj); if (symbols.length !== 0) { - keys.push(...symbols); + ArrayPrototypePush(keys, ...symbols); } for (const key of keys) { // Ignore the `constructor` property and keys that exist on layers above. @@ -632,9 +634,9 @@ function addPrototypeProperties(ctx, main, obj, recurseTimes, output) { ctx, obj, recurseTimes, key, kObjectType, desc, main); if (ctx.colors) { // Faint! - output.push(`\u001b[2m${value}\u001b[22m`); + ArrayPrototypePush(output, `\u001b[2m${value}\u001b[22m`); } else { - output.push(value); + ArrayPrototypePush(output, value); } } // Limit the inspection to up to three prototype layers. Using `recurseTimes` From fad07d5439e2aa63e69c9eb53350a69e82150e47 Mon Sep 17 00:00:00 2001 From: Mohamed Kamagate Date: Tue, 5 Jan 2021 04:25:54 -0800 Subject: [PATCH 093/161] doc: fix typo in esm documentation PR-URL: https://github.com/nodejs/node/pull/36800 Reviewed-By: Gireesh Punathil Reviewed-By: Beth Griggs Reviewed-By: Antoine du Hamel Reviewed-By: Richard Lau Reviewed-By: Pooja D P --- doc/api/esm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index 17879fda4244bd..6d968c15530fb0 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -316,7 +316,7 @@ compatibility. The CommonJS module `require` always treats the files it references as CommonJS. Using `require` to load an ES module is not supported because ES modules have -asynchronous execution. Instead, use use [`import()`][] to load an ES module +asynchronous execution. Instead, use [`import()`][] to load an ES module from a CommonJS module. ### CommonJS Namespaces From 6db465a99fbfd62ad1307a01ebbd8a1c84b3de11 Mon Sep 17 00:00:00 2001 From: Alba Mendez Date: Sat, 26 Dec 2020 21:15:28 +0100 Subject: [PATCH 094/161] doc: clarify that N-API addons are context-aware The docs on N-API say that NAPI_MODULE_INIT must be used for the addon to be context-aware. That seems to be wrong, i.e. all N-API addons are context-aware(?) PR-URL: https://github.com/nodejs/node/pull/36640 Reviewed-By: Franziska Hinkelmann Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen Reviewed-By: Gabriel Schulhof Reviewed-By: Michael Dawson --- doc/api/n-api.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 9ad15223f11da7..82bf1897b4951d 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -1853,8 +1853,8 @@ napi_value Init(napi_env env, napi_value exports) { } ``` -If the module will be loaded multiple times during the lifetime of the Node.js -process, use the `NAPI_MODULE_INIT` macro to initialize the module: +You can also use the `NAPI_MODULE_INIT` macro, which acts as a shorthand +for `NAPI_MODULE` and defining an `Init` function: ```c NAPI_MODULE_INIT() { @@ -1871,13 +1871,9 @@ NAPI_MODULE_INIT() { } ``` -This macro includes `NAPI_MODULE`, and declares an `Init` function with a -special name and with visibility beyond the addon. This will allow Node.js to -initialize the module even if it is loaded multiple times. - -There are a few design considerations when declaring a module that may be loaded -multiple times. The documentation of [context-aware addons][] provides more -details. +All N-API addons are context-aware, meaning they may be loaded multiple +times. There are a few design considerations when declaring such a module. +The documentation on [context-aware addons][] provides more details. The variables `env` and `exports` will be available inside the function body following the macro invocation. From ff3946455917e6298b6cd38e484d1782efb51d4e Mon Sep 17 00:00:00 2001 From: Beth Griggs Date: Tue, 5 Jan 2021 12:02:16 +0000 Subject: [PATCH 095/161] doc: add OpenSSL CVE fix to notable changes in v15.5.0 PR-URL: https://github.com/nodejs/node/pull/36798 Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins Reviewed-By: Filip Skokan Reviewed-By: Rich Trott --- doc/changelogs/CHANGELOG_V15.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/changelogs/CHANGELOG_V15.md b/doc/changelogs/CHANGELOG_V15.md index 0b575a984458d6..8a9b03c98913b7 100644 --- a/doc/changelogs/CHANGELOG_V15.md +++ b/doc/changelogs/CHANGELOG_V15.md @@ -77,6 +77,12 @@ Vulnerabilities fixed: ### Notable Changes +#### OpenSSL-1.1.1i + +OpenSSL-1.1.1i contains a fix for CVE-2020-1971: OpenSSL - EDIPARTYNAME NULL pointer de-reference (High). This is a vulnerability in OpenSSL which may be exploited through Node.js. You can read more about it in https://www.openssl.org/news/secadv/20201208.txt + +Contributed by Myles Borins [#36520](https://github.com/nodejs/node/pull/36520). + #### Extended support for `AbortSignal` in child_process and stream The following APIs now support an `AbortSignal` in their options object: From 1f2a198c320c6c76d2082f0dce9b0d5e659146ea Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 4 Jan 2021 15:44:48 +0000 Subject: [PATCH 096/161] tools: fix md5 hash for ICU 68.1 src MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct md5sum hash for the tarball version of the ICU 68.1 source. The previously recorded md5sum hash was for the zip version. PR-URL: https://github.com/nodejs/node/pull/36777 Fixes: https://github.com/nodejs/node/issues/36776 Reviewed-By: Michaël Zasso Reviewed-By: Beth Griggs Reviewed-By: Michael Dawson Reviewed-By: Rich Trott Reviewed-By: Myles Borins --- tools/icu/current_ver.dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/icu/current_ver.dep b/tools/icu/current_ver.dep index a73a4b1117ede6..b4caab129071e1 100644 --- a/tools/icu/current_ver.dep +++ b/tools/icu/current_ver.dep @@ -1,6 +1,6 @@ [ { "url": "https://github.com/unicode-org/icu/releases/download/release-68-1/icu4c-68_1-src.tgz", - "md5": "fd03b2d916dcadd3711b4c4a100a1713" + "md5": "6a99b541ea01f271257b121a4433c7c0" } ] From ef628891f7254de9196e62ae9a6893306f144383 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 2 Jan 2021 06:15:38 -0800 Subject: [PATCH 097/161] doc: revise exit() and run() text in async_hooks.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit for brevity and clarity. Use present tense where possible. PR-URL: https://github.com/nodejs/node/pull/36738 Reviewed-By: Andrey Pechkurov Reviewed-By: Gerhard Stöbich --- doc/api/async_hooks.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 464d0de9e00d11..9a46b41d7f4b59 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -1100,12 +1100,10 @@ This methods runs a function synchronously within a context and return its return value. The store is not accessible outside of the callback function or the asynchronous operations created within the callback. -Optionally, arguments can be passed to the function. They will be passed to -the callback function. +The optional `args` are passed to the callback function. -If the callback function throws an error, it will be thrown by `run` too. -The stacktrace will not be impacted by this call and the context will -be exited. +If the callback function throws an error, the error is thrown by `run()` too. +The stacktrace is not impacted by this call and the context is exited. Example: @@ -1137,12 +1135,10 @@ return value. The store is not accessible within the callback function or the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. -Optionally, arguments can be passed to the function. They will be passed to -the callback function. +The optional `args` are passed to the callback function. -If the callback function throws an error, it will be thrown by `exit` too. -The stacktrace will not be impacted by this call and the context will be -re-entered. +If the callback function throws an error, the error is thrown by `exit()` too. +The stacktrace is not impacted by this call and the context is re-entered. Example: From cc28d2f541a30e127b4a56e32190504f478b9fd9 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 30 Dec 2020 13:02:27 +0100 Subject: [PATCH 098/161] http: set lifo as the default scheduling strategy in Agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/36685 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: Robert Nagy Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Daijiro Wachi Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott --- doc/api/http.md | 5 ++++- lib/_http_agent.js | 2 +- test/parallel/test-http-agent-scheduling.js | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index adabc4260b7114..368eefb76fa80b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -113,6 +113,9 @@ http.get({ Creates a new instance of `AsyncLocalStorage`. Store is only provided within a -`run` or after `enterWith` method call. +`run()` call or after an `enterWith()` call. ### `asyncLocalStorage.disable()` -This method disables the instance of `AsyncLocalStorage`. All subsequent calls +Disables the instance of `AsyncLocalStorage`. All subsequent calls to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. @@ -1031,7 +1031,7 @@ Calling `asyncLocalStorage.disable()` is required before the provided by the `asyncLocalStorage`, as those objects are garbage collected along with the corresponding async resources. -This method is to be used when the `asyncLocalStorage` is not in use anymore +Use this method when the `asyncLocalStorage` is not in use anymore in the current process. ### `asyncLocalStorage.getStore()` @@ -1043,10 +1043,10 @@ added: * Returns: {any} -This method returns the current store. -If this method is called outside of an asynchronous context initialized by -calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it will -return `undefined`. +Returns the current store. +If called outside of an asynchronous context initialized by +calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it +returns `undefined`. ### `asyncLocalStorage.enterWith(store)` + +* `options` {Object} + * `disableEntropyCache` {boolean} By default, to improve performance, + Node.js will pre-emptively generate and persistently cache enough + random data to generate up to 128 random UUIDs. To generate a UUID + without using the cache, set `disableEntropyCache` to `true`. + **Defaults**: `false`. +* Returns: {string} + +Generates a random [RFC 4122][] Version 4 UUID. + ### `crypto.scrypt(password, salt, keylen[, options], callback)` + +Encapsulates an X509 certificate and provides read-only access to +it's information. + +```js +const { X509Certificate } = require('crypto'); + +const x509 = new X509Certificate('{... pem encoded cert ...}'); + +console.log(x509.subject); +``` + +### `new X509Certificate(buffer)` + + +* `buffer` {string|TypedArray|Buffer|DataView} A PEM or DER encoded + X509 Certificate. + +### `x509.ca` + + +* Type: {boolean} Will be `true` if this is a Certificate Authority (ca) + certificate. + +### `x509.checkEmail(email[, options])` + + +* `email` {string} +* `options` {Object} + * `subject` {string} `'always'` or `'never'`. **Defaults**: `'always'`. + * `wildcards` {boolean} **Defaults**: `true`. + * `partialWildcards` {boolean} **Defaults**: `true`. + * `multiLabelWildcards` {boolean} **Defaults**: `false`. + * `singleLabelSubdomains` {boolean} **Defaults**: `false`. +* Returns: {string|undefined} Returns `email` if the certificate matches, + `undefined` if it does not. + +Checks whether the certificate matches the given email address. + +### `x509.checkHost(name[, options])` + + +* `name` {string} +* `options` {Object} + * `subject` {string} `'always'` or `'never'`. **Defaults**: `'always'`. + * `wildcards` {boolean} **Defaults**: `true`. + * `partialWildcards` {boolean} **Defaults**: `true`. + * `multiLabelWildcards` {boolean} **Defaults**: `false`. + * `singleLabelSubdomains` {boolean} **Defaults**: `false`. +* Returns: {string|undefined} Returns `name` if the certificate matches, + `undefined` if it does not. + +Checks whether the certificate matches the given host name. + +### `x509.checkIP(ip[, options])` + + +* `ip` {string} +* `options` {Object} + * `subject` {string} `'always'` or `'never'`. **Defaults**: `'always'`. + * `wildcards` {boolean} **Defaults**: `true`. + * `partialWildcards` {boolean} **Defaults**: `true`. + * `multiLabelWildcards` {boolean} **Defaults**: `false`. + * `singleLabelSubdomains` {boolean} **Defaults**: `false`. +* Returns: {string|undefined} Returns `ip` if the certificate matches, + `undefined` if it does not. + +Checks whether the certificate matches the given IP address (IPv4 or IPv6). + +### `x509.checkIssued(otherCert)` + + +* `otherCert` {X509Certificate} +* Returns: {boolean} + +Checks whether this certificate was issued by the given `otherCert`. + +### `x509.checkPrivateKey(privateKey)` + + +* `privateKey` {KeyObject} A private key. +* Returns: {boolean} + +Checks whether the public key for this certificate is consistent with +the given private key. + +### `x509.fingerprint` + + +* Type: {string} + +The SHA-1 fingerprint of this certificate. + +### `x509.fingerprint256` + + +* Type: {string} + +The SHA-256 fingerprint of this certificate. + +### `x509.infoAccess` + + +* Type: {string} + +The information access content of this certificate. + +### `x509.issuer` + + +* Type: {string} + +The issuer identification included in this certificate. + +### `x509.keyUsage` + + +* Type: {string[]} + +An array detailing the key usages for this certificate. + +### `x509.publicKey` + + +* Type: {KeyObject} + +The public key {KeyObject} for this certificate. + +### `x509.raw` + + +* Type: {Buffer} + +A `Buffer` containing the DER encoding of this certificate. + +### `x509.serialNumber` + + +* Type: {string} + +The serial number of this certificate. + +### `x509.subject` + + +* Type: {string} + +The complete subject of this certificate. + +### `x509.subjectAltName` + + +* Type: {string} + +The subject alternative name specified for this certificate. + +### `x509.toJSON()` + + +* Type: {string} + +There is no standard JSON encoding for X509 certificates. The +`toJSON()` method returns a string containing the PEM encoded +certificate. + +### `x509.toLegacyObject()` + + +* Type: {Object} + +Returns information about this certificate using the legacy +[certificate object][] encoding. + +### `x509.toString()` + + +* Type: {string} + +Returns the PEM-encoded certificate. + +### `x509.validFrom` + + +* Type: {string} + +The date/time from which this certificate is considered valid. + +### `x509.validTo` + + +* Type: {string} + +The date/time until which this certificate is considered valid. + +### `x509.verify(publicKey)` + + +* `publicKey` {KeyObject} A public key. +* Returns: {boolean} + +Verifies that this certificate was signed by the given public key. +Does not perform any other validation checks on the certificate. + ## `crypto` module methods and properties ### `crypto.constants` @@ -3997,6 +4250,7 @@ See the [list of SSL OP Flags][] for details. [`util.promisify()`]: util.md#util_util_promisify_original [`verify.update()`]: #crypto_verify_update_data_inputencoding [`verify.verify()`]: #crypto_verify_verify_object_signature_signatureencoding +[certificate object]: tls.md#tls_certificate_object [encoding]: buffer.md#buffer_buffers_and_character_encodings [initialization vector]: https://en.wikipedia.org/wiki/Initialization_vector [list of SSL OP Flags]: https://wiki.openssl.org/index.php/List_of_SSL_OP_Flags#Table_of_Options diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index e745b5aa799319..f7dfea6b9eaa07 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -474,6 +474,9 @@ are part of the channel. $/, ''); - // js-yaml.safeLoad() throws on error. - const meta = yaml.safeLoad(text); + // js-yaml.load() throws on error. + const meta = yaml.load(text); if (meta.added) { // Since semver-minors can trickle down to previous major versions, diff --git a/tools/doc/package-lock.json b/tools/doc/package-lock.json index 40c07c350b3e24..e93d935aece6c1 100644 --- a/tools/doc/package-lock.json +++ b/tools/doc/package-lock.json @@ -11,8 +11,8 @@ "node-doc-generator": "generate.js" }, "devDependencies": { - "highlight.js": "10.4.1", - "js-yaml": "3.14.0", + "highlight.js": "10.5.0", + "js-yaml": "4.0.0", "rehype-raw": "5.0.0", "rehype-stringify": "8.0.0", "remark-gfm": "^1.0.0", @@ -22,7 +22,7 @@ "to-vfile": "6.1.0", "unified": "9.2.0", "unist-util-find": "^1.0.2", - "unist-util-select": "3.0.3", + "unist-util-select": "3.0.4", "unist-util-visit": "2.0.3" }, "engines": { @@ -60,13 +60,10 @@ "dev": true }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/bail": { "version": "1.0.5", @@ -167,19 +164,6 @@ } } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -345,9 +329,9 @@ } }, "node_modules/highlight.js": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.4.1.tgz", - "integrity": "sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.5.0.tgz", + "integrity": "sha512-xTmvd9HiIHR6L53TMC7TKolEj65zG1XU+Onr8oi86mYa+nLcIbxTTWkpW7CsEwv/vK7u1zb8alZIMLDqqN6KTw==", "dev": true, "engines": { "node": "*" @@ -446,13 +430,12 @@ } }, "node_modules/js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -501,41 +484,33 @@ } }, "node_modules/mdast-util-from-markdown": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.1.tgz", - "integrity": "sha512-qJXNcFcuCSPqUF0Tb0uYcFDIq67qwB3sxo9RPdf9vG8T90ViKnksFqdB/Coq2a7sTnxL/Ify2y7aIQXDkQFH0w==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz", + "integrity": "sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw==", "dev": true, "dependencies": { "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^1.0.0", - "micromark": "~2.10.0", - "parse-entities": "^2.0.0" + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-from-markdown/node_modules/mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/mdast-util-gfm": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.0.tgz", - "integrity": "sha512-HLfygQL6HdhJhFbLta4Ki9hClrzyAxRjyRvpm5caN65QZL+NyHPmqFlnF9vm1Rn58JT2+AbLwNcEDY4MEvkk8Q==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.1.tgz", + "integrity": "sha512-oE1W1zSXU2L2LHg91V22HC3Z1fbsOZTBYUQq+kpM29f9297TbRm0C1l3bQ88RREl0WaUQaB49G7trvwy5utUKQ==", "dev": true, "dependencies": { "mdast-util-gfm-autolink-literal": "^0.1.0", "mdast-util-gfm-strikethrough": "^0.2.0", "mdast-util-gfm-table": "^0.1.0", - "mdast-util-gfm-task-list-item": "^0.1.0" + "mdast-util-gfm-task-list-item": "^0.1.0", + "mdast-util-to-markdown": "^0.6.1" }, "funding": { "type": "opencollective", @@ -543,9 +518,9 @@ } }, "node_modules/mdast-util-gfm-autolink-literal": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.1.tgz", - "integrity": "sha512-gJ2xSpqKCetSr22GEWpZH3f5ffb4pPn/72m4piY0v7T/S+O7n7rw+sfoPLhb2b4O7WdnERoYdALRcmD68FMtlw==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.2.tgz", + "integrity": "sha512-WFeIrcNNsfBety0gyWuiBIPing9UkVcl/m2iZOyW1uHEH2evjFocet2h77M24ub0WyZ4ucnQn/jWhO5Ozl6j4g==", "dev": true, "funding": { "type": "opencollective", @@ -553,12 +528,12 @@ } }, "node_modules/mdast-util-gfm-strikethrough": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.2.tgz", - "integrity": "sha512-T37ZbaokJcRbHROXmoVAieWnesPD5N21tv2ifYzaGRLbkh1gknItUGhZzHefUn5Zc/eaO/iTDSAFOBrn/E8kWw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz", + "integrity": "sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA==", "dev": true, "dependencies": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "^0.6.0" }, "funding": { "type": "opencollective", @@ -566,13 +541,13 @@ } }, "node_modules/mdast-util-gfm-table": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.4.tgz", - "integrity": "sha512-T4xFSON9kUb/IpYA5N+KGWcsdGczAvILvKiXQwUGind6V9fvjPCR9yhZnIeaLdBWXaz3m/Gq77ZtuLMjtFR4IQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz", + "integrity": "sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ==", "dev": true, "dependencies": { "markdown-table": "^2.0.0", - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" }, "funding": { "type": "opencollective", @@ -580,12 +555,12 @@ } }, "node_modules/mdast-util-gfm-task-list-item": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.5.tgz", - "integrity": "sha512-6O0bt34r+e7kYjeSwedhjDPYraspKIYKbhvhQEEioL7gSmXDxhN7WQW2KoxhVMpNzjNc03yC7K5KH6NHlz2jOA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz", + "integrity": "sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A==", "dev": true, "dependencies": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" }, "funding": { "type": "opencollective", @@ -593,9 +568,9 @@ } }, "node_modules/mdast-util-to-hast": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz", - "integrity": "sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.1.1.tgz", + "integrity": "sha512-+hvJrYiUgK2aY0Q1h1LaHQ4h0P7VVumWdAcUuG9k49lYglyU9GtTrA4O8hMh5gRnyT22wC15takM2qrrlpvNxQ==", "dev": true, "dependencies": { "@types/mdast": "^3.0.0", @@ -613,9 +588,9 @@ } }, "node_modules/mdast-util-to-markdown": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.5.4.tgz", - "integrity": "sha512-0jQTkbWYx0HdEA/h++7faebJWr5JyBoBeiRf0u3F4F3QtnyyGaWIsOwo749kRb1ttKrLLr+wRtOkfou9yB0p6A==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.2.tgz", + "integrity": "sha512-iRczns6WMvu0hUw02LXsPDJshBIwtUPbvHBWo19IQeU0YqmzlA8Pd30U8V7uiI0VPkxzS7A/NXBXH6u+HS87Zg==", "dev": true, "dependencies": { "@types/unist": "^2.0.0", @@ -647,9 +622,9 @@ "dev": true }, "node_modules/micromark": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz", - "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.2.tgz", + "integrity": "sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ==", "dev": true, "funding": [ { @@ -667,12 +642,12 @@ } }, "node_modules/micromark-extension-gfm": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.1.tgz", - "integrity": "sha512-lJlhcOqzoJdjQg+LMumVHdUQ61LjtqGdmZtrAdfvatRUnJTqZlRwXXHdLQgNDYlFw4mycZ4NSTKlya5QcQXl1A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.2.tgz", + "integrity": "sha512-ToQEpLkRgg7Tp8D3GM/SjZFPV0cCwWNxZmoEVIOQivOswRtPg7gg2WlCrtHhUWFNX+DgDjbq0iLOPGp4Y15oug==", "dev": true, "dependencies": { - "micromark": "~2.10.0", + "micromark": "~2.11.0", "micromark-extension-gfm-autolink-literal": "~0.5.0", "micromark-extension-gfm-strikethrough": "~0.6.0", "micromark-extension-gfm-table": "~0.4.0", @@ -685,12 +660,12 @@ } }, "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.1.tgz", - "integrity": "sha512-j30923tDp0faCNDjwqe4cMi+slegbGfc3VEAExEU8d54Q/F6pR6YxCVH+6xV0ItRoj3lCn1XkUWcy6FC3S9BOw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.4.tgz", + "integrity": "sha512-471VKd4k3SiX7vx9fC+IYeGQL0RnxwBBXeEc5WConb7naJDG5m16guA+VoFzyXchrvmU08t0dUWWPZ0mkJSXVw==", "dev": true, "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -698,12 +673,12 @@ } }, "node_modules/micromark-extension-gfm-strikethrough": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.2.tgz", - "integrity": "sha512-aehEEqtTn3JekJNwZZxa7ZJVfzmuaWp4ew6x6sl3VAKIwdDZdqYeYSQIrNKwNgH7hX0g56fAwnSDLusJggjlCQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.3.tgz", + "integrity": "sha512-MKMoP9x2dsr1aeX46ibBwVf4Q6nJsi5aaUFTOMOID5VOLSxwl4CrqUV4OGFQd6AqhtzBJAxaV+N2trlTBtZDNQ==", "dev": true, "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -711,12 +686,12 @@ } }, "node_modules/micromark-extension-gfm-table": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.1.tgz", - "integrity": "sha512-xVpqOnfFaa2OtC/Y7rlt4tdVFlUHdoLH3RXAZgb/KP3DDyKsAOx6BRS3UxiiyvmD/p2l6VUpD4bMIniuP4o4JA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.2.tgz", + "integrity": "sha512-AAzmj85XO1ydHYX0Lz52HGhcH2sZLm2AVvkwzELXWgZF6vGdq5yZ3CTByFRsqNUPyQBSIYFKLDAtc6KlnO42aw==", "dev": true, "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -734,12 +709,12 @@ } }, "node_modules/micromark-extension-gfm-task-list-item": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.2.tgz", - "integrity": "sha512-cm8lYS10YAqeXE9B27TK3u1Ihumo3H9p/3XumT+jp8vSuSbSpFIJe0bDi2kq4YAAIxtcTzUOxhEH4ko2/NYDkQ==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz", + "integrity": "sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ==", "dev": true, "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -907,12 +882,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "node_modules/stringify-entities": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.1.0.tgz", @@ -1054,9 +1023,9 @@ } }, "node_modules/unist-util-select": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-3.0.3.tgz", - "integrity": "sha512-DnbjRvotPiDGsUaw9knEvprwD6conwGtaArUn5niG9yBQvWQyHMmUJ4p/vXXzLBm+8XyiTr3pcuw9n3TlF6SYg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-3.0.4.tgz", + "integrity": "sha512-xf1zCu4okgPqGLdhCDpRnjwBNyv3EqjiXRUbz2SdK1+qnLMB7uXXajfzuBvvbHoQ+JLyp4AEbFCGndmc6S72sw==", "dev": true, "dependencies": { "css-selector-parser": "^1.0.0", @@ -1214,13 +1183,10 @@ "dev": true }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "bail": { "version": "1.0.5", @@ -1285,12 +1251,6 @@ "ms": "2.1.2" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -1416,9 +1376,9 @@ } }, "highlight.js": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.4.1.tgz", - "integrity": "sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.5.0.tgz", + "integrity": "sha512-xTmvd9HiIHR6L53TMC7TKolEj65zG1XU+Onr8oi86mYa+nLcIbxTTWkpW7CsEwv/vK7u1zb8alZIMLDqqN6KTw==", "dev": true }, "html-void-elements": { @@ -1474,13 +1434,12 @@ "dev": true }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "lodash.iteratee": { @@ -1514,75 +1473,69 @@ } }, "mdast-util-from-markdown": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.1.tgz", - "integrity": "sha512-qJXNcFcuCSPqUF0Tb0uYcFDIq67qwB3sxo9RPdf9vG8T90ViKnksFqdB/Coq2a7sTnxL/Ify2y7aIQXDkQFH0w==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz", + "integrity": "sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw==", "dev": true, "requires": { "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^1.0.0", - "micromark": "~2.10.0", - "parse-entities": "^2.0.0" - }, - "dependencies": { - "mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", - "dev": true - } + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" } }, "mdast-util-gfm": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.0.tgz", - "integrity": "sha512-HLfygQL6HdhJhFbLta4Ki9hClrzyAxRjyRvpm5caN65QZL+NyHPmqFlnF9vm1Rn58JT2+AbLwNcEDY4MEvkk8Q==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.1.tgz", + "integrity": "sha512-oE1W1zSXU2L2LHg91V22HC3Z1fbsOZTBYUQq+kpM29f9297TbRm0C1l3bQ88RREl0WaUQaB49G7trvwy5utUKQ==", "dev": true, "requires": { "mdast-util-gfm-autolink-literal": "^0.1.0", "mdast-util-gfm-strikethrough": "^0.2.0", "mdast-util-gfm-table": "^0.1.0", - "mdast-util-gfm-task-list-item": "^0.1.0" + "mdast-util-gfm-task-list-item": "^0.1.0", + "mdast-util-to-markdown": "^0.6.1" } }, "mdast-util-gfm-autolink-literal": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.1.tgz", - "integrity": "sha512-gJ2xSpqKCetSr22GEWpZH3f5ffb4pPn/72m4piY0v7T/S+O7n7rw+sfoPLhb2b4O7WdnERoYdALRcmD68FMtlw==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.2.tgz", + "integrity": "sha512-WFeIrcNNsfBety0gyWuiBIPing9UkVcl/m2iZOyW1uHEH2evjFocet2h77M24ub0WyZ4ucnQn/jWhO5Ozl6j4g==", "dev": true }, "mdast-util-gfm-strikethrough": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.2.tgz", - "integrity": "sha512-T37ZbaokJcRbHROXmoVAieWnesPD5N21tv2ifYzaGRLbkh1gknItUGhZzHefUn5Zc/eaO/iTDSAFOBrn/E8kWw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz", + "integrity": "sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA==", "dev": true, "requires": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "^0.6.0" } }, "mdast-util-gfm-table": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.4.tgz", - "integrity": "sha512-T4xFSON9kUb/IpYA5N+KGWcsdGczAvILvKiXQwUGind6V9fvjPCR9yhZnIeaLdBWXaz3m/Gq77ZtuLMjtFR4IQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz", + "integrity": "sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ==", "dev": true, "requires": { "markdown-table": "^2.0.0", - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" } }, "mdast-util-gfm-task-list-item": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.5.tgz", - "integrity": "sha512-6O0bt34r+e7kYjeSwedhjDPYraspKIYKbhvhQEEioL7gSmXDxhN7WQW2KoxhVMpNzjNc03yC7K5KH6NHlz2jOA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz", + "integrity": "sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A==", "dev": true, "requires": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" } }, "mdast-util-to-hast": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz", - "integrity": "sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-10.1.1.tgz", + "integrity": "sha512-+hvJrYiUgK2aY0Q1h1LaHQ4h0P7VVumWdAcUuG9k49lYglyU9GtTrA4O8hMh5gRnyT22wC15takM2qrrlpvNxQ==", "dev": true, "requires": { "@types/mdast": "^3.0.0", @@ -1596,9 +1549,9 @@ } }, "mdast-util-to-markdown": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.5.4.tgz", - "integrity": "sha512-0jQTkbWYx0HdEA/h++7faebJWr5JyBoBeiRf0u3F4F3QtnyyGaWIsOwo749kRb1ttKrLLr+wRtOkfou9yB0p6A==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.2.tgz", + "integrity": "sha512-iRczns6WMvu0hUw02LXsPDJshBIwtUPbvHBWo19IQeU0YqmzlA8Pd30U8V7uiI0VPkxzS7A/NXBXH6u+HS87Zg==", "dev": true, "requires": { "@types/unist": "^2.0.0", @@ -1622,9 +1575,9 @@ "dev": true }, "micromark": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz", - "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.2.tgz", + "integrity": "sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ==", "dev": true, "requires": { "debug": "^4.0.0", @@ -1632,12 +1585,12 @@ } }, "micromark-extension-gfm": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.1.tgz", - "integrity": "sha512-lJlhcOqzoJdjQg+LMumVHdUQ61LjtqGdmZtrAdfvatRUnJTqZlRwXXHdLQgNDYlFw4mycZ4NSTKlya5QcQXl1A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.2.tgz", + "integrity": "sha512-ToQEpLkRgg7Tp8D3GM/SjZFPV0cCwWNxZmoEVIOQivOswRtPg7gg2WlCrtHhUWFNX+DgDjbq0iLOPGp4Y15oug==", "dev": true, "requires": { - "micromark": "~2.10.0", + "micromark": "~2.11.0", "micromark-extension-gfm-autolink-literal": "~0.5.0", "micromark-extension-gfm-strikethrough": "~0.6.0", "micromark-extension-gfm-table": "~0.4.0", @@ -1646,30 +1599,30 @@ } }, "micromark-extension-gfm-autolink-literal": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.1.tgz", - "integrity": "sha512-j30923tDp0faCNDjwqe4cMi+slegbGfc3VEAExEU8d54Q/F6pR6YxCVH+6xV0ItRoj3lCn1XkUWcy6FC3S9BOw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.4.tgz", + "integrity": "sha512-471VKd4k3SiX7vx9fC+IYeGQL0RnxwBBXeEc5WConb7naJDG5m16guA+VoFzyXchrvmU08t0dUWWPZ0mkJSXVw==", "dev": true, "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "micromark-extension-gfm-strikethrough": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.2.tgz", - "integrity": "sha512-aehEEqtTn3JekJNwZZxa7ZJVfzmuaWp4ew6x6sl3VAKIwdDZdqYeYSQIrNKwNgH7hX0g56fAwnSDLusJggjlCQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.3.tgz", + "integrity": "sha512-MKMoP9x2dsr1aeX46ibBwVf4Q6nJsi5aaUFTOMOID5VOLSxwl4CrqUV4OGFQd6AqhtzBJAxaV+N2trlTBtZDNQ==", "dev": true, "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "micromark-extension-gfm-table": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.1.tgz", - "integrity": "sha512-xVpqOnfFaa2OtC/Y7rlt4tdVFlUHdoLH3RXAZgb/KP3DDyKsAOx6BRS3UxiiyvmD/p2l6VUpD4bMIniuP4o4JA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.2.tgz", + "integrity": "sha512-AAzmj85XO1ydHYX0Lz52HGhcH2sZLm2AVvkwzELXWgZF6vGdq5yZ3CTByFRsqNUPyQBSIYFKLDAtc6KlnO42aw==", "dev": true, "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "micromark-extension-gfm-tagfilter": { @@ -1679,12 +1632,12 @@ "dev": true }, "micromark-extension-gfm-task-list-item": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.2.tgz", - "integrity": "sha512-cm8lYS10YAqeXE9B27TK3u1Ihumo3H9p/3XumT+jp8vSuSbSpFIJe0bDi2kq4YAAIxtcTzUOxhEH4ko2/NYDkQ==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz", + "integrity": "sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ==", "dev": true, "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "ms": { @@ -1806,12 +1759,6 @@ "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==", "dev": true }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "stringify-entities": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.1.0.tgz", @@ -1923,9 +1870,9 @@ "dev": true }, "unist-util-select": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-3.0.3.tgz", - "integrity": "sha512-DnbjRvotPiDGsUaw9knEvprwD6conwGtaArUn5niG9yBQvWQyHMmUJ4p/vXXzLBm+8XyiTr3pcuw9n3TlF6SYg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/unist-util-select/-/unist-util-select-3.0.4.tgz", + "integrity": "sha512-xf1zCu4okgPqGLdhCDpRnjwBNyv3EqjiXRUbz2SdK1+qnLMB7uXXajfzuBvvbHoQ+JLyp4AEbFCGndmc6S72sw==", "dev": true, "requires": { "css-selector-parser": "^1.0.0", diff --git a/tools/doc/package.json b/tools/doc/package.json index dec820f60886ae..d13ac4f30e8feb 100644 --- a/tools/doc/package.json +++ b/tools/doc/package.json @@ -7,8 +7,8 @@ "node": ">=12.10.0" }, "devDependencies": { - "highlight.js": "10.4.1", - "js-yaml": "3.14.0", + "highlight.js": "10.5.0", + "js-yaml": "4.0.0", "rehype-raw": "5.0.0", "rehype-stringify": "8.0.0", "remark-gfm": "^1.0.0", @@ -18,7 +18,7 @@ "to-vfile": "6.1.0", "unified": "9.2.0", "unist-util-find": "^1.0.2", - "unist-util-select": "3.0.3", + "unist-util-select": "3.0.4", "unist-util-visit": "2.0.3" }, "bin": { From ff5bd04900e4a3ac0328b199da86d2e3d3f3f4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 8 Jan 2021 10:58:18 +0100 Subject: [PATCH 139/161] deps: update nghttp2 to 1.42.0 Refs: https://github.com/nghttp2/nghttp2/releases/tag/v1.42.0 PR-URL: https://github.com/nodejs/node/pull/36842 Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina Reviewed-By: Yongsheng Zhang Reviewed-By: Rich Trott --- deps/nghttp2/lib/CMakeLists.txt | 77 ++ deps/nghttp2/lib/Makefile.am | 6 +- deps/nghttp2/lib/Makefile.in | 1028 +++++++++++++++++ deps/nghttp2/lib/includes/Makefile.in | 658 +++++++++++ deps/nghttp2/lib/includes/nghttp2/nghttp2.h | 6 +- .../nghttp2/lib/includes/nghttp2/nghttp2ver.h | 4 +- .../lib/includes/nghttp2/nghttp2ver.h.in | 42 + deps/nghttp2/lib/nghttp2_buf.c | 6 +- deps/nghttp2/lib/nghttp2_frame.c | 28 +- deps/nghttp2/lib/nghttp2_ksl.c | 707 ++++++++++++ deps/nghttp2/lib/nghttp2_ksl.h | 315 +++++ deps/nghttp2/lib/nghttp2_map.c | 260 ++++- deps/nghttp2/lib/nghttp2_map.h | 18 +- deps/nghttp2/lib/nghttp2_session.c | 31 +- deps/nghttp2/nghttp2.gyp | 1 + 15 files changed, 3109 insertions(+), 78 deletions(-) create mode 100644 deps/nghttp2/lib/CMakeLists.txt create mode 100644 deps/nghttp2/lib/Makefile.in create mode 100644 deps/nghttp2/lib/includes/Makefile.in create mode 100644 deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h.in create mode 100644 deps/nghttp2/lib/nghttp2_ksl.c create mode 100644 deps/nghttp2/lib/nghttp2_ksl.h diff --git a/deps/nghttp2/lib/CMakeLists.txt b/deps/nghttp2/lib/CMakeLists.txt new file mode 100644 index 00000000000000..a02a534b1a8436 --- /dev/null +++ b/deps/nghttp2/lib/CMakeLists.txt @@ -0,0 +1,77 @@ +add_subdirectory(includes) + +include_directories( + "${CMAKE_CURRENT_SOURCE_DIR}/includes" + "${CMAKE_CURRENT_BINARY_DIR}/includes" +) + +add_definitions(-DBUILDING_NGHTTP2) + +set(NGHTTP2_SOURCES + nghttp2_pq.c nghttp2_map.c nghttp2_queue.c + nghttp2_frame.c + nghttp2_buf.c + nghttp2_stream.c nghttp2_outbound_item.c + nghttp2_session.c nghttp2_submit.c + nghttp2_helper.c + nghttp2_npn.c + nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c + nghttp2_version.c + nghttp2_priority_spec.c + nghttp2_option.c + nghttp2_callbacks.c + nghttp2_mem.c + nghttp2_http.c + nghttp2_rcbuf.c + nghttp2_debug.c + nghttp2_ksl.c +) + +set(NGHTTP2_RES "") + +if(WIN32) + configure_file( + version.rc.in + ${CMAKE_CURRENT_BINARY_DIR}/version.rc + @ONLY) + + set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc) +endif() + +# Public shared library +if(ENABLE_SHARED_LIB) + add_library(nghttp2 SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES}) + set_target_properties(nghttp2 PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}" + VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} + C_VISIBILITY_PRESET hidden + ) + target_include_directories(nghttp2 INTERFACE + "${CMAKE_CURRENT_BINARY_DIR}/includes" + "${CMAKE_CURRENT_SOURCE_DIR}/includes" + ) + + install(TARGETS nghttp2 + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +endif() + +if(HAVE_CUNIT OR ENABLE_STATIC_LIB) + # Static library (for unittests because of symbol visibility) + add_library(nghttp2_static STATIC ${NGHTTP2_SOURCES}) + set_target_properties(nghttp2_static PROPERTIES + COMPILE_FLAGS "${WARNCFLAGS}" + VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} + ARCHIVE_OUTPUT_NAME nghttp2${STATIC_LIB_SUFFIX} + ) + target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") + if(ENABLE_STATIC_LIB) + install(TARGETS nghttp2_static + DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif() +endif() + + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp2.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") diff --git a/deps/nghttp2/lib/Makefile.am b/deps/nghttp2/lib/Makefile.am index 24a5bd62645054..63fa0fa8324d0a 100644 --- a/deps/nghttp2/lib/Makefile.am +++ b/deps/nghttp2/lib/Makefile.am @@ -49,7 +49,8 @@ OBJECTS = nghttp2_pq.c nghttp2_map.c nghttp2_queue.c \ nghttp2_mem.c \ nghttp2_http.c \ nghttp2_rcbuf.c \ - nghttp2_debug.c + nghttp2_debug.c \ + nghttp2_ksl.c HFILES = nghttp2_pq.h nghttp2_int.h nghttp2_map.h nghttp2_queue.h \ nghttp2_frame.h \ @@ -65,7 +66,8 @@ HFILES = nghttp2_pq.h nghttp2_int.h nghttp2_map.h nghttp2_queue.h \ nghttp2_mem.h \ nghttp2_http.h \ nghttp2_rcbuf.h \ - nghttp2_debug.h + nghttp2_debug.h \ + nghttp2_ksl.h libnghttp2_la_SOURCES = $(HFILES) $(OBJECTS) libnghttp2_la_LDFLAGS = -no-undefined \ diff --git a/deps/nghttp2/lib/Makefile.in b/deps/nghttp2/lib/Makefile.in new file mode 100644 index 00000000000000..14ec74591ba3df --- /dev/null +++ b/deps/nghttp2/lib/Makefile.in @@ -0,0 +1,1028 @@ +# Makefile.in generated by automake 1.16.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# nghttp2 - HTTP/2 C Library + +# Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = lib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_boost_asio.m4 \ + $(top_srcdir)/m4/ax_boost_base.m4 \ + $(top_srcdir)/m4/ax_boost_system.m4 \ + $(top_srcdir)/m4/ax_boost_thread.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_python_devel.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libnghttp2.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libnghttp2_la_LIBADD = +am__objects_1 = +am__objects_2 = nghttp2_pq.lo nghttp2_map.lo nghttp2_queue.lo \ + nghttp2_frame.lo nghttp2_buf.lo nghttp2_stream.lo \ + nghttp2_outbound_item.lo nghttp2_session.lo nghttp2_submit.lo \ + nghttp2_helper.lo nghttp2_npn.lo nghttp2_hd.lo \ + nghttp2_hd_huffman.lo nghttp2_hd_huffman_data.lo \ + nghttp2_version.lo nghttp2_priority_spec.lo nghttp2_option.lo \ + nghttp2_callbacks.lo nghttp2_mem.lo nghttp2_http.lo \ + nghttp2_rcbuf.lo nghttp2_debug.lo nghttp2_ksl.lo +am_libnghttp2_la_OBJECTS = $(am__objects_1) $(am__objects_2) +libnghttp2_la_OBJECTS = $(am_libnghttp2_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libnghttp2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libnghttp2_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/nghttp2_buf.Plo \ + ./$(DEPDIR)/nghttp2_callbacks.Plo \ + ./$(DEPDIR)/nghttp2_debug.Plo ./$(DEPDIR)/nghttp2_frame.Plo \ + ./$(DEPDIR)/nghttp2_hd.Plo ./$(DEPDIR)/nghttp2_hd_huffman.Plo \ + ./$(DEPDIR)/nghttp2_hd_huffman_data.Plo \ + ./$(DEPDIR)/nghttp2_helper.Plo ./$(DEPDIR)/nghttp2_http.Plo \ + ./$(DEPDIR)/nghttp2_ksl.Plo ./$(DEPDIR)/nghttp2_map.Plo \ + ./$(DEPDIR)/nghttp2_mem.Plo ./$(DEPDIR)/nghttp2_npn.Plo \ + ./$(DEPDIR)/nghttp2_option.Plo \ + ./$(DEPDIR)/nghttp2_outbound_item.Plo \ + ./$(DEPDIR)/nghttp2_pq.Plo \ + ./$(DEPDIR)/nghttp2_priority_spec.Plo \ + ./$(DEPDIR)/nghttp2_queue.Plo ./$(DEPDIR)/nghttp2_rcbuf.Plo \ + ./$(DEPDIR)/nghttp2_session.Plo ./$(DEPDIR)/nghttp2_stream.Plo \ + ./$(DEPDIR)/nghttp2_submit.Plo ./$(DEPDIR)/nghttp2_version.Plo +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libnghttp2_la_SOURCES) +DIST_SOURCES = $(libnghttp2_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libnghttp2.pc.in \ + $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLDFLAGS = @APPLDFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BOOST_ASIO_LIB = @BOOST_ASIO_LIB@ +BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ +BOOST_LDFLAGS = @BOOST_LDFLAGS@ +BOOST_SYSTEM_LIB = @BOOST_SYSTEM_LIB@ +BOOST_THREAD_LIB = @BOOST_THREAD_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CUNIT_CFLAGS = @CUNIT_CFLAGS@ +CUNIT_LIBS = @CUNIT_LIBS@ +CXX = @CXX@ +CXX1XCXXFLAGS = @CXX1XCXXFLAGS@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +CYTHON = @CYTHON@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTRACFLAG = @EXTRACFLAG@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX14 = @HAVE_CXX14@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JANSSON_CFLAGS = @JANSSON_CFLAGS@ +JANSSON_LIBS = @JANSSON_LIBS@ +JEMALLOC_LIBS = @JEMALLOC_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCARES_CFLAGS = @LIBCARES_CFLAGS@ +LIBCARES_LIBS = @LIBCARES_LIBS@ +LIBEVENT_OPENSSL_CFLAGS = @LIBEVENT_OPENSSL_CFLAGS@ +LIBEVENT_OPENSSL_LIBS = @LIBEVENT_OPENSSL_LIBS@ +LIBEV_CFLAGS = @LIBEV_CFLAGS@ +LIBEV_LIBS = @LIBEV_LIBS@ +LIBMRUBY_CFLAGS = @LIBMRUBY_CFLAGS@ +LIBMRUBY_LIBS = @LIBMRUBY_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_NUM = @PACKAGE_VERSION_NUM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PYTHON = @PYTHON@ +PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ +PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ +PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@ +SYSTEMD_LIBS = @SYSTEMD_LIBS@ +TESTLDADD = @TESTLDADD@ +VERSION = @VERSION@ +WARNCFLAGS = @WARNCFLAGS@ +WARNCXXFLAGS = @WARNCXXFLAGS@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +SUBDIRS = includes +EXTRA_DIST = Makefile.msvc CMakeLists.txt version.rc.in +AM_CFLAGS = $(WARNCFLAGS) $(EXTRACFLAG) +AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes -DBUILDING_NGHTTP2 \ + @DEFS@ + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libnghttp2.pc +DISTCLEANFILES = $(pkgconfig_DATA) +lib_LTLIBRARIES = libnghttp2.la +OBJECTS = nghttp2_pq.c nghttp2_map.c nghttp2_queue.c \ + nghttp2_frame.c \ + nghttp2_buf.c \ + nghttp2_stream.c nghttp2_outbound_item.c \ + nghttp2_session.c nghttp2_submit.c \ + nghttp2_helper.c \ + nghttp2_npn.c \ + nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c \ + nghttp2_version.c \ + nghttp2_priority_spec.c \ + nghttp2_option.c \ + nghttp2_callbacks.c \ + nghttp2_mem.c \ + nghttp2_http.c \ + nghttp2_rcbuf.c \ + nghttp2_debug.c \ + nghttp2_ksl.c + +HFILES = nghttp2_pq.h nghttp2_int.h nghttp2_map.h nghttp2_queue.h \ + nghttp2_frame.h \ + nghttp2_buf.h \ + nghttp2_session.h nghttp2_helper.h nghttp2_stream.h nghttp2_int.h \ + nghttp2_npn.h \ + nghttp2_submit.h nghttp2_outbound_item.h \ + nghttp2_net.h \ + nghttp2_hd.h nghttp2_hd_huffman.h \ + nghttp2_priority_spec.h \ + nghttp2_option.h \ + nghttp2_callbacks.h \ + nghttp2_mem.h \ + nghttp2_http.h \ + nghttp2_rcbuf.h \ + nghttp2_debug.h \ + nghttp2_ksl.h + +libnghttp2_la_SOURCES = $(HFILES) $(OBJECTS) +libnghttp2_la_LDFLAGS = -no-undefined \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +libnghttp2.pc: $(top_builddir)/config.status $(srcdir)/libnghttp2.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libnghttp2.la: $(libnghttp2_la_OBJECTS) $(libnghttp2_la_DEPENDENCIES) $(EXTRA_libnghttp2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libnghttp2_la_LINK) -rpath $(libdir) $(libnghttp2_la_OBJECTS) $(libnghttp2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_buf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_callbacks.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_debug.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_hd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_hd_huffman.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_hd_huffman_data.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_helper.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_http.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_ksl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_map.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_mem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_npn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_option.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_outbound_item.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_pq.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_priority_spec.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_queue.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_rcbuf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_session.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_stream.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_submit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_version.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -f ./$(DEPDIR)/nghttp2_buf.Plo + -rm -f ./$(DEPDIR)/nghttp2_callbacks.Plo + -rm -f ./$(DEPDIR)/nghttp2_debug.Plo + -rm -f ./$(DEPDIR)/nghttp2_frame.Plo + -rm -f ./$(DEPDIR)/nghttp2_hd.Plo + -rm -f ./$(DEPDIR)/nghttp2_hd_huffman.Plo + -rm -f ./$(DEPDIR)/nghttp2_hd_huffman_data.Plo + -rm -f ./$(DEPDIR)/nghttp2_helper.Plo + -rm -f ./$(DEPDIR)/nghttp2_http.Plo + -rm -f ./$(DEPDIR)/nghttp2_ksl.Plo + -rm -f ./$(DEPDIR)/nghttp2_map.Plo + -rm -f ./$(DEPDIR)/nghttp2_mem.Plo + -rm -f ./$(DEPDIR)/nghttp2_npn.Plo + -rm -f ./$(DEPDIR)/nghttp2_option.Plo + -rm -f ./$(DEPDIR)/nghttp2_outbound_item.Plo + -rm -f ./$(DEPDIR)/nghttp2_pq.Plo + -rm -f ./$(DEPDIR)/nghttp2_priority_spec.Plo + -rm -f ./$(DEPDIR)/nghttp2_queue.Plo + -rm -f ./$(DEPDIR)/nghttp2_rcbuf.Plo + -rm -f ./$(DEPDIR)/nghttp2_session.Plo + -rm -f ./$(DEPDIR)/nghttp2_stream.Plo + -rm -f ./$(DEPDIR)/nghttp2_submit.Plo + -rm -f ./$(DEPDIR)/nghttp2_version.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f ./$(DEPDIR)/nghttp2_buf.Plo + -rm -f ./$(DEPDIR)/nghttp2_callbacks.Plo + -rm -f ./$(DEPDIR)/nghttp2_debug.Plo + -rm -f ./$(DEPDIR)/nghttp2_frame.Plo + -rm -f ./$(DEPDIR)/nghttp2_hd.Plo + -rm -f ./$(DEPDIR)/nghttp2_hd_huffman.Plo + -rm -f ./$(DEPDIR)/nghttp2_hd_huffman_data.Plo + -rm -f ./$(DEPDIR)/nghttp2_helper.Plo + -rm -f ./$(DEPDIR)/nghttp2_http.Plo + -rm -f ./$(DEPDIR)/nghttp2_ksl.Plo + -rm -f ./$(DEPDIR)/nghttp2_map.Plo + -rm -f ./$(DEPDIR)/nghttp2_mem.Plo + -rm -f ./$(DEPDIR)/nghttp2_npn.Plo + -rm -f ./$(DEPDIR)/nghttp2_option.Plo + -rm -f ./$(DEPDIR)/nghttp2_outbound_item.Plo + -rm -f ./$(DEPDIR)/nghttp2_pq.Plo + -rm -f ./$(DEPDIR)/nghttp2_priority_spec.Plo + -rm -f ./$(DEPDIR)/nghttp2_queue.Plo + -rm -f ./$(DEPDIR)/nghttp2_rcbuf.Plo + -rm -f ./$(DEPDIR)/nghttp2_session.Plo + -rm -f ./$(DEPDIR)/nghttp2_stream.Plo + -rm -f ./$(DEPDIR)/nghttp2_submit.Plo + -rm -f ./$(DEPDIR)/nghttp2_version.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-libLTLIBRARIES uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/deps/nghttp2/lib/includes/Makefile.in b/deps/nghttp2/lib/includes/Makefile.in new file mode 100644 index 00000000000000..e1948dfeaa3f1c --- /dev/null +++ b/deps/nghttp2/lib/includes/Makefile.in @@ -0,0 +1,658 @@ +# Makefile.in generated by automake 1.16.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# nghttp2 - HTTP/2 C Library + +# Copyright (c) 2012 Tatsuhiro Tsujikawa + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = lib/includes +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_boost_asio.m4 \ + $(top_srcdir)/m4/ax_boost_base.m4 \ + $(top_srcdir)/m4/ax_boost_system.m4 \ + $(top_srcdir)/m4/ax_boost_thread.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_python_devel.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(nobase_include_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(includedir)" +HEADERS = $(nobase_include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLDFLAGS = @APPLDFLAGS@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BOOST_ASIO_LIB = @BOOST_ASIO_LIB@ +BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ +BOOST_LDFLAGS = @BOOST_LDFLAGS@ +BOOST_SYSTEM_LIB = @BOOST_SYSTEM_LIB@ +BOOST_THREAD_LIB = @BOOST_THREAD_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CUNIT_CFLAGS = @CUNIT_CFLAGS@ +CUNIT_LIBS = @CUNIT_LIBS@ +CXX = @CXX@ +CXX1XCXXFLAGS = @CXX1XCXXFLAGS@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +CYTHON = @CYTHON@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTRACFLAG = @EXTRACFLAG@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX14 = @HAVE_CXX14@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JANSSON_CFLAGS = @JANSSON_CFLAGS@ +JANSSON_LIBS = @JANSSON_LIBS@ +JEMALLOC_LIBS = @JEMALLOC_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCARES_CFLAGS = @LIBCARES_CFLAGS@ +LIBCARES_LIBS = @LIBCARES_LIBS@ +LIBEVENT_OPENSSL_CFLAGS = @LIBEVENT_OPENSSL_CFLAGS@ +LIBEVENT_OPENSSL_LIBS = @LIBEVENT_OPENSSL_LIBS@ +LIBEV_CFLAGS = @LIBEV_CFLAGS@ +LIBEV_LIBS = @LIBEV_LIBS@ +LIBMRUBY_CFLAGS = @LIBMRUBY_CFLAGS@ +LIBMRUBY_LIBS = @LIBMRUBY_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ +LIBXML2_LIBS = @LIBXML2_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_NUM = @PACKAGE_VERSION_NUM@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PYTHON = @PYTHON@ +PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ +PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ +PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@ +SYSTEMD_LIBS = @SYSTEMD_LIBS@ +TESTLDADD = @TESTLDADD@ +VERSION = @VERSION@ +WARNCFLAGS = @WARNCFLAGS@ +WARNCXXFLAGS = @WARNCXXFLAGS@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = CMakeLists.txt +nobase_include_HEADERS = nghttp2/nghttp2.h nghttp2/nghttp2ver.h +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/includes/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/includes/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nobase_includeHEADERS: $(nobase_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ + echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ + $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-nobase_includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-nobase_includeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man \ + install-nobase_includeHEADERS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-nobase_includeHEADERS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2.h index 9be6eea5c02257..d9fae5bf0c138e 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2.h @@ -2851,9 +2851,11 @@ NGHTTP2_EXTERN void nghttp2_session_del(nghttp2_session *session); * * This function retrieves the highest prioritized frame from the * outbound queue and sends it to the remote peer. It does this as - * many as possible until the user callback + * many times as possible until the user callback * :type:`nghttp2_send_callback` returns - * :enum:`NGHTTP2_ERR_WOULDBLOCK` or the outbound queue becomes empty. + * :enum:`NGHTTP2_ERR_WOULDBLOCK`, the outbound queue becomes empty + * or flow control is triggered (remote window size becomes depleted + * or maximum number of concurrent streams is reached). * This function calls several callback functions which are passed * when initializing the |session|. Here is the simple time chart * which tells when each callback is invoked: diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h index 795a44c1e86863..ff6bf3d3b22e4f 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h @@ -29,7 +29,7 @@ * @macro * Version number of the nghttp2 library release */ -#define NGHTTP2_VERSION "1.41.0" +#define NGHTTP2_VERSION "1.42.0" /** * @macro @@ -37,6 +37,6 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define NGHTTP2_VERSION_NUM 0x012900 +#define NGHTTP2_VERSION_NUM 0x012a00 #endif /* NGHTTP2VER_H */ diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h.in b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h.in new file mode 100644 index 00000000000000..7717a647f75581 --- /dev/null +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h.in @@ -0,0 +1,42 @@ +/* + * nghttp2 - HTTP/2 C Library + * + * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef NGHTTP2VER_H +#define NGHTTP2VER_H + +/** + * @macro + * Version number of the nghttp2 library release + */ +#define NGHTTP2_VERSION "@PACKAGE_VERSION@" + +/** + * @macro + * Numerical representation of the version number of the nghttp2 library + * release. This is a 24 bit number with 8 bits for major number, 8 bits + * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. + */ +#define NGHTTP2_VERSION_NUM @PACKAGE_VERSION_NUM@ + +#endif /* NGHTTP2VER_H */ diff --git a/deps/nghttp2/lib/nghttp2_buf.c b/deps/nghttp2/lib/nghttp2_buf.c index 2a435bebf927bd..a32844712e4493 100644 --- a/deps/nghttp2/lib/nghttp2_buf.c +++ b/deps/nghttp2/lib/nghttp2_buf.c @@ -82,8 +82,10 @@ void nghttp2_buf_reset(nghttp2_buf *buf) { } void nghttp2_buf_wrap_init(nghttp2_buf *buf, uint8_t *begin, size_t len) { - buf->begin = buf->pos = buf->last = buf->mark = begin; - buf->end = begin + len; + buf->begin = buf->pos = buf->last = buf->mark = buf->end = begin; + if (len) { + buf->end += len; + } } static int buf_chain_new(nghttp2_buf_chain **chain, size_t chunk_length, diff --git a/deps/nghttp2/lib/nghttp2_frame.c b/deps/nghttp2/lib/nghttp2_frame.c index 4821de40885736..382a26c818dd7b 100644 --- a/deps/nghttp2/lib/nghttp2_frame.c +++ b/deps/nghttp2/lib/nghttp2_frame.c @@ -818,8 +818,10 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame, size_t len = 0; origin = frame->payload; - p = payload; - end = p + payloadlen; + p = end = payload; + if (payloadlen) { + end += payloadlen; + } for (; p != end;) { if (end - p < 2) { @@ -897,9 +899,25 @@ nghttp2_settings_entry *nghttp2_frame_iv_copy(const nghttp2_settings_entry *iv, } int nghttp2_nv_equal(const nghttp2_nv *a, const nghttp2_nv *b) { - return a->namelen == b->namelen && a->valuelen == b->valuelen && - memcmp(a->name, b->name, a->namelen) == 0 && - memcmp(a->value, b->value, a->valuelen) == 0; + if (a->namelen != b->namelen || a->valuelen != b->valuelen) { + return 0; + } + + if (a->name == NULL || b->name == NULL) { + assert(a->namelen == 0); + assert(b->namelen == 0); + } else if (memcmp(a->name, b->name, a->namelen) != 0) { + return 0; + } + + if (a->value == NULL || b->value == NULL) { + assert(a->valuelen == 0); + assert(b->valuelen == 0); + } else if (memcmp(a->value, b->value, a->valuelen) != 0) { + return 0; + } + + return 1; } void nghttp2_nv_array_del(nghttp2_nv *nva, nghttp2_mem *mem) { diff --git a/deps/nghttp2/lib/nghttp2_ksl.c b/deps/nghttp2/lib/nghttp2_ksl.c new file mode 100644 index 00000000000000..dffd1cbcffc484 --- /dev/null +++ b/deps/nghttp2/lib/nghttp2_ksl.c @@ -0,0 +1,707 @@ +/* + * nghttp2 - HTTP/2 C Library + * + * Copyright (c) 2020 nghttp2 contributors + * Copyright (c) 2018 ngtcp2 contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#include "nghttp2_ksl.h" + +#include +#include +#include +#include + +#include "nghttp2_mem.h" + +static size_t ksl_nodelen(size_t keylen) { + return (sizeof(nghttp2_ksl_node) + keylen - sizeof(uint64_t) + 0xf) & + (size_t)~0xf; +} + +static size_t ksl_blklen(size_t nodelen) { + return sizeof(nghttp2_ksl_blk) + nodelen * NGHTTP2_KSL_MAX_NBLK - + sizeof(uint64_t); +} + +/* + * ksl_node_set_key sets |key| to |node|. + */ +static void ksl_node_set_key(nghttp2_ksl *ksl, nghttp2_ksl_node *node, + const void *key) { + memcpy(node->key, key, ksl->keylen); +} + +int nghttp2_ksl_init(nghttp2_ksl *ksl, nghttp2_ksl_compar compar, size_t keylen, + nghttp2_mem *mem) { + size_t nodelen = ksl_nodelen(keylen); + size_t blklen = ksl_blklen(nodelen); + nghttp2_ksl_blk *head; + + ksl->head = nghttp2_mem_malloc(mem, blklen); + if (!ksl->head) { + return NGHTTP2_ERR_NOMEM; + } + ksl->front = ksl->back = ksl->head; + ksl->compar = compar; + ksl->keylen = keylen; + ksl->nodelen = nodelen; + ksl->n = 0; + ksl->mem = mem; + + head = ksl->head; + head->next = head->prev = NULL; + head->n = 0; + head->leaf = 1; + + return 0; +} + +/* + * ksl_free_blk frees |blk| recursively. + */ +static void ksl_free_blk(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk) { + size_t i; + + if (!blk->leaf) { + for (i = 0; i < blk->n; ++i) { + ksl_free_blk(ksl, nghttp2_ksl_nth_node(ksl, blk, i)->blk); + } + } + + nghttp2_mem_free(ksl->mem, blk); +} + +void nghttp2_ksl_free(nghttp2_ksl *ksl) { + if (!ksl) { + return; + } + + ksl_free_blk(ksl, ksl->head); +} + +/* + * ksl_split_blk splits |blk| into 2 nghttp2_ksl_blk objects. The new + * nghttp2_ksl_blk is always the "right" block. + * + * It returns the pointer to the nghttp2_ksl_blk created which is the + * located at the right of |blk|, or NULL which indicates out of + * memory error. + */ +static nghttp2_ksl_blk *ksl_split_blk(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk) { + nghttp2_ksl_blk *rblk; + + rblk = nghttp2_mem_malloc(ksl->mem, ksl_blklen(ksl->nodelen)); + if (rblk == NULL) { + return NULL; + } + + rblk->next = blk->next; + blk->next = rblk; + if (rblk->next) { + rblk->next->prev = rblk; + } else if (ksl->back == blk) { + ksl->back = rblk; + } + rblk->prev = blk; + rblk->leaf = blk->leaf; + + rblk->n = blk->n / 2; + + memcpy(rblk->nodes, blk->nodes + ksl->nodelen * (blk->n - rblk->n), + ksl->nodelen * rblk->n); + + blk->n -= rblk->n; + + assert(blk->n >= NGHTTP2_KSL_MIN_NBLK); + assert(rblk->n >= NGHTTP2_KSL_MIN_NBLK); + + return rblk; +} + +/* + * ksl_split_node splits a node included in |blk| at the position |i| + * into 2 adjacent nodes. The new node is always inserted at the + * position |i+1|. + * + * It returns 0 if it succeeds, or one of the following negative error + * codes: + * + * NGHTTP2_ERR_NOMEM + * Out of memory. + */ +static int ksl_split_node(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, size_t i) { + nghttp2_ksl_node *node; + nghttp2_ksl_blk *lblk = nghttp2_ksl_nth_node(ksl, blk, i)->blk, *rblk; + + rblk = ksl_split_blk(ksl, lblk); + if (rblk == NULL) { + return NGHTTP2_ERR_NOMEM; + } + + memmove(blk->nodes + (i + 2) * ksl->nodelen, + blk->nodes + (i + 1) * ksl->nodelen, + ksl->nodelen * (blk->n - (i + 1))); + + node = nghttp2_ksl_nth_node(ksl, blk, i + 1); + node->blk = rblk; + ++blk->n; + ksl_node_set_key(ksl, node, + nghttp2_ksl_nth_node(ksl, rblk, rblk->n - 1)->key); + + node = nghttp2_ksl_nth_node(ksl, blk, i); + ksl_node_set_key(ksl, node, + nghttp2_ksl_nth_node(ksl, lblk, lblk->n - 1)->key); + + return 0; +} + +/* + * ksl_split_head splits a head (root) block. It increases the height + * of skip list by 1. + * + * It returns 0 if it succeeds, or one of the following negative error + * codes: + * + * NGHTTP2_ERR_NOMEM + * Out of memory. + */ +static int ksl_split_head(nghttp2_ksl *ksl) { + nghttp2_ksl_blk *rblk = NULL, *lblk, *nhead = NULL; + nghttp2_ksl_node *node; + + rblk = ksl_split_blk(ksl, ksl->head); + if (rblk == NULL) { + return NGHTTP2_ERR_NOMEM; + } + + lblk = ksl->head; + + nhead = nghttp2_mem_malloc(ksl->mem, ksl_blklen(ksl->nodelen)); + if (nhead == NULL) { + nghttp2_mem_free(ksl->mem, rblk); + return NGHTTP2_ERR_NOMEM; + } + nhead->next = nhead->prev = NULL; + nhead->n = 2; + nhead->leaf = 0; + + node = nghttp2_ksl_nth_node(ksl, nhead, 0); + ksl_node_set_key(ksl, node, + nghttp2_ksl_nth_node(ksl, lblk, lblk->n - 1)->key); + node->blk = lblk; + + node = nghttp2_ksl_nth_node(ksl, nhead, 1); + ksl_node_set_key(ksl, node, + nghttp2_ksl_nth_node(ksl, rblk, rblk->n - 1)->key); + node->blk = rblk; + + ksl->head = nhead; + + return 0; +} + +/* + * insert_node inserts a node whose key is |key| with the associated + * |data| at the index of |i|. This function assumes that the number + * of nodes contained by |blk| is strictly less than + * NGHTTP2_KSL_MAX_NBLK. + */ +static void ksl_insert_node(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, size_t i, + const nghttp2_ksl_key *key, void *data) { + nghttp2_ksl_node *node; + + assert(blk->n < NGHTTP2_KSL_MAX_NBLK); + + memmove(blk->nodes + (i + 1) * ksl->nodelen, blk->nodes + i * ksl->nodelen, + ksl->nodelen * (blk->n - i)); + + node = nghttp2_ksl_nth_node(ksl, blk, i); + ksl_node_set_key(ksl, node, key); + node->data = data; + + ++blk->n; +} + +static size_t ksl_bsearch(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, + const nghttp2_ksl_key *key, + nghttp2_ksl_compar compar) { + ssize_t left = -1, right = (ssize_t)blk->n, mid; + nghttp2_ksl_node *node; + + while (right - left > 1) { + mid = (left + right) / 2; + node = nghttp2_ksl_nth_node(ksl, blk, (size_t)mid); + if (compar((nghttp2_ksl_key *)node->key, key)) { + left = mid; + } else { + right = mid; + } + } + + return (size_t)right; +} + +int nghttp2_ksl_insert(nghttp2_ksl *ksl, nghttp2_ksl_it *it, + const nghttp2_ksl_key *key, void *data) { + nghttp2_ksl_blk *blk = ksl->head; + nghttp2_ksl_node *node; + size_t i; + int rv; + + if (blk->n == NGHTTP2_KSL_MAX_NBLK) { + rv = ksl_split_head(ksl); + if (rv != 0) { + return rv; + } + blk = ksl->head; + } + + for (;;) { + i = ksl_bsearch(ksl, blk, key, ksl->compar); + + if (blk->leaf) { + if (i < blk->n && + !ksl->compar(key, nghttp2_ksl_nth_node(ksl, blk, i)->key)) { + if (it) { + *it = nghttp2_ksl_end(ksl); + } + return NGHTTP2_ERR_INVALID_ARGUMENT; + } + ksl_insert_node(ksl, blk, i, key, data); + ++ksl->n; + if (it) { + nghttp2_ksl_it_init(it, ksl, blk, i); + } + return 0; + } + + if (i == blk->n) { + /* This insertion extends the largest key in this subtree. */ + for (; !blk->leaf;) { + node = nghttp2_ksl_nth_node(ksl, blk, blk->n - 1); + if (node->blk->n == NGHTTP2_KSL_MAX_NBLK) { + rv = ksl_split_node(ksl, blk, blk->n - 1); + if (rv != 0) { + return rv; + } + node = nghttp2_ksl_nth_node(ksl, blk, blk->n - 1); + } + ksl_node_set_key(ksl, node, key); + blk = node->blk; + } + ksl_insert_node(ksl, blk, blk->n, key, data); + ++ksl->n; + if (it) { + nghttp2_ksl_it_init(it, ksl, blk, blk->n - 1); + } + return 0; + } + + node = nghttp2_ksl_nth_node(ksl, blk, i); + + if (node->blk->n == NGHTTP2_KSL_MAX_NBLK) { + rv = ksl_split_node(ksl, blk, i); + if (rv != 0) { + return rv; + } + if (ksl->compar((nghttp2_ksl_key *)node->key, key)) { + node = nghttp2_ksl_nth_node(ksl, blk, i + 1); + if (ksl->compar((nghttp2_ksl_key *)node->key, key)) { + ksl_node_set_key(ksl, node, key); + } + } + } + + blk = node->blk; + } +} + +/* + * ksl_remove_node removes the node included in |blk| at the index of + * |i|. + */ +static void ksl_remove_node(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, size_t i) { + memmove(blk->nodes + i * ksl->nodelen, blk->nodes + (i + 1) * ksl->nodelen, + ksl->nodelen * (blk->n - (i + 1))); + + --blk->n; +} + +/* + * ksl_merge_node merges 2 nodes which are the nodes at the index of + * |i| and |i + 1|. + * + * If |blk| is the direct descendant of head (root) block and the head + * block contains just 2 nodes, the merged block becomes head block, + * which decreases the height of |ksl| by 1. + * + * This function returns the pointer to the merged block. + */ +static nghttp2_ksl_blk *ksl_merge_node(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, + size_t i) { + nghttp2_ksl_blk *lblk, *rblk; + + assert(i + 1 < blk->n); + + lblk = nghttp2_ksl_nth_node(ksl, blk, i)->blk; + rblk = nghttp2_ksl_nth_node(ksl, blk, i + 1)->blk; + + assert(lblk->n + rblk->n < NGHTTP2_KSL_MAX_NBLK); + + memcpy(lblk->nodes + ksl->nodelen * lblk->n, rblk->nodes, + ksl->nodelen * rblk->n); + + lblk->n += rblk->n; + lblk->next = rblk->next; + if (lblk->next) { + lblk->next->prev = lblk; + } else if (ksl->back == rblk) { + ksl->back = lblk; + } + + nghttp2_mem_free(ksl->mem, rblk); + + if (ksl->head == blk && blk->n == 2) { + nghttp2_mem_free(ksl->mem, ksl->head); + ksl->head = lblk; + } else { + ksl_remove_node(ksl, blk, i + 1); + ksl_node_set_key(ksl, nghttp2_ksl_nth_node(ksl, blk, i), + nghttp2_ksl_nth_node(ksl, lblk, lblk->n - 1)->key); + } + + return lblk; +} + +/* + * ksl_shift_left moves the first node in blk->nodes[i]->blk->nodes to + * blk->nodes[i - 1]->blk->nodes. + */ +static void ksl_shift_left(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, size_t i) { + nghttp2_ksl_node *lnode, *rnode, *dest, *src; + + assert(i > 0); + + lnode = nghttp2_ksl_nth_node(ksl, blk, i - 1); + rnode = nghttp2_ksl_nth_node(ksl, blk, i); + + assert(lnode->blk->n < NGHTTP2_KSL_MAX_NBLK); + assert(rnode->blk->n > NGHTTP2_KSL_MIN_NBLK); + + dest = nghttp2_ksl_nth_node(ksl, lnode->blk, lnode->blk->n); + src = nghttp2_ksl_nth_node(ksl, rnode->blk, 0); + + memcpy(dest, src, ksl->nodelen); + ksl_node_set_key(ksl, lnode, dest->key); + ++lnode->blk->n; + + --rnode->blk->n; + memmove(rnode->blk->nodes, rnode->blk->nodes + ksl->nodelen, + ksl->nodelen * rnode->blk->n); +} + +/* + * ksl_shift_right moves the last node in blk->nodes[i]->blk->nodes to + * blk->nodes[i + 1]->blk->nodes. + */ +static void ksl_shift_right(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, size_t i) { + nghttp2_ksl_node *lnode, *rnode, *dest, *src; + + assert(i < blk->n - 1); + + lnode = nghttp2_ksl_nth_node(ksl, blk, i); + rnode = nghttp2_ksl_nth_node(ksl, blk, i + 1); + + assert(lnode->blk->n > NGHTTP2_KSL_MIN_NBLK); + assert(rnode->blk->n < NGHTTP2_KSL_MAX_NBLK); + + memmove(rnode->blk->nodes + ksl->nodelen, rnode->blk->nodes, + ksl->nodelen * rnode->blk->n); + ++rnode->blk->n; + + dest = nghttp2_ksl_nth_node(ksl, rnode->blk, 0); + src = nghttp2_ksl_nth_node(ksl, lnode->blk, lnode->blk->n - 1); + + memcpy(dest, src, ksl->nodelen); + + --lnode->blk->n; + ksl_node_set_key( + ksl, lnode, + nghttp2_ksl_nth_node(ksl, lnode->blk, lnode->blk->n - 1)->key); +} + +/* + * key_equal returns nonzero if |lhs| and |rhs| are equal using the + * function |compar|. + */ +static int key_equal(nghttp2_ksl_compar compar, const nghttp2_ksl_key *lhs, + const nghttp2_ksl_key *rhs) { + return !compar(lhs, rhs) && !compar(rhs, lhs); +} + +int nghttp2_ksl_remove(nghttp2_ksl *ksl, nghttp2_ksl_it *it, + const nghttp2_ksl_key *key) { + nghttp2_ksl_blk *blk = ksl->head; + nghttp2_ksl_node *node; + size_t i; + + if (!blk->leaf && blk->n == 2 && + nghttp2_ksl_nth_node(ksl, blk, 0)->blk->n == NGHTTP2_KSL_MIN_NBLK && + nghttp2_ksl_nth_node(ksl, blk, 1)->blk->n == NGHTTP2_KSL_MIN_NBLK) { + blk = ksl_merge_node(ksl, ksl->head, 0); + } + + for (;;) { + i = ksl_bsearch(ksl, blk, key, ksl->compar); + + if (i == blk->n) { + if (it) { + *it = nghttp2_ksl_end(ksl); + } + return NGHTTP2_ERR_INVALID_ARGUMENT; + } + + if (blk->leaf) { + if (ksl->compar(key, nghttp2_ksl_nth_node(ksl, blk, i)->key)) { + if (it) { + *it = nghttp2_ksl_end(ksl); + } + return NGHTTP2_ERR_INVALID_ARGUMENT; + } + ksl_remove_node(ksl, blk, i); + --ksl->n; + if (it) { + if (blk->n == i && blk->next) { + nghttp2_ksl_it_init(it, ksl, blk->next, 0); + } else { + nghttp2_ksl_it_init(it, ksl, blk, i); + } + } + return 0; + } + + node = nghttp2_ksl_nth_node(ksl, blk, i); + + if (node->blk->n == NGHTTP2_KSL_MIN_NBLK) { + if (i > 0 && nghttp2_ksl_nth_node(ksl, blk, i - 1)->blk->n > + NGHTTP2_KSL_MIN_NBLK) { + ksl_shift_right(ksl, blk, i - 1); + blk = node->blk; + } else if (i + 1 < blk->n && + nghttp2_ksl_nth_node(ksl, blk, i + 1)->blk->n > + NGHTTP2_KSL_MIN_NBLK) { + ksl_shift_left(ksl, blk, i + 1); + blk = node->blk; + } else if (i > 0) { + blk = ksl_merge_node(ksl, blk, i - 1); + } else { + assert(i + 1 < blk->n); + blk = ksl_merge_node(ksl, blk, i); + } + } else { + blk = node->blk; + } + } +} + +nghttp2_ksl_it nghttp2_ksl_lower_bound(nghttp2_ksl *ksl, + const nghttp2_ksl_key *key) { + nghttp2_ksl_blk *blk = ksl->head; + nghttp2_ksl_it it; + size_t i; + + for (;;) { + i = ksl_bsearch(ksl, blk, key, ksl->compar); + + if (blk->leaf) { + if (i == blk->n && blk->next) { + blk = blk->next; + i = 0; + } + nghttp2_ksl_it_init(&it, ksl, blk, i); + return it; + } + + if (i == blk->n) { + /* This happens if descendant has smaller key. Fast forward to + find last node in this subtree. */ + for (; !blk->leaf; blk = nghttp2_ksl_nth_node(ksl, blk, blk->n - 1)->blk) + ; + if (blk->next) { + blk = blk->next; + i = 0; + } else { + i = blk->n; + } + nghttp2_ksl_it_init(&it, ksl, blk, i); + return it; + } + blk = nghttp2_ksl_nth_node(ksl, blk, i)->blk; + } +} + +nghttp2_ksl_it nghttp2_ksl_lower_bound_compar(nghttp2_ksl *ksl, + const nghttp2_ksl_key *key, + nghttp2_ksl_compar compar) { + nghttp2_ksl_blk *blk = ksl->head; + nghttp2_ksl_it it; + size_t i; + + for (;;) { + i = ksl_bsearch(ksl, blk, key, compar); + + if (blk->leaf) { + if (i == blk->n && blk->next) { + blk = blk->next; + i = 0; + } + nghttp2_ksl_it_init(&it, ksl, blk, i); + return it; + } + + if (i == blk->n) { + /* This happens if descendant has smaller key. Fast forward to + find last node in this subtree. */ + for (; !blk->leaf; blk = nghttp2_ksl_nth_node(ksl, blk, blk->n - 1)->blk) + ; + if (blk->next) { + blk = blk->next; + i = 0; + } else { + i = blk->n; + } + nghttp2_ksl_it_init(&it, ksl, blk, i); + return it; + } + blk = nghttp2_ksl_nth_node(ksl, blk, i)->blk; + } +} + +void nghttp2_ksl_update_key(nghttp2_ksl *ksl, const nghttp2_ksl_key *old_key, + const nghttp2_ksl_key *new_key) { + nghttp2_ksl_blk *blk = ksl->head; + nghttp2_ksl_node *node; + size_t i; + + for (;;) { + i = ksl_bsearch(ksl, blk, old_key, ksl->compar); + + assert(i < blk->n); + node = nghttp2_ksl_nth_node(ksl, blk, i); + + if (blk->leaf) { + assert(key_equal(ksl->compar, (nghttp2_ksl_key *)node->key, old_key)); + ksl_node_set_key(ksl, node, new_key); + return; + } + + if (key_equal(ksl->compar, (nghttp2_ksl_key *)node->key, old_key) || + ksl->compar((nghttp2_ksl_key *)node->key, new_key)) { + ksl_node_set_key(ksl, node, new_key); + } + + blk = node->blk; + } +} + +static void ksl_print(nghttp2_ksl *ksl, nghttp2_ksl_blk *blk, size_t level) { + size_t i; + nghttp2_ksl_node *node; + + fprintf(stderr, "LV=%zu n=%zu\n", level, blk->n); + + if (blk->leaf) { + for (i = 0; i < blk->n; ++i) { + node = nghttp2_ksl_nth_node(ksl, blk, i); + fprintf(stderr, " %" PRId64, *(int64_t *)(void *)node->key); + } + fprintf(stderr, "\n"); + return; + } + + for (i = 0; i < blk->n; ++i) { + ksl_print(ksl, nghttp2_ksl_nth_node(ksl, blk, i)->blk, level + 1); + } +} + +size_t nghttp2_ksl_len(nghttp2_ksl *ksl) { return ksl->n; } + +void nghttp2_ksl_clear(nghttp2_ksl *ksl) { + size_t i; + nghttp2_ksl_blk *head; + + if (!ksl->head->leaf) { + for (i = 0; i < ksl->head->n; ++i) { + ksl_free_blk(ksl, nghttp2_ksl_nth_node(ksl, ksl->head, i)->blk); + } + } + + ksl->front = ksl->back = ksl->head; + ksl->n = 0; + + head = ksl->head; + + head->next = head->prev = NULL; + head->n = 0; + head->leaf = 1; +} + +void nghttp2_ksl_print(nghttp2_ksl *ksl) { ksl_print(ksl, ksl->head, 0); } + +nghttp2_ksl_it nghttp2_ksl_begin(const nghttp2_ksl *ksl) { + nghttp2_ksl_it it; + nghttp2_ksl_it_init(&it, ksl, ksl->front, 0); + return it; +} + +nghttp2_ksl_it nghttp2_ksl_end(const nghttp2_ksl *ksl) { + nghttp2_ksl_it it; + nghttp2_ksl_it_init(&it, ksl, ksl->back, ksl->back->n); + return it; +} + +void nghttp2_ksl_it_init(nghttp2_ksl_it *it, const nghttp2_ksl *ksl, + nghttp2_ksl_blk *blk, size_t i) { + it->ksl = ksl; + it->blk = blk; + it->i = i; +} + +void *nghttp2_ksl_it_get(const nghttp2_ksl_it *it) { + assert(it->i < it->blk->n); + return nghttp2_ksl_nth_node(it->ksl, it->blk, it->i)->data; +} + +void nghttp2_ksl_it_prev(nghttp2_ksl_it *it) { + assert(!nghttp2_ksl_it_begin(it)); + + if (it->i == 0) { + it->blk = it->blk->prev; + it->i = it->blk->n - 1; + } else { + --it->i; + } +} + +int nghttp2_ksl_it_begin(const nghttp2_ksl_it *it) { + return it->i == 0 && it->blk->prev == NULL; +} diff --git a/deps/nghttp2/lib/nghttp2_ksl.h b/deps/nghttp2/lib/nghttp2_ksl.h new file mode 100644 index 00000000000000..39d900ffbf5bd6 --- /dev/null +++ b/deps/nghttp2/lib/nghttp2_ksl.h @@ -0,0 +1,315 @@ +/* + * nghttp2 - HTTP/2 C Library + * + * Copyright (c) 2020 nghttp2 contributors + * Copyright (c) 2018 ngtcp2 contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef NGHTTP2_KSL_H +#define NGHTTP2_KSL_H + +#ifdef HAVE_CONFIG_H +# include +#endif /* HAVE_CONFIG_H */ + +#include + +#include + +/* + * Skip List using single key instead of range. + */ + +#define NGHTTP2_KSL_DEGR 16 +/* NGHTTP2_KSL_MAX_NBLK is the maximum number of nodes which a single + block can contain. */ +#define NGHTTP2_KSL_MAX_NBLK (2 * NGHTTP2_KSL_DEGR - 1) +/* NGHTTP2_KSL_MIN_NBLK is the minimum number of nodes which a single + block other than root must contains. */ +#define NGHTTP2_KSL_MIN_NBLK (NGHTTP2_KSL_DEGR - 1) + +/* + * nghttp2_ksl_key represents key in nghttp2_ksl. + */ +typedef void nghttp2_ksl_key; + +struct nghttp2_ksl_node; +typedef struct nghttp2_ksl_node nghttp2_ksl_node; + +struct nghttp2_ksl_blk; +typedef struct nghttp2_ksl_blk nghttp2_ksl_blk; + +/* + * nghttp2_ksl_node is a node which contains either nghttp2_ksl_blk or + * opaque data. If a node is an internal node, it contains + * nghttp2_ksl_blk. Otherwise, it has data. The key is stored at the + * location starting at key. + */ +struct nghttp2_ksl_node { + union { + nghttp2_ksl_blk *blk; + void *data; + }; + union { + uint64_t align; + /* key is a buffer to include key associated to this node. + Because the length of key is unknown until nghttp2_ksl_init is + called, the actual buffer will be allocated after this + field. */ + uint8_t key[1]; + }; +}; + +/* + * nghttp2_ksl_blk contains nghttp2_ksl_node objects. + */ +struct nghttp2_ksl_blk { + /* next points to the next block if leaf field is nonzero. */ + nghttp2_ksl_blk *next; + /* prev points to the previous block if leaf field is nonzero. */ + nghttp2_ksl_blk *prev; + /* n is the number of nodes this object contains in nodes. */ + size_t n; + /* leaf is nonzero if this block contains leaf nodes. */ + int leaf; + union { + uint64_t align; + /* nodes is a buffer to contain NGHTTP2_KSL_MAX_NBLK + nghttp2_ksl_node objects. Because nghttp2_ksl_node object is + allocated along with the additional variable length key + storage, the size of buffer is unknown until nghttp2_ksl_init is + called. */ + uint8_t nodes[1]; + }; +}; + +/* + * nghttp2_ksl_compar is a function type which returns nonzero if key + * |lhs| should be placed before |rhs|. It returns 0 otherwise. + */ +typedef int (*nghttp2_ksl_compar)(const nghttp2_ksl_key *lhs, + const nghttp2_ksl_key *rhs); + +struct nghttp2_ksl; +typedef struct nghttp2_ksl nghttp2_ksl; + +struct nghttp2_ksl_it; +typedef struct nghttp2_ksl_it nghttp2_ksl_it; + +/* + * nghttp2_ksl_it is a forward iterator to iterate nodes. + */ +struct nghttp2_ksl_it { + const nghttp2_ksl *ksl; + nghttp2_ksl_blk *blk; + size_t i; +}; + +/* + * nghttp2_ksl is a deterministic paged skip list. + */ +struct nghttp2_ksl { + /* head points to the root block. */ + nghttp2_ksl_blk *head; + /* front points to the first leaf block. */ + nghttp2_ksl_blk *front; + /* back points to the last leaf block. */ + nghttp2_ksl_blk *back; + nghttp2_ksl_compar compar; + size_t n; + /* keylen is the size of key */ + size_t keylen; + /* nodelen is the actual size of nghttp2_ksl_node including key + storage. */ + size_t nodelen; + nghttp2_mem *mem; +}; + +/* + * nghttp2_ksl_init initializes |ksl|. |compar| specifies compare + * function. |keylen| is the length of key. + * + * It returns 0 if it succeeds, or one of the following negative error + * codes: + * + * NGHTTP2_ERR_NOMEM + * Out of memory. + */ +int nghttp2_ksl_init(nghttp2_ksl *ksl, nghttp2_ksl_compar compar, size_t keylen, + nghttp2_mem *mem); + +/* + * nghttp2_ksl_free frees resources allocated for |ksl|. If |ksl| is + * NULL, this function does nothing. It does not free the memory + * region pointed by |ksl| itself. + */ +void nghttp2_ksl_free(nghttp2_ksl *ksl); + +/* + * nghttp2_ksl_insert inserts |key| with its associated |data|. On + * successful insertion, the iterator points to the inserted node is + * stored in |*it|. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * NGHTTP2_ERR_NOMEM + * Out of memory. + * NGHTTP2_ERR_INVALID_ARGUMENT + * |key| already exists. + */ +int nghttp2_ksl_insert(nghttp2_ksl *ksl, nghttp2_ksl_it *it, + const nghttp2_ksl_key *key, void *data); + +/* + * nghttp2_ksl_remove removes the |key| from |ksl|. + * + * This function assigns the iterator to |*it|, which points to the + * node which is located at the right next of the removed node if |it| + * is not NULL. If |key| is not found, no deletion takes place and + * the return value of nghttp2_ksl_end(ksl) is assigned to |*it|. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * NGHTTP2_ERR_INVALID_ARGUMENT + * |key| does not exist. + */ +int nghttp2_ksl_remove(nghttp2_ksl *ksl, nghttp2_ksl_it *it, + const nghttp2_ksl_key *key); + +/* + * nghttp2_ksl_lower_bound returns the iterator which points to the + * first node which has the key which is equal to |key| or the last + * node which satisfies !compar(&node->key, key). If there is no such + * node, it returns the iterator which satisfies nghttp2_ksl_it_end(it) + * != 0. + */ +nghttp2_ksl_it nghttp2_ksl_lower_bound(nghttp2_ksl *ksl, + const nghttp2_ksl_key *key); + +/* + * nghttp2_ksl_lower_bound_compar works like nghttp2_ksl_lower_bound, + * but it takes custom function |compar| to do lower bound search. + */ +nghttp2_ksl_it nghttp2_ksl_lower_bound_compar(nghttp2_ksl *ksl, + const nghttp2_ksl_key *key, + nghttp2_ksl_compar compar); + +/* + * nghttp2_ksl_update_key replaces the key of nodes which has |old_key| + * with |new_key|. |new_key| must be strictly greater than the + * previous node and strictly smaller than the next node. + */ +void nghttp2_ksl_update_key(nghttp2_ksl *ksl, const nghttp2_ksl_key *old_key, + const nghttp2_ksl_key *new_key); + +/* + * nghttp2_ksl_begin returns the iterator which points to the first + * node. If there is no node in |ksl|, it returns the iterator which + * satisfies nghttp2_ksl_it_end(it) != 0. + */ +nghttp2_ksl_it nghttp2_ksl_begin(const nghttp2_ksl *ksl); + +/* + * nghttp2_ksl_end returns the iterator which points to the node + * following the last node. The returned object satisfies + * nghttp2_ksl_it_end(). If there is no node in |ksl|, it returns the + * iterator which satisfies nghttp2_ksl_it_begin(it) != 0. + */ +nghttp2_ksl_it nghttp2_ksl_end(const nghttp2_ksl *ksl); + +/* + * nghttp2_ksl_len returns the number of elements stored in |ksl|. + */ +size_t nghttp2_ksl_len(nghttp2_ksl *ksl); + +/* + * nghttp2_ksl_clear removes all elements stored in |ksl|. + */ +void nghttp2_ksl_clear(nghttp2_ksl *ksl); + +/* + * nghttp2_ksl_nth_node returns the |n|th node under |blk|. + */ +#define nghttp2_ksl_nth_node(KSL, BLK, N) \ + ((nghttp2_ksl_node *)(void *)((BLK)->nodes + (KSL)->nodelen * (N))) + +/* + * nghttp2_ksl_print prints its internal state in stderr. It assumes + * that the key is of type int64_t. This function should be used for + * the debugging purpose only. + */ +void nghttp2_ksl_print(nghttp2_ksl *ksl); + +/* + * nghttp2_ksl_it_init initializes |it|. + */ +void nghttp2_ksl_it_init(nghttp2_ksl_it *it, const nghttp2_ksl *ksl, + nghttp2_ksl_blk *blk, size_t i); + +/* + * nghttp2_ksl_it_get returns the data associated to the node which + * |it| points to. It is undefined to call this function when + * nghttp2_ksl_it_end(it) returns nonzero. + */ +void *nghttp2_ksl_it_get(const nghttp2_ksl_it *it); + +/* + * nghttp2_ksl_it_next advances the iterator by one. It is undefined + * if this function is called when nghttp2_ksl_it_end(it) returns + * nonzero. + */ +#define nghttp2_ksl_it_next(IT) \ + (++(IT)->i == (IT)->blk->n && (IT)->blk->next \ + ? ((IT)->blk = (IT)->blk->next, (IT)->i = 0) \ + : 0) + +/* + * nghttp2_ksl_it_prev moves backward the iterator by one. It is + * undefined if this function is called when nghttp2_ksl_it_begin(it) + * returns nonzero. + */ +void nghttp2_ksl_it_prev(nghttp2_ksl_it *it); + +/* + * nghttp2_ksl_it_end returns nonzero if |it| points to the beyond the + * last node. + */ +#define nghttp2_ksl_it_end(IT) \ + ((IT)->blk->n == (IT)->i && (IT)->blk->next == NULL) + +/* + * nghttp2_ksl_it_begin returns nonzero if |it| points to the first + * node. |it| might satisfy both nghttp2_ksl_it_begin(&it) and + * nghttp2_ksl_it_end(&it) if the skip list has no node. + */ +int nghttp2_ksl_it_begin(const nghttp2_ksl_it *it); + +/* + * nghttp2_ksl_key returns the key of the node which |it| points to. + * It is undefined to call this function when nghttp2_ksl_it_end(it) + * returns nonzero. + */ +#define nghttp2_ksl_it_key(IT) \ + ((nghttp2_ksl_key *)nghttp2_ksl_nth_node((IT)->ksl, (IT)->blk, (IT)->i)->key) + +#endif /* NGHTTP2_KSL_H */ diff --git a/deps/nghttp2/lib/nghttp2_map.c b/deps/nghttp2/lib/nghttp2_map.c index 4d9f97b47e2f54..d12a1f4757b725 100644 --- a/deps/nghttp2/lib/nghttp2_map.c +++ b/deps/nghttp2/lib/nghttp2_map.c @@ -1,7 +1,8 @@ /* * nghttp2 - HTTP/2 C Library * - * Copyright (c) 2012 Tatsuhiro Tsujikawa + * Copyright (c) 2017 ngtcp2 contributors + * Copyright (c) 2012 nghttp2 contributors * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,6 +26,9 @@ #include "nghttp2_map.h" #include +#include + +#include "nghttp2_helper.h" #define INITIAL_TABLE_LENGTH 256 @@ -32,7 +36,7 @@ int nghttp2_map_init(nghttp2_map *map, nghttp2_mem *mem) { map->mem = mem; map->tablelen = INITIAL_TABLE_LENGTH; map->table = - nghttp2_mem_calloc(mem, map->tablelen, sizeof(nghttp2_map_entry *)); + nghttp2_mem_calloc(mem, map->tablelen, sizeof(nghttp2_map_bucket)); if (map->table == NULL) { return NGHTTP2_ERR_NOMEM; } @@ -43,6 +47,21 @@ int nghttp2_map_init(nghttp2_map *map, nghttp2_mem *mem) { } void nghttp2_map_free(nghttp2_map *map) { + size_t i; + nghttp2_map_bucket *bkt; + + if (!map) { + return; + } + + for (i = 0; i < map->tablelen; ++i) { + bkt = &map->table[i]; + if (bkt->ksl) { + nghttp2_ksl_free(bkt->ksl); + nghttp2_mem_free(map->mem, bkt->ksl); + } + } + nghttp2_mem_free(map->mem, map->table); } @@ -50,14 +69,29 @@ void nghttp2_map_each_free(nghttp2_map *map, int (*func)(nghttp2_map_entry *entry, void *ptr), void *ptr) { uint32_t i; + nghttp2_map_bucket *bkt; + nghttp2_ksl_it it; + for (i = 0; i < map->tablelen; ++i) { - nghttp2_map_entry *entry; - for (entry = map->table[i]; entry;) { - nghttp2_map_entry *next = entry->next; - func(entry, ptr); - entry = next; + bkt = &map->table[i]; + + if (bkt->ptr) { + func(bkt->ptr, ptr); + bkt->ptr = NULL; + assert(bkt->ksl == NULL || nghttp2_ksl_len(bkt->ksl) == 0); + continue; + } + + if (bkt->ksl) { + for (it = nghttp2_ksl_begin(bkt->ksl); !nghttp2_ksl_it_end(&it); + nghttp2_ksl_it_next(&it)) { + func(nghttp2_ksl_it_get(&it), ptr); + } + + nghttp2_ksl_free(bkt->ksl); + nghttp2_mem_free(map->mem, bkt->ksl); + bkt->ksl = NULL; } - map->table[i] = NULL; } } @@ -66,13 +100,29 @@ int nghttp2_map_each(nghttp2_map *map, void *ptr) { int rv; uint32_t i; + nghttp2_map_bucket *bkt; + nghttp2_ksl_it it; + for (i = 0; i < map->tablelen; ++i) { - nghttp2_map_entry *entry; - for (entry = map->table[i]; entry; entry = entry->next) { - rv = func(entry, ptr); + bkt = &map->table[i]; + + if (bkt->ptr) { + rv = func(bkt->ptr, ptr); if (rv != 0) { return rv; } + assert(bkt->ksl == NULL || nghttp2_ksl_len(bkt->ksl) == 0); + continue; + } + + if (bkt->ksl) { + for (it = nghttp2_ksl_begin(bkt->ksl); !nghttp2_ksl_it_end(&it); + nghttp2_ksl_it_next(&it)) { + rv = func(nghttp2_ksl_it_get(&it), ptr); + if (rv != 0) { + return rv; + } + } } } return 0; @@ -83,72 +133,133 @@ void nghttp2_map_entry_init(nghttp2_map_entry *entry, key_type key) { entry->next = NULL; } -/* Same hash function in android HashMap source code. */ -/* The |mod| must be power of 2 */ -static uint32_t hash(int32_t key, uint32_t mod) { - uint32_t h = (uint32_t)key; - h ^= (h >> 20) ^ (h >> 12); - h ^= (h >> 7) ^ (h >> 4); +/* FNV1a hash */ +static uint32_t hash(key_type key, uint32_t mod) { + uint8_t *p, *end; + uint32_t h = 0x811C9DC5u; + + p = (uint8_t *)&key; + end = p + sizeof(key_type); + + for (; p != end;) { + h ^= *p++; + h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24); + } + return h & (mod - 1); } -static int insert(nghttp2_map_entry **table, uint32_t tablelen, - nghttp2_map_entry *entry) { +static int less(const nghttp2_ksl_key *lhs, const nghttp2_ksl_key *rhs) { + return *(key_type *)lhs < *(key_type *)rhs; +} + +static int map_insert(nghttp2_map *map, nghttp2_map_bucket *table, + uint32_t tablelen, nghttp2_map_entry *entry) { uint32_t h = hash(entry->key, tablelen); - if (table[h] == NULL) { - table[h] = entry; - } else { - nghttp2_map_entry *p; - /* We won't allow duplicated key, so check it out. */ - for (p = table[h]; p; p = p->next) { - if (p->key == entry->key) { - return NGHTTP2_ERR_INVALID_ARGUMENT; - } + nghttp2_map_bucket *bkt = &table[h]; + nghttp2_mem *mem = map->mem; + int rv; + + if (bkt->ptr == NULL && + (bkt->ksl == NULL || nghttp2_ksl_len(bkt->ksl) == 0)) { + bkt->ptr = entry; + return 0; + } + + if (!bkt->ksl) { + bkt->ksl = nghttp2_mem_malloc(mem, sizeof(*bkt->ksl)); + if (bkt->ksl == NULL) { + return NGHTTP2_ERR_NOMEM; } - entry->next = table[h]; - table[h] = entry; + nghttp2_ksl_init(bkt->ksl, less, sizeof(key_type), mem); } - return 0; + + if (bkt->ptr) { + rv = nghttp2_ksl_insert(bkt->ksl, NULL, &bkt->ptr->key, bkt->ptr); + if (rv != 0) { + return rv; + } + + bkt->ptr = NULL; + } + + return nghttp2_ksl_insert(bkt->ksl, NULL, &entry->key, entry); } /* new_tablelen must be power of 2 */ -static int resize(nghttp2_map *map, uint32_t new_tablelen) { +static int map_resize(nghttp2_map *map, uint32_t new_tablelen) { uint32_t i; - nghttp2_map_entry **new_table; + nghttp2_map_bucket *new_table; + nghttp2_map_bucket *bkt; + nghttp2_ksl_it it; + int rv; new_table = - nghttp2_mem_calloc(map->mem, new_tablelen, sizeof(nghttp2_map_entry *)); + nghttp2_mem_calloc(map->mem, new_tablelen, sizeof(nghttp2_map_bucket)); if (new_table == NULL) { return NGHTTP2_ERR_NOMEM; } for (i = 0; i < map->tablelen; ++i) { - nghttp2_map_entry *entry; - for (entry = map->table[i]; entry;) { - nghttp2_map_entry *next = entry->next; - entry->next = NULL; - /* This function must succeed */ - insert(new_table, new_tablelen, entry); - entry = next; + bkt = &map->table[i]; + + if (bkt->ptr) { + rv = map_insert(map, new_table, new_tablelen, bkt->ptr); + if (rv != 0) { + goto fail; + } + assert(bkt->ksl == NULL || nghttp2_ksl_len(bkt->ksl) == 0); + continue; + } + + if (bkt->ksl) { + for (it = nghttp2_ksl_begin(bkt->ksl); !nghttp2_ksl_it_end(&it); + nghttp2_ksl_it_next(&it)) { + rv = map_insert(map, new_table, new_tablelen, nghttp2_ksl_it_get(&it)); + if (rv != 0) { + goto fail; + } + } + } + } + + for (i = 0; i < map->tablelen; ++i) { + bkt = &map->table[i]; + if (bkt->ksl) { + nghttp2_ksl_free(bkt->ksl); + nghttp2_mem_free(map->mem, bkt->ksl); } } + nghttp2_mem_free(map->mem, map->table); map->tablelen = new_tablelen; map->table = new_table; return 0; + +fail: + for (i = 0; i < new_tablelen; ++i) { + bkt = &new_table[i]; + if (bkt->ksl) { + nghttp2_ksl_free(bkt->ksl); + nghttp2_mem_free(map->mem, bkt->ksl); + } + } + + return rv; } int nghttp2_map_insert(nghttp2_map *map, nghttp2_map_entry *new_entry) { int rv; + /* Load factor is 0.75 */ if ((map->size + 1) * 4 > map->tablelen * 3) { - rv = resize(map, map->tablelen * 2); + rv = map_resize(map, map->tablelen * 2); if (rv != 0) { return rv; } } - rv = insert(map->table, map->tablelen, new_entry); + rv = map_insert(map, map->table, map->tablelen, new_entry); if (rv != 0) { return rv; } @@ -157,33 +268,68 @@ int nghttp2_map_insert(nghttp2_map *map, nghttp2_map_entry *new_entry) { } nghttp2_map_entry *nghttp2_map_find(nghttp2_map *map, key_type key) { - uint32_t h; - nghttp2_map_entry *entry; - h = hash(key, map->tablelen); - for (entry = map->table[h]; entry; entry = entry->next) { - if (entry->key == key) { - return entry; + nghttp2_map_bucket *bkt = &map->table[hash(key, map->tablelen)]; + nghttp2_ksl_it it; + + if (bkt->ptr) { + if (bkt->ptr->key == key) { + return bkt->ptr; + } + return NULL; + } + + if (bkt->ksl) { + it = nghttp2_ksl_lower_bound(bkt->ksl, &key); + if (nghttp2_ksl_it_end(&it) || + *(key_type *)nghttp2_ksl_it_key(&it) != key) { + return NULL; } + return nghttp2_ksl_it_get(&it); } + return NULL; } int nghttp2_map_remove(nghttp2_map *map, key_type key) { - uint32_t h; - nghttp2_map_entry **dst; - - h = hash(key, map->tablelen); + nghttp2_map_bucket *bkt = &map->table[hash(key, map->tablelen)]; + int rv; - for (dst = &map->table[h]; *dst; dst = &(*dst)->next) { - if ((*dst)->key != key) { - continue; + if (bkt->ptr) { + if (bkt->ptr->key == key) { + bkt->ptr = NULL; + --map->size; + return 0; } + return NGHTTP2_ERR_INVALID_ARGUMENT; + } - *dst = (*dst)->next; + if (bkt->ksl) { + rv = nghttp2_ksl_remove(bkt->ksl, NULL, &key); + if (rv != 0) { + return rv; + } --map->size; return 0; } + return NGHTTP2_ERR_INVALID_ARGUMENT; } +void nghttp2_map_clear(nghttp2_map *map) { + uint32_t i; + nghttp2_map_bucket *bkt; + + for (i = 0; i < map->tablelen; ++i) { + bkt = &map->table[i]; + bkt->ptr = NULL; + if (bkt->ksl) { + nghttp2_ksl_free(bkt->ksl); + nghttp2_mem_free(map->mem, bkt->ksl); + bkt->ksl = NULL; + } + } + + map->size = 0; +} + size_t nghttp2_map_size(nghttp2_map *map) { return map->size; } diff --git a/deps/nghttp2/lib/nghttp2_map.h b/deps/nghttp2/lib/nghttp2_map.h index f6e29e35f2de3f..2cf59f698e35bb 100644 --- a/deps/nghttp2/lib/nghttp2_map.h +++ b/deps/nghttp2/lib/nghttp2_map.h @@ -1,7 +1,8 @@ /* * nghttp2 - HTTP/2 C Library * - * Copyright (c) 2012 Tatsuhiro Tsujikawa + * Copyright (c) 2017 ngtcp2 contributors + * Copyright (c) 2012 nghttp2 contributors * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -30,8 +31,9 @@ #endif /* HAVE_CONFIG_H */ #include -#include "nghttp2_int.h" + #include "nghttp2_mem.h" +#include "nghttp2_ksl.h" /* Implementation of unordered map */ @@ -46,8 +48,13 @@ typedef struct nghttp2_map_entry { #endif } nghttp2_map_entry; +typedef struct nghttp2_map_bucket { + nghttp2_map_entry *ptr; + nghttp2_ksl *ksl; +} nghttp2_map_bucket; + typedef struct { - nghttp2_map_entry **table; + nghttp2_map_bucket *table; nghttp2_mem *mem; size_t size; uint32_t tablelen; @@ -118,6 +125,11 @@ nghttp2_map_entry *nghttp2_map_find(nghttp2_map *map, key_type key); */ int nghttp2_map_remove(nghttp2_map *map, key_type key); +/* + * Removes all entries from |map|. + */ +void nghttp2_map_clear(nghttp2_map *map); + /* * Returns the number of items stored in the map |map|. */ diff --git a/deps/nghttp2/lib/nghttp2_session.c b/deps/nghttp2/lib/nghttp2_session.c index 39f81f498cda79..2e7e907f25e199 100644 --- a/deps/nghttp2/lib/nghttp2_session.c +++ b/deps/nghttp2/lib/nghttp2_session.c @@ -959,6 +959,18 @@ int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id, return 0; } + /* Sending RST_STREAM to an idle stream is subject to protocol + violation. Historically, nghttp2 allows this. In order not to + disrupt the existing applications, we don't error out this case + and simply ignore it. */ + if (nghttp2_session_is_my_stream_id(session, stream_id)) { + if ((uint32_t)stream_id >= session->next_stream_id) { + return 0; + } + } else if (session->last_recv_stream_id < stream_id) { + return 0; + } + /* Cancel pending request HEADERS in ob_syn if this RST_STREAM refers to that stream. */ if (!session->server && nghttp2_session_is_my_stream_id(session, stream_id) && @@ -969,8 +981,7 @@ int nghttp2_session_add_rst_stream(nghttp2_session *session, int32_t stream_id, headers_frame = &nghttp2_outbound_queue_top(&session->ob_syn)->frame; assert(headers_frame->hd.type == NGHTTP2_HEADERS); - if (headers_frame->hd.stream_id <= stream_id && - (uint32_t)stream_id < session->next_stream_id) { + if (headers_frame->hd.stream_id <= stream_id) { for (item = session->ob_syn.head; item; item = item->qnext) { aux_data = &item->aux_data.headers; @@ -5353,9 +5364,11 @@ static ssize_t inbound_frame_effective_readlen(nghttp2_inbound_frame *iframe, return (ssize_t)(readlen); } +static const uint8_t static_in[] = {0}; + ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in, size_t inlen) { - const uint8_t *first = in, *last = in + inlen; + const uint8_t *first, *last; nghttp2_inbound_frame *iframe = &session->iframe; size_t readlen; ssize_t padlen; @@ -5366,6 +5379,14 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in, size_t pri_fieldlen; nghttp2_mem *mem; + if (in == NULL) { + assert(inlen == 0); + in = static_in; + } + + first = in; + last = in + inlen; + DEBUGF("recv: connection recv_window_size=%d, local_window=%d\n", session->recv_window_size, session->local_window_size); @@ -7448,8 +7469,8 @@ static int nghttp2_session_upgrade_internal(nghttp2_session *session, return NGHTTP2_ERR_INVALID_ARGUMENT; } /* SETTINGS frame contains too many settings */ - if (settings_payloadlen / NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH - > session->max_settings) { + if (settings_payloadlen / NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH > + session->max_settings) { return NGHTTP2_ERR_TOO_MANY_SETTINGS; } rv = nghttp2_frame_unpack_settings_payload2(&iv, &niv, settings_payload, diff --git a/deps/nghttp2/nghttp2.gyp b/deps/nghttp2/nghttp2.gyp index 0dcd034b8169da..21fd6ba5ecf46d 100644 --- a/deps/nghttp2/nghttp2.gyp +++ b/deps/nghttp2/nghttp2.gyp @@ -44,6 +44,7 @@ 'lib/nghttp2_hd_huffman_data.c', 'lib/nghttp2_helper.c', 'lib/nghttp2_http.c', + 'lib/nghttp2_ksl.c', 'lib/nghttp2_map.c', 'lib/nghttp2_mem.c', 'lib/nghttp2_npn.c', From 54bd4ab85591e82f315766fc32932d7fb037e341 Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Mon, 4 Jan 2021 13:55:42 +0800 Subject: [PATCH 140/161] cluster: fix edge cases that throw ERR_INTERNAL_ASSERTION Some cases use both `cluster` and `net`/`cluser` will throw ERR_INTERNAL_ASSERTION when `listen`/`bind` to the port of `0`. This PR maitains a separate map of the index to fix the issue. See the new tests added for the detail cases. PR-URL: https://github.com/nodejs/node/pull/36764 Reviewed-By: Antoine du Hamel --- lib/internal/cluster/child.js | 41 ++++++++++++------- .../test-cluster-child-index-dgram.js | 40 ++++++++++++++++++ test/parallel/test-cluster-child-index-net.js | 31 ++++++++++++++ 3 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 test/parallel/test-cluster-child-index-dgram.js create mode 100644 test/parallel/test-cluster-child-index-net.js diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index 90dce42fa6fa70..24db07f118befa 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -6,6 +6,7 @@ const { ObjectAssign, ReflectApply, SafeMap, + SafeSet, } = primordials; const assert = require('internal/assert'); @@ -73,14 +74,14 @@ cluster._getServer = function(obj, options, cb) { options.fd, ], ':'); - let index = indexes.get(indexesKey); + let indexSet = indexes.get(indexesKey); - if (index === undefined) - index = 0; - else - index++; - - indexes.set(indexesKey, index); + if (indexSet === undefined) { + indexSet = { nextIndex: 0, set: new SafeSet() }; + indexes.set(indexesKey, indexSet); + } + const index = indexSet.nextIndex++; + indexSet.set.add(index); const message = { act: 'queryServer', @@ -100,9 +101,9 @@ cluster._getServer = function(obj, options, cb) { obj._setServerData(reply.data); if (handle) - shared(reply, handle, indexesKey, cb); // Shared listen socket. + shared(reply, handle, indexesKey, index, cb); // Shared listen socket. else - rr(reply, indexesKey, cb); // Round-robin. + rr(reply, indexesKey, index, cb); // Round-robin. }); obj.once('listening', () => { @@ -114,8 +115,20 @@ cluster._getServer = function(obj, options, cb) { }); }; +function removeIndexesKey(indexesKey, index) { + const indexSet = indexes.get(indexesKey); + if (!indexSet) { + return; + } + + indexSet.set.delete(index); + if (indexSet.set.size === 0) { + indexes.delete(indexesKey); + } +} + // Shared listen socket. -function shared(message, handle, indexesKey, cb) { +function shared(message, handle, indexesKey, index, cb) { const key = message.key; // Monkey-patch the close() method so we can keep track of when it's // closed. Avoids resource leaks when the handle is short-lived. @@ -124,7 +137,7 @@ function shared(message, handle, indexesKey, cb) { handle.close = function() { send({ act: 'close', key }); handles.delete(key); - indexes.delete(indexesKey); + removeIndexesKey(indexesKey, index); return ReflectApply(close, handle, arguments); }; assert(handles.has(key) === false); @@ -132,8 +145,8 @@ function shared(message, handle, indexesKey, cb) { cb(message.errno, handle); } -// Round-robin. Master distributes handles across workers. -function rr(message, indexesKey, cb) { +// Round-robin. Primary distributes handles across workers. +function rr(message, indexesKey, index, cb) { if (message.errno) return cb(message.errno, null); @@ -157,7 +170,7 @@ function rr(message, indexesKey, cb) { send({ act: 'close', key }); handles.delete(key); - indexes.delete(indexesKey); + removeIndexesKey(indexesKey, index); key = undefined; } diff --git a/test/parallel/test-cluster-child-index-dgram.js b/test/parallel/test-cluster-child-index-dgram.js new file mode 100644 index 00000000000000..0df7bc175b87f0 --- /dev/null +++ b/test/parallel/test-cluster-child-index-dgram.js @@ -0,0 +1,40 @@ +'use strict'; +const common = require('../common'); +const Countdown = require('../common/countdown'); +if (common.isWindows) + common.skip('dgram clustering is currently not supported on Windows.'); + +const cluster = require('cluster'); +const dgram = require('dgram'); + +// Test an edge case when using `cluster` and `dgram.Socket.bind()` +// the port of `0`. +const kPort = 0; + +function child() { + const kTime = 2; + const countdown = new Countdown(kTime * 2, () => { + process.exit(0); + }); + for (let i = 0; i < kTime; i += 1) { + const socket = new dgram.Socket('udp4'); + socket.bind(kPort, common.mustCall(() => { + // `process.nextTick()` or `socket2.close()` would throw + // ERR_SOCKET_DGRAM_NOT_RUNNING + process.nextTick(() => { + socket.close(countdown.dec()); + const socket2 = new dgram.Socket('udp4'); + socket2.bind(kPort, common.mustCall(() => { + process.nextTick(() => { + socket2.close(countdown.dec()); + }); + })); + }); + })); + } +} + +if (cluster.isMaster) + cluster.fork(__filename); +else + child(); diff --git a/test/parallel/test-cluster-child-index-net.js b/test/parallel/test-cluster-child-index-net.js new file mode 100644 index 00000000000000..d8c3166d1bae3c --- /dev/null +++ b/test/parallel/test-cluster-child-index-net.js @@ -0,0 +1,31 @@ +'use strict'; +const common = require('../common'); +const Countdown = require('../common/countdown'); +const cluster = require('cluster'); +const net = require('net'); + +// Test an edge case when using `cluster` and `net.Server.listen()` to +// the port of `0`. +const kPort = 0; + +function child() { + const kTime = 2; + const countdown = new Countdown(kTime * 2, () => { + process.exit(0); + }); + for (let i = 0; i < kTime; i += 1) { + const server = net.createServer(); + server.listen(kPort, common.mustCall(() => { + server.close(countdown.dec()); + const server2 = net.createServer(); + server2.listen(kPort, common.mustCall(() => { + server2.close(countdown.dec()); + })); + })); + } +} + +if (cluster.isMaster) + cluster.fork(__filename); +else + child(); From 21f329532f8b95b92efc72b2a3a369b3fcbb4b26 Mon Sep 17 00:00:00 2001 From: raisinten Date: Mon, 4 Jan 2021 20:41:57 +0530 Subject: [PATCH 141/161] build: refactor Makefile * add character classes * replace echo -n with printf Co-authored-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/36759 Reviewed-By: Antoine du Hamel --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4a6e59536bb4d2..e6ad96da91474d 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ FLAKY_TESTS ?= run TEST_CI_ARGS ?= STAGINGSERVER ?= node-www LOGLEVEL ?= silent -OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]') +OSTYPE := $(shell uname -s | tr '[:upper:]' '[:lower:]') COVTESTS ?= test-cov COV_SKIP_TESTS ?= core_line_numbers.js,testFinalizer.js,test_function/test.js GTEST_FILTER ?= "*" @@ -40,7 +40,7 @@ ifeq ($(OSTYPE), darwin) GCOV = xcrun llvm-cov gcov endif -BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[A-Z]' '[a-z]') +BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[:upper:]' '[:lower:]') # Determine EXEEXT EXEEXT := $(shell $(PYTHON) -c \ @@ -85,7 +85,7 @@ endif # To add a target to the help, add a double comment (##) on the target line. help: ## Print help for targets with comments. @printf "For more targets and info see the comments in the Makefile.\n\n" - @grep -E '^[a-zA-Z0-9._-]+:.*?## .*$$' Makefile | sort | \ + @grep -E '^[[:alnum:]._-]+:.*?## .*$$' Makefile | sort | \ awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' # The .PHONY is needed to ensure that we recursively use the out/Makefile @@ -243,10 +243,10 @@ coverage-test: coverage-build --gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \ -r Release/obj.target --html --html-detail -o ../coverage/cxxcoverage.html \ --gcov-executable="$(GCOV)") - @echo -n "Javascript coverage %: " + @printf "Javascript coverage %%: " @grep -B1 Lines coverage/index.html | head -n1 \ | sed 's/<[^>]*>//g'| sed 's/ //g' - @echo -n "C++ coverage %: " + @printf "C++ coverage %%: " @grep -A3 Lines coverage/cxxcoverage.html | grep style \ | sed 's/<[^>]*>//g'| sed 's/ //g' @@ -1360,7 +1360,7 @@ lint: ## Run JS, C++, MD and doc linters. $(MAKE) lint-addon-docs || EXIT_STATUS=$$? ; \ $(MAKE) lint-md || EXIT_STATUS=$$? ; \ exit $$EXIT_STATUS -CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+ +CONFLICT_RE=^>>>>>>> [[:xdigit:]]+|^<<<<<<< [[:alpha:]]+ # Related CI job: node-test-linter lint-ci: lint-js-ci lint-cpp lint-py lint-md lint-addon-docs From 3fa470a3c930561bbe549bbd49ce0cbd7e982cfb Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Mon, 4 Jan 2021 13:50:51 +0800 Subject: [PATCH 142/161] events: refactor to use optional chaining Co-authored-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/36763 Reviewed-By: Antoine du Hamel --- lib/events.js | 12 ++++++------ lib/internal/event_target.js | 15 +++++---------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/lib/events.js b/lib/events.js index 942e5e01eee044..8beb501678f647 100644 --- a/lib/events.js +++ b/lib/events.js @@ -203,7 +203,7 @@ EventEmitter.init = function(opts) { this._maxListeners = this._maxListeners || undefined; - if (opts && opts.captureRejections) { + if (opts?.captureRejections) { if (typeof opts.captureRejections !== 'boolean') { throw new ERR_INVALID_ARG_TYPE('options.captureRejections', 'boolean', opts.captureRejections); @@ -709,9 +709,9 @@ function getEventListeners(emitterOrTarget, type) { } async function once(emitter, name, options = {}) { - const signal = options ? options.signal : undefined; + const signal = options?.signal; validateAbortSignal(signal, 'options.signal'); - if (signal && signal.aborted) + if (signal?.aborted) throw lazyDOMException('The operation was aborted', 'AbortError'); return new Promise((resolve, reject) => { const errorListener = (err) => { @@ -765,7 +765,7 @@ function eventTargetAgnosticRemoveListener(emitter, name, listener, flags) { function eventTargetAgnosticAddListener(emitter, name, listener, flags) { if (typeof emitter.on === 'function') { - if (flags && flags.once) { + if (flags?.once) { emitter.once(name, listener); } else { emitter.on(name, listener); @@ -780,9 +780,9 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) { } function on(emitter, event, options) { - const { signal } = { ...options }; + const signal = options?.signal; validateAbortSignal(signal, 'options.signal'); - if (signal && signal.aborted) { + if (signal?.aborted) { throw lazyDOMException('The operation was aborted', 'AbortError'); } diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index fd29b07bf6df02..9616030d9dd5d8 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -95,7 +95,7 @@ class Event { this[kDefaultPrevented] = false; this[kTimestamp] = lazyNow(); this[kPropagationStopped] = false; - if (options != null && options[kTrustEvent]) { + if (options?.[kTrustEvent]) { isTrustedSet.add(this); } @@ -185,7 +185,7 @@ ObjectDefineProperty(Event.prototype, SymbolToStringTag, { class NodeCustomEvent extends Event { constructor(type, options) { super(type, options); - if (options && options.detail) { + if (options?.detail) { this.detail = options.detail; } } @@ -340,10 +340,7 @@ class EventTarget { return; type = String(type); - // TODO(@jasnell): If it's determined this cannot be backported - // to 12.x, then this can be simplified to: - // const capture = Boolean(options?.capture); - const capture = options != null && options.capture === true; + const capture = options?.capture === true; const root = this[kEvents].get(type); if (root === undefined || root.next === undefined) @@ -555,9 +552,7 @@ ObjectDefineProperties(NodeEventTarget.prototype, { function shouldAddListener(listener) { if (typeof listener === 'function' || - (listener != null && - typeof listener === 'object' && - typeof listener.handleEvent === 'function')) { + typeof listener?.handleEvent === 'function') { return true; } @@ -586,7 +581,7 @@ function validateEventListenerOptions(options) { // It stands in its current implementation as a compromise. // Ref: https://github.com/nodejs/node/pull/33661 function isEventTarget(obj) { - return obj && obj.constructor && obj.constructor[kIsEventTarget]; + return obj?.constructor?.[kIsEventTarget]; } function addCatch(that, promise, event) { From 37becfda8c2c9144f1060dbcfa346aaf938ec93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 8 Jan 2021 11:32:24 +0100 Subject: [PATCH 143/161] tools: update all lint-md rollup dependencies PR-URL: https://github.com/nodejs/node/pull/36843 Reviewed-By: Antoine du Hamel Reviewed-By: Rich Trott --- tools/lint-md.js | 19354 ++++++++-------- .../node-lint-md-cli-rollup/package-lock.json | 1250 +- tools/node-lint-md-cli-rollup/package.json | 12 +- .../node-lint-md-cli-rollup/rollup.config.js | 5 +- 4 files changed, 10436 insertions(+), 10185 deletions(-) diff --git a/tools/lint-md.js b/tools/lint-md.js index 7d88451c9224ce..332fdd63ed44e1 100644 --- a/tools/lint-md.js +++ b/tools/lint-md.js @@ -3,9 +3,9 @@ // Don't change this file manually, // it is generated from tools/node-lint-md-cli-rollup -var stream = require('stream'); +var require$$0$3 = require('stream'); var path$2 = require('path'); -var module$1 = require('module'); +var Module = require('module'); var util$2 = require('util'); var os = require('os'); var tty = require('tty'); @@ -15,9 +15,9 @@ var assert = require('assert'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } -var stream__default = /*#__PURE__*/_interopDefaultLegacy(stream); +var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$3); var path__default = /*#__PURE__*/_interopDefaultLegacy(path$2); -var module__default = /*#__PURE__*/_interopDefaultLegacy(module$1); +var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module); var util__default = /*#__PURE__*/_interopDefaultLegacy(util$2); var os__default = /*#__PURE__*/_interopDefaultLegacy(os); var tty__default = /*#__PURE__*/_interopDefaultLegacy(tty); @@ -210,20 +210,28 @@ function trough() { var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; -function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var a = Object.defineProperty({}, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; } -function getCjsExportFromNamespace (n) { - return n && n['default'] || n; +function createCommonjsModule(fn) { + var module = { exports: {} }; + return fn(module, module.exports), module.exports; } -function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); +function commonjsRequire (target) { + throw new Error('Could not dynamically require "' + target + '". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.'); } function isNothing(subject) { @@ -804,7 +812,7 @@ function isInteger(object) { (object % 1 === 0 && !common.isNegativeZero(object)); } -var int_1 = new type('tag:yaml.org,2002:int', { +var int = new type('tag:yaml.org,2002:int', { kind: 'scalar', resolve: resolveYamlInteger, construct: constructYamlInteger, @@ -928,7 +936,7 @@ function isFloat(object) { (object % 1 !== 0 || common.isNegativeZero(object)); } -var float_1 = new type('tag:yaml.org,2002:float', { +var float = new type('tag:yaml.org,2002:float', { kind: 'scalar', resolve: resolveYamlFloat, construct: constructYamlFloat, @@ -944,8 +952,8 @@ var json = new schema({ implicit: [ _null, bool, - int_1, - float_1 + int, + float ] }); @@ -2776,7 +2784,7 @@ function readAlias(state) { alias = state.input.slice(_position, state.position); - if (!state.anchorMap.hasOwnProperty(alias)) { + if (!_hasOwnProperty$2.call(state.anchorMap, alias)) { throwError(state, 'unidentified alias "' + alias + '"'); } @@ -4394,19 +4402,16 @@ var dist = /*#__PURE__*/Object.freeze({ 'default': LinesAndColumns }); -var jsTokens = createCommonjsModule(function (module, exports) { // Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell // License: MIT. (See LICENSE.) -Object.defineProperty(exports, "__esModule", { - value: true -}); + // This regex comes from regex.coffee, and is inserted here by generate-index.js // (run `npm run build`). -exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; +var _default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; -exports.matchToToken = function(match) { +var matchToToken = function(match) { var token = {type: "invalid", value: match[0], closed: undefined}; if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]); else if (match[ 5]) token.type = "comment"; @@ -4418,19 +4423,15 @@ exports.matchToToken = function(match) { else if (match[12]) token.type = "whitespace"; return token }; -}); -unwrapExports(jsTokens); -var jsTokens_1 = jsTokens.matchToToken; +var jsTokens = /*#__PURE__*/Object.defineProperty({ + default: _default, + matchToToken: matchToToken +}, '__esModule', {value: true}); -var identifier = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; +var isIdentifierStart_1 = isIdentifierStart; +var isIdentifierChar_1 = isIdentifierChar; +var isIdentifierName_1 = isIdentifierName; let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); @@ -4500,23 +4501,18 @@ function isIdentifierName(name) { return !isFirst; } -}); - -unwrapExports(identifier); -var identifier_1 = identifier.isIdentifierStart; -var identifier_2 = identifier.isIdentifierChar; -var identifier_3 = identifier.isIdentifierName; -var keyword = createCommonjsModule(function (module, exports) { +var identifier = /*#__PURE__*/Object.defineProperty({ + isIdentifierStart: isIdentifierStart_1, + isIdentifierChar: isIdentifierChar_1, + isIdentifierName: isIdentifierName_1 +}, '__esModule', {value: true}); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isReservedWord = isReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isKeyword = isKeyword; +var isReservedWord_1 = isReservedWord; +var isStrictReservedWord_1 = isStrictReservedWord; +var isStrictBindOnlyReservedWord_1 = isStrictBindOnlyReservedWord; +var isStrictBindReservedWord_1 = isStrictBindReservedWord; +var isKeyword_1 = isKeyword; const reservedWords = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], @@ -4545,14 +4541,14 @@ function isStrictBindReservedWord(word, inModule) { function isKeyword(word) { return keywords.has(word); } -}); -unwrapExports(keyword); -var keyword_1 = keyword.isReservedWord; -var keyword_2 = keyword.isStrictReservedWord; -var keyword_3 = keyword.isStrictBindOnlyReservedWord; -var keyword_4 = keyword.isStrictBindReservedWord; -var keyword_5 = keyword.isKeyword; +var keyword = /*#__PURE__*/Object.defineProperty({ + isReservedWord: isReservedWord_1, + isStrictReservedWord: isStrictReservedWord_1, + isStrictBindOnlyReservedWord: isStrictBindOnlyReservedWord_1, + isStrictBindReservedWord: isStrictBindReservedWord_1, + isKeyword: isKeyword_1 +}, '__esModule', {value: true}); var lib = createCommonjsModule(function (module, exports) { @@ -4609,16 +4605,6 @@ Object.defineProperty(exports, "isKeyword", { }); }); -unwrapExports(lib); -var lib_1 = lib.isIdentifierName; -var lib_2 = lib.isIdentifierChar; -var lib_3 = lib.isIdentifierStart; -var lib_4 = lib.isReservedWord; -var lib_5 = lib.isStrictBindOnlyReservedWord; -var lib_6 = lib.isStrictBindReservedWord; -var lib_7 = lib.isStrictReservedWord; -var lib_8 = lib.isKeyword; - var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; var escapeStringRegexp = function (str) { @@ -4780,10 +4766,9 @@ var colorName = { "yellowgreen": [154, 205, 50] }; -var conversions = createCommonjsModule(function (module) { /* MIT license */ - +var conversions = createCommonjsModule(function (module) { // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) @@ -5650,21 +5635,6 @@ convert.rgb.gray = function (rgb) { return [val / 255 * 100]; }; }); -var conversions_1 = conversions.rgb; -var conversions_2 = conversions.hsl; -var conversions_3 = conversions.hsv; -var conversions_4 = conversions.hwb; -var conversions_5 = conversions.cmyk; -var conversions_6 = conversions.xyz; -var conversions_7 = conversions.lab; -var conversions_8 = conversions.lch; -var conversions_9 = conversions.hex; -var conversions_10 = conversions.keyword; -var conversions_11 = conversions.ansi16; -var conversions_12 = conversions.ansi256; -var conversions_13 = conversions.hcg; -var conversions_14 = conversions.apple; -var conversions_15 = conversions.gray; /* this function routes a model to all other models. @@ -6497,16 +6467,10 @@ module.exports = Chalk(); // eslint-disable-line new-cap module.exports.supportsColor = stdoutColor; module.exports.default = module.exports; // For TypeScript }); -var chalk_1 = chalk.supportsColor; -var lib$1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shouldHighlight = shouldHighlight; -exports.getChalk = getChalk; -exports.default = highlight; +var shouldHighlight_1 = shouldHighlight; +var getChalk_1 = getChalk; +var _default$1 = highlight; var _jsTokens = _interopRequireWildcard(jsTokens); @@ -6606,29 +6570,25 @@ function highlight(code, options = {}) { return code; } } -}); - -unwrapExports(lib$1); -var lib_1$1 = lib$1.shouldHighlight; -var lib_2$1 = lib$1.getChalk; -var lib$2 = createCommonjsModule(function (module, exports) { +var lib$1 = /*#__PURE__*/Object.defineProperty({ + shouldHighlight: shouldHighlight_1, + getChalk: getChalk_1, + default: _default$1 +}, '__esModule', {value: true}); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeFrameColumns = codeFrameColumns; -exports.default = _default; +var codeFrameColumns_1 = codeFrameColumns; +var default_1 = _default$2; -var _highlight = _interopRequireWildcard(lib$1); +var _highlight = _interopRequireWildcard$1(lib$1); -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } +function _getRequireWildcardCache$1() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache$1 = function () { return cache; }; return cache; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _interopRequireWildcard$1(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache$1(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } let deprecationWarningShown = false; -function getDefs(chalk) { +function getDefs$1(chalk) { return { gutter: chalk.grey, marker: chalk.red.bold, @@ -6636,7 +6596,7 @@ function getDefs(chalk) { }; } -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; function getMarkerLines(loc, source, opts) { const startLoc = Object.assign({ @@ -6704,13 +6664,13 @@ function getMarkerLines(loc, source, opts) { function codeFrameColumns(rawLines, loc, opts = {}) { const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); const chalk = (0, _highlight.getChalk)(opts); - const defs = getDefs(chalk); + const defs = getDefs$1(chalk); const maybeHighlight = (chalkFn, string) => { return highlighted ? chalkFn(string) : string; }; - const lines = rawLines.split(NEWLINE); + const lines = rawLines.split(NEWLINE$1); const { start, end, @@ -6719,7 +6679,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) { const hasColumns = loc.start && typeof loc.start.column === "number"; const numberMaxWidth = String(end).length; const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; - let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { + let frame = highlightedLines.split(NEWLINE$1).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); const gutter = ` ${paddedNumber} | `; @@ -6756,7 +6716,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) { } } -function _default(rawLines, lineNumber, colNumber, opts = {}) { +function _default$2(rawLines, lineNumber, colNumber, opts = {}) { if (!deprecationWarningShown) { deprecationWarningShown = true; const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; @@ -6779,15 +6739,16 @@ function _default(rawLines, lineNumber, colNumber, opts = {}) { }; return codeFrameColumns(rawLines, location, opts); } -}); -unwrapExports(lib$2); -var lib_1$2 = lib$2.codeFrameColumns; +var lib$2 = /*#__PURE__*/Object.defineProperty({ + codeFrameColumns: codeFrameColumns_1, + default: default_1 +}, '__esModule', {value: true}); -var require$$0 = getCjsExportFromNamespace(dist); +var require$$0 = /*@__PURE__*/getAugmentedNamespace(dist); const {default: LinesAndColumns$1} = require$$0; -const {codeFrameColumns} = lib$2; +const {codeFrameColumns: codeFrameColumns$1} = lib$2; const JSONError = errorEx_1('JSONError', { fileName: errorEx_1.append('in %s'), @@ -6821,7 +6782,7 @@ var parseJson$1 = (string, reviver, filename) => { const index = Number(indexMatch[1]); const location = lines.locationForIndex(index); - const codeFrame = codeFrameColumns( + const codeFrame = codeFrameColumns$1( string, {start: {line: location.line + 1, column: location.column + 1}}, {highlightCode: true} @@ -6837,7 +6798,6 @@ var parseJson$1 = (string, reviver, filename) => { /** * Helpers. */ - var s = 1000; var m = s * 60; var h = m * 60; @@ -7010,16 +6970,12 @@ function setup(env) { createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = ms; + createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); - /** - * Active `debug` instances. - */ - createDebug.instances = []; - /** * The currently active debug mode names, and names to skip. */ @@ -7061,6 +7017,7 @@ function setup(env) { */ function createDebug(namespace) { let prevTime; + let enableOverride = null; function debug(...args) { // Disabled? @@ -7090,7 +7047,7 @@ function setup(env) { args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { - return match; + return '%'; } index++; const formatter = createDebug.formatters[format]; @@ -7113,31 +7070,28 @@ function setup(env) { } debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); - debug.destroy = destroy; debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, + set: v => { + enableOverride = v; + } + }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } - createDebug.instances.push(debug); - return debug; } - function destroy() { - const index = createDebug.instances.indexOf(this); - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - return false; - } - function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; @@ -7175,11 +7129,6 @@ function setup(env) { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } - - for (i = 0; i < createDebug.instances.length; i++) { - const instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } } /** @@ -7254,6 +7203,14 @@ function setup(env) { return val; } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + createDebug.enable(createDebug.load()); return createDebug; @@ -7261,9 +7218,9 @@ function setup(env) { var common$1 = setup; -var browser = createCommonjsModule(function (module, exports) { /* eslint-env browser */ +var browser = createCommonjsModule(function (module, exports) { /** * This is the web browser implementation of `debug()`. */ @@ -7273,6 +7230,16 @@ exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); /** * Colors. @@ -7522,13 +7489,6 @@ formatters.j = function (v) { } }; }); -var browser_1 = browser.formatArgs; -var browser_2 = browser.save; -var browser_3 = browser.load; -var browser_4 = browser.useColors; -var browser_5 = browser.storage; -var browser_6 = browser.colors; -var browser_7 = browser.log; var hasFlag$1 = (flag, argv = process.argv) => { const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); @@ -7668,14 +7628,11 @@ var supportsColor_1$1 = { stderr: translateLevel$1(supportsColor$1(true, tty__default['default'].isatty(2))) }; -var node = createCommonjsModule(function (module, exports) { /** * Module dependencies. */ - - - +var node = createCommonjsModule(function (module, exports) { /** * This is the Node.js implementation of `debug()`. */ @@ -7686,6 +7643,10 @@ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; +exports.destroy = util__default['default'].deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); /** * Colors. @@ -7915,7 +7876,9 @@ const {formatters} = module.exports; formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util__default['default'].inspect(v, this.inspectOpts) - .replace(/\s*\n\s*/g, ' '); + .split('\n') + .map(str => str.trim()) + .join(' '); }; /** @@ -7927,21 +7890,13 @@ formatters.O = function (v) { return util__default['default'].inspect(v, this.inspectOpts); }; }); -var node_1 = node.init; -var node_2 = node.log; -var node_3 = node.formatArgs; -var node_4 = node.save; -var node_5 = node.load; -var node_6 = node.useColors; -var node_7 = node.colors; -var node_8 = node.inspectOpts; -var src = createCommonjsModule(function (module) { /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ +var src = createCommonjsModule(function (module) { if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = browser; } else { @@ -7972,10 +7927,10 @@ const resolveFrom = (fromDirectory, moduleId, silent) => { const fromFile = path__default['default'].join(fromDirectory, 'noop.js'); - const resolveFileName = () => module__default['default']._resolveFilename(moduleId, { + const resolveFileName = () => Module__default['default']._resolveFilename(moduleId, { id: fromFile, filename: fromFile, - paths: module__default['default']._nodeModulePaths(fromDirectory) + paths: Module__default['default']._nodeModulePaths(fromDirectory) }); if (silent) { @@ -8211,8 +8166,8 @@ const pTry = (fn, ...arguments_) => new Promise(resolve => { var pTry_1 = pTry; // TODO: remove this in the next major version -var _default = pTry; -pTry_1.default = _default; +var _default$3 = pTry; +pTry_1.default = _default$3; const pLimit = concurrency => { if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { @@ -8267,8 +8222,8 @@ const pLimit = concurrency => { }; var pLimit_1 = pLimit; -var _default$1 = pLimit; -pLimit_1.default = _default$1; +var _default$4 = pLimit; +pLimit_1.default = _default$4; class EndError extends Error { constructor(value) { @@ -8388,7 +8343,7 @@ function encode (obj, opt) { whitespace: false, }; } else { - opt = opt || Object.create(null); + opt = opt || {}; opt.whitespace = opt.whitespace === true; } @@ -8435,7 +8390,7 @@ function dotSplit (str) { } function decode (str) { - var out = Object.create(null); + var out = {}; var p = out; var section = null; // section |key = value @@ -8453,10 +8408,10 @@ function decode (str) { if (section === '__proto__') { // not allowed // keep parsing the section, but don't attach it. - p = Object.create(null); + p = {}; return } - p = out[section] = out[section] || Object.create(null); + p = out[section] = out[section] || {}; return } var key = unsafe(match[2]); @@ -8506,7 +8461,7 @@ function decode (str) { if (part === '__proto__') return if (!p[part] || typeof p[part] !== 'object') - p[part] = Object.create(null); + p[part] = {}; p = p[part]; }); if (p === out && nl === l) @@ -8575,12 +8530,6 @@ function unsafe (val, doUnesc) { return val } }); -var ini_1 = ini.parse; -var ini_2 = ini.decode; -var ini_3 = ini.stringify; -var ini_4 = ini.encode; -var ini_5 = ini.safe; -var ini_6 = ini.unsafe; const NpmConfig = figgyPudding_1({}, { // Open up the pudding object. @@ -9282,15 +9231,15 @@ function create(buf, filePath) { // Basically `Module.prototype.load`, but for a buffer instead of a file path. function loadScript(buf, filePath) { - var submodule = module__default['default']._cache[filePath]; + var submodule = Module__default['default']._cache[filePath]; if (!submodule) { - submodule = new module__default['default'](filePath, module); + submodule = new Module__default['default'](filePath, module); submodule.filename = filePath; - submodule.paths = module__default['default']._nodeModulePaths(dirname(filePath)); + submodule.paths = Module__default['default']._nodeModulePaths(dirname(filePath)); submodule._compile(String(buf), filePath); submodule.loaded = true; - module__default['default']._cache[filePath] = submodule; + Module__default['default']._cache[filePath] = submodule; } return submodule.exports @@ -13386,7 +13335,6 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { * @author Feross Aboukhadijeh * @license MIT */ - var isBuffer = function isBuffer (obj) { return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) @@ -13532,53 +13480,49 @@ function parseOrigin(origin) { return result } -function replaceExt(npath, ext) { - if (typeof npath !== 'string') { - return npath; - } - - if (npath.length === 0) { - return npath; - } - - var nFileName = path__default['default'].basename(npath, path__default['default'].extname(npath)) + ext; - return path__default['default'].join(path__default['default'].dirname(npath), nFileName); -} +var minpath = path__default['default']; -var replaceExt_1 = replaceExt; +var minproc = process; var core$1 = VFile; var own$1 = {}.hasOwnProperty; -var proto$1 = VFile.prototype; // 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 // stem can be set. var order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']; -proto$1.toString = toString; +VFile.prototype.toString = toString; // Access full path (`~/index.min.js`). -Object.defineProperty(proto$1, 'path', {get: getPath, set: setPath}); +Object.defineProperty(VFile.prototype, 'path', {get: getPath, set: setPath}); // Access parent path (`~`). -Object.defineProperty(proto$1, 'dirname', {get: getDirname, set: setDirname}); +Object.defineProperty(VFile.prototype, 'dirname', { + get: getDirname, + set: setDirname +}); // Access basename (`index.min.js`). -Object.defineProperty(proto$1, 'basename', {get: getBasename, set: setBasename}); +Object.defineProperty(VFile.prototype, 'basename', { + get: getBasename, + set: setBasename +}); // Access extname (`.js`). -Object.defineProperty(proto$1, 'extname', {get: getExtname, set: setExtname}); +Object.defineProperty(VFile.prototype, 'extname', { + get: getExtname, + set: setExtname +}); // Access stem (`index.min`). -Object.defineProperty(proto$1, 'stem', {get: getStem, set: setStem}); +Object.defineProperty(VFile.prototype, 'stem', {get: getStem, set: setStem}); // Construct a new file. function VFile(options) { var prop; var index; - var length; if (!options) { options = {}; @@ -13595,13 +13539,12 @@ function VFile(options) { this.data = {}; this.messages = []; this.history = []; - this.cwd = process.cwd(); + this.cwd = minproc.cwd(); // Set path related properties in the correct order. index = -1; - length = order.length; - while (++index < length) { + while (++index < order.length) { prop = order[index]; if (own$1.call(options, prop)) { @@ -13611,7 +13554,7 @@ function VFile(options) { // Set non-path related properties. for (prop in options) { - if (order.indexOf(prop) === -1) { + if (order.indexOf(prop) < 0) { this[prop] = options[prop]; } } @@ -13624,76 +13567,73 @@ function getPath() { function setPath(path) { assertNonEmpty(path, 'path'); - if (path !== this.path) { + if (this.path !== path) { this.history.push(path); } } function getDirname() { - return typeof this.path === 'string' ? path__default['default'].dirname(this.path) : undefined + return typeof this.path === 'string' ? minpath.dirname(this.path) : undefined } function setDirname(dirname) { assertPath(this.path, 'dirname'); - this.path = path__default['default'].join(dirname || '', this.basename); + this.path = minpath.join(dirname || '', this.basename); } function getBasename() { - return typeof this.path === 'string' ? path__default['default'].basename(this.path) : undefined + return typeof this.path === 'string' ? minpath.basename(this.path) : undefined } function setBasename(basename) { assertNonEmpty(basename, 'basename'); assertPart(basename, 'basename'); - this.path = path__default['default'].join(this.dirname || '', basename); + this.path = minpath.join(this.dirname || '', basename); } function getExtname() { - return typeof this.path === 'string' ? path__default['default'].extname(this.path) : undefined + return typeof this.path === 'string' ? minpath.extname(this.path) : undefined } function setExtname(extname) { - var ext = extname || ''; - - assertPart(ext, 'extname'); + assertPart(extname, 'extname'); assertPath(this.path, 'extname'); - if (ext) { - if (ext.charAt(0) !== '.') { + if (extname) { + if (extname.charCodeAt(0) !== 46 /* `.` */) { throw new Error('`extname` must start with `.`') } - if (ext.indexOf('.', 1) !== -1) { + if (extname.indexOf('.', 1) > -1) { throw new Error('`extname` cannot contain multiple dots') } } - this.path = replaceExt_1(this.path, ext); + this.path = minpath.join(this.dirname, this.stem + (extname || '')); } function getStem() { return typeof this.path === 'string' - ? path__default['default'].basename(this.path, this.extname) + ? minpath.basename(this.path, this.extname) : undefined } function setStem(stem) { assertNonEmpty(stem, 'stem'); assertPart(stem, 'stem'); - this.path = path__default['default'].join(this.dirname || '', stem + (this.extname || '')); + this.path = minpath.join(this.dirname || '', stem + (this.extname || '')); } // Get the value of the file. function toString(encoding) { - var value = this.contents || ''; - return isBuffer(value) ? value.toString(encoding) : String(value) + return (this.contents || '').toString(encoding) } -// Assert that `part` is not a path (i.e., does not contain `path.sep`). +// Assert that `part` is not a path (i.e., does not contain `p.sep`). function assertPart(part, name) { - if (part.indexOf(path__default['default'].sep) !== -1) { + if (part && part.indexOf(minpath.sep) > -1) { throw new Error( - '`' + name + '` cannot be a path: did not expect `' + path__default['default'].sep + '`' + '`' + name + '` cannot be a path: did not expect `' + minpath.sep + '`' ) } } @@ -13712,23 +13652,20 @@ function assertPath(path, name) { } } -var vfile = core$1; - -var proto$2 = core$1.prototype; +var lib$3 = core$1; -proto$2.message = message; -proto$2.info = info; -proto$2.fail = fail; +core$1.prototype.message = message; +core$1.prototype.info = info; +core$1.prototype.fail = fail; // Create a message with `reason` at `position`. // When an error is passed in as `reason`, copies the stack. function message(reason, position, origin) { - var filePath = this.path; var message = new vfileMessage(reason, position, origin); - if (filePath) { - message.name = filePath + ':' + message.name; - message.file = filePath; + if (this.path) { + message.name = this.path + ':' + message.name; + message.file = this.path; } message.fatal = false; @@ -13757,6 +13694,8 @@ function info() { return message } +var vfile = lib$3; + var core$2 = toVFile; // Create a virtual file from a description. If `options` is a string or a @@ -14938,19 +14877,8 @@ function packF32(v) { return packIEEE754(v, 8, 23); } }()); }); -var typedarray_1 = typedarray.ArrayBuffer; -var typedarray_2 = typedarray.Int8Array; -var typedarray_3 = typedarray.Uint8Array; -var typedarray_4 = typedarray.Uint8ClampedArray; -var typedarray_5 = typedarray.Int16Array; -var typedarray_6 = typedarray.Uint16Array; -var typedarray_7 = typedarray.Int32Array; -var typedarray_8 = typedarray.Uint32Array; -var typedarray_9 = typedarray.Float32Array; -var typedarray_10 = typedarray.Float64Array; -var typedarray_11 = typedarray.DataView; -var Writable = stream__default['default'].Writable; +var Writable = require$$0__default['default'].Writable; @@ -15367,7 +15295,7 @@ function isEmpty(val) { * @type {Function} */ -var lib$3 = isEmpty; +var lib$4 = isEmpty; var debug$3 = src('unified-engine:file-pipeline:configure'); @@ -15417,7 +15345,7 @@ function configure$1(context, file, fileSet, next) { } // Allow for default arguments in es2020. - if (options === null || (typeof options === 'object' && lib$3(options))) { + if (options === null || (typeof options === 'object' && lib$4(options))) { options = undefined; } @@ -15732,7 +15660,7 @@ function formatNode(node) { ignore$2.indexOf(key) !== -1 || value === null || value === undefined || - (typeof value === 'object' && lib$3(value)) + (typeof value === 'object' && lib$4(value)) ) { continue } @@ -16240,8 +16168,8 @@ const isFullwidthCodePoint = codePoint => { }; var isFullwidthCodePoint_1 = isFullwidthCodePoint; -var _default$2 = isFullwidthCodePoint; -isFullwidthCodePoint_1.default = _default$2; +var _default$5 = isFullwidthCodePoint; +isFullwidthCodePoint_1.default = _default$5; var emojiRegex = function () { // https://mths.be/emoji @@ -16285,8 +16213,8 @@ const stringWidth = string => { var stringWidth_1 = stringWidth; // TODO: remove this in the next major version -var _default$3 = stringWidth; -stringWidth_1.default = _default$3; +var _default$6 = stringWidth; +stringWidth_1.default = _default$6; /*! * repeat-string @@ -16400,33 +16328,14 @@ var supported = supportsColor_1$2.stderr.hasBasic; var vfileReporter = reporter; -// Check which characters should be used. -var windows$1 = process.platform === 'win32'; +var push = [].push; + // `log-symbols` without chalk: /* istanbul ignore next - Windows. */ -var chars = windows$1 ? {error: '×', warning: '‼'} : {error: '✖', warning: '⚠'}; - -// Match trailing white-space. -var trailing = /\s*$/; - -// Default filename. -var defaultName = ''; - -var noop = {open: '', close: ''}; - -var colors = { - underline: {open: '\u001B[4m', close: '\u001B[24m'}, - red: {open: '\u001B[31m', close: '\u001B[39m'}, - yellow: {open: '\u001B[33m', close: '\u001B[39m'}, - green: {open: '\u001B[32m', close: '\u001B[39m'} -}; - -var noops = { - underline: noop, - red: noop, - yellow: noop, - green: noop -}; +var chars = + process.platform === 'win32' + ? {error: '×', warning: '‼'} + : {error: '✖', warning: '⚠'}; var labels = { true: 'error', @@ -16455,223 +16364,183 @@ function reporter(files, options) { files = [files]; } - return compile$1(parse$4(filter$1(files, settings), settings), one, settings) -} - -function filter$1(files, options) { - var result = []; - var length = files.length; - var index = -1; - var file; - - if (!options.quiet && !options.silent) { - return files.concat() - } - - while (++index < length) { - file = files[index]; - - if (applicable(file, options).length !== 0) { - result.push(file); - } - } - - return result + return format$1(transform$2(files, settings), one, settings) } -function parse$4(files, options) { - var length = files.length; +function transform$2(files, options) { var index = -1; var rows = []; var all = []; - var locationSize = 0; - var labelSize = 0; - var reasonSize = 0; - var ruleIdSize = 0; - var file; - var destination; - var origin; + var sizes = {}; var messages; var offset; - var count; var message; - var loc; - var reason; - var label; - var id; - - while (++index < length) { - file = files[index]; - destination = file.path; - origin = file.history[0] || destination; - messages = vfileSort({messages: applicable(file, options)}).messages; - - if (rows.length !== 0 && rows[rows.length - 1].type !== 'header') { - rows.push({type: 'separator'}); - } - - rows.push({ - type: 'header', - origin: origin, - destination: destination, - name: origin || options.defaultName || defaultName, - stored: Boolean(file.stored), - moved: Boolean(file.stored && destination !== origin), - stats: vfileStatistics(messages) - }); + var messageRows; + var row; + var key; + while (++index < files.length) { + messages = vfileSort({messages: files[index].messages.concat()}).messages; + messageRows = []; offset = -1; - count = messages.length; - while (++offset < count) { + while (++offset < messages.length) { message = messages[offset]; - id = message.ruleId || ''; - reason = message.stack || message.message; - loc = message.location; - loc = unistUtilStringifyPosition(loc.end.line && loc.end.column ? loc : loc.start); - - if (options.verbose && message.note) { - reason += '\n' + message.note; - } - label = labels[message.fatal]; + if (!options.silent || message.fatal) { + all.push(message); + + row = { + location: unistUtilStringifyPosition( + message.location.end.line && message.location.end.column + ? message.location + : message.location.start + ), + label: labels[message.fatal], + reason: + (message.stack || message.message) + + (options.verbose && message.note ? '\n' + message.note : ''), + ruleId: message.ruleId || '', + source: message.source || '' + }; - rows.push({ - location: loc, - label: label, - reason: reason, - ruleId: id, - source: message.source - }); + for (key in row) { + sizes[key] = Math.max(size(row[key]), sizes[key] || 0); + } - locationSize = Math.max(realLength(loc), locationSize); - labelSize = Math.max(realLength(label), labelSize); - reasonSize = Math.max(realLength(reason), reasonSize); - ruleIdSize = Math.max(realLength(id), ruleIdSize); + messageRows.push(row); + } } - all = all.concat(messages); + if ((!options.quiet && !options.silent) || messageRows.length) { + rows.push({type: 'file', file: files[index], stats: vfileStatistics(messages)}); + push.apply(rows, messageRows); + } } - return { - rows: rows, - statistics: vfileStatistics(all), - location: locationSize, - label: labelSize, - reason: reasonSize, - ruleId: ruleIdSize - } + return {rows: rows, stats: vfileStatistics(all), sizes: sizes} } -// eslint-disable-next-line complexity -function compile$1(map, one, options) { - var enabled = options.color; - var all = map.statistics; - var rows = map.rows; - var length = rows.length; - var index = -1; +function format$1(map, one, options) { + var enabled = options.color == null ? supported : options.color; var lines = []; + var index = -1; + var stats; var row; var line; - var style; - var color; var reason; var rest; - var position; - - if (enabled === null || enabled === undefined) { - enabled = supported; - } - - style = enabled ? colors : noops; - - while (++index < length) { - row = rows[index]; + var match; - if (row.type === 'separator') { - lines.push(''); - } else if (row.type === 'header') { - if (one && !options.defaultName && !row.origin) { - line = ''; - } else { - color = - style[row.stats.fatal ? 'red' : row.stats.total ? 'yellow' : 'green']; + while (++index < map.rows.length) { + row = map.rows[index]; + + if (row.type === 'file') { + stats = row.stats; + line = row.file.history[0] || options.defaultName || ''; + + line = + one && !options.defaultName && !row.file.history[0] + ? '' + : (enabled + ? '\x1b[4m' /* Underline. */ + + (stats.fatal + ? '\x1b[31m' /* Red. */ + : stats.total + ? '\x1b[33m' /* Yellow. */ + : '\x1b[32m') /* Green. */ + + line + + '\x1b[39m\x1b[24m' + : line) + + (row.file.stored && row.file.path !== row.file.history[0] + ? ' > ' + row.file.path + : ''); + + if (!stats.total) { line = - style.underline.open + - color.open + - row.name + - color.close + - style.underline.close; - line += row.moved ? ' > ' + row.destination : ''; + (line ? line + ': ' : '') + + (row.file.stored + ? enabled + ? '\x1b[33mwritten\x1b[39m' /* Yellow. */ + : 'written' + : 'no issues found'); } - if (!row.stats.total) { - line += line ? ': ' : ''; - - if (row.stored) { - line += style.yellow.open + 'written' + style.yellow.close; - } else { - line += 'no issues found'; + if (line) { + if (index && map.rows[index - 1].type !== 'file') { + lines.push(''); } - } - if (line) { lines.push(line); } } else { - color = style[row.label === 'error' ? 'red' : 'yellow']; - reason = row.reason; - rest = ''; - position = reason.indexOf('\n'); + match = /\r?\n|\r/.exec(reason); - if (position !== -1) { - rest = reason.slice(position); - reason = reason.slice(0, position); + if (match) { + rest = reason.slice(match.index); + reason = reason.slice(0, match.index); + } else { + rest = ''; } lines.push( - [ - '', - padLeft(row.location, map.location), - padRight(color.open + row.label + color.close, map.label), - padRight(reason, map.reason), - padRight(row.ruleId, map.ruleId), - row.source || '' - ] - .join(' ') - .replace(trailing, '') + rest + ( + ' ' + + repeatString(' ', map.sizes.location - size(row.location)) + + row.location + + ' ' + + (enabled + ? (row.label === 'error' + ? '\x1b[31m' /* Red. */ + : '\x1b[33m') /* Yellow. */ + + row.label + + '\x1b[39m' + : row.label) + + repeatString(' ', map.sizes.label - size(row.label)) + + ' ' + + reason + + repeatString(' ', map.sizes.reason - size(reason)) + + ' ' + + row.ruleId + + repeatString(' ', map.sizes.ruleId - size(row.ruleId)) + + ' ' + + (row.source || '') + ).replace(/ +$/, '') + rest ); } } - if (all.fatal || all.warn) { - line = []; + stats = map.stats; - if (all.fatal) { - line.push( - [ - style.red.open + chars.error + style.red.close, - all.fatal, - plural$1(labels.true, all.fatal) - ].join(' ') - ); - } + if (stats.fatal || stats.warn) { + line = ''; - if (all.warn) { - line.push( - [ - style.yellow.open + chars.warning + style.yellow.close, - all.warn, - plural$1(labels.false, all.warn) - ].join(' ') - ); + if (stats.fatal) { + line = + (enabled + ? '\x1b[31m' /* Red. */ + chars.error + '\x1b[39m' + : chars.error) + + ' ' + + stats.fatal + + ' ' + + (labels.true + (stats.fatal === 1 ? '' : 's')); } - line = line.join(', '); + if (stats.warn) { + line = + (line ? line + ', ' : '') + + (enabled + ? '\x1b[33m' /* Yellow. */ + chars.warning + '\x1b[39m' + : chars.warning) + + ' ' + + stats.warn + + ' ' + + (labels.false + (stats.warn === 1 ? '' : 's')); + } - if (all.total !== all.fatal && all.total !== all.warn) { - line = all.total + ' messages (' + line + ')'; + if (stats.total !== stats.fatal && stats.total !== stats.warn) { + line = stats.total + ' messages (' + line + ')'; } lines.push('', line); @@ -16680,43 +16549,10 @@ function compile$1(map, one, options) { return lines.join('\n') } -function applicable(file, options) { - var messages = file.messages; - var length = messages.length; - var index = -1; - var result = []; - - if (options.silent) { - while (++index < length) { - if (messages[index].fatal) { - result.push(messages[index]); - } - } - } else { - result = messages.concat(); - } - - return result -} - // Get the length of `value`, ignoring ANSI sequences. -function realLength(value) { - var length = value.indexOf('\n'); - return stringWidth_1(length === -1 ? value : value.slice(0, length)) -} - -// Pad `value` on the left. -function padLeft(value, minimum) { - return repeatString(' ', minimum - realLength(value)) + value -} - -// Pad `value` on the right. -function padRight(value, minimum) { - return value + repeatString(' ', minimum - realLength(value)) -} - -function plural$1(value, count) { - return count === 1 ? value : value + 's' +function size(value) { + var match = /\r?\n|\r/.exec(value); + return stringWidth_1(match ? value.slice(0, match.index) : value) } var log_1 = log; @@ -16767,11 +16603,11 @@ var fileSetPipeline = trough_1() .use(transform_1$1) .use(log_1); -var PassThrough = stream__default['default'].PassThrough; +var PassThrough = require$$0__default['default'].PassThrough; -var lib$4 = run; +var lib$5 = run; // Run the file set pipeline once. // `callback` is invoked with a fatal error, or with a status code (`0` on @@ -17069,6 +16905,7 @@ var colorName$1 = { }; /* MIT license */ + /* eslint-disable no-mixed-operators */ @@ -18518,7 +18355,7 @@ for (const model of usedModels) { }; } -const proto$3 = Object.defineProperties(() => {}, { +const proto$1 = Object.defineProperties(() => {}, { ...styles, level: { enumerable: true, @@ -18560,7 +18397,7 @@ const createBuilder = (self, _styler, _isEmpty) => { // `__proto__` is used because we must return a function, but there is // no way to create a function with a different prototype - builder.__proto__ = proto$3; // eslint-disable-line no-proto + builder.__proto__ = proto$1; // eslint-disable-line no-proto builder._generator = self; builder._styler = _styler; @@ -18893,17 +18730,6 @@ exports.wrapOutput = (input, state = {}, options = {}) => { return output; }; }); -var utils_1 = utils.isObject; -var utils_2 = utils.hasRegexChars; -var utils_3 = utils.isRegexChar; -var utils_4 = utils.escapeRegex; -var utils_5 = utils.toPosixSlashes; -var utils_6 = utils.removeBackslashes; -var utils_7 = utils.supportsLookbehinds; -var utils_8 = utils.isWindows; -var utils_9 = utils.escapeLast; -var utils_10 = utils.removePrefix; -var utils_11 = utils.wrapOutput; const { CHAR_ASTERISK: CHAR_ASTERISK$1, /* * */ @@ -19335,7 +19161,7 @@ const syntaxError = (type, char) => { * @return {Object} */ -const parse$5 = (input, options) => { +const parse$4 = (input, options) => { if (typeof input !== 'string') { throw new TypeError('Expected a string'); } @@ -20271,7 +20097,7 @@ const parse$5 = (input, options) => { * impact when none of the fast paths match. */ -parse$5.fastpaths = (input, options) => { +parse$4.fastpaths = (input, options) => { const opts = { ...options }; const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; const len = input.length; @@ -20358,7 +20184,7 @@ parse$5.fastpaths = (input, options) => { return source; }; -var parse_1$1 = parse$5; +var parse_1$1 = parse$4; const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val); @@ -20695,7 +20521,7 @@ var picomatch_1 = picomatch; var picomatch$1 = picomatch_1; -const { Readable } = stream__default['default']; +const { Readable } = require$$0__default['default']; const { promisify } = util__default['default']; @@ -20981,7 +20807,6 @@ var readdirp_1 = readdirp; * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. */ - var normalizePath = function(path, stripTrailing) { if (typeof path !== 'string') { throw new TypeError('expected path to be a string'); @@ -21011,19 +20836,12 @@ var normalizePath = function(path, stripTrailing) { return prefix + segs.join('/'); }; -var anymatch_1 = createCommonjsModule(function (module, exports) { - -Object.defineProperty(exports, "__esModule", { value: true }); - - - - /** * @typedef {(testString: string) => boolean} AnymatchFn * @typedef {string|RegExp|AnymatchFn} AnymatchPattern * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher */ -const BANG = '!'; +const BANG$1 = '!'; const DEFAULT_OPTIONS = {returnIndex: false}; const arrify = (item) => Array.isArray(item) ? item : [item]; @@ -21096,7 +20914,7 @@ const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { // Early cache for matchers. const mtchers = arrify(matchers); const negatedGlobs = mtchers - .filter(item => typeof item === 'string' && item.charAt(0) === BANG) + .filter(item => typeof item === 'string' && item.charAt(0) === BANG$1) .map(item => item.slice(1)) .map(item => picomatch$1(item, opts)); const patterns = mtchers.map(matcher => createPattern(matcher, opts)); @@ -21112,10 +20930,7 @@ const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { }; anymatch.default = anymatch; -module.exports = anymatch; -}); - -unwrapExports(anymatch_1); +var anymatch_1 = anymatch; /*! * is-extglob @@ -21123,7 +20938,6 @@ unwrapExports(anymatch_1); * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ - var isExtglob = function isExtglob(str) { if (typeof str !== 'string' || str === '') { return false; @@ -21145,7 +20959,6 @@ var isExtglob = function isExtglob(str) { * Released under the MIT License. */ - var chars$1 = { '{': '}', '(': ')', '[': ']'}; var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; @@ -21339,15 +21152,6 @@ exports.flatten = (...args) => { return result; }; }); -var utils_1$1 = utils$1.isInteger; -var utils_2$1 = utils$1.find; -var utils_3$1 = utils$1.exceedsLimit; -var utils_4$1 = utils$1.escapeNode; -var utils_5$1 = utils$1.encloseBrace; -var utils_6$1 = utils$1.isInvalidBrace; -var utils_7$1 = utils$1.isOpenOrClose; -var utils_8$1 = utils$1.reduce; -var utils_9$1 = utils$1.flatten; var stringify$3 = (ast, options = {}) => { let stringify = (node, parent = {}) => { @@ -21394,6 +21198,15 @@ var isNumber = function(num) { return false; }; +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + + + const toRegexRange = (min, max, options) => { if (isNumber(min) === false) { throw new TypeError('toRegexRange: expected the first argument to be a number'); @@ -21672,9 +21485,19 @@ toRegexRange.clearCache = () => (toRegexRange.cache = {}); var toRegexRange_1 = toRegexRange; +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + + const isObject$2 = val => val !== null && typeof val === 'object' && !Array.isArray(val); -const transform$2 = toNumber => { +const transform$3 = toNumber => { return value => toNumber === true ? Number(value) : String(value); }; @@ -21811,7 +21634,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$4(start, end, options) === false; - let format = options.transform || transform$2(toNumber); + let format = options.transform || transform$3(toNumber); if (options.toRegex && step === 1) { return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); @@ -21910,7 +21733,7 @@ const fill = (start, end, step, options = {}) => { var fillRange = fill; -const compile$2 = (ast, options = {}) => { +const compile$1 = (ast, options = {}) => { let walk = (node, parent = {}) => { let invalidBlock = utils$1.isInvalidBrace(parent); let invalidNode = node.invalid === true && options.escapeInvalid === true; @@ -21961,7 +21784,7 @@ const compile$2 = (ast, options = {}) => { return walk(ast); }; -var compile_1 = compile$2; +var compile_1 = compile$1; const append = (queue = '', stash = '', enclose = false) => { let result = []; @@ -22153,7 +21976,7 @@ const { * parse */ -const parse$6 = (input, options = {}) => { +const parse$5 = (input, options = {}) => { if (typeof input !== 'string') { throw new TypeError('Expected a string'); } @@ -22452,7 +22275,7 @@ const parse$6 = (input, options = {}) => { return ast; }; -var parse_1$2 = parse$6; +var parse_1$2 = parse$5; /** * Expand the given pattern or create a regex-compatible string. @@ -22618,7 +22441,7 @@ braces.create = (input, options = {}) => { var braces_1 = braces; -var binaryExtensions = [ +var require$$0$1 = [ "3dm", "3ds", "3g2", @@ -22875,16 +22698,9 @@ var binaryExtensions = [ "zipx" ]; -var binaryExtensions$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': binaryExtensions -}); - -var require$$0$1 = getCjsExportFromNamespace(binaryExtensions$1); +var binaryExtensions = require$$0$1; -var binaryExtensions$2 = require$$0$1; - -const extensions = new Set(binaryExtensions$2); +const extensions = new Set(binaryExtensions); var isBinaryPath = filePath => extensions.has(path__default['default'].extname(filePath).slice(1).toLowerCase()); @@ -22952,57 +22768,6 @@ exports.isWindows = platform === 'win32'; exports.isMacos = platform === 'darwin'; exports.isLinux = platform === 'linux'; }); -var constants_1 = constants$2.EV_ALL; -var constants_2 = constants$2.EV_READY; -var constants_3 = constants$2.EV_ADD; -var constants_4 = constants$2.EV_CHANGE; -var constants_5 = constants$2.EV_ADD_DIR; -var constants_6 = constants$2.EV_UNLINK; -var constants_7 = constants$2.EV_UNLINK_DIR; -var constants_8 = constants$2.EV_RAW; -var constants_9 = constants$2.EV_ERROR; -var constants_10 = constants$2.STR_DATA; -var constants_11 = constants$2.STR_END; -var constants_12 = constants$2.STR_CLOSE; -var constants_13 = constants$2.FSEVENT_CREATED; -var constants_14 = constants$2.FSEVENT_MODIFIED; -var constants_15 = constants$2.FSEVENT_DELETED; -var constants_16 = constants$2.FSEVENT_MOVED; -var constants_17 = constants$2.FSEVENT_CLONED; -var constants_18 = constants$2.FSEVENT_UNKNOWN; -var constants_19 = constants$2.FSEVENT_TYPE_FILE; -var constants_20 = constants$2.FSEVENT_TYPE_DIRECTORY; -var constants_21 = constants$2.FSEVENT_TYPE_SYMLINK; -var constants_22 = constants$2.KEY_LISTENERS; -var constants_23 = constants$2.KEY_ERR; -var constants_24 = constants$2.KEY_RAW; -var constants_25 = constants$2.HANDLER_KEYS; -var constants_26 = constants$2.DOT_SLASH; -var constants_27 = constants$2.BACK_SLASH_RE; -var constants_28 = constants$2.DOUBLE_SLASH_RE; -var constants_29 = constants$2.SLASH_OR_BACK_SLASH_RE; -var constants_30 = constants$2.DOT_RE; -var constants_31 = constants$2.REPLACER_RE; -var constants_32 = constants$2.SLASH; -var constants_33 = constants$2.SLASH_SLASH; -var constants_34 = constants$2.BRACE_START; -var constants_35 = constants$2.BANG; -var constants_36 = constants$2.ONE_DOT; -var constants_37 = constants$2.TWO_DOTS; -var constants_38 = constants$2.STAR; -var constants_39 = constants$2.GLOBSTAR; -var constants_40 = constants$2.ROOT_GLOBSTAR; -var constants_41 = constants$2.SLASH_GLOBSTAR; -var constants_42 = constants$2.DIR_SUFFIX; -var constants_43 = constants$2.ANYMATCH_OPTS; -var constants_44 = constants$2.STRING_TYPE; -var constants_45 = constants$2.FUNCTION_TYPE; -var constants_46 = constants$2.EMPTY_STR; -var constants_47 = constants$2.EMPTY_FN; -var constants_48 = constants$2.IDENTITY_FN; -var constants_49 = constants$2.isWindows; -var constants_50 = constants$2.isMacos; -var constants_51 = constants$2.isLinux; const { promisify: promisify$1 } = util__default['default']; @@ -23235,18 +23000,14 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => { const {listener, rawEmitter} = handlers; let cont = FsWatchFileInstances.get(fullPath); - /* eslint-disable no-unused-vars, prefer-destructuring */ - let listeners = new Set(); - let rawEmitters = new Set(); - const copts = cont && cont.options; if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { // "Upgrade" the watcher to persistence or a quicker interval. // This creates some unlikely edge case issues if the user mixes // settings in a very weird way, but solving for those cases // doesn't seem worthwhile for the added complexity. - listeners = cont.listeners; - rawEmitters = cont.rawEmitters; + cont.listeners; + cont.rawEmitters; fs__default['default'].unwatchFile(fullPath); cont = undefined; } @@ -23943,8 +23704,7 @@ handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opt * @returns {Function} closer for the watcher instance */ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { - if (this.fsw.closed) return; - if (this.fsw._isIgnored(watchPath)) return; + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; const opts = this.fsw.options; const watchCallback = async (fullPath, flags, info) => { if (this.fsw.closed) return; @@ -24173,7 +23933,7 @@ const { EventEmitter } = events__default['default']; const { promisify: promisify$3 } = util__default['default']; -const anymatch = anymatch_1.default; +const anymatch$1 = anymatch_1.default; @@ -24204,7 +23964,7 @@ const { SLASH: SLASH$1, SLASH_SLASH, BRACE_START: BRACE_START$1, - BANG: BANG$1, + BANG: BANG$2, ONE_DOT, TWO_DOTS, GLOBSTAR: GLOBSTAR$1, @@ -24242,7 +24002,7 @@ const readdir$2 = promisify$3(fs__default['default'].readdir); * @property {Function} filterDir */ -const arrify = (value = []) => Array.isArray(value) ? value : [value]; +const arrify$1 = (value = []) => Array.isArray(value) ? value : [value]; const flatten = (list, result = []) => { list.forEach(item => { if (Array.isArray(item)) { @@ -24258,7 +24018,7 @@ const unifyPaths = (paths_) => { /** * @type {Array} */ - const paths = flatten(arrify(paths_)); + const paths = flatten(arrify$1(paths_)); if (!paths.every(p => typeof p === STRING_TYPE)) { throw new TypeError(`Non-string provided as watch path: ${paths}`); } @@ -24295,8 +24055,8 @@ const getAbsolutePath = (path, cwd) => { if (path__default['default'].isAbsolute(path)) { return path; } - if (path.startsWith(BANG$1)) { - return BANG$1 + path__default['default'].join(cwd, path.slice(1)); + if (path.startsWith(BANG$2)) { + return BANG$2 + path__default['default'].join(cwd, path.slice(1)); } return path__default['default'].join(cwd, path); }; @@ -24378,7 +24138,7 @@ class WatchHelper { /** @type {object|boolean} */ if (path === EMPTY_STR$1) this.hasGlob = false; this.globSymlink = this.hasGlob && follow ? undefined : false; - this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.globFilter = this.hasGlob ? anymatch$1(path, undefined, ANYMATCH_OPTS) : false; this.dirParts = this.getDirParts(path); this.dirParts.forEach((parts) => { if (parts.length > 1) parts.pop(); @@ -24436,7 +24196,7 @@ class WatchHelper { this.unmatchedGlob = !this.dirParts.some((parts) => { return parts.every((part, i) => { if (part === GLOBSTAR$1) globstar = true; - return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); + return globstar || !entryParts[0][i] || anymatch$1(part, entryParts[0][i], ANYMATCH_OPTS); }); }); } @@ -24531,7 +24291,7 @@ constructor(_opts) { if (!awf.pollInterval) awf.pollInterval = 100; this._pendingWrites = new Map(); } - if (opts.ignored) opts.ignored = arrify(opts.ignored); + if (opts.ignored) opts.ignored = arrify$1(opts.ignored); let readyCalls = 0; this._emitReady = () => { @@ -24585,7 +24345,7 @@ add(paths_, _origAdd, _internal) { // set aside negated glob strings paths = paths.filter((path) => { - if (path.startsWith(BANG$1)) { + if (path.startsWith(BANG$2)) { this._ignoredPaths.add(path.slice(1)); return false; } @@ -24931,11 +24691,11 @@ _isIgnored(path, stats) { const ign = this.options.ignored; const ignored = ign && ign.map(normalizeIgnored(cwd)); - const paths = arrify(ignored) + const paths = arrify$1(ignored) .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) .map((path) => path + SLASH_GLOBSTAR); const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); - this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); + this._userIgnored = anymatch$1(list, undefined, ANYMATCH_OPTS); } return this._userIgnored([path, stats]); @@ -25032,6 +24792,15 @@ _remove(directory, item, isDirectory) { const wasTracked = parent.has(item); parent.remove(item); + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + // If we wait for this file to be fully written, cancel the wait. let relPath = path; if (this.options.cwd) relPath = path__default['default'].relative(this.options.cwd, path); @@ -25290,8 +25059,8 @@ const camelCase = (input, options) => { var camelcase = camelCase; // TODO: Remove this for the next major release -var _default$4 = camelCase; -camelcase.default = _default$4; +var _default$7 = camelCase; +camelcase.default = _default$7; var minimist = function (args, opts) { if (!opts) opts = {}; @@ -25593,7 +25362,7 @@ let token; let key; let root; -var parse$7 = function parse (text, reviver) { +var parse$6 = function parse (text, reviver) { source$1 = String(text); parseState = 'start'; stack = []; @@ -26404,7 +26173,7 @@ const parseStates = { throw invalidEOF() } - push(); + push$1(); }, beforePropertyName () { @@ -26450,7 +26219,7 @@ const parseStates = { throw invalidEOF() } - push(); + push$1(); }, beforeArrayValue () { @@ -26463,7 +26232,7 @@ const parseStates = { return } - push(); + push$1(); }, afterPropertyValue () { @@ -26520,7 +26289,7 @@ const parseStates = { }, }; -function push () { +function push$1 () { let value; switch (token.type) { @@ -26930,15 +26699,15 @@ var stringify$5 = function stringify (value, replacer, space) { }; const JSON5 = { - parse: parse$7, + parse: parse$6, stringify: stringify$5, }; -var lib$5 = JSON5; +var lib$6 = JSON5; var dist$1 = /*#__PURE__*/Object.freeze({ __proto__: null, - 'default': lib$5 + 'default': lib$6 }); var schema$1 = [ @@ -27103,14 +26872,7 @@ var schema$1 = [ } ]; -var schema$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': schema$1 -}); - -var json5 = getCjsExportFromNamespace(dist$1); - -var schema$3 = getCjsExportFromNamespace(schema$2); +var json5 = /*@__PURE__*/getAugmentedNamespace(dist$1); var options_1 = options; @@ -27123,7 +26885,7 @@ var minischema = { boolean: [] }; -schema$3.forEach(addEach); +schema$1.forEach(addEach); // Parse CLI options. function options(flags, configuration) { @@ -27134,7 +26896,7 @@ function options(flags, configuration) { var ext; var report; - schema$3.forEach(function (option) { + schema$1.forEach(function (option) { if (option.type === 'string' && config[option.long] === '') { throw fault_1('Missing value:%s', inspect$1(option).join(' ')) } @@ -27144,7 +26906,7 @@ function options(flags, configuration) { report = reporter$1(config.report); help = [ - inspectAll(schema$3), + inspectAll(schema$1), '', 'Examples:', '', @@ -27281,19 +27043,19 @@ function handleUnknownArgument(flag) { // Long options, always unknown. if (flag.charAt(1) === '-') { - throw fault_1('Unknown option `%s`, expected:\n%s', flag, inspectAll(schema$3)) + throw fault_1('Unknown option `%s`, expected:\n%s', flag, inspectAll(schema$1)) } // Short options, can be grouped. flag.slice(1).split('').forEach(each); function each(key) { - var length = schema$3.length; + var length = schema$1.length; var index = -1; var option; while (++index < length) { - option = schema$3[index]; + option = schema$1[index]; if (option.short === key) { return @@ -27303,7 +27065,7 @@ function handleUnknownArgument(flag) { throw fault_1( 'Unknown short option `-%s`, expected:\n%s', key, - inspectAll(schema$3.filter(short)) + inspectAll(schema$1.filter(short)) ) } @@ -27385,12 +27147,12 @@ function parseJSON(value) { return json5.parse('{' + value + '}') } -var lib$6 = start; +var lib$7 = start; -var noop$1 = Function.prototype; +var noop = Function.prototype; // Fake TTY stream. -var ttyStream = new stream__default['default'].Readable(); +var ttyStream = new require$$0__default['default'].Readable(); ttyStream.isTTY = true; // Exit, lazily, with the correct exit status code. @@ -27425,14 +27187,14 @@ function start(cliConfig) { config.helpMessage, '' ].join('\n'), - noop$1 + noop ); return } if (config.version) { - process.stdout.write(cliConfig.version + '\n', noop$1); + process.stdout.write(cliConfig.version + '\n', noop); return } @@ -27449,7 +27211,7 @@ function start(cliConfig) { process.stderr.write( source.bold('Watching...') + ' (press CTRL+C to exit)\n', - noop$1 + noop ); // Prevent infinite loop if set to regeneration. @@ -27458,13 +27220,13 @@ function start(cliConfig) { process.stderr.write( source.yellow('Note') + ': Ignoring `--output` until exit.\n', - noop$1 + noop ); } } // Initial run. - lib$4(config, done); + lib$5(config, done); // Handle complete run. function done(err, code, context) { @@ -27500,12 +27262,12 @@ function start(cliConfig) { function onchange(filePath) { config.files = [filePath]; - lib$4(config, done); + lib$5(config, done); } function onsigint() { // Hide the `^C` in terminal. - process.stderr.write('\n', noop$1); + process.stderr.write('\n', noop); clean(); @@ -27513,7 +27275,7 @@ function start(cliConfig) { if (output === true) { config.output = output; config.watch = false; - lib$4(config, done); + lib$5(config, done); } } } @@ -27527,7 +27289,7 @@ function fail$1(err, pretty) { exitStatus = 1; - process.stderr.write(message.trim() + '\n', noop$1); + process.stderr.write(message.trim() + '\n', noop); } function onexit() { @@ -27536,9 +27298,9 @@ function onexit() { /* eslint-enable unicorn/no-process-exit */ } -var unifiedArgs = lib$6; +var unifiedArgs = lib$7; -var markdownExtensions = [ +var require$$0$2 = [ "md", "markdown", "mdown", @@ -27549,14 +27311,7 @@ var markdownExtensions = [ "ron" ]; -var markdownExtensions$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': markdownExtensions -}); - -var require$$0$2 = getCjsExportFromNamespace(markdownExtensions$1); - -var markdownExtensions$2 = require$$0$2; +var markdownExtensions = require$$0$2; var bail_1 = bail; @@ -28141,6688 +27896,6 @@ function assertDone(name, asyncName, complete) { } } -const AEli = "Æ"; -const AElig = "Æ"; -const AM = "&"; -const AMP = "&"; -const Aacut = "Á"; -const Aacute = "Á"; -const Abreve = "Ă"; -const Acir = "Â"; -const Acirc = "Â"; -const Acy = "А"; -const Afr = "𝔄"; -const Agrav = "À"; -const Agrave = "À"; -const Alpha = "Α"; -const Amacr = "Ā"; -const And = "⩓"; -const Aogon = "Ą"; -const Aopf = "𝔸"; -const ApplyFunction = "⁡"; -const Arin = "Å"; -const Aring = "Å"; -const Ascr = "𝒜"; -const Assign = "≔"; -const Atild = "Ã"; -const Atilde = "Ã"; -const Aum = "Ä"; -const Auml = "Ä"; -const Backslash = "∖"; -const Barv = "⫧"; -const Barwed = "⌆"; -const Bcy = "Б"; -const Because = "∵"; -const Bernoullis = "ℬ"; -const Beta = "Β"; -const Bfr = "𝔅"; -const Bopf = "𝔹"; -const Breve = "˘"; -const Bscr = "ℬ"; -const Bumpeq = "≎"; -const CHcy = "Ч"; -const COP = "©"; -const COPY = "©"; -const Cacute = "Ć"; -const Cap = "⋒"; -const CapitalDifferentialD = "ⅅ"; -const Cayleys = "ℭ"; -const Ccaron = "Č"; -const Ccedi = "Ç"; -const Ccedil = "Ç"; -const Ccirc = "Ĉ"; -const Cconint = "∰"; -const Cdot = "Ċ"; -const Cedilla = "¸"; -const CenterDot = "·"; -const Cfr = "ℭ"; -const Chi = "Χ"; -const CircleDot = "⊙"; -const CircleMinus = "⊖"; -const CirclePlus = "⊕"; -const CircleTimes = "⊗"; -const ClockwiseContourIntegral = "∲"; -const CloseCurlyDoubleQuote = "”"; -const CloseCurlyQuote = "’"; -const Colon = "∷"; -const Colone = "⩴"; -const Congruent = "≡"; -const Conint = "∯"; -const ContourIntegral = "∮"; -const Copf = "ℂ"; -const Coproduct = "∐"; -const CounterClockwiseContourIntegral = "∳"; -const Cross = "⨯"; -const Cscr = "𝒞"; -const Cup = "⋓"; -const CupCap = "≍"; -const DD = "ⅅ"; -const DDotrahd = "⤑"; -const DJcy = "Ђ"; -const DScy = "Ѕ"; -const DZcy = "Џ"; -const Dagger = "‡"; -const Darr = "↡"; -const Dashv = "⫤"; -const Dcaron = "Ď"; -const Dcy = "Д"; -const Del = "∇"; -const Delta = "Δ"; -const Dfr = "𝔇"; -const DiacriticalAcute = "´"; -const DiacriticalDot = "˙"; -const DiacriticalDoubleAcute = "˝"; -const DiacriticalGrave = "`"; -const DiacriticalTilde = "˜"; -const Diamond = "⋄"; -const DifferentialD = "ⅆ"; -const Dopf = "𝔻"; -const Dot = "¨"; -const DotDot = "⃜"; -const DotEqual = "≐"; -const DoubleContourIntegral = "∯"; -const DoubleDot = "¨"; -const DoubleDownArrow = "⇓"; -const DoubleLeftArrow = "⇐"; -const DoubleLeftRightArrow = "⇔"; -const DoubleLeftTee = "⫤"; -const DoubleLongLeftArrow = "⟸"; -const DoubleLongLeftRightArrow = "⟺"; -const DoubleLongRightArrow = "⟹"; -const DoubleRightArrow = "⇒"; -const DoubleRightTee = "⊨"; -const DoubleUpArrow = "⇑"; -const DoubleUpDownArrow = "⇕"; -const DoubleVerticalBar = "∥"; -const DownArrow = "↓"; -const DownArrowBar = "⤓"; -const DownArrowUpArrow = "⇵"; -const DownBreve = "̑"; -const DownLeftRightVector = "⥐"; -const DownLeftTeeVector = "⥞"; -const DownLeftVector = "↽"; -const DownLeftVectorBar = "⥖"; -const DownRightTeeVector = "⥟"; -const DownRightVector = "⇁"; -const DownRightVectorBar = "⥗"; -const DownTee = "⊤"; -const DownTeeArrow = "↧"; -const Downarrow = "⇓"; -const Dscr = "𝒟"; -const Dstrok = "Đ"; -const ENG = "Ŋ"; -const ET = "Ð"; -const ETH = "Ð"; -const Eacut = "É"; -const Eacute = "É"; -const Ecaron = "Ě"; -const Ecir = "Ê"; -const Ecirc = "Ê"; -const Ecy = "Э"; -const Edot = "Ė"; -const Efr = "𝔈"; -const Egrav = "È"; -const Egrave = "È"; -const Element = "∈"; -const Emacr = "Ē"; -const EmptySmallSquare = "◻"; -const EmptyVerySmallSquare = "▫"; -const Eogon = "Ę"; -const Eopf = "𝔼"; -const Epsilon = "Ε"; -const Equal = "⩵"; -const EqualTilde = "≂"; -const Equilibrium = "⇌"; -const Escr = "ℰ"; -const Esim = "⩳"; -const Eta = "Η"; -const Eum = "Ë"; -const Euml = "Ë"; -const Exists = "∃"; -const ExponentialE = "ⅇ"; -const Fcy = "Ф"; -const Ffr = "𝔉"; -const FilledSmallSquare = "◼"; -const FilledVerySmallSquare = "▪"; -const Fopf = "𝔽"; -const ForAll = "∀"; -const Fouriertrf = "ℱ"; -const Fscr = "ℱ"; -const GJcy = "Ѓ"; -const G = ">"; -const GT = ">"; -const Gamma = "Γ"; -const Gammad = "Ϝ"; -const Gbreve = "Ğ"; -const Gcedil = "Ģ"; -const Gcirc = "Ĝ"; -const Gcy = "Г"; -const Gdot = "Ġ"; -const Gfr = "𝔊"; -const Gg = "⋙"; -const Gopf = "𝔾"; -const GreaterEqual = "≥"; -const GreaterEqualLess = "⋛"; -const GreaterFullEqual = "≧"; -const GreaterGreater = "⪢"; -const GreaterLess = "≷"; -const GreaterSlantEqual = "⩾"; -const GreaterTilde = "≳"; -const Gscr = "𝒢"; -const Gt = "≫"; -const HARDcy = "Ъ"; -const Hacek = "ˇ"; -const Hat = "^"; -const Hcirc = "Ĥ"; -const Hfr = "ℌ"; -const HilbertSpace = "ℋ"; -const Hopf = "ℍ"; -const HorizontalLine = "─"; -const Hscr = "ℋ"; -const Hstrok = "Ħ"; -const HumpDownHump = "≎"; -const HumpEqual = "≏"; -const IEcy = "Е"; -const IJlig = "IJ"; -const IOcy = "Ё"; -const Iacut = "Í"; -const Iacute = "Í"; -const Icir = "Î"; -const Icirc = "Î"; -const Icy = "И"; -const Idot = "İ"; -const Ifr = "ℑ"; -const Igrav = "Ì"; -const Igrave = "Ì"; -const Im = "ℑ"; -const Imacr = "Ī"; -const ImaginaryI = "ⅈ"; -const Implies = "⇒"; -const Int = "∬"; -const Integral = "∫"; -const Intersection = "⋂"; -const InvisibleComma = "⁣"; -const InvisibleTimes = "⁢"; -const Iogon = "Į"; -const Iopf = "𝕀"; -const Iota = "Ι"; -const Iscr = "ℐ"; -const Itilde = "Ĩ"; -const Iukcy = "І"; -const Ium = "Ï"; -const Iuml = "Ï"; -const Jcirc = "Ĵ"; -const Jcy = "Й"; -const Jfr = "𝔍"; -const Jopf = "𝕁"; -const Jscr = "𝒥"; -const Jsercy = "Ј"; -const Jukcy = "Є"; -const KHcy = "Х"; -const KJcy = "Ќ"; -const Kappa = "Κ"; -const Kcedil = "Ķ"; -const Kcy = "К"; -const Kfr = "𝔎"; -const Kopf = "𝕂"; -const Kscr = "𝒦"; -const LJcy = "Љ"; -const L = "<"; -const LT = "<"; -const Lacute = "Ĺ"; -const Lambda = "Λ"; -const Lang = "⟪"; -const Laplacetrf = "ℒ"; -const Larr = "↞"; -const Lcaron = "Ľ"; -const Lcedil = "Ļ"; -const Lcy = "Л"; -const LeftAngleBracket = "⟨"; -const LeftArrow = "←"; -const LeftArrowBar = "⇤"; -const LeftArrowRightArrow = "⇆"; -const LeftCeiling = "⌈"; -const LeftDoubleBracket = "⟦"; -const LeftDownTeeVector = "⥡"; -const LeftDownVector = "⇃"; -const LeftDownVectorBar = "⥙"; -const LeftFloor = "⌊"; -const LeftRightArrow = "↔"; -const LeftRightVector = "⥎"; -const LeftTee = "⊣"; -const LeftTeeArrow = "↤"; -const LeftTeeVector = "⥚"; -const LeftTriangle = "⊲"; -const LeftTriangleBar = "⧏"; -const LeftTriangleEqual = "⊴"; -const LeftUpDownVector = "⥑"; -const LeftUpTeeVector = "⥠"; -const LeftUpVector = "↿"; -const LeftUpVectorBar = "⥘"; -const LeftVector = "↼"; -const LeftVectorBar = "⥒"; -const Leftarrow = "⇐"; -const Leftrightarrow = "⇔"; -const LessEqualGreater = "⋚"; -const LessFullEqual = "≦"; -const LessGreater = "≶"; -const LessLess = "⪡"; -const LessSlantEqual = "⩽"; -const LessTilde = "≲"; -const Lfr = "𝔏"; -const Ll = "⋘"; -const Lleftarrow = "⇚"; -const Lmidot = "Ŀ"; -const LongLeftArrow = "⟵"; -const LongLeftRightArrow = "⟷"; -const LongRightArrow = "⟶"; -const Longleftarrow = "⟸"; -const Longleftrightarrow = "⟺"; -const Longrightarrow = "⟹"; -const Lopf = "𝕃"; -const LowerLeftArrow = "↙"; -const LowerRightArrow = "↘"; -const Lscr = "ℒ"; -const Lsh = "↰"; -const Lstrok = "Ł"; -const Lt = "≪"; -const Mcy = "М"; -const MediumSpace = " "; -const Mellintrf = "ℳ"; -const Mfr = "𝔐"; -const MinusPlus = "∓"; -const Mopf = "𝕄"; -const Mscr = "ℳ"; -const Mu = "Μ"; -const NJcy = "Њ"; -const Nacute = "Ń"; -const Ncaron = "Ň"; -const Ncedil = "Ņ"; -const Ncy = "Н"; -const NegativeMediumSpace = "​"; -const NegativeThickSpace = "​"; -const NegativeThinSpace = "​"; -const NegativeVeryThinSpace = "​"; -const NestedGreaterGreater = "≫"; -const NestedLessLess = "≪"; -const NewLine = "\n"; -const Nfr = "𝔑"; -const NoBreak = "⁠"; -const NonBreakingSpace = " "; -const Nopf = "ℕ"; -const Not = "⫬"; -const NotCongruent = "≢"; -const NotCupCap = "≭"; -const NotDoubleVerticalBar = "∦"; -const NotElement = "∉"; -const NotEqual = "≠"; -const NotEqualTilde = "≂̸"; -const NotExists = "∄"; -const NotGreater = "≯"; -const NotGreaterEqual = "≱"; -const NotGreaterFullEqual = "≧̸"; -const NotGreaterGreater = "≫̸"; -const NotGreaterLess = "≹"; -const NotGreaterSlantEqual = "⩾̸"; -const NotGreaterTilde = "≵"; -const NotHumpDownHump = "≎̸"; -const NotHumpEqual = "≏̸"; -const NotLeftTriangle = "⋪"; -const NotLeftTriangleBar = "⧏̸"; -const NotLeftTriangleEqual = "⋬"; -const NotLess = "≮"; -const NotLessEqual = "≰"; -const NotLessGreater = "≸"; -const NotLessLess = "≪̸"; -const NotLessSlantEqual = "⩽̸"; -const NotLessTilde = "≴"; -const NotNestedGreaterGreater = "⪢̸"; -const NotNestedLessLess = "⪡̸"; -const NotPrecedes = "⊀"; -const NotPrecedesEqual = "⪯̸"; -const NotPrecedesSlantEqual = "⋠"; -const NotReverseElement = "∌"; -const NotRightTriangle = "⋫"; -const NotRightTriangleBar = "⧐̸"; -const NotRightTriangleEqual = "⋭"; -const NotSquareSubset = "⊏̸"; -const NotSquareSubsetEqual = "⋢"; -const NotSquareSuperset = "⊐̸"; -const NotSquareSupersetEqual = "⋣"; -const NotSubset = "⊂⃒"; -const NotSubsetEqual = "⊈"; -const NotSucceeds = "⊁"; -const NotSucceedsEqual = "⪰̸"; -const NotSucceedsSlantEqual = "⋡"; -const NotSucceedsTilde = "≿̸"; -const NotSuperset = "⊃⃒"; -const NotSupersetEqual = "⊉"; -const NotTilde = "≁"; -const NotTildeEqual = "≄"; -const NotTildeFullEqual = "≇"; -const NotTildeTilde = "≉"; -const NotVerticalBar = "∤"; -const Nscr = "𝒩"; -const Ntild = "Ñ"; -const Ntilde = "Ñ"; -const Nu = "Ν"; -const OElig = "Œ"; -const Oacut = "Ó"; -const Oacute = "Ó"; -const Ocir = "Ô"; -const Ocirc = "Ô"; -const Ocy = "О"; -const Odblac = "Ő"; -const Ofr = "𝔒"; -const Ograv = "Ò"; -const Ograve = "Ò"; -const Omacr = "Ō"; -const Omega = "Ω"; -const Omicron = "Ο"; -const Oopf = "𝕆"; -const OpenCurlyDoubleQuote = "“"; -const OpenCurlyQuote = "‘"; -const Or = "⩔"; -const Oscr = "𝒪"; -const Oslas = "Ø"; -const Oslash = "Ø"; -const Otild = "Õ"; -const Otilde = "Õ"; -const Otimes = "⨷"; -const Oum = "Ö"; -const Ouml = "Ö"; -const OverBar = "‾"; -const OverBrace = "⏞"; -const OverBracket = "⎴"; -const OverParenthesis = "⏜"; -const PartialD = "∂"; -const Pcy = "П"; -const Pfr = "𝔓"; -const Phi = "Φ"; -const Pi = "Π"; -const PlusMinus = "±"; -const Poincareplane = "ℌ"; -const Popf = "ℙ"; -const Pr = "⪻"; -const Precedes = "≺"; -const PrecedesEqual = "⪯"; -const PrecedesSlantEqual = "≼"; -const PrecedesTilde = "≾"; -const Prime = "″"; -const Product = "∏"; -const Proportion = "∷"; -const Proportional = "∝"; -const Pscr = "𝒫"; -const Psi = "Ψ"; -const QUO = "\""; -const QUOT = "\""; -const Qfr = "𝔔"; -const Qopf = "ℚ"; -const Qscr = "𝒬"; -const RBarr = "⤐"; -const RE = "®"; -const REG = "®"; -const Racute = "Ŕ"; -const Rang = "⟫"; -const Rarr = "↠"; -const Rarrtl = "⤖"; -const Rcaron = "Ř"; -const Rcedil = "Ŗ"; -const Rcy = "Р"; -const Re = "ℜ"; -const ReverseElement = "∋"; -const ReverseEquilibrium = "⇋"; -const ReverseUpEquilibrium = "⥯"; -const Rfr = "ℜ"; -const Rho = "Ρ"; -const RightAngleBracket = "⟩"; -const RightArrow = "→"; -const RightArrowBar = "⇥"; -const RightArrowLeftArrow = "⇄"; -const RightCeiling = "⌉"; -const RightDoubleBracket = "⟧"; -const RightDownTeeVector = "⥝"; -const RightDownVector = "⇂"; -const RightDownVectorBar = "⥕"; -const RightFloor = "⌋"; -const RightTee = "⊢"; -const RightTeeArrow = "↦"; -const RightTeeVector = "⥛"; -const RightTriangle = "⊳"; -const RightTriangleBar = "⧐"; -const RightTriangleEqual = "⊵"; -const RightUpDownVector = "⥏"; -const RightUpTeeVector = "⥜"; -const RightUpVector = "↾"; -const RightUpVectorBar = "⥔"; -const RightVector = "⇀"; -const RightVectorBar = "⥓"; -const Rightarrow = "⇒"; -const Ropf = "ℝ"; -const RoundImplies = "⥰"; -const Rrightarrow = "⇛"; -const Rscr = "ℛ"; -const Rsh = "↱"; -const RuleDelayed = "⧴"; -const SHCHcy = "Щ"; -const SHcy = "Ш"; -const SOFTcy = "Ь"; -const Sacute = "Ś"; -const Sc = "⪼"; -const Scaron = "Š"; -const Scedil = "Ş"; -const Scirc = "Ŝ"; -const Scy = "С"; -const Sfr = "𝔖"; -const ShortDownArrow = "↓"; -const ShortLeftArrow = "←"; -const ShortRightArrow = "→"; -const ShortUpArrow = "↑"; -const Sigma = "Σ"; -const SmallCircle = "∘"; -const Sopf = "𝕊"; -const Sqrt = "√"; -const Square = "□"; -const SquareIntersection = "⊓"; -const SquareSubset = "⊏"; -const SquareSubsetEqual = "⊑"; -const SquareSuperset = "⊐"; -const SquareSupersetEqual = "⊒"; -const SquareUnion = "⊔"; -const Sscr = "𝒮"; -const Star = "⋆"; -const Sub = "⋐"; -const Subset = "⋐"; -const SubsetEqual = "⊆"; -const Succeeds = "≻"; -const SucceedsEqual = "⪰"; -const SucceedsSlantEqual = "≽"; -const SucceedsTilde = "≿"; -const SuchThat = "∋"; -const Sum = "∑"; -const Sup = "⋑"; -const Superset = "⊃"; -const SupersetEqual = "⊇"; -const Supset = "⋑"; -const THOR = "Þ"; -const THORN = "Þ"; -const TRADE = "™"; -const TSHcy = "Ћ"; -const TScy = "Ц"; -const Tab = "\t"; -const Tau = "Τ"; -const Tcaron = "Ť"; -const Tcedil = "Ţ"; -const Tcy = "Т"; -const Tfr = "𝔗"; -const Therefore = "∴"; -const Theta = "Θ"; -const ThickSpace = "  "; -const ThinSpace = " "; -const Tilde = "∼"; -const TildeEqual = "≃"; -const TildeFullEqual = "≅"; -const TildeTilde = "≈"; -const Topf = "𝕋"; -const TripleDot = "⃛"; -const Tscr = "𝒯"; -const Tstrok = "Ŧ"; -const Uacut = "Ú"; -const Uacute = "Ú"; -const Uarr = "↟"; -const Uarrocir = "⥉"; -const Ubrcy = "Ў"; -const Ubreve = "Ŭ"; -const Ucir = "Û"; -const Ucirc = "Û"; -const Ucy = "У"; -const Udblac = "Ű"; -const Ufr = "𝔘"; -const Ugrav = "Ù"; -const Ugrave = "Ù"; -const Umacr = "Ū"; -const UnderBar = "_"; -const UnderBrace = "⏟"; -const UnderBracket = "⎵"; -const UnderParenthesis = "⏝"; -const Union = "⋃"; -const UnionPlus = "⊎"; -const Uogon = "Ų"; -const Uopf = "𝕌"; -const UpArrow = "↑"; -const UpArrowBar = "⤒"; -const UpArrowDownArrow = "⇅"; -const UpDownArrow = "↕"; -const UpEquilibrium = "⥮"; -const UpTee = "⊥"; -const UpTeeArrow = "↥"; -const Uparrow = "⇑"; -const Updownarrow = "⇕"; -const UpperLeftArrow = "↖"; -const UpperRightArrow = "↗"; -const Upsi = "ϒ"; -const Upsilon = "Υ"; -const Uring = "Ů"; -const Uscr = "𝒰"; -const Utilde = "Ũ"; -const Uum = "Ü"; -const Uuml = "Ü"; -const VDash = "⊫"; -const Vbar = "⫫"; -const Vcy = "В"; -const Vdash = "⊩"; -const Vdashl = "⫦"; -const Vee = "⋁"; -const Verbar = "‖"; -const Vert = "‖"; -const VerticalBar = "∣"; -const VerticalLine = "|"; -const VerticalSeparator = "❘"; -const VerticalTilde = "≀"; -const VeryThinSpace = " "; -const Vfr = "𝔙"; -const Vopf = "𝕍"; -const Vscr = "𝒱"; -const Vvdash = "⊪"; -const Wcirc = "Ŵ"; -const Wedge = "⋀"; -const Wfr = "𝔚"; -const Wopf = "𝕎"; -const Wscr = "𝒲"; -const Xfr = "𝔛"; -const Xi = "Ξ"; -const Xopf = "𝕏"; -const Xscr = "𝒳"; -const YAcy = "Я"; -const YIcy = "Ї"; -const YUcy = "Ю"; -const Yacut = "Ý"; -const Yacute = "Ý"; -const Ycirc = "Ŷ"; -const Ycy = "Ы"; -const Yfr = "𝔜"; -const Yopf = "𝕐"; -const Yscr = "𝒴"; -const Yuml = "Ÿ"; -const ZHcy = "Ж"; -const Zacute = "Ź"; -const Zcaron = "Ž"; -const Zcy = "З"; -const Zdot = "Ż"; -const ZeroWidthSpace = "​"; -const Zeta = "Ζ"; -const Zfr = "ℨ"; -const Zopf = "ℤ"; -const Zscr = "𝒵"; -const aacut = "á"; -const aacute = "á"; -const abreve = "ă"; -const ac = "∾"; -const acE = "∾̳"; -const acd = "∿"; -const acir = "â"; -const acirc = "â"; -const acut = "´"; -const acute = "´"; -const acy = "а"; -const aeli = "æ"; -const aelig = "æ"; -const af = "⁡"; -const afr = "𝔞"; -const agrav = "à"; -const agrave = "à"; -const alefsym = "ℵ"; -const aleph = "ℵ"; -const alpha = "α"; -const amacr = "ā"; -const amalg = "⨿"; -const am = "&"; -const amp = "&"; -const and = "∧"; -const andand = "⩕"; -const andd = "⩜"; -const andslope = "⩘"; -const andv = "⩚"; -const ang = "∠"; -const ange = "⦤"; -const angle = "∠"; -const angmsd = "∡"; -const angmsdaa = "⦨"; -const angmsdab = "⦩"; -const angmsdac = "⦪"; -const angmsdad = "⦫"; -const angmsdae = "⦬"; -const angmsdaf = "⦭"; -const angmsdag = "⦮"; -const angmsdah = "⦯"; -const angrt = "∟"; -const angrtvb = "⊾"; -const angrtvbd = "⦝"; -const angsph = "∢"; -const angst = "Å"; -const angzarr = "⍼"; -const aogon = "ą"; -const aopf = "𝕒"; -const ap = "≈"; -const apE = "⩰"; -const apacir = "⩯"; -const ape = "≊"; -const apid = "≋"; -const apos = "'"; -const approx = "≈"; -const approxeq = "≊"; -const arin = "å"; -const aring = "å"; -const ascr = "𝒶"; -const ast = "*"; -const asymp = "≈"; -const asympeq = "≍"; -const atild = "ã"; -const atilde = "ã"; -const aum = "ä"; -const auml = "ä"; -const awconint = "∳"; -const awint = "⨑"; -const bNot = "⫭"; -const backcong = "≌"; -const backepsilon = "϶"; -const backprime = "‵"; -const backsim = "∽"; -const backsimeq = "⋍"; -const barvee = "⊽"; -const barwed = "⌅"; -const barwedge = "⌅"; -const bbrk = "⎵"; -const bbrktbrk = "⎶"; -const bcong = "≌"; -const bcy = "б"; -const bdquo = "„"; -const becaus = "∵"; -const because = "∵"; -const bemptyv = "⦰"; -const bepsi = "϶"; -const bernou = "ℬ"; -const beta = "β"; -const beth = "ℶ"; -const between = "≬"; -const bfr = "𝔟"; -const bigcap = "⋂"; -const bigcirc = "◯"; -const bigcup = "⋃"; -const bigodot = "⨀"; -const bigoplus = "⨁"; -const bigotimes = "⨂"; -const bigsqcup = "⨆"; -const bigstar = "★"; -const bigtriangledown = "▽"; -const bigtriangleup = "△"; -const biguplus = "⨄"; -const bigvee = "⋁"; -const bigwedge = "⋀"; -const bkarow = "⤍"; -const blacklozenge = "⧫"; -const blacksquare = "▪"; -const blacktriangle = "▴"; -const blacktriangledown = "▾"; -const blacktriangleleft = "◂"; -const blacktriangleright = "▸"; -const blank = "␣"; -const blk12 = "▒"; -const blk14 = "░"; -const blk34 = "▓"; -const block = "█"; -const bne = "=⃥"; -const bnequiv = "≡⃥"; -const bnot = "⌐"; -const bopf = "𝕓"; -const bot = "⊥"; -const bottom = "⊥"; -const bowtie = "⋈"; -const boxDL = "╗"; -const boxDR = "╔"; -const boxDl = "╖"; -const boxDr = "╓"; -const boxH = "═"; -const boxHD = "╦"; -const boxHU = "╩"; -const boxHd = "╤"; -const boxHu = "╧"; -const boxUL = "╝"; -const boxUR = "╚"; -const boxUl = "╜"; -const boxUr = "╙"; -const boxV = "║"; -const boxVH = "╬"; -const boxVL = "╣"; -const boxVR = "╠"; -const boxVh = "╫"; -const boxVl = "╢"; -const boxVr = "╟"; -const boxbox = "⧉"; -const boxdL = "╕"; -const boxdR = "╒"; -const boxdl = "┐"; -const boxdr = "┌"; -const boxh = "─"; -const boxhD = "╥"; -const boxhU = "╨"; -const boxhd = "┬"; -const boxhu = "┴"; -const boxminus = "⊟"; -const boxplus = "⊞"; -const boxtimes = "⊠"; -const boxuL = "╛"; -const boxuR = "╘"; -const boxul = "┘"; -const boxur = "└"; -const boxv = "│"; -const boxvH = "╪"; -const boxvL = "╡"; -const boxvR = "╞"; -const boxvh = "┼"; -const boxvl = "┤"; -const boxvr = "├"; -const bprime = "‵"; -const breve = "˘"; -const brvba = "¦"; -const brvbar = "¦"; -const bscr = "𝒷"; -const bsemi = "⁏"; -const bsim = "∽"; -const bsime = "⋍"; -const bsol = "\\"; -const bsolb = "⧅"; -const bsolhsub = "⟈"; -const bull = "•"; -const bullet = "•"; -const bump = "≎"; -const bumpE = "⪮"; -const bumpe = "≏"; -const bumpeq = "≏"; -const cacute = "ć"; -const cap = "∩"; -const capand = "⩄"; -const capbrcup = "⩉"; -const capcap = "⩋"; -const capcup = "⩇"; -const capdot = "⩀"; -const caps = "∩︀"; -const caret = "⁁"; -const caron = "ˇ"; -const ccaps = "⩍"; -const ccaron = "č"; -const ccedi = "ç"; -const ccedil = "ç"; -const ccirc = "ĉ"; -const ccups = "⩌"; -const ccupssm = "⩐"; -const cdot = "ċ"; -const cedi = "¸"; -const cedil = "¸"; -const cemptyv = "⦲"; -const cen = "¢"; -const cent = "¢"; -const centerdot = "·"; -const cfr = "𝔠"; -const chcy = "ч"; -const check$2 = "✓"; -const checkmark = "✓"; -const chi = "χ"; -const cir = "○"; -const cirE = "⧃"; -const circ = "ˆ"; -const circeq = "≗"; -const circlearrowleft = "↺"; -const circlearrowright = "↻"; -const circledR = "®"; -const circledS = "Ⓢ"; -const circledast = "⊛"; -const circledcirc = "⊚"; -const circleddash = "⊝"; -const cire = "≗"; -const cirfnint = "⨐"; -const cirmid = "⫯"; -const cirscir = "⧂"; -const clubs = "♣"; -const clubsuit = "♣"; -const colon = ":"; -const colone = "≔"; -const coloneq = "≔"; -const comma = ","; -const commat = "@"; -const comp = "∁"; -const compfn = "∘"; -const complement = "∁"; -const complexes = "ℂ"; -const cong = "≅"; -const congdot = "⩭"; -const conint = "∮"; -const copf = "𝕔"; -const coprod = "∐"; -const cop = "©"; -const copy$1 = "©"; -const copysr = "℗"; -const crarr = "↵"; -const cross = "✗"; -const cscr = "𝒸"; -const csub = "⫏"; -const csube = "⫑"; -const csup = "⫐"; -const csupe = "⫒"; -const ctdot = "⋯"; -const cudarrl = "⤸"; -const cudarrr = "⤵"; -const cuepr = "⋞"; -const cuesc = "⋟"; -const cularr = "↶"; -const cularrp = "⤽"; -const cup = "∪"; -const cupbrcap = "⩈"; -const cupcap = "⩆"; -const cupcup = "⩊"; -const cupdot = "⊍"; -const cupor = "⩅"; -const cups = "∪︀"; -const curarr = "↷"; -const curarrm = "⤼"; -const curlyeqprec = "⋞"; -const curlyeqsucc = "⋟"; -const curlyvee = "⋎"; -const curlywedge = "⋏"; -const curre = "¤"; -const curren = "¤"; -const curvearrowleft = "↶"; -const curvearrowright = "↷"; -const cuvee = "⋎"; -const cuwed = "⋏"; -const cwconint = "∲"; -const cwint = "∱"; -const cylcty = "⌭"; -const dArr = "⇓"; -const dHar = "⥥"; -const dagger = "†"; -const daleth = "ℸ"; -const darr = "↓"; -const dash = "‐"; -const dashv = "⊣"; -const dbkarow = "⤏"; -const dblac = "˝"; -const dcaron = "ď"; -const dcy = "д"; -const dd = "ⅆ"; -const ddagger = "‡"; -const ddarr = "⇊"; -const ddotseq = "⩷"; -const de = "°"; -const deg = "°"; -const delta = "δ"; -const demptyv = "⦱"; -const dfisht = "⥿"; -const dfr = "𝔡"; -const dharl = "⇃"; -const dharr = "⇂"; -const diam = "⋄"; -const diamond = "⋄"; -const diamondsuit = "♦"; -const diams = "♦"; -const die = "¨"; -const digamma = "ϝ"; -const disin = "⋲"; -const div = "÷"; -const divid = "÷"; -const divide = "÷"; -const divideontimes = "⋇"; -const divonx = "⋇"; -const djcy = "ђ"; -const dlcorn = "⌞"; -const dlcrop = "⌍"; -const dollar = "$"; -const dopf = "𝕕"; -const dot = "˙"; -const doteq = "≐"; -const doteqdot = "≑"; -const dotminus = "∸"; -const dotplus = "∔"; -const dotsquare = "⊡"; -const doublebarwedge = "⌆"; -const downarrow = "↓"; -const downdownarrows = "⇊"; -const downharpoonleft = "⇃"; -const downharpoonright = "⇂"; -const drbkarow = "⤐"; -const drcorn = "⌟"; -const drcrop = "⌌"; -const dscr = "𝒹"; -const dscy = "ѕ"; -const dsol = "⧶"; -const dstrok = "đ"; -const dtdot = "⋱"; -const dtri = "▿"; -const dtrif = "▾"; -const duarr = "⇵"; -const duhar = "⥯"; -const dwangle = "⦦"; -const dzcy = "џ"; -const dzigrarr = "⟿"; -const eDDot = "⩷"; -const eDot = "≑"; -const eacut = "é"; -const eacute = "é"; -const easter = "⩮"; -const ecaron = "ě"; -const ecir = "ê"; -const ecirc = "ê"; -const ecolon = "≕"; -const ecy = "э"; -const edot = "ė"; -const ee = "ⅇ"; -const efDot = "≒"; -const efr = "𝔢"; -const eg = "⪚"; -const egrav = "è"; -const egrave = "è"; -const egs = "⪖"; -const egsdot = "⪘"; -const el = "⪙"; -const elinters = "⏧"; -const ell = "ℓ"; -const els = "⪕"; -const elsdot = "⪗"; -const emacr = "ē"; -const empty = "∅"; -const emptyset = "∅"; -const emptyv = "∅"; -const emsp13 = " "; -const emsp14 = " "; -const emsp = " "; -const eng = "ŋ"; -const ensp = " "; -const eogon = "ę"; -const eopf = "𝕖"; -const epar = "⋕"; -const eparsl = "⧣"; -const eplus = "⩱"; -const epsi = "ε"; -const epsilon = "ε"; -const epsiv = "ϵ"; -const eqcirc = "≖"; -const eqcolon = "≕"; -const eqsim = "≂"; -const eqslantgtr = "⪖"; -const eqslantless = "⪕"; -const equals = "="; -const equest = "≟"; -const equiv = "≡"; -const equivDD = "⩸"; -const eqvparsl = "⧥"; -const erDot = "≓"; -const erarr = "⥱"; -const escr = "ℯ"; -const esdot = "≐"; -const esim = "≂"; -const eta = "η"; -const et = "ð"; -const eth = "ð"; -const eum = "ë"; -const euml = "ë"; -const euro = "€"; -const excl = "!"; -const exist = "∃"; -const expectation = "ℰ"; -const exponentiale = "ⅇ"; -const fallingdotseq = "≒"; -const fcy = "ф"; -const female = "♀"; -const ffilig = "ffi"; -const fflig = "ff"; -const ffllig = "ffl"; -const ffr = "𝔣"; -const filig = "fi"; -const fjlig = "fj"; -const flat = "♭"; -const fllig = "fl"; -const fltns = "▱"; -const fnof = "ƒ"; -const fopf = "𝕗"; -const forall = "∀"; -const fork = "⋔"; -const forkv = "⫙"; -const fpartint = "⨍"; -const frac1 = "¼"; -const frac12 = "½"; -const frac13 = "⅓"; -const frac14 = "¼"; -const frac15 = "⅕"; -const frac16 = "⅙"; -const frac18 = "⅛"; -const frac23 = "⅔"; -const frac25 = "⅖"; -const frac3 = "¾"; -const frac34 = "¾"; -const frac35 = "⅗"; -const frac38 = "⅜"; -const frac45 = "⅘"; -const frac56 = "⅚"; -const frac58 = "⅝"; -const frac78 = "⅞"; -const frasl = "⁄"; -const frown = "⌢"; -const fscr = "𝒻"; -const gE = "≧"; -const gEl = "⪌"; -const gacute = "ǵ"; -const gamma = "γ"; -const gammad = "ϝ"; -const gap = "⪆"; -const gbreve = "ğ"; -const gcirc = "ĝ"; -const gcy = "г"; -const gdot = "ġ"; -const ge = "≥"; -const gel = "⋛"; -const geq = "≥"; -const geqq = "≧"; -const geqslant = "⩾"; -const ges = "⩾"; -const gescc = "⪩"; -const gesdot = "⪀"; -const gesdoto = "⪂"; -const gesdotol = "⪄"; -const gesl = "⋛︀"; -const gesles = "⪔"; -const gfr = "𝔤"; -const gg = "≫"; -const ggg = "⋙"; -const gimel = "ℷ"; -const gjcy = "ѓ"; -const gl = "≷"; -const glE = "⪒"; -const gla = "⪥"; -const glj = "⪤"; -const gnE = "≩"; -const gnap = "⪊"; -const gnapprox = "⪊"; -const gne = "⪈"; -const gneq = "⪈"; -const gneqq = "≩"; -const gnsim = "⋧"; -const gopf = "𝕘"; -const grave = "`"; -const gscr = "ℊ"; -const gsim = "≳"; -const gsime = "⪎"; -const gsiml = "⪐"; -const g = ">"; -const gt = ">"; -const gtcc = "⪧"; -const gtcir = "⩺"; -const gtdot = "⋗"; -const gtlPar = "⦕"; -const gtquest = "⩼"; -const gtrapprox = "⪆"; -const gtrarr = "⥸"; -const gtrdot = "⋗"; -const gtreqless = "⋛"; -const gtreqqless = "⪌"; -const gtrless = "≷"; -const gtrsim = "≳"; -const gvertneqq = "≩︀"; -const gvnE = "≩︀"; -const hArr = "⇔"; -const hairsp = " "; -const half = "½"; -const hamilt = "ℋ"; -const hardcy = "ъ"; -const harr = "↔"; -const harrcir = "⥈"; -const harrw = "↭"; -const hbar = "ℏ"; -const hcirc = "ĥ"; -const hearts = "♥"; -const heartsuit = "♥"; -const hellip = "…"; -const hercon = "⊹"; -const hfr = "𝔥"; -const hksearow = "⤥"; -const hkswarow = "⤦"; -const hoarr = "⇿"; -const homtht = "∻"; -const hookleftarrow = "↩"; -const hookrightarrow = "↪"; -const hopf = "𝕙"; -const horbar = "―"; -const hscr = "𝒽"; -const hslash = "ℏ"; -const hstrok = "ħ"; -const hybull = "⁃"; -const hyphen = "‐"; -const iacut = "í"; -const iacute = "í"; -const ic = "⁣"; -const icir = "î"; -const icirc = "î"; -const icy = "и"; -const iecy = "е"; -const iexc = "¡"; -const iexcl = "¡"; -const iff = "⇔"; -const ifr = "𝔦"; -const igrav = "ì"; -const igrave = "ì"; -const ii = "ⅈ"; -const iiiint = "⨌"; -const iiint = "∭"; -const iinfin = "⧜"; -const iiota = "℩"; -const ijlig = "ij"; -const imacr = "ī"; -const image = "ℑ"; -const imagline = "ℐ"; -const imagpart = "ℑ"; -const imath = "ı"; -const imof = "⊷"; -const imped = "Ƶ"; -const incare = "℅"; -const infin = "∞"; -const infintie = "⧝"; -const inodot = "ı"; -const int = "∫"; -const intcal = "⊺"; -const integers = "ℤ"; -const intercal = "⊺"; -const intlarhk = "⨗"; -const intprod = "⨼"; -const iocy = "ё"; -const iogon = "į"; -const iopf = "𝕚"; -const iota = "ι"; -const iprod = "⨼"; -const iques = "¿"; -const iquest = "¿"; -const iscr = "𝒾"; -const isin = "∈"; -const isinE = "⋹"; -const isindot = "⋵"; -const isins = "⋴"; -const isinsv = "⋳"; -const isinv = "∈"; -const it = "⁢"; -const itilde = "ĩ"; -const iukcy = "і"; -const ium = "ï"; -const iuml = "ï"; -const jcirc = "ĵ"; -const jcy = "й"; -const jfr = "𝔧"; -const jmath = "ȷ"; -const jopf = "𝕛"; -const jscr = "𝒿"; -const jsercy = "ј"; -const jukcy = "є"; -const kappa = "κ"; -const kappav = "ϰ"; -const kcedil = "ķ"; -const kcy = "к"; -const kfr = "𝔨"; -const kgreen = "ĸ"; -const khcy = "х"; -const kjcy = "ќ"; -const kopf = "𝕜"; -const kscr = "𝓀"; -const lAarr = "⇚"; -const lArr = "⇐"; -const lAtail = "⤛"; -const lBarr = "⤎"; -const lE = "≦"; -const lEg = "⪋"; -const lHar = "⥢"; -const lacute = "ĺ"; -const laemptyv = "⦴"; -const lagran = "ℒ"; -const lambda = "λ"; -const lang = "⟨"; -const langd = "⦑"; -const langle = "⟨"; -const lap = "⪅"; -const laqu = "«"; -const laquo = "«"; -const larr = "←"; -const larrb = "⇤"; -const larrbfs = "⤟"; -const larrfs = "⤝"; -const larrhk = "↩"; -const larrlp = "↫"; -const larrpl = "⤹"; -const larrsim = "⥳"; -const larrtl = "↢"; -const lat = "⪫"; -const latail = "⤙"; -const late = "⪭"; -const lates = "⪭︀"; -const lbarr = "⤌"; -const lbbrk = "❲"; -const lbrace = "{"; -const lbrack = "["; -const lbrke = "⦋"; -const lbrksld = "⦏"; -const lbrkslu = "⦍"; -const lcaron = "ľ"; -const lcedil = "ļ"; -const lceil = "⌈"; -const lcub = "{"; -const lcy = "л"; -const ldca = "⤶"; -const ldquo = "“"; -const ldquor = "„"; -const ldrdhar = "⥧"; -const ldrushar = "⥋"; -const ldsh = "↲"; -const le = "≤"; -const leftarrow = "←"; -const leftarrowtail = "↢"; -const leftharpoondown = "↽"; -const leftharpoonup = "↼"; -const leftleftarrows = "⇇"; -const leftrightarrow = "↔"; -const leftrightarrows = "⇆"; -const leftrightharpoons = "⇋"; -const leftrightsquigarrow = "↭"; -const leftthreetimes = "⋋"; -const leg = "⋚"; -const leq = "≤"; -const leqq = "≦"; -const leqslant = "⩽"; -const les = "⩽"; -const lescc = "⪨"; -const lesdot = "⩿"; -const lesdoto = "⪁"; -const lesdotor = "⪃"; -const lesg = "⋚︀"; -const lesges = "⪓"; -const lessapprox = "⪅"; -const lessdot = "⋖"; -const lesseqgtr = "⋚"; -const lesseqqgtr = "⪋"; -const lessgtr = "≶"; -const lesssim = "≲"; -const lfisht = "⥼"; -const lfloor = "⌊"; -const lfr = "𝔩"; -const lg = "≶"; -const lgE = "⪑"; -const lhard = "↽"; -const lharu = "↼"; -const lharul = "⥪"; -const lhblk = "▄"; -const ljcy = "љ"; -const ll = "≪"; -const llarr = "⇇"; -const llcorner = "⌞"; -const llhard = "⥫"; -const lltri = "◺"; -const lmidot = "ŀ"; -const lmoust = "⎰"; -const lmoustache = "⎰"; -const lnE = "≨"; -const lnap = "⪉"; -const lnapprox = "⪉"; -const lne = "⪇"; -const lneq = "⪇"; -const lneqq = "≨"; -const lnsim = "⋦"; -const loang = "⟬"; -const loarr = "⇽"; -const lobrk = "⟦"; -const longleftarrow = "⟵"; -const longleftrightarrow = "⟷"; -const longmapsto = "⟼"; -const longrightarrow = "⟶"; -const looparrowleft = "↫"; -const looparrowright = "↬"; -const lopar = "⦅"; -const lopf = "𝕝"; -const loplus = "⨭"; -const lotimes = "⨴"; -const lowast = "∗"; -const lowbar = "_"; -const loz = "◊"; -const lozenge = "◊"; -const lozf = "⧫"; -const lpar = "("; -const lparlt = "⦓"; -const lrarr = "⇆"; -const lrcorner = "⌟"; -const lrhar = "⇋"; -const lrhard = "⥭"; -const lrm = "‎"; -const lrtri = "⊿"; -const lsaquo = "‹"; -const lscr = "𝓁"; -const lsh = "↰"; -const lsim = "≲"; -const lsime = "⪍"; -const lsimg = "⪏"; -const lsqb = "["; -const lsquo = "‘"; -const lsquor = "‚"; -const lstrok = "ł"; -const l = "<"; -const lt = "<"; -const ltcc = "⪦"; -const ltcir = "⩹"; -const ltdot = "⋖"; -const lthree = "⋋"; -const ltimes = "⋉"; -const ltlarr = "⥶"; -const ltquest = "⩻"; -const ltrPar = "⦖"; -const ltri = "◃"; -const ltrie = "⊴"; -const ltrif = "◂"; -const lurdshar = "⥊"; -const luruhar = "⥦"; -const lvertneqq = "≨︀"; -const lvnE = "≨︀"; -const mDDot = "∺"; -const mac = "¯"; -const macr = "¯"; -const male = "♂"; -const malt = "✠"; -const maltese = "✠"; -const map$2 = "↦"; -const mapsto = "↦"; -const mapstodown = "↧"; -const mapstoleft = "↤"; -const mapstoup = "↥"; -const marker = "▮"; -const mcomma = "⨩"; -const mcy = "м"; -const mdash = "—"; -const measuredangle = "∡"; -const mfr = "𝔪"; -const mho = "℧"; -const micr = "µ"; -const micro = "µ"; -const mid = "∣"; -const midast = "*"; -const midcir = "⫰"; -const middo = "·"; -const middot = "·"; -const minus = "−"; -const minusb = "⊟"; -const minusd = "∸"; -const minusdu = "⨪"; -const mlcp = "⫛"; -const mldr = "…"; -const mnplus = "∓"; -const models$2 = "⊧"; -const mopf = "𝕞"; -const mp = "∓"; -const mscr = "𝓂"; -const mstpos = "∾"; -const mu = "μ"; -const multimap = "⊸"; -const mumap = "⊸"; -const nGg = "⋙̸"; -const nGt = "≫⃒"; -const nGtv = "≫̸"; -const nLeftarrow = "⇍"; -const nLeftrightarrow = "⇎"; -const nLl = "⋘̸"; -const nLt = "≪⃒"; -const nLtv = "≪̸"; -const nRightarrow = "⇏"; -const nVDash = "⊯"; -const nVdash = "⊮"; -const nabla = "∇"; -const nacute = "ń"; -const nang = "∠⃒"; -const nap = "≉"; -const napE = "⩰̸"; -const napid = "≋̸"; -const napos = "ʼn"; -const napprox = "≉"; -const natur = "♮"; -const natural = "♮"; -const naturals = "ℕ"; -const nbs = " "; -const nbsp = " "; -const nbump = "≎̸"; -const nbumpe = "≏̸"; -const ncap = "⩃"; -const ncaron = "ň"; -const ncedil = "ņ"; -const ncong = "≇"; -const ncongdot = "⩭̸"; -const ncup = "⩂"; -const ncy = "н"; -const ndash = "–"; -const ne = "≠"; -const neArr = "⇗"; -const nearhk = "⤤"; -const nearr = "↗"; -const nearrow = "↗"; -const nedot = "≐̸"; -const nequiv = "≢"; -const nesear = "⤨"; -const nesim = "≂̸"; -const nexist = "∄"; -const nexists = "∄"; -const nfr = "𝔫"; -const ngE = "≧̸"; -const nge = "≱"; -const ngeq = "≱"; -const ngeqq = "≧̸"; -const ngeqslant = "⩾̸"; -const nges = "⩾̸"; -const ngsim = "≵"; -const ngt = "≯"; -const ngtr = "≯"; -const nhArr = "⇎"; -const nharr = "↮"; -const nhpar = "⫲"; -const ni = "∋"; -const nis = "⋼"; -const nisd = "⋺"; -const niv = "∋"; -const njcy = "њ"; -const nlArr = "⇍"; -const nlE = "≦̸"; -const nlarr = "↚"; -const nldr = "‥"; -const nle = "≰"; -const nleftarrow = "↚"; -const nleftrightarrow = "↮"; -const nleq = "≰"; -const nleqq = "≦̸"; -const nleqslant = "⩽̸"; -const nles = "⩽̸"; -const nless = "≮"; -const nlsim = "≴"; -const nlt = "≮"; -const nltri = "⋪"; -const nltrie = "⋬"; -const nmid = "∤"; -const nopf = "𝕟"; -const no = "¬"; -const not = "¬"; -const notin = "∉"; -const notinE = "⋹̸"; -const notindot = "⋵̸"; -const notinva = "∉"; -const notinvb = "⋷"; -const notinvc = "⋶"; -const notni = "∌"; -const notniva = "∌"; -const notnivb = "⋾"; -const notnivc = "⋽"; -const npar = "∦"; -const nparallel = "∦"; -const nparsl = "⫽⃥"; -const npart = "∂̸"; -const npolint = "⨔"; -const npr = "⊀"; -const nprcue = "⋠"; -const npre = "⪯̸"; -const nprec = "⊀"; -const npreceq = "⪯̸"; -const nrArr = "⇏"; -const nrarr = "↛"; -const nrarrc = "⤳̸"; -const nrarrw = "↝̸"; -const nrightarrow = "↛"; -const nrtri = "⋫"; -const nrtrie = "⋭"; -const nsc = "⊁"; -const nsccue = "⋡"; -const nsce = "⪰̸"; -const nscr = "𝓃"; -const nshortmid = "∤"; -const nshortparallel = "∦"; -const nsim = "≁"; -const nsime = "≄"; -const nsimeq = "≄"; -const nsmid = "∤"; -const nspar = "∦"; -const nsqsube = "⋢"; -const nsqsupe = "⋣"; -const nsub = "⊄"; -const nsubE = "⫅̸"; -const nsube = "⊈"; -const nsubset = "⊂⃒"; -const nsubseteq = "⊈"; -const nsubseteqq = "⫅̸"; -const nsucc = "⊁"; -const nsucceq = "⪰̸"; -const nsup = "⊅"; -const nsupE = "⫆̸"; -const nsupe = "⊉"; -const nsupset = "⊃⃒"; -const nsupseteq = "⊉"; -const nsupseteqq = "⫆̸"; -const ntgl = "≹"; -const ntild = "ñ"; -const ntilde = "ñ"; -const ntlg = "≸"; -const ntriangleleft = "⋪"; -const ntrianglelefteq = "⋬"; -const ntriangleright = "⋫"; -const ntrianglerighteq = "⋭"; -const nu = "ν"; -const num = "#"; -const numero = "№"; -const numsp = " "; -const nvDash = "⊭"; -const nvHarr = "⤄"; -const nvap = "≍⃒"; -const nvdash = "⊬"; -const nvge = "≥⃒"; -const nvgt = ">⃒"; -const nvinfin = "⧞"; -const nvlArr = "⤂"; -const nvle = "≤⃒"; -const nvlt = "<⃒"; -const nvltrie = "⊴⃒"; -const nvrArr = "⤃"; -const nvrtrie = "⊵⃒"; -const nvsim = "∼⃒"; -const nwArr = "⇖"; -const nwarhk = "⤣"; -const nwarr = "↖"; -const nwarrow = "↖"; -const nwnear = "⤧"; -const oS = "Ⓢ"; -const oacut = "ó"; -const oacute = "ó"; -const oast = "⊛"; -const ocir = "ô"; -const ocirc = "ô"; -const ocy = "о"; -const odash = "⊝"; -const odblac = "ő"; -const odiv = "⨸"; -const odot = "⊙"; -const odsold = "⦼"; -const oelig = "œ"; -const ofcir = "⦿"; -const ofr = "𝔬"; -const ogon = "˛"; -const ograv = "ò"; -const ograve = "ò"; -const ogt = "⧁"; -const ohbar = "⦵"; -const ohm = "Ω"; -const oint = "∮"; -const olarr = "↺"; -const olcir = "⦾"; -const olcross = "⦻"; -const oline = "‾"; -const olt = "⧀"; -const omacr = "ō"; -const omega = "ω"; -const omicron = "ο"; -const omid = "⦶"; -const ominus = "⊖"; -const oopf = "𝕠"; -const opar = "⦷"; -const operp = "⦹"; -const oplus = "⊕"; -const or = "∨"; -const orarr = "↻"; -const ord = "º"; -const order$1 = "ℴ"; -const orderof = "ℴ"; -const ordf = "ª"; -const ordm = "º"; -const origof = "⊶"; -const oror = "⩖"; -const orslope = "⩗"; -const orv = "⩛"; -const oscr = "ℴ"; -const oslas = "ø"; -const oslash = "ø"; -const osol = "⊘"; -const otild = "õ"; -const otilde = "õ"; -const otimes = "⊗"; -const otimesas = "⨶"; -const oum = "ö"; -const ouml = "ö"; -const ovbar = "⌽"; -const par = "¶"; -const para = "¶"; -const parallel = "∥"; -const parsim = "⫳"; -const parsl = "⫽"; -const part = "∂"; -const pcy = "п"; -const percnt = "%"; -const period = "."; -const permil = "‰"; -const perp = "⊥"; -const pertenk = "‱"; -const pfr = "𝔭"; -const phi = "φ"; -const phiv = "ϕ"; -const phmmat = "ℳ"; -const phone = "☎"; -const pi = "π"; -const pitchfork = "⋔"; -const piv = "ϖ"; -const planck = "ℏ"; -const planckh = "ℎ"; -const plankv = "ℏ"; -const plus = "+"; -const plusacir = "⨣"; -const plusb = "⊞"; -const pluscir = "⨢"; -const plusdo = "∔"; -const plusdu = "⨥"; -const pluse = "⩲"; -const plusm = "±"; -const plusmn = "±"; -const plussim = "⨦"; -const plustwo = "⨧"; -const pm = "±"; -const pointint = "⨕"; -const popf = "𝕡"; -const poun = "£"; -const pound = "£"; -const pr = "≺"; -const prE = "⪳"; -const prap = "⪷"; -const prcue = "≼"; -const pre = "⪯"; -const prec = "≺"; -const precapprox = "⪷"; -const preccurlyeq = "≼"; -const preceq = "⪯"; -const precnapprox = "⪹"; -const precneqq = "⪵"; -const precnsim = "⋨"; -const precsim = "≾"; -const prime = "′"; -const primes = "ℙ"; -const prnE = "⪵"; -const prnap = "⪹"; -const prnsim = "⋨"; -const prod = "∏"; -const profalar = "⌮"; -const profline = "⌒"; -const profsurf = "⌓"; -const prop = "∝"; -const propto = "∝"; -const prsim = "≾"; -const prurel = "⊰"; -const pscr = "𝓅"; -const psi = "ψ"; -const puncsp = " "; -const qfr = "𝔮"; -const qint = "⨌"; -const qopf = "𝕢"; -const qprime = "⁗"; -const qscr = "𝓆"; -const quaternions = "ℍ"; -const quatint = "⨖"; -const quest = "?"; -const questeq = "≟"; -const quo = "\""; -const quot = "\""; -const rAarr = "⇛"; -const rArr = "⇒"; -const rAtail = "⤜"; -const rBarr = "⤏"; -const rHar = "⥤"; -const race = "∽̱"; -const racute = "ŕ"; -const radic = "√"; -const raemptyv = "⦳"; -const rang = "⟩"; -const rangd = "⦒"; -const range$1 = "⦥"; -const rangle = "⟩"; -const raqu = "»"; -const raquo = "»"; -const rarr = "→"; -const rarrap = "⥵"; -const rarrb = "⇥"; -const rarrbfs = "⤠"; -const rarrc = "⤳"; -const rarrfs = "⤞"; -const rarrhk = "↪"; -const rarrlp = "↬"; -const rarrpl = "⥅"; -const rarrsim = "⥴"; -const rarrtl = "↣"; -const rarrw = "↝"; -const ratail = "⤚"; -const ratio = "∶"; -const rationals = "ℚ"; -const rbarr = "⤍"; -const rbbrk = "❳"; -const rbrace = "}"; -const rbrack = "]"; -const rbrke = "⦌"; -const rbrksld = "⦎"; -const rbrkslu = "⦐"; -const rcaron = "ř"; -const rcedil = "ŗ"; -const rceil = "⌉"; -const rcub = "}"; -const rcy = "р"; -const rdca = "⤷"; -const rdldhar = "⥩"; -const rdquo = "”"; -const rdquor = "”"; -const rdsh = "↳"; -const real = "ℜ"; -const realine = "ℛ"; -const realpart = "ℜ"; -const reals = "ℝ"; -const rect = "▭"; -const re = "®"; -const reg = "®"; -const rfisht = "⥽"; -const rfloor = "⌋"; -const rfr = "𝔯"; -const rhard = "⇁"; -const rharu = "⇀"; -const rharul = "⥬"; -const rho = "ρ"; -const rhov = "ϱ"; -const rightarrow = "→"; -const rightarrowtail = "↣"; -const rightharpoondown = "⇁"; -const rightharpoonup = "⇀"; -const rightleftarrows = "⇄"; -const rightleftharpoons = "⇌"; -const rightrightarrows = "⇉"; -const rightsquigarrow = "↝"; -const rightthreetimes = "⋌"; -const ring = "˚"; -const risingdotseq = "≓"; -const rlarr = "⇄"; -const rlhar = "⇌"; -const rlm = "‏"; -const rmoust = "⎱"; -const rmoustache = "⎱"; -const rnmid = "⫮"; -const roang = "⟭"; -const roarr = "⇾"; -const robrk = "⟧"; -const ropar = "⦆"; -const ropf = "𝕣"; -const roplus = "⨮"; -const rotimes = "⨵"; -const rpar = ")"; -const rpargt = "⦔"; -const rppolint = "⨒"; -const rrarr = "⇉"; -const rsaquo = "›"; -const rscr = "𝓇"; -const rsh = "↱"; -const rsqb = "]"; -const rsquo = "’"; -const rsquor = "’"; -const rthree = "⋌"; -const rtimes = "⋊"; -const rtri = "▹"; -const rtrie = "⊵"; -const rtrif = "▸"; -const rtriltri = "⧎"; -const ruluhar = "⥨"; -const rx = "℞"; -const sacute = "ś"; -const sbquo = "‚"; -const sc = "≻"; -const scE = "⪴"; -const scap = "⪸"; -const scaron = "š"; -const sccue = "≽"; -const sce = "⪰"; -const scedil = "ş"; -const scirc = "ŝ"; -const scnE = "⪶"; -const scnap = "⪺"; -const scnsim = "⋩"; -const scpolint = "⨓"; -const scsim = "≿"; -const scy = "с"; -const sdot = "⋅"; -const sdotb = "⊡"; -const sdote = "⩦"; -const seArr = "⇘"; -const searhk = "⤥"; -const searr = "↘"; -const searrow = "↘"; -const sec = "§"; -const sect = "§"; -const semi = ";"; -const seswar = "⤩"; -const setminus = "∖"; -const setmn = "∖"; -const sext = "✶"; -const sfr = "𝔰"; -const sfrown = "⌢"; -const sharp = "♯"; -const shchcy = "щ"; -const shcy = "ш"; -const shortmid = "∣"; -const shortparallel = "∥"; -const sh = "­"; -const shy = "­"; -const sigma = "σ"; -const sigmaf = "ς"; -const sigmav = "ς"; -const sim = "∼"; -const simdot = "⩪"; -const sime = "≃"; -const simeq = "≃"; -const simg = "⪞"; -const simgE = "⪠"; -const siml = "⪝"; -const simlE = "⪟"; -const simne = "≆"; -const simplus = "⨤"; -const simrarr = "⥲"; -const slarr = "←"; -const smallsetminus = "∖"; -const smashp = "⨳"; -const smeparsl = "⧤"; -const smid = "∣"; -const smile = "⌣"; -const smt = "⪪"; -const smte = "⪬"; -const smtes = "⪬︀"; -const softcy = "ь"; -const sol = "/"; -const solb = "⧄"; -const solbar = "⌿"; -const sopf = "𝕤"; -const spades = "♠"; -const spadesuit = "♠"; -const spar = "∥"; -const sqcap = "⊓"; -const sqcaps = "⊓︀"; -const sqcup = "⊔"; -const sqcups = "⊔︀"; -const sqsub = "⊏"; -const sqsube = "⊑"; -const sqsubset = "⊏"; -const sqsubseteq = "⊑"; -const sqsup = "⊐"; -const sqsupe = "⊒"; -const sqsupset = "⊐"; -const sqsupseteq = "⊒"; -const squ = "□"; -const square = "□"; -const squarf = "▪"; -const squf = "▪"; -const srarr = "→"; -const sscr = "𝓈"; -const ssetmn = "∖"; -const ssmile = "⌣"; -const sstarf = "⋆"; -const star$1 = "☆"; -const starf = "★"; -const straightepsilon = "ϵ"; -const straightphi = "ϕ"; -const strns = "¯"; -const sub = "⊂"; -const subE = "⫅"; -const subdot = "⪽"; -const sube = "⊆"; -const subedot = "⫃"; -const submult = "⫁"; -const subnE = "⫋"; -const subne = "⊊"; -const subplus = "⪿"; -const subrarr = "⥹"; -const subset = "⊂"; -const subseteq = "⊆"; -const subseteqq = "⫅"; -const subsetneq = "⊊"; -const subsetneqq = "⫋"; -const subsim = "⫇"; -const subsub = "⫕"; -const subsup = "⫓"; -const succ = "≻"; -const succapprox = "⪸"; -const succcurlyeq = "≽"; -const succeq = "⪰"; -const succnapprox = "⪺"; -const succneqq = "⪶"; -const succnsim = "⋩"; -const succsim = "≿"; -const sum = "∑"; -const sung = "♪"; -const sup = "⊃"; -const sup1 = "¹"; -const sup2 = "²"; -const sup3 = "³"; -const supE = "⫆"; -const supdot = "⪾"; -const supdsub = "⫘"; -const supe = "⊇"; -const supedot = "⫄"; -const suphsol = "⟉"; -const suphsub = "⫗"; -const suplarr = "⥻"; -const supmult = "⫂"; -const supnE = "⫌"; -const supne = "⊋"; -const supplus = "⫀"; -const supset = "⊃"; -const supseteq = "⊇"; -const supseteqq = "⫆"; -const supsetneq = "⊋"; -const supsetneqq = "⫌"; -const supsim = "⫈"; -const supsub = "⫔"; -const supsup = "⫖"; -const swArr = "⇙"; -const swarhk = "⤦"; -const swarr = "↙"; -const swarrow = "↙"; -const swnwar = "⤪"; -const szli = "ß"; -const szlig = "ß"; -const target = "⌖"; -const tau = "τ"; -const tbrk = "⎴"; -const tcaron = "ť"; -const tcedil = "ţ"; -const tcy = "т"; -const tdot = "⃛"; -const telrec = "⌕"; -const tfr = "𝔱"; -const there4 = "∴"; -const therefore = "∴"; -const theta = "θ"; -const thetasym = "ϑ"; -const thetav = "ϑ"; -const thickapprox = "≈"; -const thicksim = "∼"; -const thinsp = " "; -const thkap = "≈"; -const thksim = "∼"; -const thor = "þ"; -const thorn = "þ"; -const tilde = "˜"; -const time = "×"; -const times = "×"; -const timesb = "⊠"; -const timesbar = "⨱"; -const timesd = "⨰"; -const tint = "∭"; -const toea = "⤨"; -const top = "⊤"; -const topbot = "⌶"; -const topcir = "⫱"; -const topf = "𝕥"; -const topfork = "⫚"; -const tosa = "⤩"; -const tprime = "‴"; -const trade = "™"; -const triangle = "▵"; -const triangledown = "▿"; -const triangleleft = "◃"; -const trianglelefteq = "⊴"; -const triangleq = "≜"; -const triangleright = "▹"; -const trianglerighteq = "⊵"; -const tridot = "◬"; -const trie = "≜"; -const triminus = "⨺"; -const triplus = "⨹"; -const trisb = "⧍"; -const tritime = "⨻"; -const trpezium = "⏢"; -const tscr = "𝓉"; -const tscy = "ц"; -const tshcy = "ћ"; -const tstrok = "ŧ"; -const twixt = "≬"; -const twoheadleftarrow = "↞"; -const twoheadrightarrow = "↠"; -const uArr = "⇑"; -const uHar = "⥣"; -const uacut = "ú"; -const uacute = "ú"; -const uarr = "↑"; -const ubrcy = "ў"; -const ubreve = "ŭ"; -const ucir = "û"; -const ucirc = "û"; -const ucy = "у"; -const udarr = "⇅"; -const udblac = "ű"; -const udhar = "⥮"; -const ufisht = "⥾"; -const ufr = "𝔲"; -const ugrav = "ù"; -const ugrave = "ù"; -const uharl = "↿"; -const uharr = "↾"; -const uhblk = "▀"; -const ulcorn = "⌜"; -const ulcorner = "⌜"; -const ulcrop = "⌏"; -const ultri = "◸"; -const umacr = "ū"; -const um = "¨"; -const uml = "¨"; -const uogon = "ų"; -const uopf = "𝕦"; -const uparrow = "↑"; -const updownarrow = "↕"; -const upharpoonleft = "↿"; -const upharpoonright = "↾"; -const uplus = "⊎"; -const upsi = "υ"; -const upsih = "ϒ"; -const upsilon = "υ"; -const upuparrows = "⇈"; -const urcorn = "⌝"; -const urcorner = "⌝"; -const urcrop = "⌎"; -const uring = "ů"; -const urtri = "◹"; -const uscr = "𝓊"; -const utdot = "⋰"; -const utilde = "ũ"; -const utri = "▵"; -const utrif = "▴"; -const uuarr = "⇈"; -const uum = "ü"; -const uuml = "ü"; -const uwangle = "⦧"; -const vArr = "⇕"; -const vBar = "⫨"; -const vBarv = "⫩"; -const vDash = "⊨"; -const vangrt = "⦜"; -const varepsilon = "ϵ"; -const varkappa = "ϰ"; -const varnothing = "∅"; -const varphi = "ϕ"; -const varpi = "ϖ"; -const varpropto = "∝"; -const varr = "↕"; -const varrho = "ϱ"; -const varsigma = "ς"; -const varsubsetneq = "⊊︀"; -const varsubsetneqq = "⫋︀"; -const varsupsetneq = "⊋︀"; -const varsupsetneqq = "⫌︀"; -const vartheta = "ϑ"; -const vartriangleleft = "⊲"; -const vartriangleright = "⊳"; -const vcy = "в"; -const vdash = "⊢"; -const vee = "∨"; -const veebar = "⊻"; -const veeeq = "≚"; -const vellip = "⋮"; -const verbar = "|"; -const vert = "|"; -const vfr = "𝔳"; -const vltri = "⊲"; -const vnsub = "⊂⃒"; -const vnsup = "⊃⃒"; -const vopf = "𝕧"; -const vprop = "∝"; -const vrtri = "⊳"; -const vscr = "𝓋"; -const vsubnE = "⫋︀"; -const vsubne = "⊊︀"; -const vsupnE = "⫌︀"; -const vsupne = "⊋︀"; -const vzigzag = "⦚"; -const wcirc = "ŵ"; -const wedbar = "⩟"; -const wedge = "∧"; -const wedgeq = "≙"; -const weierp = "℘"; -const wfr = "𝔴"; -const wopf = "𝕨"; -const wp = "℘"; -const wr = "≀"; -const wreath = "≀"; -const wscr = "𝓌"; -const xcap = "⋂"; -const xcirc = "◯"; -const xcup = "⋃"; -const xdtri = "▽"; -const xfr = "𝔵"; -const xhArr = "⟺"; -const xharr = "⟷"; -const xi = "ξ"; -const xlArr = "⟸"; -const xlarr = "⟵"; -const xmap = "⟼"; -const xnis = "⋻"; -const xodot = "⨀"; -const xopf = "𝕩"; -const xoplus = "⨁"; -const xotime = "⨂"; -const xrArr = "⟹"; -const xrarr = "⟶"; -const xscr = "𝓍"; -const xsqcup = "⨆"; -const xuplus = "⨄"; -const xutri = "△"; -const xvee = "⋁"; -const xwedge = "⋀"; -const yacut = "ý"; -const yacute = "ý"; -const yacy = "я"; -const ycirc = "ŷ"; -const ycy = "ы"; -const ye = "¥"; -const yen = "¥"; -const yfr = "𝔶"; -const yicy = "ї"; -const yopf = "𝕪"; -const yscr = "𝓎"; -const yucy = "ю"; -const yum = "ÿ"; -const yuml = "ÿ"; -const zacute = "ź"; -const zcaron = "ž"; -const zcy = "з"; -const zdot = "ż"; -const zeetrf = "ℨ"; -const zeta = "ζ"; -const zfr = "𝔷"; -const zhcy = "ж"; -const zigrarr = "⇝"; -const zopf = "𝕫"; -const zscr = "𝓏"; -const zwj = "‍"; -const zwnj = "‌"; -var index$1 = { - AEli: AEli, - AElig: AElig, - AM: AM, - AMP: AMP, - Aacut: Aacut, - Aacute: Aacute, - Abreve: Abreve, - Acir: Acir, - Acirc: Acirc, - Acy: Acy, - Afr: Afr, - Agrav: Agrav, - Agrave: Agrave, - Alpha: Alpha, - Amacr: Amacr, - And: And, - Aogon: Aogon, - Aopf: Aopf, - ApplyFunction: ApplyFunction, - Arin: Arin, - Aring: Aring, - Ascr: Ascr, - Assign: Assign, - Atild: Atild, - Atilde: Atilde, - Aum: Aum, - Auml: Auml, - Backslash: Backslash, - Barv: Barv, - Barwed: Barwed, - Bcy: Bcy, - Because: Because, - Bernoullis: Bernoullis, - Beta: Beta, - Bfr: Bfr, - Bopf: Bopf, - Breve: Breve, - Bscr: Bscr, - Bumpeq: Bumpeq, - CHcy: CHcy, - COP: COP, - COPY: COPY, - Cacute: Cacute, - Cap: Cap, - CapitalDifferentialD: CapitalDifferentialD, - Cayleys: Cayleys, - Ccaron: Ccaron, - Ccedi: Ccedi, - Ccedil: Ccedil, - Ccirc: Ccirc, - Cconint: Cconint, - Cdot: Cdot, - Cedilla: Cedilla, - CenterDot: CenterDot, - Cfr: Cfr, - Chi: Chi, - CircleDot: CircleDot, - CircleMinus: CircleMinus, - CirclePlus: CirclePlus, - CircleTimes: CircleTimes, - ClockwiseContourIntegral: ClockwiseContourIntegral, - CloseCurlyDoubleQuote: CloseCurlyDoubleQuote, - CloseCurlyQuote: CloseCurlyQuote, - Colon: Colon, - Colone: Colone, - Congruent: Congruent, - Conint: Conint, - ContourIntegral: ContourIntegral, - Copf: Copf, - Coproduct: Coproduct, - CounterClockwiseContourIntegral: CounterClockwiseContourIntegral, - Cross: Cross, - Cscr: Cscr, - Cup: Cup, - CupCap: CupCap, - DD: DD, - DDotrahd: DDotrahd, - DJcy: DJcy, - DScy: DScy, - DZcy: DZcy, - Dagger: Dagger, - Darr: Darr, - Dashv: Dashv, - Dcaron: Dcaron, - Dcy: Dcy, - Del: Del, - Delta: Delta, - Dfr: Dfr, - DiacriticalAcute: DiacriticalAcute, - DiacriticalDot: DiacriticalDot, - DiacriticalDoubleAcute: DiacriticalDoubleAcute, - DiacriticalGrave: DiacriticalGrave, - DiacriticalTilde: DiacriticalTilde, - Diamond: Diamond, - DifferentialD: DifferentialD, - Dopf: Dopf, - Dot: Dot, - DotDot: DotDot, - DotEqual: DotEqual, - DoubleContourIntegral: DoubleContourIntegral, - DoubleDot: DoubleDot, - DoubleDownArrow: DoubleDownArrow, - DoubleLeftArrow: DoubleLeftArrow, - DoubleLeftRightArrow: DoubleLeftRightArrow, - DoubleLeftTee: DoubleLeftTee, - DoubleLongLeftArrow: DoubleLongLeftArrow, - DoubleLongLeftRightArrow: DoubleLongLeftRightArrow, - DoubleLongRightArrow: DoubleLongRightArrow, - DoubleRightArrow: DoubleRightArrow, - DoubleRightTee: DoubleRightTee, - DoubleUpArrow: DoubleUpArrow, - DoubleUpDownArrow: DoubleUpDownArrow, - DoubleVerticalBar: DoubleVerticalBar, - DownArrow: DownArrow, - DownArrowBar: DownArrowBar, - DownArrowUpArrow: DownArrowUpArrow, - DownBreve: DownBreve, - DownLeftRightVector: DownLeftRightVector, - DownLeftTeeVector: DownLeftTeeVector, - DownLeftVector: DownLeftVector, - DownLeftVectorBar: DownLeftVectorBar, - DownRightTeeVector: DownRightTeeVector, - DownRightVector: DownRightVector, - DownRightVectorBar: DownRightVectorBar, - DownTee: DownTee, - DownTeeArrow: DownTeeArrow, - Downarrow: Downarrow, - Dscr: Dscr, - Dstrok: Dstrok, - ENG: ENG, - ET: ET, - ETH: ETH, - Eacut: Eacut, - Eacute: Eacute, - Ecaron: Ecaron, - Ecir: Ecir, - Ecirc: Ecirc, - Ecy: Ecy, - Edot: Edot, - Efr: Efr, - Egrav: Egrav, - Egrave: Egrave, - Element: Element, - Emacr: Emacr, - EmptySmallSquare: EmptySmallSquare, - EmptyVerySmallSquare: EmptyVerySmallSquare, - Eogon: Eogon, - Eopf: Eopf, - Epsilon: Epsilon, - Equal: Equal, - EqualTilde: EqualTilde, - Equilibrium: Equilibrium, - Escr: Escr, - Esim: Esim, - Eta: Eta, - Eum: Eum, - Euml: Euml, - Exists: Exists, - ExponentialE: ExponentialE, - Fcy: Fcy, - Ffr: Ffr, - FilledSmallSquare: FilledSmallSquare, - FilledVerySmallSquare: FilledVerySmallSquare, - Fopf: Fopf, - ForAll: ForAll, - Fouriertrf: Fouriertrf, - Fscr: Fscr, - GJcy: GJcy, - G: G, - GT: GT, - Gamma: Gamma, - Gammad: Gammad, - Gbreve: Gbreve, - Gcedil: Gcedil, - Gcirc: Gcirc, - Gcy: Gcy, - Gdot: Gdot, - Gfr: Gfr, - Gg: Gg, - Gopf: Gopf, - GreaterEqual: GreaterEqual, - GreaterEqualLess: GreaterEqualLess, - GreaterFullEqual: GreaterFullEqual, - GreaterGreater: GreaterGreater, - GreaterLess: GreaterLess, - GreaterSlantEqual: GreaterSlantEqual, - GreaterTilde: GreaterTilde, - Gscr: Gscr, - Gt: Gt, - HARDcy: HARDcy, - Hacek: Hacek, - Hat: Hat, - Hcirc: Hcirc, - Hfr: Hfr, - HilbertSpace: HilbertSpace, - Hopf: Hopf, - HorizontalLine: HorizontalLine, - Hscr: Hscr, - Hstrok: Hstrok, - HumpDownHump: HumpDownHump, - HumpEqual: HumpEqual, - IEcy: IEcy, - IJlig: IJlig, - IOcy: IOcy, - Iacut: Iacut, - Iacute: Iacute, - Icir: Icir, - Icirc: Icirc, - Icy: Icy, - Idot: Idot, - Ifr: Ifr, - Igrav: Igrav, - Igrave: Igrave, - Im: Im, - Imacr: Imacr, - ImaginaryI: ImaginaryI, - Implies: Implies, - Int: Int, - Integral: Integral, - Intersection: Intersection, - InvisibleComma: InvisibleComma, - InvisibleTimes: InvisibleTimes, - Iogon: Iogon, - Iopf: Iopf, - Iota: Iota, - Iscr: Iscr, - Itilde: Itilde, - Iukcy: Iukcy, - Ium: Ium, - Iuml: Iuml, - Jcirc: Jcirc, - Jcy: Jcy, - Jfr: Jfr, - Jopf: Jopf, - Jscr: Jscr, - Jsercy: Jsercy, - Jukcy: Jukcy, - KHcy: KHcy, - KJcy: KJcy, - Kappa: Kappa, - Kcedil: Kcedil, - Kcy: Kcy, - Kfr: Kfr, - Kopf: Kopf, - Kscr: Kscr, - LJcy: LJcy, - L: L, - LT: LT, - Lacute: Lacute, - Lambda: Lambda, - Lang: Lang, - Laplacetrf: Laplacetrf, - Larr: Larr, - Lcaron: Lcaron, - Lcedil: Lcedil, - Lcy: Lcy, - LeftAngleBracket: LeftAngleBracket, - LeftArrow: LeftArrow, - LeftArrowBar: LeftArrowBar, - LeftArrowRightArrow: LeftArrowRightArrow, - LeftCeiling: LeftCeiling, - LeftDoubleBracket: LeftDoubleBracket, - LeftDownTeeVector: LeftDownTeeVector, - LeftDownVector: LeftDownVector, - LeftDownVectorBar: LeftDownVectorBar, - LeftFloor: LeftFloor, - LeftRightArrow: LeftRightArrow, - LeftRightVector: LeftRightVector, - LeftTee: LeftTee, - LeftTeeArrow: LeftTeeArrow, - LeftTeeVector: LeftTeeVector, - LeftTriangle: LeftTriangle, - LeftTriangleBar: LeftTriangleBar, - LeftTriangleEqual: LeftTriangleEqual, - LeftUpDownVector: LeftUpDownVector, - LeftUpTeeVector: LeftUpTeeVector, - LeftUpVector: LeftUpVector, - LeftUpVectorBar: LeftUpVectorBar, - LeftVector: LeftVector, - LeftVectorBar: LeftVectorBar, - Leftarrow: Leftarrow, - Leftrightarrow: Leftrightarrow, - LessEqualGreater: LessEqualGreater, - LessFullEqual: LessFullEqual, - LessGreater: LessGreater, - LessLess: LessLess, - LessSlantEqual: LessSlantEqual, - LessTilde: LessTilde, - Lfr: Lfr, - Ll: Ll, - Lleftarrow: Lleftarrow, - Lmidot: Lmidot, - LongLeftArrow: LongLeftArrow, - LongLeftRightArrow: LongLeftRightArrow, - LongRightArrow: LongRightArrow, - Longleftarrow: Longleftarrow, - Longleftrightarrow: Longleftrightarrow, - Longrightarrow: Longrightarrow, - Lopf: Lopf, - LowerLeftArrow: LowerLeftArrow, - LowerRightArrow: LowerRightArrow, - Lscr: Lscr, - Lsh: Lsh, - Lstrok: Lstrok, - Lt: Lt, - "Map": "⤅", - Mcy: Mcy, - MediumSpace: MediumSpace, - Mellintrf: Mellintrf, - Mfr: Mfr, - MinusPlus: MinusPlus, - Mopf: Mopf, - Mscr: Mscr, - Mu: Mu, - NJcy: NJcy, - Nacute: Nacute, - Ncaron: Ncaron, - Ncedil: Ncedil, - Ncy: Ncy, - NegativeMediumSpace: NegativeMediumSpace, - NegativeThickSpace: NegativeThickSpace, - NegativeThinSpace: NegativeThinSpace, - NegativeVeryThinSpace: NegativeVeryThinSpace, - NestedGreaterGreater: NestedGreaterGreater, - NestedLessLess: NestedLessLess, - NewLine: NewLine, - Nfr: Nfr, - NoBreak: NoBreak, - NonBreakingSpace: NonBreakingSpace, - Nopf: Nopf, - Not: Not, - NotCongruent: NotCongruent, - NotCupCap: NotCupCap, - NotDoubleVerticalBar: NotDoubleVerticalBar, - NotElement: NotElement, - NotEqual: NotEqual, - NotEqualTilde: NotEqualTilde, - NotExists: NotExists, - NotGreater: NotGreater, - NotGreaterEqual: NotGreaterEqual, - NotGreaterFullEqual: NotGreaterFullEqual, - NotGreaterGreater: NotGreaterGreater, - NotGreaterLess: NotGreaterLess, - NotGreaterSlantEqual: NotGreaterSlantEqual, - NotGreaterTilde: NotGreaterTilde, - NotHumpDownHump: NotHumpDownHump, - NotHumpEqual: NotHumpEqual, - NotLeftTriangle: NotLeftTriangle, - NotLeftTriangleBar: NotLeftTriangleBar, - NotLeftTriangleEqual: NotLeftTriangleEqual, - NotLess: NotLess, - NotLessEqual: NotLessEqual, - NotLessGreater: NotLessGreater, - NotLessLess: NotLessLess, - NotLessSlantEqual: NotLessSlantEqual, - NotLessTilde: NotLessTilde, - NotNestedGreaterGreater: NotNestedGreaterGreater, - NotNestedLessLess: NotNestedLessLess, - NotPrecedes: NotPrecedes, - NotPrecedesEqual: NotPrecedesEqual, - NotPrecedesSlantEqual: NotPrecedesSlantEqual, - NotReverseElement: NotReverseElement, - NotRightTriangle: NotRightTriangle, - NotRightTriangleBar: NotRightTriangleBar, - NotRightTriangleEqual: NotRightTriangleEqual, - NotSquareSubset: NotSquareSubset, - NotSquareSubsetEqual: NotSquareSubsetEqual, - NotSquareSuperset: NotSquareSuperset, - NotSquareSupersetEqual: NotSquareSupersetEqual, - NotSubset: NotSubset, - NotSubsetEqual: NotSubsetEqual, - NotSucceeds: NotSucceeds, - NotSucceedsEqual: NotSucceedsEqual, - NotSucceedsSlantEqual: NotSucceedsSlantEqual, - NotSucceedsTilde: NotSucceedsTilde, - NotSuperset: NotSuperset, - NotSupersetEqual: NotSupersetEqual, - NotTilde: NotTilde, - NotTildeEqual: NotTildeEqual, - NotTildeFullEqual: NotTildeFullEqual, - NotTildeTilde: NotTildeTilde, - NotVerticalBar: NotVerticalBar, - Nscr: Nscr, - Ntild: Ntild, - Ntilde: Ntilde, - Nu: Nu, - OElig: OElig, - Oacut: Oacut, - Oacute: Oacute, - Ocir: Ocir, - Ocirc: Ocirc, - Ocy: Ocy, - Odblac: Odblac, - Ofr: Ofr, - Ograv: Ograv, - Ograve: Ograve, - Omacr: Omacr, - Omega: Omega, - Omicron: Omicron, - Oopf: Oopf, - OpenCurlyDoubleQuote: OpenCurlyDoubleQuote, - OpenCurlyQuote: OpenCurlyQuote, - Or: Or, - Oscr: Oscr, - Oslas: Oslas, - Oslash: Oslash, - Otild: Otild, - Otilde: Otilde, - Otimes: Otimes, - Oum: Oum, - Ouml: Ouml, - OverBar: OverBar, - OverBrace: OverBrace, - OverBracket: OverBracket, - OverParenthesis: OverParenthesis, - PartialD: PartialD, - Pcy: Pcy, - Pfr: Pfr, - Phi: Phi, - Pi: Pi, - PlusMinus: PlusMinus, - Poincareplane: Poincareplane, - Popf: Popf, - Pr: Pr, - Precedes: Precedes, - PrecedesEqual: PrecedesEqual, - PrecedesSlantEqual: PrecedesSlantEqual, - PrecedesTilde: PrecedesTilde, - Prime: Prime, - Product: Product, - Proportion: Proportion, - Proportional: Proportional, - Pscr: Pscr, - Psi: Psi, - QUO: QUO, - QUOT: QUOT, - Qfr: Qfr, - Qopf: Qopf, - Qscr: Qscr, - RBarr: RBarr, - RE: RE, - REG: REG, - Racute: Racute, - Rang: Rang, - Rarr: Rarr, - Rarrtl: Rarrtl, - Rcaron: Rcaron, - Rcedil: Rcedil, - Rcy: Rcy, - Re: Re, - ReverseElement: ReverseElement, - ReverseEquilibrium: ReverseEquilibrium, - ReverseUpEquilibrium: ReverseUpEquilibrium, - Rfr: Rfr, - Rho: Rho, - RightAngleBracket: RightAngleBracket, - RightArrow: RightArrow, - RightArrowBar: RightArrowBar, - RightArrowLeftArrow: RightArrowLeftArrow, - RightCeiling: RightCeiling, - RightDoubleBracket: RightDoubleBracket, - RightDownTeeVector: RightDownTeeVector, - RightDownVector: RightDownVector, - RightDownVectorBar: RightDownVectorBar, - RightFloor: RightFloor, - RightTee: RightTee, - RightTeeArrow: RightTeeArrow, - RightTeeVector: RightTeeVector, - RightTriangle: RightTriangle, - RightTriangleBar: RightTriangleBar, - RightTriangleEqual: RightTriangleEqual, - RightUpDownVector: RightUpDownVector, - RightUpTeeVector: RightUpTeeVector, - RightUpVector: RightUpVector, - RightUpVectorBar: RightUpVectorBar, - RightVector: RightVector, - RightVectorBar: RightVectorBar, - Rightarrow: Rightarrow, - Ropf: Ropf, - RoundImplies: RoundImplies, - Rrightarrow: Rrightarrow, - Rscr: Rscr, - Rsh: Rsh, - RuleDelayed: RuleDelayed, - SHCHcy: SHCHcy, - SHcy: SHcy, - SOFTcy: SOFTcy, - Sacute: Sacute, - Sc: Sc, - Scaron: Scaron, - Scedil: Scedil, - Scirc: Scirc, - Scy: Scy, - Sfr: Sfr, - ShortDownArrow: ShortDownArrow, - ShortLeftArrow: ShortLeftArrow, - ShortRightArrow: ShortRightArrow, - ShortUpArrow: ShortUpArrow, - Sigma: Sigma, - SmallCircle: SmallCircle, - Sopf: Sopf, - Sqrt: Sqrt, - Square: Square, - SquareIntersection: SquareIntersection, - SquareSubset: SquareSubset, - SquareSubsetEqual: SquareSubsetEqual, - SquareSuperset: SquareSuperset, - SquareSupersetEqual: SquareSupersetEqual, - SquareUnion: SquareUnion, - Sscr: Sscr, - Star: Star, - Sub: Sub, - Subset: Subset, - SubsetEqual: SubsetEqual, - Succeeds: Succeeds, - SucceedsEqual: SucceedsEqual, - SucceedsSlantEqual: SucceedsSlantEqual, - SucceedsTilde: SucceedsTilde, - SuchThat: SuchThat, - Sum: Sum, - Sup: Sup, - Superset: Superset, - SupersetEqual: SupersetEqual, - Supset: Supset, - THOR: THOR, - THORN: THORN, - TRADE: TRADE, - TSHcy: TSHcy, - TScy: TScy, - Tab: Tab, - Tau: Tau, - Tcaron: Tcaron, - Tcedil: Tcedil, - Tcy: Tcy, - Tfr: Tfr, - Therefore: Therefore, - Theta: Theta, - ThickSpace: ThickSpace, - ThinSpace: ThinSpace, - Tilde: Tilde, - TildeEqual: TildeEqual, - TildeFullEqual: TildeFullEqual, - TildeTilde: TildeTilde, - Topf: Topf, - TripleDot: TripleDot, - Tscr: Tscr, - Tstrok: Tstrok, - Uacut: Uacut, - Uacute: Uacute, - Uarr: Uarr, - Uarrocir: Uarrocir, - Ubrcy: Ubrcy, - Ubreve: Ubreve, - Ucir: Ucir, - Ucirc: Ucirc, - Ucy: Ucy, - Udblac: Udblac, - Ufr: Ufr, - Ugrav: Ugrav, - Ugrave: Ugrave, - Umacr: Umacr, - UnderBar: UnderBar, - UnderBrace: UnderBrace, - UnderBracket: UnderBracket, - UnderParenthesis: UnderParenthesis, - Union: Union, - UnionPlus: UnionPlus, - Uogon: Uogon, - Uopf: Uopf, - UpArrow: UpArrow, - UpArrowBar: UpArrowBar, - UpArrowDownArrow: UpArrowDownArrow, - UpDownArrow: UpDownArrow, - UpEquilibrium: UpEquilibrium, - UpTee: UpTee, - UpTeeArrow: UpTeeArrow, - Uparrow: Uparrow, - Updownarrow: Updownarrow, - UpperLeftArrow: UpperLeftArrow, - UpperRightArrow: UpperRightArrow, - Upsi: Upsi, - Upsilon: Upsilon, - Uring: Uring, - Uscr: Uscr, - Utilde: Utilde, - Uum: Uum, - Uuml: Uuml, - VDash: VDash, - Vbar: Vbar, - Vcy: Vcy, - Vdash: Vdash, - Vdashl: Vdashl, - Vee: Vee, - Verbar: Verbar, - Vert: Vert, - VerticalBar: VerticalBar, - VerticalLine: VerticalLine, - VerticalSeparator: VerticalSeparator, - VerticalTilde: VerticalTilde, - VeryThinSpace: VeryThinSpace, - Vfr: Vfr, - Vopf: Vopf, - Vscr: Vscr, - Vvdash: Vvdash, - Wcirc: Wcirc, - Wedge: Wedge, - Wfr: Wfr, - Wopf: Wopf, - Wscr: Wscr, - Xfr: Xfr, - Xi: Xi, - Xopf: Xopf, - Xscr: Xscr, - YAcy: YAcy, - YIcy: YIcy, - YUcy: YUcy, - Yacut: Yacut, - Yacute: Yacute, - Ycirc: Ycirc, - Ycy: Ycy, - Yfr: Yfr, - Yopf: Yopf, - Yscr: Yscr, - Yuml: Yuml, - ZHcy: ZHcy, - Zacute: Zacute, - Zcaron: Zcaron, - Zcy: Zcy, - Zdot: Zdot, - ZeroWidthSpace: ZeroWidthSpace, - Zeta: Zeta, - Zfr: Zfr, - Zopf: Zopf, - Zscr: Zscr, - aacut: aacut, - aacute: aacute, - abreve: abreve, - ac: ac, - acE: acE, - acd: acd, - acir: acir, - acirc: acirc, - acut: acut, - acute: acute, - acy: acy, - aeli: aeli, - aelig: aelig, - af: af, - afr: afr, - agrav: agrav, - agrave: agrave, - alefsym: alefsym, - aleph: aleph, - alpha: alpha, - amacr: amacr, - amalg: amalg, - am: am, - amp: amp, - and: and, - andand: andand, - andd: andd, - andslope: andslope, - andv: andv, - ang: ang, - ange: ange, - angle: angle, - angmsd: angmsd, - angmsdaa: angmsdaa, - angmsdab: angmsdab, - angmsdac: angmsdac, - angmsdad: angmsdad, - angmsdae: angmsdae, - angmsdaf: angmsdaf, - angmsdag: angmsdag, - angmsdah: angmsdah, - angrt: angrt, - angrtvb: angrtvb, - angrtvbd: angrtvbd, - angsph: angsph, - angst: angst, - angzarr: angzarr, - aogon: aogon, - aopf: aopf, - ap: ap, - apE: apE, - apacir: apacir, - ape: ape, - apid: apid, - apos: apos, - approx: approx, - approxeq: approxeq, - arin: arin, - aring: aring, - ascr: ascr, - ast: ast, - asymp: asymp, - asympeq: asympeq, - atild: atild, - atilde: atilde, - aum: aum, - auml: auml, - awconint: awconint, - awint: awint, - bNot: bNot, - backcong: backcong, - backepsilon: backepsilon, - backprime: backprime, - backsim: backsim, - backsimeq: backsimeq, - barvee: barvee, - barwed: barwed, - barwedge: barwedge, - bbrk: bbrk, - bbrktbrk: bbrktbrk, - bcong: bcong, - bcy: bcy, - bdquo: bdquo, - becaus: becaus, - because: because, - bemptyv: bemptyv, - bepsi: bepsi, - bernou: bernou, - beta: beta, - beth: beth, - between: between, - bfr: bfr, - bigcap: bigcap, - bigcirc: bigcirc, - bigcup: bigcup, - bigodot: bigodot, - bigoplus: bigoplus, - bigotimes: bigotimes, - bigsqcup: bigsqcup, - bigstar: bigstar, - bigtriangledown: bigtriangledown, - bigtriangleup: bigtriangleup, - biguplus: biguplus, - bigvee: bigvee, - bigwedge: bigwedge, - bkarow: bkarow, - blacklozenge: blacklozenge, - blacksquare: blacksquare, - blacktriangle: blacktriangle, - blacktriangledown: blacktriangledown, - blacktriangleleft: blacktriangleleft, - blacktriangleright: blacktriangleright, - blank: blank, - blk12: blk12, - blk14: blk14, - blk34: blk34, - block: block, - bne: bne, - bnequiv: bnequiv, - bnot: bnot, - bopf: bopf, - bot: bot, - bottom: bottom, - bowtie: bowtie, - boxDL: boxDL, - boxDR: boxDR, - boxDl: boxDl, - boxDr: boxDr, - boxH: boxH, - boxHD: boxHD, - boxHU: boxHU, - boxHd: boxHd, - boxHu: boxHu, - boxUL: boxUL, - boxUR: boxUR, - boxUl: boxUl, - boxUr: boxUr, - boxV: boxV, - boxVH: boxVH, - boxVL: boxVL, - boxVR: boxVR, - boxVh: boxVh, - boxVl: boxVl, - boxVr: boxVr, - boxbox: boxbox, - boxdL: boxdL, - boxdR: boxdR, - boxdl: boxdl, - boxdr: boxdr, - boxh: boxh, - boxhD: boxhD, - boxhU: boxhU, - boxhd: boxhd, - boxhu: boxhu, - boxminus: boxminus, - boxplus: boxplus, - boxtimes: boxtimes, - boxuL: boxuL, - boxuR: boxuR, - boxul: boxul, - boxur: boxur, - boxv: boxv, - boxvH: boxvH, - boxvL: boxvL, - boxvR: boxvR, - boxvh: boxvh, - boxvl: boxvl, - boxvr: boxvr, - bprime: bprime, - breve: breve, - brvba: brvba, - brvbar: brvbar, - bscr: bscr, - bsemi: bsemi, - bsim: bsim, - bsime: bsime, - bsol: bsol, - bsolb: bsolb, - bsolhsub: bsolhsub, - bull: bull, - bullet: bullet, - bump: bump, - bumpE: bumpE, - bumpe: bumpe, - bumpeq: bumpeq, - cacute: cacute, - cap: cap, - capand: capand, - capbrcup: capbrcup, - capcap: capcap, - capcup: capcup, - capdot: capdot, - caps: caps, - caret: caret, - caron: caron, - ccaps: ccaps, - ccaron: ccaron, - ccedi: ccedi, - ccedil: ccedil, - ccirc: ccirc, - ccups: ccups, - ccupssm: ccupssm, - cdot: cdot, - cedi: cedi, - cedil: cedil, - cemptyv: cemptyv, - cen: cen, - cent: cent, - centerdot: centerdot, - cfr: cfr, - chcy: chcy, - check: check$2, - checkmark: checkmark, - chi: chi, - cir: cir, - cirE: cirE, - circ: circ, - circeq: circeq, - circlearrowleft: circlearrowleft, - circlearrowright: circlearrowright, - circledR: circledR, - circledS: circledS, - circledast: circledast, - circledcirc: circledcirc, - circleddash: circleddash, - cire: cire, - cirfnint: cirfnint, - cirmid: cirmid, - cirscir: cirscir, - clubs: clubs, - clubsuit: clubsuit, - colon: colon, - colone: colone, - coloneq: coloneq, - comma: comma, - commat: commat, - comp: comp, - compfn: compfn, - complement: complement, - complexes: complexes, - cong: cong, - congdot: congdot, - conint: conint, - copf: copf, - coprod: coprod, - cop: cop, - copy: copy$1, - copysr: copysr, - crarr: crarr, - cross: cross, - cscr: cscr, - csub: csub, - csube: csube, - csup: csup, - csupe: csupe, - ctdot: ctdot, - cudarrl: cudarrl, - cudarrr: cudarrr, - cuepr: cuepr, - cuesc: cuesc, - cularr: cularr, - cularrp: cularrp, - cup: cup, - cupbrcap: cupbrcap, - cupcap: cupcap, - cupcup: cupcup, - cupdot: cupdot, - cupor: cupor, - cups: cups, - curarr: curarr, - curarrm: curarrm, - curlyeqprec: curlyeqprec, - curlyeqsucc: curlyeqsucc, - curlyvee: curlyvee, - curlywedge: curlywedge, - curre: curre, - curren: curren, - curvearrowleft: curvearrowleft, - curvearrowright: curvearrowright, - cuvee: cuvee, - cuwed: cuwed, - cwconint: cwconint, - cwint: cwint, - cylcty: cylcty, - dArr: dArr, - dHar: dHar, - dagger: dagger, - daleth: daleth, - darr: darr, - dash: dash, - dashv: dashv, - dbkarow: dbkarow, - dblac: dblac, - dcaron: dcaron, - dcy: dcy, - dd: dd, - ddagger: ddagger, - ddarr: ddarr, - ddotseq: ddotseq, - de: de, - deg: deg, - delta: delta, - demptyv: demptyv, - dfisht: dfisht, - dfr: dfr, - dharl: dharl, - dharr: dharr, - diam: diam, - diamond: diamond, - diamondsuit: diamondsuit, - diams: diams, - die: die, - digamma: digamma, - disin: disin, - div: div, - divid: divid, - divide: divide, - divideontimes: divideontimes, - divonx: divonx, - djcy: djcy, - dlcorn: dlcorn, - dlcrop: dlcrop, - dollar: dollar, - dopf: dopf, - dot: dot, - doteq: doteq, - doteqdot: doteqdot, - dotminus: dotminus, - dotplus: dotplus, - dotsquare: dotsquare, - doublebarwedge: doublebarwedge, - downarrow: downarrow, - downdownarrows: downdownarrows, - downharpoonleft: downharpoonleft, - downharpoonright: downharpoonright, - drbkarow: drbkarow, - drcorn: drcorn, - drcrop: drcrop, - dscr: dscr, - dscy: dscy, - dsol: dsol, - dstrok: dstrok, - dtdot: dtdot, - dtri: dtri, - dtrif: dtrif, - duarr: duarr, - duhar: duhar, - dwangle: dwangle, - dzcy: dzcy, - dzigrarr: dzigrarr, - eDDot: eDDot, - eDot: eDot, - eacut: eacut, - eacute: eacute, - easter: easter, - ecaron: ecaron, - ecir: ecir, - ecirc: ecirc, - ecolon: ecolon, - ecy: ecy, - edot: edot, - ee: ee, - efDot: efDot, - efr: efr, - eg: eg, - egrav: egrav, - egrave: egrave, - egs: egs, - egsdot: egsdot, - el: el, - elinters: elinters, - ell: ell, - els: els, - elsdot: elsdot, - emacr: emacr, - empty: empty, - emptyset: emptyset, - emptyv: emptyv, - emsp13: emsp13, - emsp14: emsp14, - emsp: emsp, - eng: eng, - ensp: ensp, - eogon: eogon, - eopf: eopf, - epar: epar, - eparsl: eparsl, - eplus: eplus, - epsi: epsi, - epsilon: epsilon, - epsiv: epsiv, - eqcirc: eqcirc, - eqcolon: eqcolon, - eqsim: eqsim, - eqslantgtr: eqslantgtr, - eqslantless: eqslantless, - equals: equals, - equest: equest, - equiv: equiv, - equivDD: equivDD, - eqvparsl: eqvparsl, - erDot: erDot, - erarr: erarr, - escr: escr, - esdot: esdot, - esim: esim, - eta: eta, - et: et, - eth: eth, - eum: eum, - euml: euml, - euro: euro, - excl: excl, - exist: exist, - expectation: expectation, - exponentiale: exponentiale, - fallingdotseq: fallingdotseq, - fcy: fcy, - female: female, - ffilig: ffilig, - fflig: fflig, - ffllig: ffllig, - ffr: ffr, - filig: filig, - fjlig: fjlig, - flat: flat, - fllig: fllig, - fltns: fltns, - fnof: fnof, - fopf: fopf, - forall: forall, - fork: fork, - forkv: forkv, - fpartint: fpartint, - frac1: frac1, - frac12: frac12, - frac13: frac13, - frac14: frac14, - frac15: frac15, - frac16: frac16, - frac18: frac18, - frac23: frac23, - frac25: frac25, - frac3: frac3, - frac34: frac34, - frac35: frac35, - frac38: frac38, - frac45: frac45, - frac56: frac56, - frac58: frac58, - frac78: frac78, - frasl: frasl, - frown: frown, - fscr: fscr, - gE: gE, - gEl: gEl, - gacute: gacute, - gamma: gamma, - gammad: gammad, - gap: gap, - gbreve: gbreve, - gcirc: gcirc, - gcy: gcy, - gdot: gdot, - ge: ge, - gel: gel, - geq: geq, - geqq: geqq, - geqslant: geqslant, - ges: ges, - gescc: gescc, - gesdot: gesdot, - gesdoto: gesdoto, - gesdotol: gesdotol, - gesl: gesl, - gesles: gesles, - gfr: gfr, - gg: gg, - ggg: ggg, - gimel: gimel, - gjcy: gjcy, - gl: gl, - glE: glE, - gla: gla, - glj: glj, - gnE: gnE, - gnap: gnap, - gnapprox: gnapprox, - gne: gne, - gneq: gneq, - gneqq: gneqq, - gnsim: gnsim, - gopf: gopf, - grave: grave, - gscr: gscr, - gsim: gsim, - gsime: gsime, - gsiml: gsiml, - g: g, - gt: gt, - gtcc: gtcc, - gtcir: gtcir, - gtdot: gtdot, - gtlPar: gtlPar, - gtquest: gtquest, - gtrapprox: gtrapprox, - gtrarr: gtrarr, - gtrdot: gtrdot, - gtreqless: gtreqless, - gtreqqless: gtreqqless, - gtrless: gtrless, - gtrsim: gtrsim, - gvertneqq: gvertneqq, - gvnE: gvnE, - hArr: hArr, - hairsp: hairsp, - half: half, - hamilt: hamilt, - hardcy: hardcy, - harr: harr, - harrcir: harrcir, - harrw: harrw, - hbar: hbar, - hcirc: hcirc, - hearts: hearts, - heartsuit: heartsuit, - hellip: hellip, - hercon: hercon, - hfr: hfr, - hksearow: hksearow, - hkswarow: hkswarow, - hoarr: hoarr, - homtht: homtht, - hookleftarrow: hookleftarrow, - hookrightarrow: hookrightarrow, - hopf: hopf, - horbar: horbar, - hscr: hscr, - hslash: hslash, - hstrok: hstrok, - hybull: hybull, - hyphen: hyphen, - iacut: iacut, - iacute: iacute, - ic: ic, - icir: icir, - icirc: icirc, - icy: icy, - iecy: iecy, - iexc: iexc, - iexcl: iexcl, - iff: iff, - ifr: ifr, - igrav: igrav, - igrave: igrave, - ii: ii, - iiiint: iiiint, - iiint: iiint, - iinfin: iinfin, - iiota: iiota, - ijlig: ijlig, - imacr: imacr, - image: image, - imagline: imagline, - imagpart: imagpart, - imath: imath, - imof: imof, - imped: imped, - "in": "∈", - incare: incare, - infin: infin, - infintie: infintie, - inodot: inodot, - int: int, - intcal: intcal, - integers: integers, - intercal: intercal, - intlarhk: intlarhk, - intprod: intprod, - iocy: iocy, - iogon: iogon, - iopf: iopf, - iota: iota, - iprod: iprod, - iques: iques, - iquest: iquest, - iscr: iscr, - isin: isin, - isinE: isinE, - isindot: isindot, - isins: isins, - isinsv: isinsv, - isinv: isinv, - it: it, - itilde: itilde, - iukcy: iukcy, - ium: ium, - iuml: iuml, - jcirc: jcirc, - jcy: jcy, - jfr: jfr, - jmath: jmath, - jopf: jopf, - jscr: jscr, - jsercy: jsercy, - jukcy: jukcy, - kappa: kappa, - kappav: kappav, - kcedil: kcedil, - kcy: kcy, - kfr: kfr, - kgreen: kgreen, - khcy: khcy, - kjcy: kjcy, - kopf: kopf, - kscr: kscr, - lAarr: lAarr, - lArr: lArr, - lAtail: lAtail, - lBarr: lBarr, - lE: lE, - lEg: lEg, - lHar: lHar, - lacute: lacute, - laemptyv: laemptyv, - lagran: lagran, - lambda: lambda, - lang: lang, - langd: langd, - langle: langle, - lap: lap, - laqu: laqu, - laquo: laquo, - larr: larr, - larrb: larrb, - larrbfs: larrbfs, - larrfs: larrfs, - larrhk: larrhk, - larrlp: larrlp, - larrpl: larrpl, - larrsim: larrsim, - larrtl: larrtl, - lat: lat, - latail: latail, - late: late, - lates: lates, - lbarr: lbarr, - lbbrk: lbbrk, - lbrace: lbrace, - lbrack: lbrack, - lbrke: lbrke, - lbrksld: lbrksld, - lbrkslu: lbrkslu, - lcaron: lcaron, - lcedil: lcedil, - lceil: lceil, - lcub: lcub, - lcy: lcy, - ldca: ldca, - ldquo: ldquo, - ldquor: ldquor, - ldrdhar: ldrdhar, - ldrushar: ldrushar, - ldsh: ldsh, - le: le, - leftarrow: leftarrow, - leftarrowtail: leftarrowtail, - leftharpoondown: leftharpoondown, - leftharpoonup: leftharpoonup, - leftleftarrows: leftleftarrows, - leftrightarrow: leftrightarrow, - leftrightarrows: leftrightarrows, - leftrightharpoons: leftrightharpoons, - leftrightsquigarrow: leftrightsquigarrow, - leftthreetimes: leftthreetimes, - leg: leg, - leq: leq, - leqq: leqq, - leqslant: leqslant, - les: les, - lescc: lescc, - lesdot: lesdot, - lesdoto: lesdoto, - lesdotor: lesdotor, - lesg: lesg, - lesges: lesges, - lessapprox: lessapprox, - lessdot: lessdot, - lesseqgtr: lesseqgtr, - lesseqqgtr: lesseqqgtr, - lessgtr: lessgtr, - lesssim: lesssim, - lfisht: lfisht, - lfloor: lfloor, - lfr: lfr, - lg: lg, - lgE: lgE, - lhard: lhard, - lharu: lharu, - lharul: lharul, - lhblk: lhblk, - ljcy: ljcy, - ll: ll, - llarr: llarr, - llcorner: llcorner, - llhard: llhard, - lltri: lltri, - lmidot: lmidot, - lmoust: lmoust, - lmoustache: lmoustache, - lnE: lnE, - lnap: lnap, - lnapprox: lnapprox, - lne: lne, - lneq: lneq, - lneqq: lneqq, - lnsim: lnsim, - loang: loang, - loarr: loarr, - lobrk: lobrk, - longleftarrow: longleftarrow, - longleftrightarrow: longleftrightarrow, - longmapsto: longmapsto, - longrightarrow: longrightarrow, - looparrowleft: looparrowleft, - looparrowright: looparrowright, - lopar: lopar, - lopf: lopf, - loplus: loplus, - lotimes: lotimes, - lowast: lowast, - lowbar: lowbar, - loz: loz, - lozenge: lozenge, - lozf: lozf, - lpar: lpar, - lparlt: lparlt, - lrarr: lrarr, - lrcorner: lrcorner, - lrhar: lrhar, - lrhard: lrhard, - lrm: lrm, - lrtri: lrtri, - lsaquo: lsaquo, - lscr: lscr, - lsh: lsh, - lsim: lsim, - lsime: lsime, - lsimg: lsimg, - lsqb: lsqb, - lsquo: lsquo, - lsquor: lsquor, - lstrok: lstrok, - l: l, - lt: lt, - ltcc: ltcc, - ltcir: ltcir, - ltdot: ltdot, - lthree: lthree, - ltimes: ltimes, - ltlarr: ltlarr, - ltquest: ltquest, - ltrPar: ltrPar, - ltri: ltri, - ltrie: ltrie, - ltrif: ltrif, - lurdshar: lurdshar, - luruhar: luruhar, - lvertneqq: lvertneqq, - lvnE: lvnE, - mDDot: mDDot, - mac: mac, - macr: macr, - male: male, - malt: malt, - maltese: maltese, - map: map$2, - mapsto: mapsto, - mapstodown: mapstodown, - mapstoleft: mapstoleft, - mapstoup: mapstoup, - marker: marker, - mcomma: mcomma, - mcy: mcy, - mdash: mdash, - measuredangle: measuredangle, - mfr: mfr, - mho: mho, - micr: micr, - micro: micro, - mid: mid, - midast: midast, - midcir: midcir, - middo: middo, - middot: middot, - minus: minus, - minusb: minusb, - minusd: minusd, - minusdu: minusdu, - mlcp: mlcp, - mldr: mldr, - mnplus: mnplus, - models: models$2, - mopf: mopf, - mp: mp, - mscr: mscr, - mstpos: mstpos, - mu: mu, - multimap: multimap, - mumap: mumap, - nGg: nGg, - nGt: nGt, - nGtv: nGtv, - nLeftarrow: nLeftarrow, - nLeftrightarrow: nLeftrightarrow, - nLl: nLl, - nLt: nLt, - nLtv: nLtv, - nRightarrow: nRightarrow, - nVDash: nVDash, - nVdash: nVdash, - nabla: nabla, - nacute: nacute, - nang: nang, - nap: nap, - napE: napE, - napid: napid, - napos: napos, - napprox: napprox, - natur: natur, - natural: natural, - naturals: naturals, - nbs: nbs, - nbsp: nbsp, - nbump: nbump, - nbumpe: nbumpe, - ncap: ncap, - ncaron: ncaron, - ncedil: ncedil, - ncong: ncong, - ncongdot: ncongdot, - ncup: ncup, - ncy: ncy, - ndash: ndash, - ne: ne, - neArr: neArr, - nearhk: nearhk, - nearr: nearr, - nearrow: nearrow, - nedot: nedot, - nequiv: nequiv, - nesear: nesear, - nesim: nesim, - nexist: nexist, - nexists: nexists, - nfr: nfr, - ngE: ngE, - nge: nge, - ngeq: ngeq, - ngeqq: ngeqq, - ngeqslant: ngeqslant, - nges: nges, - ngsim: ngsim, - ngt: ngt, - ngtr: ngtr, - nhArr: nhArr, - nharr: nharr, - nhpar: nhpar, - ni: ni, - nis: nis, - nisd: nisd, - niv: niv, - njcy: njcy, - nlArr: nlArr, - nlE: nlE, - nlarr: nlarr, - nldr: nldr, - nle: nle, - nleftarrow: nleftarrow, - nleftrightarrow: nleftrightarrow, - nleq: nleq, - nleqq: nleqq, - nleqslant: nleqslant, - nles: nles, - nless: nless, - nlsim: nlsim, - nlt: nlt, - nltri: nltri, - nltrie: nltrie, - nmid: nmid, - nopf: nopf, - no: no, - not: not, - notin: notin, - notinE: notinE, - notindot: notindot, - notinva: notinva, - notinvb: notinvb, - notinvc: notinvc, - notni: notni, - notniva: notniva, - notnivb: notnivb, - notnivc: notnivc, - npar: npar, - nparallel: nparallel, - nparsl: nparsl, - npart: npart, - npolint: npolint, - npr: npr, - nprcue: nprcue, - npre: npre, - nprec: nprec, - npreceq: npreceq, - nrArr: nrArr, - nrarr: nrarr, - nrarrc: nrarrc, - nrarrw: nrarrw, - nrightarrow: nrightarrow, - nrtri: nrtri, - nrtrie: nrtrie, - nsc: nsc, - nsccue: nsccue, - nsce: nsce, - nscr: nscr, - nshortmid: nshortmid, - nshortparallel: nshortparallel, - nsim: nsim, - nsime: nsime, - nsimeq: nsimeq, - nsmid: nsmid, - nspar: nspar, - nsqsube: nsqsube, - nsqsupe: nsqsupe, - nsub: nsub, - nsubE: nsubE, - nsube: nsube, - nsubset: nsubset, - nsubseteq: nsubseteq, - nsubseteqq: nsubseteqq, - nsucc: nsucc, - nsucceq: nsucceq, - nsup: nsup, - nsupE: nsupE, - nsupe: nsupe, - nsupset: nsupset, - nsupseteq: nsupseteq, - nsupseteqq: nsupseteqq, - ntgl: ntgl, - ntild: ntild, - ntilde: ntilde, - ntlg: ntlg, - ntriangleleft: ntriangleleft, - ntrianglelefteq: ntrianglelefteq, - ntriangleright: ntriangleright, - ntrianglerighteq: ntrianglerighteq, - nu: nu, - num: num, - numero: numero, - numsp: numsp, - nvDash: nvDash, - nvHarr: nvHarr, - nvap: nvap, - nvdash: nvdash, - nvge: nvge, - nvgt: nvgt, - nvinfin: nvinfin, - nvlArr: nvlArr, - nvle: nvle, - nvlt: nvlt, - nvltrie: nvltrie, - nvrArr: nvrArr, - nvrtrie: nvrtrie, - nvsim: nvsim, - nwArr: nwArr, - nwarhk: nwarhk, - nwarr: nwarr, - nwarrow: nwarrow, - nwnear: nwnear, - oS: oS, - oacut: oacut, - oacute: oacute, - oast: oast, - ocir: ocir, - ocirc: ocirc, - ocy: ocy, - odash: odash, - odblac: odblac, - odiv: odiv, - odot: odot, - odsold: odsold, - oelig: oelig, - ofcir: ofcir, - ofr: ofr, - ogon: ogon, - ograv: ograv, - ograve: ograve, - ogt: ogt, - ohbar: ohbar, - ohm: ohm, - oint: oint, - olarr: olarr, - olcir: olcir, - olcross: olcross, - oline: oline, - olt: olt, - omacr: omacr, - omega: omega, - omicron: omicron, - omid: omid, - ominus: ominus, - oopf: oopf, - opar: opar, - operp: operp, - oplus: oplus, - or: or, - orarr: orarr, - ord: ord, - order: order$1, - orderof: orderof, - ordf: ordf, - ordm: ordm, - origof: origof, - oror: oror, - orslope: orslope, - orv: orv, - oscr: oscr, - oslas: oslas, - oslash: oslash, - osol: osol, - otild: otild, - otilde: otilde, - otimes: otimes, - otimesas: otimesas, - oum: oum, - ouml: ouml, - ovbar: ovbar, - par: par, - para: para, - parallel: parallel, - parsim: parsim, - parsl: parsl, - part: part, - pcy: pcy, - percnt: percnt, - period: period, - permil: permil, - perp: perp, - pertenk: pertenk, - pfr: pfr, - phi: phi, - phiv: phiv, - phmmat: phmmat, - phone: phone, - pi: pi, - pitchfork: pitchfork, - piv: piv, - planck: planck, - planckh: planckh, - plankv: plankv, - plus: plus, - plusacir: plusacir, - plusb: plusb, - pluscir: pluscir, - plusdo: plusdo, - plusdu: plusdu, - pluse: pluse, - plusm: plusm, - plusmn: plusmn, - plussim: plussim, - plustwo: plustwo, - pm: pm, - pointint: pointint, - popf: popf, - poun: poun, - pound: pound, - pr: pr, - prE: prE, - prap: prap, - prcue: prcue, - pre: pre, - prec: prec, - precapprox: precapprox, - preccurlyeq: preccurlyeq, - preceq: preceq, - precnapprox: precnapprox, - precneqq: precneqq, - precnsim: precnsim, - precsim: precsim, - prime: prime, - primes: primes, - prnE: prnE, - prnap: prnap, - prnsim: prnsim, - prod: prod, - profalar: profalar, - profline: profline, - profsurf: profsurf, - prop: prop, - propto: propto, - prsim: prsim, - prurel: prurel, - pscr: pscr, - psi: psi, - puncsp: puncsp, - qfr: qfr, - qint: qint, - qopf: qopf, - qprime: qprime, - qscr: qscr, - quaternions: quaternions, - quatint: quatint, - quest: quest, - questeq: questeq, - quo: quo, - quot: quot, - rAarr: rAarr, - rArr: rArr, - rAtail: rAtail, - rBarr: rBarr, - rHar: rHar, - race: race, - racute: racute, - radic: radic, - raemptyv: raemptyv, - rang: rang, - rangd: rangd, - range: range$1, - rangle: rangle, - raqu: raqu, - raquo: raquo, - rarr: rarr, - rarrap: rarrap, - rarrb: rarrb, - rarrbfs: rarrbfs, - rarrc: rarrc, - rarrfs: rarrfs, - rarrhk: rarrhk, - rarrlp: rarrlp, - rarrpl: rarrpl, - rarrsim: rarrsim, - rarrtl: rarrtl, - rarrw: rarrw, - ratail: ratail, - ratio: ratio, - rationals: rationals, - rbarr: rbarr, - rbbrk: rbbrk, - rbrace: rbrace, - rbrack: rbrack, - rbrke: rbrke, - rbrksld: rbrksld, - rbrkslu: rbrkslu, - rcaron: rcaron, - rcedil: rcedil, - rceil: rceil, - rcub: rcub, - rcy: rcy, - rdca: rdca, - rdldhar: rdldhar, - rdquo: rdquo, - rdquor: rdquor, - rdsh: rdsh, - real: real, - realine: realine, - realpart: realpart, - reals: reals, - rect: rect, - re: re, - reg: reg, - rfisht: rfisht, - rfloor: rfloor, - rfr: rfr, - rhard: rhard, - rharu: rharu, - rharul: rharul, - rho: rho, - rhov: rhov, - rightarrow: rightarrow, - rightarrowtail: rightarrowtail, - rightharpoondown: rightharpoondown, - rightharpoonup: rightharpoonup, - rightleftarrows: rightleftarrows, - rightleftharpoons: rightleftharpoons, - rightrightarrows: rightrightarrows, - rightsquigarrow: rightsquigarrow, - rightthreetimes: rightthreetimes, - ring: ring, - risingdotseq: risingdotseq, - rlarr: rlarr, - rlhar: rlhar, - rlm: rlm, - rmoust: rmoust, - rmoustache: rmoustache, - rnmid: rnmid, - roang: roang, - roarr: roarr, - robrk: robrk, - ropar: ropar, - ropf: ropf, - roplus: roplus, - rotimes: rotimes, - rpar: rpar, - rpargt: rpargt, - rppolint: rppolint, - rrarr: rrarr, - rsaquo: rsaquo, - rscr: rscr, - rsh: rsh, - rsqb: rsqb, - rsquo: rsquo, - rsquor: rsquor, - rthree: rthree, - rtimes: rtimes, - rtri: rtri, - rtrie: rtrie, - rtrif: rtrif, - rtriltri: rtriltri, - ruluhar: ruluhar, - rx: rx, - sacute: sacute, - sbquo: sbquo, - sc: sc, - scE: scE, - scap: scap, - scaron: scaron, - sccue: sccue, - sce: sce, - scedil: scedil, - scirc: scirc, - scnE: scnE, - scnap: scnap, - scnsim: scnsim, - scpolint: scpolint, - scsim: scsim, - scy: scy, - sdot: sdot, - sdotb: sdotb, - sdote: sdote, - seArr: seArr, - searhk: searhk, - searr: searr, - searrow: searrow, - sec: sec, - sect: sect, - semi: semi, - seswar: seswar, - setminus: setminus, - setmn: setmn, - sext: sext, - sfr: sfr, - sfrown: sfrown, - sharp: sharp, - shchcy: shchcy, - shcy: shcy, - shortmid: shortmid, - shortparallel: shortparallel, - sh: sh, - shy: shy, - sigma: sigma, - sigmaf: sigmaf, - sigmav: sigmav, - sim: sim, - simdot: simdot, - sime: sime, - simeq: simeq, - simg: simg, - simgE: simgE, - siml: siml, - simlE: simlE, - simne: simne, - simplus: simplus, - simrarr: simrarr, - slarr: slarr, - smallsetminus: smallsetminus, - smashp: smashp, - smeparsl: smeparsl, - smid: smid, - smile: smile, - smt: smt, - smte: smte, - smtes: smtes, - softcy: softcy, - sol: sol, - solb: solb, - solbar: solbar, - sopf: sopf, - spades: spades, - spadesuit: spadesuit, - spar: spar, - sqcap: sqcap, - sqcaps: sqcaps, - sqcup: sqcup, - sqcups: sqcups, - sqsub: sqsub, - sqsube: sqsube, - sqsubset: sqsubset, - sqsubseteq: sqsubseteq, - sqsup: sqsup, - sqsupe: sqsupe, - sqsupset: sqsupset, - sqsupseteq: sqsupseteq, - squ: squ, - square: square, - squarf: squarf, - squf: squf, - srarr: srarr, - sscr: sscr, - ssetmn: ssetmn, - ssmile: ssmile, - sstarf: sstarf, - star: star$1, - starf: starf, - straightepsilon: straightepsilon, - straightphi: straightphi, - strns: strns, - sub: sub, - subE: subE, - subdot: subdot, - sube: sube, - subedot: subedot, - submult: submult, - subnE: subnE, - subne: subne, - subplus: subplus, - subrarr: subrarr, - subset: subset, - subseteq: subseteq, - subseteqq: subseteqq, - subsetneq: subsetneq, - subsetneqq: subsetneqq, - subsim: subsim, - subsub: subsub, - subsup: subsup, - succ: succ, - succapprox: succapprox, - succcurlyeq: succcurlyeq, - succeq: succeq, - succnapprox: succnapprox, - succneqq: succneqq, - succnsim: succnsim, - succsim: succsim, - sum: sum, - sung: sung, - sup: sup, - sup1: sup1, - sup2: sup2, - sup3: sup3, - supE: supE, - supdot: supdot, - supdsub: supdsub, - supe: supe, - supedot: supedot, - suphsol: suphsol, - suphsub: suphsub, - suplarr: suplarr, - supmult: supmult, - supnE: supnE, - supne: supne, - supplus: supplus, - supset: supset, - supseteq: supseteq, - supseteqq: supseteqq, - supsetneq: supsetneq, - supsetneqq: supsetneqq, - supsim: supsim, - supsub: supsub, - supsup: supsup, - swArr: swArr, - swarhk: swarhk, - swarr: swarr, - swarrow: swarrow, - swnwar: swnwar, - szli: szli, - szlig: szlig, - target: target, - tau: tau, - tbrk: tbrk, - tcaron: tcaron, - tcedil: tcedil, - tcy: tcy, - tdot: tdot, - telrec: telrec, - tfr: tfr, - there4: there4, - therefore: therefore, - theta: theta, - thetasym: thetasym, - thetav: thetav, - thickapprox: thickapprox, - thicksim: thicksim, - thinsp: thinsp, - thkap: thkap, - thksim: thksim, - thor: thor, - thorn: thorn, - tilde: tilde, - time: time, - times: times, - timesb: timesb, - timesbar: timesbar, - timesd: timesd, - tint: tint, - toea: toea, - top: top, - topbot: topbot, - topcir: topcir, - topf: topf, - topfork: topfork, - tosa: tosa, - tprime: tprime, - trade: trade, - triangle: triangle, - triangledown: triangledown, - triangleleft: triangleleft, - trianglelefteq: trianglelefteq, - triangleq: triangleq, - triangleright: triangleright, - trianglerighteq: trianglerighteq, - tridot: tridot, - trie: trie, - triminus: triminus, - triplus: triplus, - trisb: trisb, - tritime: tritime, - trpezium: trpezium, - tscr: tscr, - tscy: tscy, - tshcy: tshcy, - tstrok: tstrok, - twixt: twixt, - twoheadleftarrow: twoheadleftarrow, - twoheadrightarrow: twoheadrightarrow, - uArr: uArr, - uHar: uHar, - uacut: uacut, - uacute: uacute, - uarr: uarr, - ubrcy: ubrcy, - ubreve: ubreve, - ucir: ucir, - ucirc: ucirc, - ucy: ucy, - udarr: udarr, - udblac: udblac, - udhar: udhar, - ufisht: ufisht, - ufr: ufr, - ugrav: ugrav, - ugrave: ugrave, - uharl: uharl, - uharr: uharr, - uhblk: uhblk, - ulcorn: ulcorn, - ulcorner: ulcorner, - ulcrop: ulcrop, - ultri: ultri, - umacr: umacr, - um: um, - uml: uml, - uogon: uogon, - uopf: uopf, - uparrow: uparrow, - updownarrow: updownarrow, - upharpoonleft: upharpoonleft, - upharpoonright: upharpoonright, - uplus: uplus, - upsi: upsi, - upsih: upsih, - upsilon: upsilon, - upuparrows: upuparrows, - urcorn: urcorn, - urcorner: urcorner, - urcrop: urcrop, - uring: uring, - urtri: urtri, - uscr: uscr, - utdot: utdot, - utilde: utilde, - utri: utri, - utrif: utrif, - uuarr: uuarr, - uum: uum, - uuml: uuml, - uwangle: uwangle, - vArr: vArr, - vBar: vBar, - vBarv: vBarv, - vDash: vDash, - vangrt: vangrt, - varepsilon: varepsilon, - varkappa: varkappa, - varnothing: varnothing, - varphi: varphi, - varpi: varpi, - varpropto: varpropto, - varr: varr, - varrho: varrho, - varsigma: varsigma, - varsubsetneq: varsubsetneq, - varsubsetneqq: varsubsetneqq, - varsupsetneq: varsupsetneq, - varsupsetneqq: varsupsetneqq, - vartheta: vartheta, - vartriangleleft: vartriangleleft, - vartriangleright: vartriangleright, - vcy: vcy, - vdash: vdash, - vee: vee, - veebar: veebar, - veeeq: veeeq, - vellip: vellip, - verbar: verbar, - vert: vert, - vfr: vfr, - vltri: vltri, - vnsub: vnsub, - vnsup: vnsup, - vopf: vopf, - vprop: vprop, - vrtri: vrtri, - vscr: vscr, - vsubnE: vsubnE, - vsubne: vsubne, - vsupnE: vsupnE, - vsupne: vsupne, - vzigzag: vzigzag, - wcirc: wcirc, - wedbar: wedbar, - wedge: wedge, - wedgeq: wedgeq, - weierp: weierp, - wfr: wfr, - wopf: wopf, - wp: wp, - wr: wr, - wreath: wreath, - wscr: wscr, - xcap: xcap, - xcirc: xcirc, - xcup: xcup, - xdtri: xdtri, - xfr: xfr, - xhArr: xhArr, - xharr: xharr, - xi: xi, - xlArr: xlArr, - xlarr: xlarr, - xmap: xmap, - xnis: xnis, - xodot: xodot, - xopf: xopf, - xoplus: xoplus, - xotime: xotime, - xrArr: xrArr, - xrarr: xrarr, - xscr: xscr, - xsqcup: xsqcup, - xuplus: xuplus, - xutri: xutri, - xvee: xvee, - xwedge: xwedge, - yacut: yacut, - yacute: yacute, - yacy: yacy, - ycirc: ycirc, - ycy: ycy, - ye: ye, - yen: yen, - yfr: yfr, - yicy: yicy, - yopf: yopf, - yscr: yscr, - yucy: yucy, - yum: yum, - yuml: yuml, - zacute: zacute, - zcaron: zcaron, - zcy: zcy, - zdot: zdot, - zeetrf: zeetrf, - zeta: zeta, - zfr: zfr, - zhcy: zhcy, - zigrarr: zigrarr, - zopf: zopf, - zscr: zscr, - zwj: zwj, - zwnj: zwnj -}; - -var characterEntities = /*#__PURE__*/Object.freeze({ - __proto__: null, - AEli: AEli, - AElig: AElig, - AM: AM, - AMP: AMP, - Aacut: Aacut, - Aacute: Aacute, - Abreve: Abreve, - Acir: Acir, - Acirc: Acirc, - Acy: Acy, - Afr: Afr, - Agrav: Agrav, - Agrave: Agrave, - Alpha: Alpha, - Amacr: Amacr, - And: And, - Aogon: Aogon, - Aopf: Aopf, - ApplyFunction: ApplyFunction, - Arin: Arin, - Aring: Aring, - Ascr: Ascr, - Assign: Assign, - Atild: Atild, - Atilde: Atilde, - Aum: Aum, - Auml: Auml, - Backslash: Backslash, - Barv: Barv, - Barwed: Barwed, - Bcy: Bcy, - Because: Because, - Bernoullis: Bernoullis, - Beta: Beta, - Bfr: Bfr, - Bopf: Bopf, - Breve: Breve, - Bscr: Bscr, - Bumpeq: Bumpeq, - CHcy: CHcy, - COP: COP, - COPY: COPY, - Cacute: Cacute, - Cap: Cap, - CapitalDifferentialD: CapitalDifferentialD, - Cayleys: Cayleys, - Ccaron: Ccaron, - Ccedi: Ccedi, - Ccedil: Ccedil, - Ccirc: Ccirc, - Cconint: Cconint, - Cdot: Cdot, - Cedilla: Cedilla, - CenterDot: CenterDot, - Cfr: Cfr, - Chi: Chi, - CircleDot: CircleDot, - CircleMinus: CircleMinus, - CirclePlus: CirclePlus, - CircleTimes: CircleTimes, - ClockwiseContourIntegral: ClockwiseContourIntegral, - CloseCurlyDoubleQuote: CloseCurlyDoubleQuote, - CloseCurlyQuote: CloseCurlyQuote, - Colon: Colon, - Colone: Colone, - Congruent: Congruent, - Conint: Conint, - ContourIntegral: ContourIntegral, - Copf: Copf, - Coproduct: Coproduct, - CounterClockwiseContourIntegral: CounterClockwiseContourIntegral, - Cross: Cross, - Cscr: Cscr, - Cup: Cup, - CupCap: CupCap, - DD: DD, - DDotrahd: DDotrahd, - DJcy: DJcy, - DScy: DScy, - DZcy: DZcy, - Dagger: Dagger, - Darr: Darr, - Dashv: Dashv, - Dcaron: Dcaron, - Dcy: Dcy, - Del: Del, - Delta: Delta, - Dfr: Dfr, - DiacriticalAcute: DiacriticalAcute, - DiacriticalDot: DiacriticalDot, - DiacriticalDoubleAcute: DiacriticalDoubleAcute, - DiacriticalGrave: DiacriticalGrave, - DiacriticalTilde: DiacriticalTilde, - Diamond: Diamond, - DifferentialD: DifferentialD, - Dopf: Dopf, - Dot: Dot, - DotDot: DotDot, - DotEqual: DotEqual, - DoubleContourIntegral: DoubleContourIntegral, - DoubleDot: DoubleDot, - DoubleDownArrow: DoubleDownArrow, - DoubleLeftArrow: DoubleLeftArrow, - DoubleLeftRightArrow: DoubleLeftRightArrow, - DoubleLeftTee: DoubleLeftTee, - DoubleLongLeftArrow: DoubleLongLeftArrow, - DoubleLongLeftRightArrow: DoubleLongLeftRightArrow, - DoubleLongRightArrow: DoubleLongRightArrow, - DoubleRightArrow: DoubleRightArrow, - DoubleRightTee: DoubleRightTee, - DoubleUpArrow: DoubleUpArrow, - DoubleUpDownArrow: DoubleUpDownArrow, - DoubleVerticalBar: DoubleVerticalBar, - DownArrow: DownArrow, - DownArrowBar: DownArrowBar, - DownArrowUpArrow: DownArrowUpArrow, - DownBreve: DownBreve, - DownLeftRightVector: DownLeftRightVector, - DownLeftTeeVector: DownLeftTeeVector, - DownLeftVector: DownLeftVector, - DownLeftVectorBar: DownLeftVectorBar, - DownRightTeeVector: DownRightTeeVector, - DownRightVector: DownRightVector, - DownRightVectorBar: DownRightVectorBar, - DownTee: DownTee, - DownTeeArrow: DownTeeArrow, - Downarrow: Downarrow, - Dscr: Dscr, - Dstrok: Dstrok, - ENG: ENG, - ET: ET, - ETH: ETH, - Eacut: Eacut, - Eacute: Eacute, - Ecaron: Ecaron, - Ecir: Ecir, - Ecirc: Ecirc, - Ecy: Ecy, - Edot: Edot, - Efr: Efr, - Egrav: Egrav, - Egrave: Egrave, - Element: Element, - Emacr: Emacr, - EmptySmallSquare: EmptySmallSquare, - EmptyVerySmallSquare: EmptyVerySmallSquare, - Eogon: Eogon, - Eopf: Eopf, - Epsilon: Epsilon, - Equal: Equal, - EqualTilde: EqualTilde, - Equilibrium: Equilibrium, - Escr: Escr, - Esim: Esim, - Eta: Eta, - Eum: Eum, - Euml: Euml, - Exists: Exists, - ExponentialE: ExponentialE, - Fcy: Fcy, - Ffr: Ffr, - FilledSmallSquare: FilledSmallSquare, - FilledVerySmallSquare: FilledVerySmallSquare, - Fopf: Fopf, - ForAll: ForAll, - Fouriertrf: Fouriertrf, - Fscr: Fscr, - GJcy: GJcy, - G: G, - GT: GT, - Gamma: Gamma, - Gammad: Gammad, - Gbreve: Gbreve, - Gcedil: Gcedil, - Gcirc: Gcirc, - Gcy: Gcy, - Gdot: Gdot, - Gfr: Gfr, - Gg: Gg, - Gopf: Gopf, - GreaterEqual: GreaterEqual, - GreaterEqualLess: GreaterEqualLess, - GreaterFullEqual: GreaterFullEqual, - GreaterGreater: GreaterGreater, - GreaterLess: GreaterLess, - GreaterSlantEqual: GreaterSlantEqual, - GreaterTilde: GreaterTilde, - Gscr: Gscr, - Gt: Gt, - HARDcy: HARDcy, - Hacek: Hacek, - Hat: Hat, - Hcirc: Hcirc, - Hfr: Hfr, - HilbertSpace: HilbertSpace, - Hopf: Hopf, - HorizontalLine: HorizontalLine, - Hscr: Hscr, - Hstrok: Hstrok, - HumpDownHump: HumpDownHump, - HumpEqual: HumpEqual, - IEcy: IEcy, - IJlig: IJlig, - IOcy: IOcy, - Iacut: Iacut, - Iacute: Iacute, - Icir: Icir, - Icirc: Icirc, - Icy: Icy, - Idot: Idot, - Ifr: Ifr, - Igrav: Igrav, - Igrave: Igrave, - Im: Im, - Imacr: Imacr, - ImaginaryI: ImaginaryI, - Implies: Implies, - Int: Int, - Integral: Integral, - Intersection: Intersection, - InvisibleComma: InvisibleComma, - InvisibleTimes: InvisibleTimes, - Iogon: Iogon, - Iopf: Iopf, - Iota: Iota, - Iscr: Iscr, - Itilde: Itilde, - Iukcy: Iukcy, - Ium: Ium, - Iuml: Iuml, - Jcirc: Jcirc, - Jcy: Jcy, - Jfr: Jfr, - Jopf: Jopf, - Jscr: Jscr, - Jsercy: Jsercy, - Jukcy: Jukcy, - KHcy: KHcy, - KJcy: KJcy, - Kappa: Kappa, - Kcedil: Kcedil, - Kcy: Kcy, - Kfr: Kfr, - Kopf: Kopf, - Kscr: Kscr, - LJcy: LJcy, - L: L, - LT: LT, - Lacute: Lacute, - Lambda: Lambda, - Lang: Lang, - Laplacetrf: Laplacetrf, - Larr: Larr, - Lcaron: Lcaron, - Lcedil: Lcedil, - Lcy: Lcy, - LeftAngleBracket: LeftAngleBracket, - LeftArrow: LeftArrow, - LeftArrowBar: LeftArrowBar, - LeftArrowRightArrow: LeftArrowRightArrow, - LeftCeiling: LeftCeiling, - LeftDoubleBracket: LeftDoubleBracket, - LeftDownTeeVector: LeftDownTeeVector, - LeftDownVector: LeftDownVector, - LeftDownVectorBar: LeftDownVectorBar, - LeftFloor: LeftFloor, - LeftRightArrow: LeftRightArrow, - LeftRightVector: LeftRightVector, - LeftTee: LeftTee, - LeftTeeArrow: LeftTeeArrow, - LeftTeeVector: LeftTeeVector, - LeftTriangle: LeftTriangle, - LeftTriangleBar: LeftTriangleBar, - LeftTriangleEqual: LeftTriangleEqual, - LeftUpDownVector: LeftUpDownVector, - LeftUpTeeVector: LeftUpTeeVector, - LeftUpVector: LeftUpVector, - LeftUpVectorBar: LeftUpVectorBar, - LeftVector: LeftVector, - LeftVectorBar: LeftVectorBar, - Leftarrow: Leftarrow, - Leftrightarrow: Leftrightarrow, - LessEqualGreater: LessEqualGreater, - LessFullEqual: LessFullEqual, - LessGreater: LessGreater, - LessLess: LessLess, - LessSlantEqual: LessSlantEqual, - LessTilde: LessTilde, - Lfr: Lfr, - Ll: Ll, - Lleftarrow: Lleftarrow, - Lmidot: Lmidot, - LongLeftArrow: LongLeftArrow, - LongLeftRightArrow: LongLeftRightArrow, - LongRightArrow: LongRightArrow, - Longleftarrow: Longleftarrow, - Longleftrightarrow: Longleftrightarrow, - Longrightarrow: Longrightarrow, - Lopf: Lopf, - LowerLeftArrow: LowerLeftArrow, - LowerRightArrow: LowerRightArrow, - Lscr: Lscr, - Lsh: Lsh, - Lstrok: Lstrok, - Lt: Lt, - Mcy: Mcy, - MediumSpace: MediumSpace, - Mellintrf: Mellintrf, - Mfr: Mfr, - MinusPlus: MinusPlus, - Mopf: Mopf, - Mscr: Mscr, - Mu: Mu, - NJcy: NJcy, - Nacute: Nacute, - Ncaron: Ncaron, - Ncedil: Ncedil, - Ncy: Ncy, - NegativeMediumSpace: NegativeMediumSpace, - NegativeThickSpace: NegativeThickSpace, - NegativeThinSpace: NegativeThinSpace, - NegativeVeryThinSpace: NegativeVeryThinSpace, - NestedGreaterGreater: NestedGreaterGreater, - NestedLessLess: NestedLessLess, - NewLine: NewLine, - Nfr: Nfr, - NoBreak: NoBreak, - NonBreakingSpace: NonBreakingSpace, - Nopf: Nopf, - Not: Not, - NotCongruent: NotCongruent, - NotCupCap: NotCupCap, - NotDoubleVerticalBar: NotDoubleVerticalBar, - NotElement: NotElement, - NotEqual: NotEqual, - NotEqualTilde: NotEqualTilde, - NotExists: NotExists, - NotGreater: NotGreater, - NotGreaterEqual: NotGreaterEqual, - NotGreaterFullEqual: NotGreaterFullEqual, - NotGreaterGreater: NotGreaterGreater, - NotGreaterLess: NotGreaterLess, - NotGreaterSlantEqual: NotGreaterSlantEqual, - NotGreaterTilde: NotGreaterTilde, - NotHumpDownHump: NotHumpDownHump, - NotHumpEqual: NotHumpEqual, - NotLeftTriangle: NotLeftTriangle, - NotLeftTriangleBar: NotLeftTriangleBar, - NotLeftTriangleEqual: NotLeftTriangleEqual, - NotLess: NotLess, - NotLessEqual: NotLessEqual, - NotLessGreater: NotLessGreater, - NotLessLess: NotLessLess, - NotLessSlantEqual: NotLessSlantEqual, - NotLessTilde: NotLessTilde, - NotNestedGreaterGreater: NotNestedGreaterGreater, - NotNestedLessLess: NotNestedLessLess, - NotPrecedes: NotPrecedes, - NotPrecedesEqual: NotPrecedesEqual, - NotPrecedesSlantEqual: NotPrecedesSlantEqual, - NotReverseElement: NotReverseElement, - NotRightTriangle: NotRightTriangle, - NotRightTriangleBar: NotRightTriangleBar, - NotRightTriangleEqual: NotRightTriangleEqual, - NotSquareSubset: NotSquareSubset, - NotSquareSubsetEqual: NotSquareSubsetEqual, - NotSquareSuperset: NotSquareSuperset, - NotSquareSupersetEqual: NotSquareSupersetEqual, - NotSubset: NotSubset, - NotSubsetEqual: NotSubsetEqual, - NotSucceeds: NotSucceeds, - NotSucceedsEqual: NotSucceedsEqual, - NotSucceedsSlantEqual: NotSucceedsSlantEqual, - NotSucceedsTilde: NotSucceedsTilde, - NotSuperset: NotSuperset, - NotSupersetEqual: NotSupersetEqual, - NotTilde: NotTilde, - NotTildeEqual: NotTildeEqual, - NotTildeFullEqual: NotTildeFullEqual, - NotTildeTilde: NotTildeTilde, - NotVerticalBar: NotVerticalBar, - Nscr: Nscr, - Ntild: Ntild, - Ntilde: Ntilde, - Nu: Nu, - OElig: OElig, - Oacut: Oacut, - Oacute: Oacute, - Ocir: Ocir, - Ocirc: Ocirc, - Ocy: Ocy, - Odblac: Odblac, - Ofr: Ofr, - Ograv: Ograv, - Ograve: Ograve, - Omacr: Omacr, - Omega: Omega, - Omicron: Omicron, - Oopf: Oopf, - OpenCurlyDoubleQuote: OpenCurlyDoubleQuote, - OpenCurlyQuote: OpenCurlyQuote, - Or: Or, - Oscr: Oscr, - Oslas: Oslas, - Oslash: Oslash, - Otild: Otild, - Otilde: Otilde, - Otimes: Otimes, - Oum: Oum, - Ouml: Ouml, - OverBar: OverBar, - OverBrace: OverBrace, - OverBracket: OverBracket, - OverParenthesis: OverParenthesis, - PartialD: PartialD, - Pcy: Pcy, - Pfr: Pfr, - Phi: Phi, - Pi: Pi, - PlusMinus: PlusMinus, - Poincareplane: Poincareplane, - Popf: Popf, - Pr: Pr, - Precedes: Precedes, - PrecedesEqual: PrecedesEqual, - PrecedesSlantEqual: PrecedesSlantEqual, - PrecedesTilde: PrecedesTilde, - Prime: Prime, - Product: Product, - Proportion: Proportion, - Proportional: Proportional, - Pscr: Pscr, - Psi: Psi, - QUO: QUO, - QUOT: QUOT, - Qfr: Qfr, - Qopf: Qopf, - Qscr: Qscr, - RBarr: RBarr, - RE: RE, - REG: REG, - Racute: Racute, - Rang: Rang, - Rarr: Rarr, - Rarrtl: Rarrtl, - Rcaron: Rcaron, - Rcedil: Rcedil, - Rcy: Rcy, - Re: Re, - ReverseElement: ReverseElement, - ReverseEquilibrium: ReverseEquilibrium, - ReverseUpEquilibrium: ReverseUpEquilibrium, - Rfr: Rfr, - Rho: Rho, - RightAngleBracket: RightAngleBracket, - RightArrow: RightArrow, - RightArrowBar: RightArrowBar, - RightArrowLeftArrow: RightArrowLeftArrow, - RightCeiling: RightCeiling, - RightDoubleBracket: RightDoubleBracket, - RightDownTeeVector: RightDownTeeVector, - RightDownVector: RightDownVector, - RightDownVectorBar: RightDownVectorBar, - RightFloor: RightFloor, - RightTee: RightTee, - RightTeeArrow: RightTeeArrow, - RightTeeVector: RightTeeVector, - RightTriangle: RightTriangle, - RightTriangleBar: RightTriangleBar, - RightTriangleEqual: RightTriangleEqual, - RightUpDownVector: RightUpDownVector, - RightUpTeeVector: RightUpTeeVector, - RightUpVector: RightUpVector, - RightUpVectorBar: RightUpVectorBar, - RightVector: RightVector, - RightVectorBar: RightVectorBar, - Rightarrow: Rightarrow, - Ropf: Ropf, - RoundImplies: RoundImplies, - Rrightarrow: Rrightarrow, - Rscr: Rscr, - Rsh: Rsh, - RuleDelayed: RuleDelayed, - SHCHcy: SHCHcy, - SHcy: SHcy, - SOFTcy: SOFTcy, - Sacute: Sacute, - Sc: Sc, - Scaron: Scaron, - Scedil: Scedil, - Scirc: Scirc, - Scy: Scy, - Sfr: Sfr, - ShortDownArrow: ShortDownArrow, - ShortLeftArrow: ShortLeftArrow, - ShortRightArrow: ShortRightArrow, - ShortUpArrow: ShortUpArrow, - Sigma: Sigma, - SmallCircle: SmallCircle, - Sopf: Sopf, - Sqrt: Sqrt, - Square: Square, - SquareIntersection: SquareIntersection, - SquareSubset: SquareSubset, - SquareSubsetEqual: SquareSubsetEqual, - SquareSuperset: SquareSuperset, - SquareSupersetEqual: SquareSupersetEqual, - SquareUnion: SquareUnion, - Sscr: Sscr, - Star: Star, - Sub: Sub, - Subset: Subset, - SubsetEqual: SubsetEqual, - Succeeds: Succeeds, - SucceedsEqual: SucceedsEqual, - SucceedsSlantEqual: SucceedsSlantEqual, - SucceedsTilde: SucceedsTilde, - SuchThat: SuchThat, - Sum: Sum, - Sup: Sup, - Superset: Superset, - SupersetEqual: SupersetEqual, - Supset: Supset, - THOR: THOR, - THORN: THORN, - TRADE: TRADE, - TSHcy: TSHcy, - TScy: TScy, - Tab: Tab, - Tau: Tau, - Tcaron: Tcaron, - Tcedil: Tcedil, - Tcy: Tcy, - Tfr: Tfr, - Therefore: Therefore, - Theta: Theta, - ThickSpace: ThickSpace, - ThinSpace: ThinSpace, - Tilde: Tilde, - TildeEqual: TildeEqual, - TildeFullEqual: TildeFullEqual, - TildeTilde: TildeTilde, - Topf: Topf, - TripleDot: TripleDot, - Tscr: Tscr, - Tstrok: Tstrok, - Uacut: Uacut, - Uacute: Uacute, - Uarr: Uarr, - Uarrocir: Uarrocir, - Ubrcy: Ubrcy, - Ubreve: Ubreve, - Ucir: Ucir, - Ucirc: Ucirc, - Ucy: Ucy, - Udblac: Udblac, - Ufr: Ufr, - Ugrav: Ugrav, - Ugrave: Ugrave, - Umacr: Umacr, - UnderBar: UnderBar, - UnderBrace: UnderBrace, - UnderBracket: UnderBracket, - UnderParenthesis: UnderParenthesis, - Union: Union, - UnionPlus: UnionPlus, - Uogon: Uogon, - Uopf: Uopf, - UpArrow: UpArrow, - UpArrowBar: UpArrowBar, - UpArrowDownArrow: UpArrowDownArrow, - UpDownArrow: UpDownArrow, - UpEquilibrium: UpEquilibrium, - UpTee: UpTee, - UpTeeArrow: UpTeeArrow, - Uparrow: Uparrow, - Updownarrow: Updownarrow, - UpperLeftArrow: UpperLeftArrow, - UpperRightArrow: UpperRightArrow, - Upsi: Upsi, - Upsilon: Upsilon, - Uring: Uring, - Uscr: Uscr, - Utilde: Utilde, - Uum: Uum, - Uuml: Uuml, - VDash: VDash, - Vbar: Vbar, - Vcy: Vcy, - Vdash: Vdash, - Vdashl: Vdashl, - Vee: Vee, - Verbar: Verbar, - Vert: Vert, - VerticalBar: VerticalBar, - VerticalLine: VerticalLine, - VerticalSeparator: VerticalSeparator, - VerticalTilde: VerticalTilde, - VeryThinSpace: VeryThinSpace, - Vfr: Vfr, - Vopf: Vopf, - Vscr: Vscr, - Vvdash: Vvdash, - Wcirc: Wcirc, - Wedge: Wedge, - Wfr: Wfr, - Wopf: Wopf, - Wscr: Wscr, - Xfr: Xfr, - Xi: Xi, - Xopf: Xopf, - Xscr: Xscr, - YAcy: YAcy, - YIcy: YIcy, - YUcy: YUcy, - Yacut: Yacut, - Yacute: Yacute, - Ycirc: Ycirc, - Ycy: Ycy, - Yfr: Yfr, - Yopf: Yopf, - Yscr: Yscr, - Yuml: Yuml, - ZHcy: ZHcy, - Zacute: Zacute, - Zcaron: Zcaron, - Zcy: Zcy, - Zdot: Zdot, - ZeroWidthSpace: ZeroWidthSpace, - Zeta: Zeta, - Zfr: Zfr, - Zopf: Zopf, - Zscr: Zscr, - aacut: aacut, - aacute: aacute, - abreve: abreve, - ac: ac, - acE: acE, - acd: acd, - acir: acir, - acirc: acirc, - acut: acut, - acute: acute, - acy: acy, - aeli: aeli, - aelig: aelig, - af: af, - afr: afr, - agrav: agrav, - agrave: agrave, - alefsym: alefsym, - aleph: aleph, - alpha: alpha, - amacr: amacr, - amalg: amalg, - am: am, - amp: amp, - and: and, - andand: andand, - andd: andd, - andslope: andslope, - andv: andv, - ang: ang, - ange: ange, - angle: angle, - angmsd: angmsd, - angmsdaa: angmsdaa, - angmsdab: angmsdab, - angmsdac: angmsdac, - angmsdad: angmsdad, - angmsdae: angmsdae, - angmsdaf: angmsdaf, - angmsdag: angmsdag, - angmsdah: angmsdah, - angrt: angrt, - angrtvb: angrtvb, - angrtvbd: angrtvbd, - angsph: angsph, - angst: angst, - angzarr: angzarr, - aogon: aogon, - aopf: aopf, - ap: ap, - apE: apE, - apacir: apacir, - ape: ape, - apid: apid, - apos: apos, - approx: approx, - approxeq: approxeq, - arin: arin, - aring: aring, - ascr: ascr, - ast: ast, - asymp: asymp, - asympeq: asympeq, - atild: atild, - atilde: atilde, - aum: aum, - auml: auml, - awconint: awconint, - awint: awint, - bNot: bNot, - backcong: backcong, - backepsilon: backepsilon, - backprime: backprime, - backsim: backsim, - backsimeq: backsimeq, - barvee: barvee, - barwed: barwed, - barwedge: barwedge, - bbrk: bbrk, - bbrktbrk: bbrktbrk, - bcong: bcong, - bcy: bcy, - bdquo: bdquo, - becaus: becaus, - because: because, - bemptyv: bemptyv, - bepsi: bepsi, - bernou: bernou, - beta: beta, - beth: beth, - between: between, - bfr: bfr, - bigcap: bigcap, - bigcirc: bigcirc, - bigcup: bigcup, - bigodot: bigodot, - bigoplus: bigoplus, - bigotimes: bigotimes, - bigsqcup: bigsqcup, - bigstar: bigstar, - bigtriangledown: bigtriangledown, - bigtriangleup: bigtriangleup, - biguplus: biguplus, - bigvee: bigvee, - bigwedge: bigwedge, - bkarow: bkarow, - blacklozenge: blacklozenge, - blacksquare: blacksquare, - blacktriangle: blacktriangle, - blacktriangledown: blacktriangledown, - blacktriangleleft: blacktriangleleft, - blacktriangleright: blacktriangleright, - blank: blank, - blk12: blk12, - blk14: blk14, - blk34: blk34, - block: block, - bne: bne, - bnequiv: bnequiv, - bnot: bnot, - bopf: bopf, - bot: bot, - bottom: bottom, - bowtie: bowtie, - boxDL: boxDL, - boxDR: boxDR, - boxDl: boxDl, - boxDr: boxDr, - boxH: boxH, - boxHD: boxHD, - boxHU: boxHU, - boxHd: boxHd, - boxHu: boxHu, - boxUL: boxUL, - boxUR: boxUR, - boxUl: boxUl, - boxUr: boxUr, - boxV: boxV, - boxVH: boxVH, - boxVL: boxVL, - boxVR: boxVR, - boxVh: boxVh, - boxVl: boxVl, - boxVr: boxVr, - boxbox: boxbox, - boxdL: boxdL, - boxdR: boxdR, - boxdl: boxdl, - boxdr: boxdr, - boxh: boxh, - boxhD: boxhD, - boxhU: boxhU, - boxhd: boxhd, - boxhu: boxhu, - boxminus: boxminus, - boxplus: boxplus, - boxtimes: boxtimes, - boxuL: boxuL, - boxuR: boxuR, - boxul: boxul, - boxur: boxur, - boxv: boxv, - boxvH: boxvH, - boxvL: boxvL, - boxvR: boxvR, - boxvh: boxvh, - boxvl: boxvl, - boxvr: boxvr, - bprime: bprime, - breve: breve, - brvba: brvba, - brvbar: brvbar, - bscr: bscr, - bsemi: bsemi, - bsim: bsim, - bsime: bsime, - bsol: bsol, - bsolb: bsolb, - bsolhsub: bsolhsub, - bull: bull, - bullet: bullet, - bump: bump, - bumpE: bumpE, - bumpe: bumpe, - bumpeq: bumpeq, - cacute: cacute, - cap: cap, - capand: capand, - capbrcup: capbrcup, - capcap: capcap, - capcup: capcup, - capdot: capdot, - caps: caps, - caret: caret, - caron: caron, - ccaps: ccaps, - ccaron: ccaron, - ccedi: ccedi, - ccedil: ccedil, - ccirc: ccirc, - ccups: ccups, - ccupssm: ccupssm, - cdot: cdot, - cedi: cedi, - cedil: cedil, - cemptyv: cemptyv, - cen: cen, - cent: cent, - centerdot: centerdot, - cfr: cfr, - chcy: chcy, - check: check$2, - checkmark: checkmark, - chi: chi, - cir: cir, - cirE: cirE, - circ: circ, - circeq: circeq, - circlearrowleft: circlearrowleft, - circlearrowright: circlearrowright, - circledR: circledR, - circledS: circledS, - circledast: circledast, - circledcirc: circledcirc, - circleddash: circleddash, - cire: cire, - cirfnint: cirfnint, - cirmid: cirmid, - cirscir: cirscir, - clubs: clubs, - clubsuit: clubsuit, - colon: colon, - colone: colone, - coloneq: coloneq, - comma: comma, - commat: commat, - comp: comp, - compfn: compfn, - complement: complement, - complexes: complexes, - cong: cong, - congdot: congdot, - conint: conint, - copf: copf, - coprod: coprod, - cop: cop, - copy: copy$1, - copysr: copysr, - crarr: crarr, - cross: cross, - cscr: cscr, - csub: csub, - csube: csube, - csup: csup, - csupe: csupe, - ctdot: ctdot, - cudarrl: cudarrl, - cudarrr: cudarrr, - cuepr: cuepr, - cuesc: cuesc, - cularr: cularr, - cularrp: cularrp, - cup: cup, - cupbrcap: cupbrcap, - cupcap: cupcap, - cupcup: cupcup, - cupdot: cupdot, - cupor: cupor, - cups: cups, - curarr: curarr, - curarrm: curarrm, - curlyeqprec: curlyeqprec, - curlyeqsucc: curlyeqsucc, - curlyvee: curlyvee, - curlywedge: curlywedge, - curre: curre, - curren: curren, - curvearrowleft: curvearrowleft, - curvearrowright: curvearrowright, - cuvee: cuvee, - cuwed: cuwed, - cwconint: cwconint, - cwint: cwint, - cylcty: cylcty, - dArr: dArr, - dHar: dHar, - dagger: dagger, - daleth: daleth, - darr: darr, - dash: dash, - dashv: dashv, - dbkarow: dbkarow, - dblac: dblac, - dcaron: dcaron, - dcy: dcy, - dd: dd, - ddagger: ddagger, - ddarr: ddarr, - ddotseq: ddotseq, - de: de, - deg: deg, - delta: delta, - demptyv: demptyv, - dfisht: dfisht, - dfr: dfr, - dharl: dharl, - dharr: dharr, - diam: diam, - diamond: diamond, - diamondsuit: diamondsuit, - diams: diams, - die: die, - digamma: digamma, - disin: disin, - div: div, - divid: divid, - divide: divide, - divideontimes: divideontimes, - divonx: divonx, - djcy: djcy, - dlcorn: dlcorn, - dlcrop: dlcrop, - dollar: dollar, - dopf: dopf, - dot: dot, - doteq: doteq, - doteqdot: doteqdot, - dotminus: dotminus, - dotplus: dotplus, - dotsquare: dotsquare, - doublebarwedge: doublebarwedge, - downarrow: downarrow, - downdownarrows: downdownarrows, - downharpoonleft: downharpoonleft, - downharpoonright: downharpoonright, - drbkarow: drbkarow, - drcorn: drcorn, - drcrop: drcrop, - dscr: dscr, - dscy: dscy, - dsol: dsol, - dstrok: dstrok, - dtdot: dtdot, - dtri: dtri, - dtrif: dtrif, - duarr: duarr, - duhar: duhar, - dwangle: dwangle, - dzcy: dzcy, - dzigrarr: dzigrarr, - eDDot: eDDot, - eDot: eDot, - eacut: eacut, - eacute: eacute, - easter: easter, - ecaron: ecaron, - ecir: ecir, - ecirc: ecirc, - ecolon: ecolon, - ecy: ecy, - edot: edot, - ee: ee, - efDot: efDot, - efr: efr, - eg: eg, - egrav: egrav, - egrave: egrave, - egs: egs, - egsdot: egsdot, - el: el, - elinters: elinters, - ell: ell, - els: els, - elsdot: elsdot, - emacr: emacr, - empty: empty, - emptyset: emptyset, - emptyv: emptyv, - emsp13: emsp13, - emsp14: emsp14, - emsp: emsp, - eng: eng, - ensp: ensp, - eogon: eogon, - eopf: eopf, - epar: epar, - eparsl: eparsl, - eplus: eplus, - epsi: epsi, - epsilon: epsilon, - epsiv: epsiv, - eqcirc: eqcirc, - eqcolon: eqcolon, - eqsim: eqsim, - eqslantgtr: eqslantgtr, - eqslantless: eqslantless, - equals: equals, - equest: equest, - equiv: equiv, - equivDD: equivDD, - eqvparsl: eqvparsl, - erDot: erDot, - erarr: erarr, - escr: escr, - esdot: esdot, - esim: esim, - eta: eta, - et: et, - eth: eth, - eum: eum, - euml: euml, - euro: euro, - excl: excl, - exist: exist, - expectation: expectation, - exponentiale: exponentiale, - fallingdotseq: fallingdotseq, - fcy: fcy, - female: female, - ffilig: ffilig, - fflig: fflig, - ffllig: ffllig, - ffr: ffr, - filig: filig, - fjlig: fjlig, - flat: flat, - fllig: fllig, - fltns: fltns, - fnof: fnof, - fopf: fopf, - forall: forall, - fork: fork, - forkv: forkv, - fpartint: fpartint, - frac1: frac1, - frac12: frac12, - frac13: frac13, - frac14: frac14, - frac15: frac15, - frac16: frac16, - frac18: frac18, - frac23: frac23, - frac25: frac25, - frac3: frac3, - frac34: frac34, - frac35: frac35, - frac38: frac38, - frac45: frac45, - frac56: frac56, - frac58: frac58, - frac78: frac78, - frasl: frasl, - frown: frown, - fscr: fscr, - gE: gE, - gEl: gEl, - gacute: gacute, - gamma: gamma, - gammad: gammad, - gap: gap, - gbreve: gbreve, - gcirc: gcirc, - gcy: gcy, - gdot: gdot, - ge: ge, - gel: gel, - geq: geq, - geqq: geqq, - geqslant: geqslant, - ges: ges, - gescc: gescc, - gesdot: gesdot, - gesdoto: gesdoto, - gesdotol: gesdotol, - gesl: gesl, - gesles: gesles, - gfr: gfr, - gg: gg, - ggg: ggg, - gimel: gimel, - gjcy: gjcy, - gl: gl, - glE: glE, - gla: gla, - glj: glj, - gnE: gnE, - gnap: gnap, - gnapprox: gnapprox, - gne: gne, - gneq: gneq, - gneqq: gneqq, - gnsim: gnsim, - gopf: gopf, - grave: grave, - gscr: gscr, - gsim: gsim, - gsime: gsime, - gsiml: gsiml, - g: g, - gt: gt, - gtcc: gtcc, - gtcir: gtcir, - gtdot: gtdot, - gtlPar: gtlPar, - gtquest: gtquest, - gtrapprox: gtrapprox, - gtrarr: gtrarr, - gtrdot: gtrdot, - gtreqless: gtreqless, - gtreqqless: gtreqqless, - gtrless: gtrless, - gtrsim: gtrsim, - gvertneqq: gvertneqq, - gvnE: gvnE, - hArr: hArr, - hairsp: hairsp, - half: half, - hamilt: hamilt, - hardcy: hardcy, - harr: harr, - harrcir: harrcir, - harrw: harrw, - hbar: hbar, - hcirc: hcirc, - hearts: hearts, - heartsuit: heartsuit, - hellip: hellip, - hercon: hercon, - hfr: hfr, - hksearow: hksearow, - hkswarow: hkswarow, - hoarr: hoarr, - homtht: homtht, - hookleftarrow: hookleftarrow, - hookrightarrow: hookrightarrow, - hopf: hopf, - horbar: horbar, - hscr: hscr, - hslash: hslash, - hstrok: hstrok, - hybull: hybull, - hyphen: hyphen, - iacut: iacut, - iacute: iacute, - ic: ic, - icir: icir, - icirc: icirc, - icy: icy, - iecy: iecy, - iexc: iexc, - iexcl: iexcl, - iff: iff, - ifr: ifr, - igrav: igrav, - igrave: igrave, - ii: ii, - iiiint: iiiint, - iiint: iiint, - iinfin: iinfin, - iiota: iiota, - ijlig: ijlig, - imacr: imacr, - image: image, - imagline: imagline, - imagpart: imagpart, - imath: imath, - imof: imof, - imped: imped, - incare: incare, - infin: infin, - infintie: infintie, - inodot: inodot, - int: int, - intcal: intcal, - integers: integers, - intercal: intercal, - intlarhk: intlarhk, - intprod: intprod, - iocy: iocy, - iogon: iogon, - iopf: iopf, - iota: iota, - iprod: iprod, - iques: iques, - iquest: iquest, - iscr: iscr, - isin: isin, - isinE: isinE, - isindot: isindot, - isins: isins, - isinsv: isinsv, - isinv: isinv, - it: it, - itilde: itilde, - iukcy: iukcy, - ium: ium, - iuml: iuml, - jcirc: jcirc, - jcy: jcy, - jfr: jfr, - jmath: jmath, - jopf: jopf, - jscr: jscr, - jsercy: jsercy, - jukcy: jukcy, - kappa: kappa, - kappav: kappav, - kcedil: kcedil, - kcy: kcy, - kfr: kfr, - kgreen: kgreen, - khcy: khcy, - kjcy: kjcy, - kopf: kopf, - kscr: kscr, - lAarr: lAarr, - lArr: lArr, - lAtail: lAtail, - lBarr: lBarr, - lE: lE, - lEg: lEg, - lHar: lHar, - lacute: lacute, - laemptyv: laemptyv, - lagran: lagran, - lambda: lambda, - lang: lang, - langd: langd, - langle: langle, - lap: lap, - laqu: laqu, - laquo: laquo, - larr: larr, - larrb: larrb, - larrbfs: larrbfs, - larrfs: larrfs, - larrhk: larrhk, - larrlp: larrlp, - larrpl: larrpl, - larrsim: larrsim, - larrtl: larrtl, - lat: lat, - latail: latail, - late: late, - lates: lates, - lbarr: lbarr, - lbbrk: lbbrk, - lbrace: lbrace, - lbrack: lbrack, - lbrke: lbrke, - lbrksld: lbrksld, - lbrkslu: lbrkslu, - lcaron: lcaron, - lcedil: lcedil, - lceil: lceil, - lcub: lcub, - lcy: lcy, - ldca: ldca, - ldquo: ldquo, - ldquor: ldquor, - ldrdhar: ldrdhar, - ldrushar: ldrushar, - ldsh: ldsh, - le: le, - leftarrow: leftarrow, - leftarrowtail: leftarrowtail, - leftharpoondown: leftharpoondown, - leftharpoonup: leftharpoonup, - leftleftarrows: leftleftarrows, - leftrightarrow: leftrightarrow, - leftrightarrows: leftrightarrows, - leftrightharpoons: leftrightharpoons, - leftrightsquigarrow: leftrightsquigarrow, - leftthreetimes: leftthreetimes, - leg: leg, - leq: leq, - leqq: leqq, - leqslant: leqslant, - les: les, - lescc: lescc, - lesdot: lesdot, - lesdoto: lesdoto, - lesdotor: lesdotor, - lesg: lesg, - lesges: lesges, - lessapprox: lessapprox, - lessdot: lessdot, - lesseqgtr: lesseqgtr, - lesseqqgtr: lesseqqgtr, - lessgtr: lessgtr, - lesssim: lesssim, - lfisht: lfisht, - lfloor: lfloor, - lfr: lfr, - lg: lg, - lgE: lgE, - lhard: lhard, - lharu: lharu, - lharul: lharul, - lhblk: lhblk, - ljcy: ljcy, - ll: ll, - llarr: llarr, - llcorner: llcorner, - llhard: llhard, - lltri: lltri, - lmidot: lmidot, - lmoust: lmoust, - lmoustache: lmoustache, - lnE: lnE, - lnap: lnap, - lnapprox: lnapprox, - lne: lne, - lneq: lneq, - lneqq: lneqq, - lnsim: lnsim, - loang: loang, - loarr: loarr, - lobrk: lobrk, - longleftarrow: longleftarrow, - longleftrightarrow: longleftrightarrow, - longmapsto: longmapsto, - longrightarrow: longrightarrow, - looparrowleft: looparrowleft, - looparrowright: looparrowright, - lopar: lopar, - lopf: lopf, - loplus: loplus, - lotimes: lotimes, - lowast: lowast, - lowbar: lowbar, - loz: loz, - lozenge: lozenge, - lozf: lozf, - lpar: lpar, - lparlt: lparlt, - lrarr: lrarr, - lrcorner: lrcorner, - lrhar: lrhar, - lrhard: lrhard, - lrm: lrm, - lrtri: lrtri, - lsaquo: lsaquo, - lscr: lscr, - lsh: lsh, - lsim: lsim, - lsime: lsime, - lsimg: lsimg, - lsqb: lsqb, - lsquo: lsquo, - lsquor: lsquor, - lstrok: lstrok, - l: l, - lt: lt, - ltcc: ltcc, - ltcir: ltcir, - ltdot: ltdot, - lthree: lthree, - ltimes: ltimes, - ltlarr: ltlarr, - ltquest: ltquest, - ltrPar: ltrPar, - ltri: ltri, - ltrie: ltrie, - ltrif: ltrif, - lurdshar: lurdshar, - luruhar: luruhar, - lvertneqq: lvertneqq, - lvnE: lvnE, - mDDot: mDDot, - mac: mac, - macr: macr, - male: male, - malt: malt, - maltese: maltese, - map: map$2, - mapsto: mapsto, - mapstodown: mapstodown, - mapstoleft: mapstoleft, - mapstoup: mapstoup, - marker: marker, - mcomma: mcomma, - mcy: mcy, - mdash: mdash, - measuredangle: measuredangle, - mfr: mfr, - mho: mho, - micr: micr, - micro: micro, - mid: mid, - midast: midast, - midcir: midcir, - middo: middo, - middot: middot, - minus: minus, - minusb: minusb, - minusd: minusd, - minusdu: minusdu, - mlcp: mlcp, - mldr: mldr, - mnplus: mnplus, - models: models$2, - mopf: mopf, - mp: mp, - mscr: mscr, - mstpos: mstpos, - mu: mu, - multimap: multimap, - mumap: mumap, - nGg: nGg, - nGt: nGt, - nGtv: nGtv, - nLeftarrow: nLeftarrow, - nLeftrightarrow: nLeftrightarrow, - nLl: nLl, - nLt: nLt, - nLtv: nLtv, - nRightarrow: nRightarrow, - nVDash: nVDash, - nVdash: nVdash, - nabla: nabla, - nacute: nacute, - nang: nang, - nap: nap, - napE: napE, - napid: napid, - napos: napos, - napprox: napprox, - natur: natur, - natural: natural, - naturals: naturals, - nbs: nbs, - nbsp: nbsp, - nbump: nbump, - nbumpe: nbumpe, - ncap: ncap, - ncaron: ncaron, - ncedil: ncedil, - ncong: ncong, - ncongdot: ncongdot, - ncup: ncup, - ncy: ncy, - ndash: ndash, - ne: ne, - neArr: neArr, - nearhk: nearhk, - nearr: nearr, - nearrow: nearrow, - nedot: nedot, - nequiv: nequiv, - nesear: nesear, - nesim: nesim, - nexist: nexist, - nexists: nexists, - nfr: nfr, - ngE: ngE, - nge: nge, - ngeq: ngeq, - ngeqq: ngeqq, - ngeqslant: ngeqslant, - nges: nges, - ngsim: ngsim, - ngt: ngt, - ngtr: ngtr, - nhArr: nhArr, - nharr: nharr, - nhpar: nhpar, - ni: ni, - nis: nis, - nisd: nisd, - niv: niv, - njcy: njcy, - nlArr: nlArr, - nlE: nlE, - nlarr: nlarr, - nldr: nldr, - nle: nle, - nleftarrow: nleftarrow, - nleftrightarrow: nleftrightarrow, - nleq: nleq, - nleqq: nleqq, - nleqslant: nleqslant, - nles: nles, - nless: nless, - nlsim: nlsim, - nlt: nlt, - nltri: nltri, - nltrie: nltrie, - nmid: nmid, - nopf: nopf, - no: no, - not: not, - notin: notin, - notinE: notinE, - notindot: notindot, - notinva: notinva, - notinvb: notinvb, - notinvc: notinvc, - notni: notni, - notniva: notniva, - notnivb: notnivb, - notnivc: notnivc, - npar: npar, - nparallel: nparallel, - nparsl: nparsl, - npart: npart, - npolint: npolint, - npr: npr, - nprcue: nprcue, - npre: npre, - nprec: nprec, - npreceq: npreceq, - nrArr: nrArr, - nrarr: nrarr, - nrarrc: nrarrc, - nrarrw: nrarrw, - nrightarrow: nrightarrow, - nrtri: nrtri, - nrtrie: nrtrie, - nsc: nsc, - nsccue: nsccue, - nsce: nsce, - nscr: nscr, - nshortmid: nshortmid, - nshortparallel: nshortparallel, - nsim: nsim, - nsime: nsime, - nsimeq: nsimeq, - nsmid: nsmid, - nspar: nspar, - nsqsube: nsqsube, - nsqsupe: nsqsupe, - nsub: nsub, - nsubE: nsubE, - nsube: nsube, - nsubset: nsubset, - nsubseteq: nsubseteq, - nsubseteqq: nsubseteqq, - nsucc: nsucc, - nsucceq: nsucceq, - nsup: nsup, - nsupE: nsupE, - nsupe: nsupe, - nsupset: nsupset, - nsupseteq: nsupseteq, - nsupseteqq: nsupseteqq, - ntgl: ntgl, - ntild: ntild, - ntilde: ntilde, - ntlg: ntlg, - ntriangleleft: ntriangleleft, - ntrianglelefteq: ntrianglelefteq, - ntriangleright: ntriangleright, - ntrianglerighteq: ntrianglerighteq, - nu: nu, - num: num, - numero: numero, - numsp: numsp, - nvDash: nvDash, - nvHarr: nvHarr, - nvap: nvap, - nvdash: nvdash, - nvge: nvge, - nvgt: nvgt, - nvinfin: nvinfin, - nvlArr: nvlArr, - nvle: nvle, - nvlt: nvlt, - nvltrie: nvltrie, - nvrArr: nvrArr, - nvrtrie: nvrtrie, - nvsim: nvsim, - nwArr: nwArr, - nwarhk: nwarhk, - nwarr: nwarr, - nwarrow: nwarrow, - nwnear: nwnear, - oS: oS, - oacut: oacut, - oacute: oacute, - oast: oast, - ocir: ocir, - ocirc: ocirc, - ocy: ocy, - odash: odash, - odblac: odblac, - odiv: odiv, - odot: odot, - odsold: odsold, - oelig: oelig, - ofcir: ofcir, - ofr: ofr, - ogon: ogon, - ograv: ograv, - ograve: ograve, - ogt: ogt, - ohbar: ohbar, - ohm: ohm, - oint: oint, - olarr: olarr, - olcir: olcir, - olcross: olcross, - oline: oline, - olt: olt, - omacr: omacr, - omega: omega, - omicron: omicron, - omid: omid, - ominus: ominus, - oopf: oopf, - opar: opar, - operp: operp, - oplus: oplus, - or: or, - orarr: orarr, - ord: ord, - order: order$1, - orderof: orderof, - ordf: ordf, - ordm: ordm, - origof: origof, - oror: oror, - orslope: orslope, - orv: orv, - oscr: oscr, - oslas: oslas, - oslash: oslash, - osol: osol, - otild: otild, - otilde: otilde, - otimes: otimes, - otimesas: otimesas, - oum: oum, - ouml: ouml, - ovbar: ovbar, - par: par, - para: para, - parallel: parallel, - parsim: parsim, - parsl: parsl, - part: part, - pcy: pcy, - percnt: percnt, - period: period, - permil: permil, - perp: perp, - pertenk: pertenk, - pfr: pfr, - phi: phi, - phiv: phiv, - phmmat: phmmat, - phone: phone, - pi: pi, - pitchfork: pitchfork, - piv: piv, - planck: planck, - planckh: planckh, - plankv: plankv, - plus: plus, - plusacir: plusacir, - plusb: plusb, - pluscir: pluscir, - plusdo: plusdo, - plusdu: plusdu, - pluse: pluse, - plusm: plusm, - plusmn: plusmn, - plussim: plussim, - plustwo: plustwo, - pm: pm, - pointint: pointint, - popf: popf, - poun: poun, - pound: pound, - pr: pr, - prE: prE, - prap: prap, - prcue: prcue, - pre: pre, - prec: prec, - precapprox: precapprox, - preccurlyeq: preccurlyeq, - preceq: preceq, - precnapprox: precnapprox, - precneqq: precneqq, - precnsim: precnsim, - precsim: precsim, - prime: prime, - primes: primes, - prnE: prnE, - prnap: prnap, - prnsim: prnsim, - prod: prod, - profalar: profalar, - profline: profline, - profsurf: profsurf, - prop: prop, - propto: propto, - prsim: prsim, - prurel: prurel, - pscr: pscr, - psi: psi, - puncsp: puncsp, - qfr: qfr, - qint: qint, - qopf: qopf, - qprime: qprime, - qscr: qscr, - quaternions: quaternions, - quatint: quatint, - quest: quest, - questeq: questeq, - quo: quo, - quot: quot, - rAarr: rAarr, - rArr: rArr, - rAtail: rAtail, - rBarr: rBarr, - rHar: rHar, - race: race, - racute: racute, - radic: radic, - raemptyv: raemptyv, - rang: rang, - rangd: rangd, - range: range$1, - rangle: rangle, - raqu: raqu, - raquo: raquo, - rarr: rarr, - rarrap: rarrap, - rarrb: rarrb, - rarrbfs: rarrbfs, - rarrc: rarrc, - rarrfs: rarrfs, - rarrhk: rarrhk, - rarrlp: rarrlp, - rarrpl: rarrpl, - rarrsim: rarrsim, - rarrtl: rarrtl, - rarrw: rarrw, - ratail: ratail, - ratio: ratio, - rationals: rationals, - rbarr: rbarr, - rbbrk: rbbrk, - rbrace: rbrace, - rbrack: rbrack, - rbrke: rbrke, - rbrksld: rbrksld, - rbrkslu: rbrkslu, - rcaron: rcaron, - rcedil: rcedil, - rceil: rceil, - rcub: rcub, - rcy: rcy, - rdca: rdca, - rdldhar: rdldhar, - rdquo: rdquo, - rdquor: rdquor, - rdsh: rdsh, - real: real, - realine: realine, - realpart: realpart, - reals: reals, - rect: rect, - re: re, - reg: reg, - rfisht: rfisht, - rfloor: rfloor, - rfr: rfr, - rhard: rhard, - rharu: rharu, - rharul: rharul, - rho: rho, - rhov: rhov, - rightarrow: rightarrow, - rightarrowtail: rightarrowtail, - rightharpoondown: rightharpoondown, - rightharpoonup: rightharpoonup, - rightleftarrows: rightleftarrows, - rightleftharpoons: rightleftharpoons, - rightrightarrows: rightrightarrows, - rightsquigarrow: rightsquigarrow, - rightthreetimes: rightthreetimes, - ring: ring, - risingdotseq: risingdotseq, - rlarr: rlarr, - rlhar: rlhar, - rlm: rlm, - rmoust: rmoust, - rmoustache: rmoustache, - rnmid: rnmid, - roang: roang, - roarr: roarr, - robrk: robrk, - ropar: ropar, - ropf: ropf, - roplus: roplus, - rotimes: rotimes, - rpar: rpar, - rpargt: rpargt, - rppolint: rppolint, - rrarr: rrarr, - rsaquo: rsaquo, - rscr: rscr, - rsh: rsh, - rsqb: rsqb, - rsquo: rsquo, - rsquor: rsquor, - rthree: rthree, - rtimes: rtimes, - rtri: rtri, - rtrie: rtrie, - rtrif: rtrif, - rtriltri: rtriltri, - ruluhar: ruluhar, - rx: rx, - sacute: sacute, - sbquo: sbquo, - sc: sc, - scE: scE, - scap: scap, - scaron: scaron, - sccue: sccue, - sce: sce, - scedil: scedil, - scirc: scirc, - scnE: scnE, - scnap: scnap, - scnsim: scnsim, - scpolint: scpolint, - scsim: scsim, - scy: scy, - sdot: sdot, - sdotb: sdotb, - sdote: sdote, - seArr: seArr, - searhk: searhk, - searr: searr, - searrow: searrow, - sec: sec, - sect: sect, - semi: semi, - seswar: seswar, - setminus: setminus, - setmn: setmn, - sext: sext, - sfr: sfr, - sfrown: sfrown, - sharp: sharp, - shchcy: shchcy, - shcy: shcy, - shortmid: shortmid, - shortparallel: shortparallel, - sh: sh, - shy: shy, - sigma: sigma, - sigmaf: sigmaf, - sigmav: sigmav, - sim: sim, - simdot: simdot, - sime: sime, - simeq: simeq, - simg: simg, - simgE: simgE, - siml: siml, - simlE: simlE, - simne: simne, - simplus: simplus, - simrarr: simrarr, - slarr: slarr, - smallsetminus: smallsetminus, - smashp: smashp, - smeparsl: smeparsl, - smid: smid, - smile: smile, - smt: smt, - smte: smte, - smtes: smtes, - softcy: softcy, - sol: sol, - solb: solb, - solbar: solbar, - sopf: sopf, - spades: spades, - spadesuit: spadesuit, - spar: spar, - sqcap: sqcap, - sqcaps: sqcaps, - sqcup: sqcup, - sqcups: sqcups, - sqsub: sqsub, - sqsube: sqsube, - sqsubset: sqsubset, - sqsubseteq: sqsubseteq, - sqsup: sqsup, - sqsupe: sqsupe, - sqsupset: sqsupset, - sqsupseteq: sqsupseteq, - squ: squ, - square: square, - squarf: squarf, - squf: squf, - srarr: srarr, - sscr: sscr, - ssetmn: ssetmn, - ssmile: ssmile, - sstarf: sstarf, - star: star$1, - starf: starf, - straightepsilon: straightepsilon, - straightphi: straightphi, - strns: strns, - sub: sub, - subE: subE, - subdot: subdot, - sube: sube, - subedot: subedot, - submult: submult, - subnE: subnE, - subne: subne, - subplus: subplus, - subrarr: subrarr, - subset: subset, - subseteq: subseteq, - subseteqq: subseteqq, - subsetneq: subsetneq, - subsetneqq: subsetneqq, - subsim: subsim, - subsub: subsub, - subsup: subsup, - succ: succ, - succapprox: succapprox, - succcurlyeq: succcurlyeq, - succeq: succeq, - succnapprox: succnapprox, - succneqq: succneqq, - succnsim: succnsim, - succsim: succsim, - sum: sum, - sung: sung, - sup: sup, - sup1: sup1, - sup2: sup2, - sup3: sup3, - supE: supE, - supdot: supdot, - supdsub: supdsub, - supe: supe, - supedot: supedot, - suphsol: suphsol, - suphsub: suphsub, - suplarr: suplarr, - supmult: supmult, - supnE: supnE, - supne: supne, - supplus: supplus, - supset: supset, - supseteq: supseteq, - supseteqq: supseteqq, - supsetneq: supsetneq, - supsetneqq: supsetneqq, - supsim: supsim, - supsub: supsub, - supsup: supsup, - swArr: swArr, - swarhk: swarhk, - swarr: swarr, - swarrow: swarrow, - swnwar: swnwar, - szli: szli, - szlig: szlig, - target: target, - tau: tau, - tbrk: tbrk, - tcaron: tcaron, - tcedil: tcedil, - tcy: tcy, - tdot: tdot, - telrec: telrec, - tfr: tfr, - there4: there4, - therefore: therefore, - theta: theta, - thetasym: thetasym, - thetav: thetav, - thickapprox: thickapprox, - thicksim: thicksim, - thinsp: thinsp, - thkap: thkap, - thksim: thksim, - thor: thor, - thorn: thorn, - tilde: tilde, - time: time, - times: times, - timesb: timesb, - timesbar: timesbar, - timesd: timesd, - tint: tint, - toea: toea, - top: top, - topbot: topbot, - topcir: topcir, - topf: topf, - topfork: topfork, - tosa: tosa, - tprime: tprime, - trade: trade, - triangle: triangle, - triangledown: triangledown, - triangleleft: triangleleft, - trianglelefteq: trianglelefteq, - triangleq: triangleq, - triangleright: triangleright, - trianglerighteq: trianglerighteq, - tridot: tridot, - trie: trie, - triminus: triminus, - triplus: triplus, - trisb: trisb, - tritime: tritime, - trpezium: trpezium, - tscr: tscr, - tscy: tscy, - tshcy: tshcy, - tstrok: tstrok, - twixt: twixt, - twoheadleftarrow: twoheadleftarrow, - twoheadrightarrow: twoheadrightarrow, - uArr: uArr, - uHar: uHar, - uacut: uacut, - uacute: uacute, - uarr: uarr, - ubrcy: ubrcy, - ubreve: ubreve, - ucir: ucir, - ucirc: ucirc, - ucy: ucy, - udarr: udarr, - udblac: udblac, - udhar: udhar, - ufisht: ufisht, - ufr: ufr, - ugrav: ugrav, - ugrave: ugrave, - uharl: uharl, - uharr: uharr, - uhblk: uhblk, - ulcorn: ulcorn, - ulcorner: ulcorner, - ulcrop: ulcrop, - ultri: ultri, - umacr: umacr, - um: um, - uml: uml, - uogon: uogon, - uopf: uopf, - uparrow: uparrow, - updownarrow: updownarrow, - upharpoonleft: upharpoonleft, - upharpoonright: upharpoonright, - uplus: uplus, - upsi: upsi, - upsih: upsih, - upsilon: upsilon, - upuparrows: upuparrows, - urcorn: urcorn, - urcorner: urcorner, - urcrop: urcrop, - uring: uring, - urtri: urtri, - uscr: uscr, - utdot: utdot, - utilde: utilde, - utri: utri, - utrif: utrif, - uuarr: uuarr, - uum: uum, - uuml: uuml, - uwangle: uwangle, - vArr: vArr, - vBar: vBar, - vBarv: vBarv, - vDash: vDash, - vangrt: vangrt, - varepsilon: varepsilon, - varkappa: varkappa, - varnothing: varnothing, - varphi: varphi, - varpi: varpi, - varpropto: varpropto, - varr: varr, - varrho: varrho, - varsigma: varsigma, - varsubsetneq: varsubsetneq, - varsubsetneqq: varsubsetneqq, - varsupsetneq: varsupsetneq, - varsupsetneqq: varsupsetneqq, - vartheta: vartheta, - vartriangleleft: vartriangleleft, - vartriangleright: vartriangleright, - vcy: vcy, - vdash: vdash, - vee: vee, - veebar: veebar, - veeeq: veeeq, - vellip: vellip, - verbar: verbar, - vert: vert, - vfr: vfr, - vltri: vltri, - vnsub: vnsub, - vnsup: vnsup, - vopf: vopf, - vprop: vprop, - vrtri: vrtri, - vscr: vscr, - vsubnE: vsubnE, - vsubne: vsubne, - vsupnE: vsupnE, - vsupne: vsupne, - vzigzag: vzigzag, - wcirc: wcirc, - wedbar: wedbar, - wedge: wedge, - wedgeq: wedgeq, - weierp: weierp, - wfr: wfr, - wopf: wopf, - wp: wp, - wr: wr, - wreath: wreath, - wscr: wscr, - xcap: xcap, - xcirc: xcirc, - xcup: xcup, - xdtri: xdtri, - xfr: xfr, - xhArr: xhArr, - xharr: xharr, - xi: xi, - xlArr: xlArr, - xlarr: xlarr, - xmap: xmap, - xnis: xnis, - xodot: xodot, - xopf: xopf, - xoplus: xoplus, - xotime: xotime, - xrArr: xrArr, - xrarr: xrarr, - xscr: xscr, - xsqcup: xsqcup, - xuplus: xuplus, - xutri: xutri, - xvee: xvee, - xwedge: xwedge, - yacut: yacut, - yacute: yacute, - yacy: yacy, - ycirc: ycirc, - ycy: ycy, - ye: ye, - yen: yen, - yfr: yfr, - yicy: yicy, - yopf: yopf, - yscr: yscr, - yucy: yucy, - yum: yum, - yuml: yuml, - zacute: zacute, - zcaron: zcaron, - zcy: zcy, - zdot: zdot, - zeetrf: zeetrf, - zeta: zeta, - zfr: zfr, - zhcy: zhcy, - zigrarr: zigrarr, - zopf: zopf, - zscr: zscr, - zwj: zwj, - zwnj: zwnj, - 'default': index$1 -}); - -var characterEntities$1 = getCjsExportFromNamespace(characterEntities); - -var decodeEntity_1 = decodeEntity; - -var own$3 = {}.hasOwnProperty; - -function decodeEntity(characters) { - return own$3.call(characterEntities$1, characters) - ? characterEntities$1[characters] - : false -} - var mdastUtilToString = toString$3; // Get the text content of a node. @@ -34842,28 +27915,28 @@ function toString$3(node) { function all(values) { var result = []; - var length = values.length; var index = -1; - while (++index < length) { + while (++index < values.length) { result[index] = toString$3(values[index]); } return result.join('') } -var hasOwnProperty_1 = {}.hasOwnProperty; +var assign = Object.assign; + +var assign_1 = assign; -var normalizeIdentifier_1 = normalizeIdentifier; +var own$3 = {}.hasOwnProperty; + +var hasOwnProperty = own$3; 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 + 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. @@ -34874,11 +27947,11 @@ function normalizeIdentifier(value) { ) } -var fromCharCode = String.fromCharCode; - -var safeFromInt_1 = safeFromInt; +var normalizeIdentifier_1 = normalizeIdentifier; +var fromCharCode = String.fromCharCode; +var fromCharCode_1 = fromCharCode; function safeFromInt(value, base) { var code = parseInt(value, base); @@ -34887,50 +27960,52 @@ function safeFromInt(value, base) { // C0 except for HT, LF, FF, CR, space code < 9 || code === 11 || - (code > 13 && code < 32) || - // Control character (DEL) of the basic block and C1 controls. - (code > 126 && code < 160) || - // Lone high surrogates and low surrogates. - (code > 55295 && code < 57344) || - // Noncharacters. + (code > 13 && code < 32) || // Control character (DEL) of the basic block and C1 controls. + (code > 126 && code < 160) || // Lone high surrogates and low surrogates. + (code > 55295 && code < 57344) || // Noncharacters. (code > 64975 && code < 65008) || (code & 65535) === 65535 || - (code & 65535) === 65534 || - // Out of range + (code & 65535) === 65534 || // Out of range code > 1114111 ) { return '\uFFFD' } - return fromCharCode(code) + return fromCharCode_1(code) } -var markdownLineEnding_1 = markdownLineEnding; +var safeFromInt_1 = safeFromInt; + +function miniflat(value) { + return value === null || value === undefined + ? [] + : 'length' in value + ? value + : [value] +} + +var miniflat_1 = miniflat; function markdownLineEnding(code) { return code < -2 } -var markdownSpace_1 = markdownSpace; +var markdownLineEnding_1 = markdownLineEnding; function markdownSpace(code) { return code === -2 || code === -1 || code === 32 } -var factorySpace = createSpace; - - +var markdownSpace_1 = markdownSpace; -function createSpace(effects, ok, type, max) { +function spaceFactory(effects, ok, type, max) { var limit = max ? max - 1 : Infinity; - var size; - + var size = 0; return start function start(code) { if (markdownSpace_1(code)) { effects.enter(type); - size = 0; return prefix(code) } @@ -34948,11 +28023,9 @@ function createSpace(effects, ok, type, max) { } } -var tokenize = initializeContent; - - - +var factorySpace = spaceFactory; +var tokenize = initializeContent; function initializeContent(effects) { var contentStart = effects.attempt( @@ -34960,9 +28033,7 @@ function initializeContent(effects) { afterContentStartConstruct, paragraphInitial ); - var previous; - return contentStart function afterContentStartConstruct(code) { @@ -34993,7 +28064,6 @@ function initializeContent(effects) { } previous = token; - return data(code) } @@ -35009,26 +28079,25 @@ function initializeContent(effects) { effects.consume(code); effects.exit('chunkText'); return lineStart - } + } // Data. - // Data. effects.consume(code); return data } } -var content = { - tokenize: tokenize -}; - -var tokenize$1 = tokenizeBlankLine; -var partial = true; - - +var tokenize_1 = tokenize; +var content = /*#__PURE__*/Object.defineProperty({ + tokenize: tokenize_1 +}, '__esModule', {value: true}); +var partialBlankLine = { + tokenize: tokenizePartialBlankLine, + partial: true +}; -function tokenizeBlankLine(effects, ok, nok) { +function tokenizePartialBlankLine(effects, ok, nok) { return factorySpace(effects, afterWhitespace, 'linePrefix') function afterWhitespace(code) { @@ -35036,29 +28105,27 @@ function tokenizeBlankLine(effects, ok, nok) { } } -var partialBlankLine = { - tokenize: tokenize$1, - partial: partial -}; - -var tokenize$2 = initializeDocument; - - +var partialBlankLine_1 = partialBlankLine; - - - -var container = {tokenize: tokenizeContainer}; -var lazyFlow = {tokenize: tokenizeLazyFlow}; +var tokenize$1 = initializeDocument; +var containerConstruct = { + tokenize: tokenizeContainer +}; +var lazyFlowConstruct = { + tokenize: tokenizeLazyFlow +}; function initializeDocument(effects) { var self = this; var stack = []; var continued = 0; + var inspectConstruct = { + tokenize: tokenizeInspect, + partial: true + }; var inspectResult; var childFlow; var childToken; - return start function start(code) { @@ -35091,7 +28158,11 @@ function initializeDocument(effects) { childFlow.currentConstruct && childFlow.currentConstruct.interruptible; self.containerState = {}; - return effects.attempt(container, containerContinue, flowStart)(code) + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code) } function containerContinue(code) { @@ -35108,13 +28179,11 @@ function initializeDocument(effects) { } childFlow = childFlow || self.parser.flow(self.now()); - effects.enter('chunkFlow', { contentType: 'flow', previous: childToken, _tokenizer: childFlow }); - return flowContinue(code) } @@ -35127,10 +28196,7 @@ function initializeDocument(effects) { if (markdownLineEnding_1(code)) { effects.consume(code); continueFlow(effects.exit('chunkFlow')); - return effects.check( - {tokenize: tokenizeInspect, partial: true}, - documentAfterPeek - ) + return effects.check(inspectConstruct, documentAfterPeek) } effects.consume(code); @@ -35142,7 +28208,6 @@ function initializeDocument(effects) { inspectResult.continued, inspectResult && inspectResult.flowEnd ); - continued = 0; return start(code) } @@ -35156,15 +28221,13 @@ function initializeDocument(effects) { } function exitContainers(size, end) { - var index = stack.length; + var index = stack.length; // Close the flow. - // Close the flow. if (childFlow && end) { childFlow.write([null]); childToken = childFlow = undefined; - } + } // Exit open containers. - // Exit open containers. while (index-- > size) { self.containerState = stack[index][1]; stack[index][0].exit.call(self, effects); @@ -35175,9 +28238,7 @@ function initializeDocument(effects) { function tokenizeInspect(effects, ok) { var subcontinued = 0; - inspectResult = {}; - return inspectStart function inspectStart(code) { @@ -35188,10 +28249,9 @@ function initializeDocument(effects) { inspectContinue, inspectLess )(code) - } - - // If we’re continued but in a concrete flow, we can’t have more + } // If we’re continued but in a concrete flow, we can’t have more // containers. + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { inspectResult.flowContinue = true; return inspectDone(code) @@ -35200,7 +28260,11 @@ function initializeDocument(effects) { self.interrupt = childFlow.currentConstruct && childFlow.currentConstruct.interruptible; self.containerState = {}; - return effects.attempt(container, inspectFlowEnd, inspectDone)(code) + return effects.attempt( + containerConstruct, + inspectFlowEnd, + inspectDone + )(code) } function inspectContinue(code) { @@ -35215,18 +28279,16 @@ function initializeDocument(effects) { // Maybe another container? self.containerState = {}; return effects.attempt( - container, - inspectFlowEnd, - // Maybe flow, or a blank line? + containerConstruct, + inspectFlowEnd, // Maybe flow, or a blank line? effects.attempt( - lazyFlow, + lazyFlowConstruct, inspectFlowEnd, - effects.check(partialBlankLine, inspectFlowEnd, inspectLazy) + effects.check(partialBlankLine_1, inspectFlowEnd, inspectLazy) ) )(code) - } + } // Otherwise we’re interrupting. - // Otherwise we’re interrupting. return inspectFlowEnd(code) } @@ -35236,9 +28298,8 @@ function initializeDocument(effects) { inspectResult.lazy = true; inspectResult.flowContinue = true; return inspectDone(code) - } + } // We’re done with flow if we have more containers, or an interruption. - // We’re done with flow if we have more containers, or an interruption. function inspectFlowEnd(code) { inspectResult.flowEnd = true; return inspectDone(code) @@ -35257,7 +28318,9 @@ function tokenizeContainer(effects, ok, nok) { effects, effects.attempt(this.parser.constructs.document, ok, nok), 'linePrefix', - 4 + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 ) } @@ -35266,74 +28329,85 @@ function tokenizeLazyFlow(effects, ok, nok) { effects, effects.lazy(this.parser.constructs.flow, ok, nok), 'linePrefix', - 4 + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 ) } -var document$1 = { - tokenize: tokenize$2 -}; +var tokenize_1$1 = tokenize$1; -var assign = Object.assign; +var document$1 = /*#__PURE__*/Object.defineProperty({ + tokenize: tokenize_1$1 +}, '__esModule', {value: true}); -var chunkedSplice_1 = chunkedSplice; +// Counts tabs based on their expanded size, and CR+LF as one character. + +function sizeChunks(chunks) { + var index = -1; + var size = 0; + + while (++index < chunks.length) { + size += typeof chunks[index] === 'string' ? chunks[index].length : 1; + } + + return size +} + +var sizeChunks_1 = sizeChunks; + +function prefixSize(events, type) { + var tail = events[events.length - 1]; + if (!tail || tail[1].type !== type) return 0 + return sizeChunks_1(tail[2].sliceStream(tail[1])) +} + +var prefixSize_1 = prefixSize; + +var splice = [].splice; -var v8MaxSafeChunkSize = 10000; +var splice_1 = splice; -// `Array#splice` takes all items to be inserted as individual argument which // causes a stack overflow in V8 when trying to insert 100k items for instance. + function chunkedSplice(list, start, remove, items) { var end = list.length; var chunkStart = 0; - var result; - var parameters; + var parameters; // Make start between zero and `end` (included). - // Make start between zero and `end` (included). if (start < 0) { start = -start > end ? 0 : end + start; } else { start = start > end ? end : start; } - remove = remove > 0 ? remove : 0; + remove = remove > 0 ? remove : 0; // No need to chunk the items if there’s only a couple (10k) items. - // No need to chunk the items if there’s only a couple (10k) items. - if (items.length < v8MaxSafeChunkSize) { + if (items.length < 10000) { parameters = Array.from(items); parameters.unshift(start, remove); - return [].splice.apply(list, parameters) - } - - // Delete `remove` items starting from `start` - result = [].splice.apply(list, [start, remove]); - - // Insert the items in chunks to not cause stack overflows. - while (chunkStart < items.length) { - parameters = items.slice(chunkStart, chunkStart + v8MaxSafeChunkSize); - parameters.unshift(start, 0) - ;[].splice.apply(list, parameters); + splice_1.apply(list, parameters); + } else { + // Delete `remove` items starting from `start` + if (remove) splice_1.apply(list, [start, remove]); // Insert the items in chunks to not cause stack overflows. - chunkStart += v8MaxSafeChunkSize; - start += v8MaxSafeChunkSize; + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 10000); + parameters.unshift(start, 0); + splice_1.apply(list, parameters); + chunkStart += 10000; + start += 10000; + } } - - return result } -var shallow_1 = shallow; - - +var chunkedSplice_1 = chunkedSplice; function shallow(object) { - return assign({}, object) + return assign_1({}, object) } -var subtokenize_1 = subtokenize; - - - - - +var shallow_1 = shallow; function subtokenize(events) { var jumps = {}; @@ -35351,10 +28425,9 @@ function subtokenize(events) { index = jumps[index]; } - event = events[index]; - - // Add a hook for the GFM tasklist extension, which needs to know if text + event = events[index]; // Add a hook for the GFM tasklist extension, which needs to know if text // is in the first content of a list item. + if ( index && event[1].type === 'chunkFlow' && @@ -35385,17 +28458,15 @@ function subtokenize(events) { } } } - } + } // Enter. - // Enter. if (event[0] === 'enter') { if (event[1].contentType) { - assign(jumps, subcontent(events, index)); + assign_1(jumps, subcontent(events, index)); index = jumps[index]; more = true; } - } - // Exit. + } // Exit. else if (event[1]._container || event[1]._movePreviousLineEndings) { otherIndex = index; lineIndex = undefined; @@ -35422,9 +28493,8 @@ function subtokenize(events) { if (lineIndex) { // Fix position. - event[1].end = shallow_1(events[lineIndex][1].start); + event[1].end = shallow_1(events[lineIndex][1].start); // Switch container exit w/ line endings. - // Switch container exit w/ line endings. parameters = events.slice(lineIndex, index); parameters.unshift(event); chunkedSplice_1(events, lineIndex, index - lineIndex + 1, parameters); @@ -35450,10 +28520,9 @@ function subcontent(events, eventIndex) { var index; var entered; var end; - var adjust; - - // Loop forward through the linked tokens to pass them in order to the + var adjust; // Loop forward through the linked tokens to pass them in order to the // subtokenizer. + while (token) { // Find the position of the event for this token. while (events[++startPosition][1] !== token) { @@ -35482,15 +28551,13 @@ function subcontent(events, eventIndex) { if (token.isInFirstContentOfListItem) { tokenizer._gfmTasklistFirstContentOfListItem = undefined; } - } + } // Unravel the next token. - // Unravel the next token. previous = token; token = token.next; - } - - // Now, loop back through all events (and linked tokens), to figure out which + } // Now, loop back through all events (and linked tokens), to figure out which // parts belong where. + token = previous; index = childEvents.length; @@ -35505,78 +28572,50 @@ function subcontent(events, eventIndex) { childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line ) { - add(childEvents.slice(index + 1, end)); - - // Help GC. - token._tokenizer = token.next = undefined; - token = token.previous; - end = index + 1; - } - } - - // Help GC. - tokenizer.events = token._tokenizer = token.next = undefined; - - // Do head: - add(childEvents.slice(0, end)); - - index = -1; - adjust = 0; - - while (++index < jumps.length) { - gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]; - adjust += jumps[index][1] - jumps[index][0] - 1; - } - - return gaps - - function add(slice) { - var start = startPositions.pop(); - jumps.unshift([start, start + slice.length - 1]); - chunkedSplice_1(events, start, 2, slice); - } -} - -var sizeChunks_1 = sizeChunks; - -// Measure the number of character codes in chunks. -// Counts tabs based on their expanded size, and CR+LF as one character. -function sizeChunks(chunks) { - var index = -1; - var size = 0; - - while (++index < chunks.length) { - size += typeof chunks[index] === 'string' ? chunks[index].length : 1; - } - - return size -} - -var prefixSize_1 = prefixSize; - - - -function prefixSize(events, type) { - var tail = events[events.length - 1]; - if (!tail || tail[1].type !== type) return 0 - return sizeChunks_1(tail[2].sliceStream(tail[1])) -} - -var tokenize$3 = tokenizeContent; -var resolve$7 = resolveContent; -var interruptible = true; -var lazy = true; - + add(childEvents.slice(index + 1, end)); + // Help GC. + token._tokenizer = token.next = undefined; + token = token.previous; + end = index + 1; + } + } + // Help GC. + tokenizer.events = token._tokenizer = token.next = undefined; // Do head: + add(childEvents.slice(0, end)); + index = -1; + adjust = 0; + while (++index < jumps.length) { + gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]; + adjust += jumps[index][1] - jumps[index][0] - 1; + } + return gaps + function add(slice) { + var start = startPositions.pop(); + jumps.unshift([start, start + slice.length - 1]); + chunkedSplice_1(events, start, 2, slice); + } +} -var lookaheadConstruct = {tokenize: tokenizeLookaheadConstruct, partial: true}; +var subtokenize_1 = subtokenize; -// Content is transparent: it’s parsed right now. That way, definitions are also +// No name because it must not be turned off. +var content$1 = { + tokenize: tokenizeContent, + resolve: resolveContent, + interruptible: true, + lazy: true +}; +var continuationConstruct = { + tokenize: tokenizeContinuation, + partial: true +}; // Content is transparent: it’s parsed right now. That way, definitions are also // parsed right now: before text in paragraphs (specifically, media) are parsed. + function resolveContent(events) { subtokenize_1(events); return events @@ -35584,7 +28623,6 @@ function resolveContent(events) { function tokenizeContent(effects, ok) { var previous; - return start function start(code) { @@ -35592,7 +28630,6 @@ function tokenizeContent(effects, ok) { previous = effects.enter('chunkContent', { contentType: 'content' }); - return data(code) } @@ -35603,13 +28640,12 @@ function tokenizeContent(effects, ok) { if (markdownLineEnding_1(code)) { return effects.check( - lookaheadConstruct, + continuationConstruct, contentContinue, contentEnd )(code) - } + } // Data. - // Data. effects.consume(code); return data } @@ -35627,14 +28663,12 @@ function tokenizeContent(effects, ok) { contentType: 'content', previous: previous }); - return data } } -function tokenizeLookaheadConstruct(effects, ok, nok) { +function tokenizeContinuation(effects, ok, nok) { var self = this; - return startLookahead function startLookahead(code) { @@ -35649,7 +28683,10 @@ function tokenizeLookaheadConstruct(effects, ok, nok) { return nok(code) } - if (prefixSize_1(self.events, 'linePrefix') < 4) { + if ( + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 || + prefixSize_1(self.events, 'linePrefix') < 4 + ) { return effects.interrupt(self.parser.constructs.flow, nok, ok)(code) } @@ -35657,28 +28694,16 @@ function tokenizeLookaheadConstruct(effects, ok, nok) { } } -var content$1 = { - tokenize: tokenize$3, - resolve: resolve$7, - interruptible: interruptible, - lazy: lazy -}; - -var tokenize$4 = initializeFlow; - - - - - +var content_1 = content$1; +var tokenize$2 = initializeFlow; function initializeFlow(effects) { var self = this; var initial = effects.attempt( // Try to parse a blank line. - partialBlankLine, - atBlankEnding, - // Try to parse initial flow (essentially, only code). + partialBlankLine_1, + atBlankEnding, // Try to parse initial flow (essentially, only code). effects.attempt( this.parser.constructs.flowInitial, afterConstruct, @@ -35687,13 +28712,12 @@ function initializeFlow(effects) { effects.attempt( this.parser.constructs.flow, afterConstruct, - effects.attempt(content$1, afterConstruct) + effects.attempt(content_1, afterConstruct) ), 'linePrefix' ) ) ); - return initial function atBlankEnding(code) { @@ -35723,29 +28747,30 @@ function initializeFlow(effects) { } } -var flow = { - tokenize: tokenize$4 -}; - -var text_1 = initializeFactory('text'); -var string = initializeFactory('string'); -var resolver_1 = {resolveAll: resolver()}; - - +var tokenize_1$2 = tokenize$2; +var flow = /*#__PURE__*/Object.defineProperty({ + tokenize: tokenize_1$2 +}, '__esModule', {value: true}); +var text = initializeFactory('text'); +var string = initializeFactory('string'); +var resolver = { + resolveAll: createResolver() +}; function initializeFactory(field) { return { tokenize: initializeText, - resolveAll: resolver(field === 'text' ? resolveAllLineSuffixes : undefined) + resolveAll: createResolver( + field === 'text' ? resolveAllLineSuffixes : undefined + ) } function initializeText(effects) { var self = this; var constructs = this.parser.constructs[field]; var text = effects.attempt(constructs, start, notText); - return start function start(code) { @@ -35767,9 +28792,8 @@ function initializeFactory(field) { if (atBreak(code)) { effects.exit('data'); return text(code) - } + } // Data. - // Data. effects.consume(code); return data } @@ -35796,15 +28820,14 @@ function initializeFactory(field) { } } -function resolver(extraResolver) { +function createResolver(extraResolver) { return resolveAllText function resolveAllText(events, context) { var index = -1; - var enter; - - // A rather boring computation (to merge adjacent `data` events) which + var enter; // A rather boring computation (to merge adjacent `data` events) which // improves mm performance by 29%. + while (++index <= events.length) { if (enter === undefined) { if (events[index] && events[index][1].type === 'data') { @@ -35825,15 +28848,14 @@ function resolver(extraResolver) { return extraResolver ? extraResolver(events, context) : events } -} - -// A rather ugly set of instructions which again looks at chunks in the input +} // A rather ugly set of instructions which again looks at chunks in the input // stream. // The reason to do this here is that it is *much* faster to parse in reverse. // And that we can’t hook into `null` to split the line suffix before an EOF. // To do: figure out if we can make this into a clean utility, or even in core. // As it will be useful for GFMs literal autolink extension (and maybe even // tables?) + function resolveAllLineSuffixes(events, context) { var eventIndex = -1; var chunks; @@ -35871,12 +28893,12 @@ function resolveAllLineSuffixes(events, context) { if (bufferIndex) break bufferIndex = -1; - } - // Number + } // Number else if (chunk === -2) { tabs = true; size++; - } else if (chunk === -1) ; else { + } else if (chunk === -1); + else { // Replacement character, exit. index++; break @@ -35889,7 +28911,6 @@ function resolveAllLineSuffixes(events, context) { eventIndex === events.length || tabs || size < 2 ? 'lineSuffix' : 'hardBreakTrailing', - start: { line: data.end.line, column: data.end.column - size, @@ -35899,14 +28920,12 @@ function resolveAllLineSuffixes(events, context) { ? bufferIndex : data.start._bufferIndex + bufferIndex }, - end: shallow_1(data.end) }; - data.end = shallow_1(token.start); if (data.start.offset === data.end.offset) { - assign(data, token); + assign_1(data, token); } else { events.splice( eventIndex, @@ -35914,7 +28933,6 @@ function resolveAllLineSuffixes(events, context) { ['enter', token, context], ['exit', token, context] ); - eventIndex += 2; } } @@ -35926,48 +28944,493 @@ function resolveAllLineSuffixes(events, context) { return events } -var text = { - text: text_1, - string: string, - resolver: resolver_1 -}; +var resolver_1 = resolver; +var string_1 = string; +var text_2 = text; -var markdownLineEndingOrSpace_1 = markdownLineEndingOrSpace; +var text_1 = /*#__PURE__*/Object.defineProperty({ + resolver: resolver_1, + string: string_1, + text: text_2 +}, '__esModule', {value: true}); -function markdownLineEndingOrSpace(code) { - return code < 0 || code === 32 +function combineExtensions(extensions) { + var all = {}; + var index = -1; + + while (++index < extensions.length) { + extension$1(all, extensions[index]); + } + + return all } -// This module is generated by `script/`. -// -// CommonMark handles attention (emphasis, strong) markers based on what comes -// before or after them. -// One such difference is if those characters are Unicode punctuation. -// This script is generated from the Unicode data. -var unicodePunctuationRegex = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; +function extension$1(all, extension) { + var hook; + var left; + var right; + var code; -var regexCheck_1 = regexCheck; + for (hook in extension) { + left = hasOwnProperty.call(all, hook) ? all[hook] : (all[hook] = {}); + right = extension[hook]; + + for (code in right) { + left[code] = constructs( + miniflat_1(right[code]), + hasOwnProperty.call(left, code) ? left[code] : [] + ); + } + } +} + +function constructs(list, existing) { + var index = -1; + var before = []; + + while (++index < list.length) { +(list[index].add === 'after' ? existing : before).push(list[index]); + } + + chunkedSplice_1(existing, 0, 0, before); + return existing +} + +var combineExtensions_1 = combineExtensions; + +function chunkedPush(list, items) { + if (list.length) { + chunkedSplice_1(list, list.length, 0, items); + return list + } + + return items +} + +var chunkedPush_1 = chunkedPush; + +function resolveAll(constructs, events, context) { + var called = []; + var index = -1; + var resolve; + + while (++index < constructs.length) { + resolve = constructs[index].resolveAll; + + if (resolve && called.indexOf(resolve) < 0) { + events = resolve(events, context); + called.push(resolve); + } + } + + return events +} + +var resolveAll_1 = resolveAll; + +function serializeChunks(chunks) { + var index = -1; + var result = []; + var chunk; + var value; + var atTab; + + while (++index < chunks.length) { + chunk = chunks[index]; + + if (typeof chunk === 'string') { + value = chunk; + } else if (chunk === -5) { + value = '\r'; + } else if (chunk === -4) { + value = '\n'; + } else if (chunk === -3) { + value = '\r' + '\n'; + } else if (chunk === -2) { + value = '\t'; + } else if (chunk === -1) { + if (atTab) continue + value = ' '; + } else { + // Currently only replacement character. + value = fromCharCode_1(chunk); + } + + atTab = chunk === -2; + result.push(value); + } + + return result.join('') +} + +var serializeChunks_1 = serializeChunks; + +function sliceChunks(chunks, token) { + var startIndex = token.start._index; + var startBufferIndex = token.start._bufferIndex; + var endIndex = token.end._index; + var endBufferIndex = token.end._bufferIndex; + var view; + + if (startIndex === endIndex) { + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; + } else { + view = chunks.slice(startIndex, endIndex); + + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex); + } + + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)); + } + } + + return view +} + +var sliceChunks_1 = sliceChunks; + +// Create a tokenizer. +// Tokenizers deal with one type of data (e.g., containers, flow, text). +// The parser is the object dealing with it all. +// `initialize` works like other constructs, except that only its `tokenize` +// function is used, in which case it doesn’t receive an `ok` or `nok`. +// `from` can be given to set the point before the first character, although +// when further lines are indented, they must be set with `defineSkip`. +function createTokenizer(parser, initialize, from) { + var point = from + ? shallow_1(from) + : { + line: 1, + column: 1, + offset: 0 + }; + var columnStart = {}; + var resolveAllConstructs = []; + var chunks = []; + var stack = []; + + var effects = { + consume: consume, + enter: enter, + exit: exit, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, { + interrupt: true + }), + lazy: constructFactory(onsuccessfulcheck, { + lazy: true + }) + }; // State and tools for resolving and serializing. + + var context = { + previous: null, + events: [], + parser: parser, + sliceStream: sliceStream, + sliceSerialize: sliceSerialize, + now: now, + defineSkip: skip, + write: write + }; // The state function. + + var state = initialize.tokenize.call(context, effects); // Track which character we expect to be consumed, to catch bugs. + + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize); + } // Store where we are in the input stream. + + point._index = 0; + point._bufferIndex = -1; + return context + + function write(slice) { + chunks = chunkedPush_1(chunks, slice); + main(); // Exit if we’re not done, resolve might change stuff. + + if (chunks[chunks.length - 1] !== null) { + return [] + } + + addResult(initialize, 0); // Otherwise, resolve, and exit. + + context.events = resolveAll_1(resolveAllConstructs, context.events, context); + return context.events + } // + // Tools. + // + + function sliceSerialize(token) { + return serializeChunks_1(sliceStream(token)) + } + + function sliceStream(token) { + return sliceChunks_1(chunks, token) + } + + function now() { + return shallow_1(point) + } + + function skip(value) { + columnStart[value.line] = value.column; + accountForPotentialSkip(); + } // + // State management. + // + // Main loop (note that `_index` and `_bufferIndex` in `point` are modified by + // `consume`). + // Here is where we walk through the chunks, which either include strings of + // several characters, or numerical character codes. + // The reason to do this in a loop instead of a call is so the stack can + // drain. + + function main() { + var chunkIndex; + var chunk; + + while (point._index < chunks.length) { + chunk = chunks[point._index]; // If we’re in a buffer chunk, loop through it. + + if (typeof chunk === 'string') { + chunkIndex = point._index; + + if (point._bufferIndex < 0) { + point._bufferIndex = 0; + } + + while ( + point._index === chunkIndex && + point._bufferIndex < chunk.length + ) { + go(chunk.charCodeAt(point._bufferIndex)); + } + } else { + go(chunk); + } + } + } // Deal with one code. + + function go(code) { + state = state(code); + } // Move a character forward. + + function consume(code) { + if (markdownLineEnding_1(code)) { + point.line++; + point.column = 1; + point.offset += code === -3 ? 2 : 1; + accountForPotentialSkip(); + } else if (code !== -1) { + point.column++; + point.offset++; + } // Not in a string chunk. + + if (point._bufferIndex < 0) { + point._index++; + } else { + point._bufferIndex++; // At end of string chunk. + + if (point._bufferIndex === chunks[point._index].length) { + point._bufferIndex = -1; + point._index++; + } + } // Expose the previous character. + + context.previous = code; // Mark as consumed. + } // Start a token. + + function enter(type, fields) { + var token = fields || {}; + token.type = type; + token.start = now(); + context.events.push(['enter', token, context]); + stack.push(token); + return token + } // Stop a token. + + function exit(type) { + var token = stack.pop(); + token.end = now(); + context.events.push(['exit', token, context]); + return token + } // Use results. + + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from); + } // Discard results. + + function onsuccessfulcheck(construct, info) { + info.restore(); + } // Factory to attempt/check/interrupt. + + function constructFactory(onreturn, fields) { + return hook // Handle either an object mapping codes to constructs, a list of + // constructs, or a single construct. + + function hook(constructs, returnState, bogusState) { + var listOfConstructs; + var constructIndex; + var currentConstruct; + var info; + return constructs.tokenize || 'length' in constructs + ? handleListOfConstructs(miniflat_1(constructs)) + : handleMapOfConstructs + + function handleMapOfConstructs(code) { + if (code in constructs || null in constructs) { + return handleListOfConstructs( + constructs.null + ? /* c8 ignore next */ + miniflat_1(constructs[code]).concat(miniflat_1(constructs.null)) + : constructs[code] + )(code) + } + + return bogusState(code) + } + + function handleListOfConstructs(list) { + listOfConstructs = list; + constructIndex = 0; + return handleConstruct(list[constructIndex]) + } + + function handleConstruct(construct) { + return start + + function start(code) { + // To do: not nede to store if there is no bogus state, probably? + // Currently doesn’t work because `inspect` in document does a check + // w/o a bogus, which doesn’t make sense. But it does seem to help perf + // by not storing. + info = store(); + currentConstruct = construct; + + if (!construct.partial) { + context.currentConstruct = construct; + } + + if ( + construct.name && + context.parser.constructs.disable.null.indexOf(construct.name) > -1 + ) { + return nok() + } + + return construct.tokenize.call( + fields ? assign_1({}, context, fields) : context, + effects, + ok, + nok + )(code) + } + } + + function ok(code) { + onreturn(currentConstruct, info); + return returnState + } + + function nok(code) { + info.restore(); + + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]) + } + + return bogusState + } + } + } + + function addResult(construct, from) { + if (construct.resolveAll && resolveAllConstructs.indexOf(construct) < 0) { + resolveAllConstructs.push(construct); + } + + if (construct.resolve) { + chunkedSplice_1( + context.events, + from, + context.events.length - from, + construct.resolve(context.events.slice(from), context) + ); + } + + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context); + } + } + + function store() { + var startPoint = now(); + var startPrevious = context.previous; + var startCurrentConstruct = context.currentConstruct; + var startEventsIndex = context.events.length; + var startStack = Array.from(stack); + return { + restore: restore, + from: startEventsIndex + } + + function restore() { + point = startPoint; + context.previous = startPrevious; + context.currentConstruct = startCurrentConstruct; + context.events.length = startEventsIndex; + stack = startStack; + accountForPotentialSkip(); + } + } + + function accountForPotentialSkip() { + if (point.line in columnStart && point.column < 2) { + point.column = columnStart[point.line]; + point.offset += columnStart[point.line] - 1; + } + } +} + +var createTokenizer_1 = createTokenizer; +function markdownLineEndingOrSpace(code) { + return code < 0 || code === 32 +} +var markdownLineEndingOrSpace_1 = markdownLineEndingOrSpace; function regexCheck(regex) { return check + function check(code) { - return regex.test(fromCharCode(code)) + return regex.test(fromCharCode_1(code)) } } -// Size note: removing ASCII from the regex and using `ascii-punctuation` here -// In fact adds to the bundle size. -var unicodePunctuation_1 = regexCheck_1(unicodePunctuationRegex); +var regexCheck_1 = regexCheck; -var unicodeWhitespace = regexCheck_1(/\s/); +// This module is generated by `script/`. +// +// CommonMark handles attention (emphasis, strong) markers based on what comes +// before or after them. +// One such difference is if those characters are Unicode punctuation. +// This script is generated from the Unicode data. +var unicodePunctuation = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; -var classifyCharacter_1 = classifyCharacter; +var unicodePunctuationRegex = unicodePunctuation; + +// In fact adds to the bundle size. +var unicodePunctuation$1 = regexCheck_1(unicodePunctuationRegex); +var unicodePunctuation_1 = unicodePunctuation$1; +var unicodeWhitespace = regexCheck_1(/\s/); +var unicodeWhitespace_1 = unicodeWhitespace; // Classify whether a character is unicode whitespace, unicode punctuation, or // anything else. @@ -35977,7 +29440,7 @@ function classifyCharacter(code) { if ( code === null || markdownLineEndingOrSpace_1(code) || - unicodeWhitespace(code) + unicodeWhitespace_1(code) ) { return 1 } @@ -35987,10 +29450,10 @@ function classifyCharacter(code) { } } -var movePoint_1 = movePoint; +var classifyCharacter_1 = classifyCharacter; -// Note! `move` only works inside lines! It’s not possible to move past other // chunks (replacement characters, tabs, or line endings). + function movePoint(point, offset) { point.column += offset; point.offset += offset; @@ -35998,35 +29461,14 @@ function movePoint(point, offset) { return point } -var resolveAll_1 = resolveAll; - -function resolveAll(constructs, events, context) { - var called = []; - var index = -1; - var resolve; - - while (++index < constructs.length) { - resolve = constructs[index].resolveAll; - - if (resolve && called.indexOf(resolve) < 0) { - events = resolve(events, context); - called.push(resolve); - } - } - - return events -} - -var tokenize$5 = tokenizeAttention; -var resolveAll_1$1 = resolveAllAttention; - - - - - +var movePoint_1 = movePoint; +var attention = { + name: 'attention', + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +}; -// Take all events and resolve attention to emphasis or strong. function resolveAllAttention(events, context) { var index = -1; var open; @@ -36036,12 +29478,11 @@ function resolveAllAttention(events, context) { var closingSequence; var use; var nextEvents; - var offset; - - // Walk through all events. + var offset; // Walk through all events. // // Note: performance of this is fine on an mb of normal markdown, but it’s // a bottleneck for malicious stuff. + while (++index < events.length) { // Find a token that can close. if ( @@ -36049,16 +29490,14 @@ function resolveAllAttention(events, context) { events[index][1].type === 'attentionSequence' && events[index][1]._close ) { - open = index; + open = index; // Now walk back to find an opener. - // Now walk back to find an opener. while (open--) { // Find a token that can open the closer. if ( events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && - events[open][1]._open && - // If the markers are the same: + events[open][1]._open && // If the markers are the same: context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0) ) { @@ -36078,84 +29517,70 @@ function resolveAllAttention(events, context) { ) ) { continue - } + } // Number of markers to use from the sequence. - // Number of markers to use from the sequence. use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1; - openingSequence = { type: use > 1 ? 'strongSequence' : 'emphasisSequence', start: movePoint_1(shallow_1(events[open][1].end), -use), end: shallow_1(events[open][1].end) }; - closingSequence = { type: use > 1 ? 'strongSequence' : 'emphasisSequence', start: shallow_1(events[index][1].start), end: movePoint_1(shallow_1(events[index][1].start), use) }; - text = { type: use > 1 ? 'strongText' : 'emphasisText', start: shallow_1(events[open][1].end), end: shallow_1(events[index][1].start) }; - group = { type: use > 1 ? 'strong' : 'emphasis', start: shallow_1(openingSequence.start), end: shallow_1(closingSequence.end) }; - events[open][1].end = shallow_1(openingSequence.start); events[index][1].start = shallow_1(closingSequence.end); + nextEvents = []; // If there are more markers in the opening, add them before. - nextEvents = []; - - // If there are more markers in the opening, add them before. if (events[open][1].end.offset - events[open][1].start.offset) { - chunkedSplice_1(nextEvents, nextEvents.length, 0, [ + nextEvents = chunkedPush_1(nextEvents, [ ['enter', events[open][1], context], ['exit', events[open][1], context] ]); - } + } // Opening. - // Opening. - chunkedSplice_1(nextEvents, nextEvents.length, 0, [ + nextEvents = chunkedPush_1(nextEvents, [ ['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context] - ]); + ]); // Between. - // Between. - chunkedSplice_1( + nextEvents = chunkedPush_1( nextEvents, - nextEvents.length, - 0, resolveAll_1( context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context ) - ); + ); // Closing. - // Closing. - chunkedSplice_1(nextEvents, nextEvents.length, 0, [ + nextEvents = chunkedPush_1(nextEvents, [ ['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context] - ]); + ]); // If there are more markers in the closing, add them after. - // If there are more markers in the closing, add them after. if (events[index][1].end.offset - events[index][1].start.offset) { offset = 2; - chunkedSplice_1(nextEvents, nextEvents.length, 0, [ + nextEvents = chunkedPush_1(nextEvents, [ ['enter', events[index][1], context], ['exit', events[index][1], context] ]); @@ -36164,15 +29589,13 @@ function resolveAllAttention(events, context) { } chunkedSplice_1(events, open - 1, index - open + 3, nextEvents); - index = open + nextEvents.length - offset - 2; break } } } - } + } // Remove remaining sequences. - // Remove remaining sequences. index = -1; while (++index < events.length) { @@ -36187,7 +29610,6 @@ function resolveAllAttention(events, context) { function tokenizeAttention(effects, ok) { var before = classifyCharacter_1(this.previous); var marker; - return start function start(code) { @@ -36217,670 +29639,4727 @@ function tokenizeAttention(effects, ok) { } } -var attention = { - tokenize: tokenize$5, - resolveAll: resolveAll_1$1 -}; +var attention_1 = attention; -var tokenize$6 = tokenizeAtxHeading; -var resolve$8 = resolveAtxHeading; +var asciiAlphanumeric = regexCheck_1(/[\dA-Za-z]/); +var asciiAlphanumeric_1 = asciiAlphanumeric; +var asciiAlpha = regexCheck_1(/[A-Za-z]/); +var asciiAlpha_1 = asciiAlpha; +var asciiAtext = regexCheck_1(/[#-'*+\--9=?A-Z^-~]/); +var asciiAtext_1 = asciiAtext; +// Note: EOF is seen as ASCII control here, because `null < 32 == true`. +function asciiControl(code) { + return ( + // Special whitespace codes (which have negative values), C0 and Control + // character DEL + code < 32 || code === 127 + ) +} +var asciiControl_1 = asciiControl; -function resolveAtxHeading(events, context) { - var contentEnd = events.length - 2; - var contentStart = 3; - var content; - var text; +var autolink = { + name: 'autolink', + tokenize: tokenizeAutolink +}; - // Prefix whitespace, part of the opening. - if (events[contentStart][1].type === 'whitespace') { - contentStart += 2; +function tokenizeAutolink(effects, ok, nok) { + var size = 1; + return start + + function start(code) { + effects.enter('autolink'); + effects.enter('autolinkMarker'); + effects.consume(code); + effects.exit('autolinkMarker'); + effects.enter('autolinkProtocol'); + return open } - // Suffix whitespace, part of the closing. - if ( - contentEnd - 2 > contentStart && - events[contentEnd][1].type === 'whitespace' - ) { - contentEnd -= 2; + function open(code) { + if (asciiAlpha_1(code)) { + effects.consume(code); + return schemeOrEmailAtext + } + + return asciiAtext_1(code) ? emailAtext(code) : nok(code) } - if ( - events[contentEnd][1].type === 'atxHeadingSequence' && - (contentStart === contentEnd - 1 || - (contentEnd - 4 > contentStart && - events[contentEnd - 2][1].type === 'whitespace')) - ) { - contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; + function schemeOrEmailAtext(code) { + return code === 43 || code === 45 || code === 46 || asciiAlphanumeric_1(code) + ? schemeInsideOrEmailAtext(code) + : emailAtext(code) } - if (contentEnd > contentStart) { - content = { - type: 'atxHeadingText', - start: events[contentStart][1].start, - end: events[contentEnd][1].end - }; + function schemeInsideOrEmailAtext(code) { + if (code === 58) { + effects.consume(code); + return urlInside + } - text = { - type: 'chunkText', - start: events[contentStart][1].start, - end: events[contentEnd][1].end, - contentType: 'text' - }; + if ( + (code === 43 || code === 45 || code === 46 || asciiAlphanumeric_1(code)) && + size++ < 32 + ) { + effects.consume(code); + return schemeInsideOrEmailAtext + } - chunkedSplice_1(events, contentStart, contentEnd - contentStart + 1, [ - ['enter', content, context], - ['enter', text, context], - ['exit', text, context], - ['exit', content, context] - ]); + return emailAtext(code) } - return events -} - -function tokenizeAtxHeading(effects, ok, nok) { - var self = this; - var size = 0; + function urlInside(code) { + if (code === 62) { + effects.exit('autolinkProtocol'); + return end(code) + } - return start + if (code === 32 || code === 60 || asciiControl_1(code)) { + return nok(code) + } - function start(code) { - effects.enter('atxHeading'); - effects.enter('atxHeadingSequence'); - return fenceOpenInside(code) + effects.consume(code); + return urlInside } - function fenceOpenInside(code) { - if (code === 35 && size++ < 6) { + function emailAtext(code) { + if (code === 64) { effects.consume(code); - return fenceOpenInside + size = 0; + return emailAtSignOrDot } - if (code === null || markdownLineEndingOrSpace_1(code)) { - effects.exit('atxHeadingSequence'); - return self.interrupt ? ok(code) : headingBreak(code) + if (asciiAtext_1(code)) { + effects.consume(code); + return emailAtext } return nok(code) } - function headingBreak(code) { - if (code === 35) { - effects.enter('atxHeadingSequence'); - return sequence(code) + function emailAtSignOrDot(code) { + return asciiAlphanumeric_1(code) ? emailLabel(code) : nok(code) + } + + function emailLabel(code) { + if (code === 46) { + effects.consume(code); + size = 0; + return emailAtSignOrDot } - if (code === null || markdownLineEnding_1(code)) { - effects.exit('atxHeading'); - return ok(code) + if (code === 62) { + // Exit, then change the type. + effects.exit('autolinkProtocol').type = 'autolinkEmail'; + return end(code) } - if (markdownSpace_1(code)) { - return factorySpace(effects, headingBreak, 'whitespace')(code) + return emailValue(code) + } + + function emailValue(code) { + if ((code === 45 || asciiAlphanumeric_1(code)) && size++ < 63) { + effects.consume(code); + return code === 45 ? emailValue : emailLabel } - effects.enter('atxHeadingText'); - return data(code) + return nok(code) } - function sequence(code) { - if (code === 35) { + function end(code) { + effects.enter('autolinkMarker'); + effects.consume(code); + effects.exit('autolinkMarker'); + effects.exit('autolink'); + return ok + } +} + +var autolink_1 = autolink; + +var blockQuote = { + name: 'blockQuote', + tokenize: tokenizeBlockQuoteStart, + continuation: { + tokenize: tokenizeBlockQuoteContinuation + }, + exit: exit +}; + +function tokenizeBlockQuoteStart(effects, ok, nok) { + var self = this; + return start + + function start(code) { + if (code === 62) { + if (!self.containerState.open) { + effects.enter('blockQuote', { + _container: true + }); + self.containerState.open = true; + } + + effects.enter('blockQuotePrefix'); + effects.enter('blockQuoteMarker'); effects.consume(code); - return sequence + effects.exit('blockQuoteMarker'); + return after } - effects.exit('atxHeadingSequence'); - return headingBreak(code) + return nok(code) } - function data(code) { - if (code === null || code === 35 || markdownLineEndingOrSpace_1(code)) { - effects.exit('atxHeadingText'); - return headingBreak(code) + function after(code) { + if (markdownSpace_1(code)) { + effects.enter('blockQuotePrefixWhitespace'); + effects.consume(code); + effects.exit('blockQuotePrefixWhitespace'); + effects.exit('blockQuotePrefix'); + return ok } + effects.exit('blockQuotePrefix'); + return ok(code) + } +} + +function tokenizeBlockQuoteContinuation(effects, ok, nok) { + return factorySpace( + effects, + effects.attempt(blockQuote, ok, nok), + 'linePrefix', + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) +} + +function exit(effects) { + effects.exit('blockQuote'); +} + +var blockQuote_1 = blockQuote; + +var asciiPunctuation = regexCheck_1(/[!-/:-@[-`{-~]/); + +var asciiPunctuation_1 = asciiPunctuation; + +var characterEscape = { + name: 'characterEscape', + tokenize: tokenizeCharacterEscape +}; + +function tokenizeCharacterEscape(effects, ok, nok) { + return start + + function start(code) { + effects.enter('characterEscape'); + effects.enter('escapeMarker'); effects.consume(code); - return data + effects.exit('escapeMarker'); + return open + } + + function open(code) { + if (asciiPunctuation_1(code)) { + effects.enter('characterEscapeValue'); + effects.consume(code); + effects.exit('characterEscapeValue'); + effects.exit('characterEscape'); + return ok + } + + return nok(code) } } -var headingAtx = { - tokenize: tokenize$6, - resolve: resolve$8 +var characterEscape_1 = characterEscape; + +const AEli = "Æ"; +const AElig = "Æ"; +const AM = "&"; +const AMP = "&"; +const Aacut = "Á"; +const Aacute = "Á"; +const Abreve = "Ă"; +const Acir = "Â"; +const Acirc = "Â"; +const Acy = "А"; +const Afr = "𝔄"; +const Agrav = "À"; +const Agrave = "À"; +const Alpha = "Α"; +const Amacr = "Ā"; +const And = "⩓"; +const Aogon = "Ą"; +const Aopf = "𝔸"; +const ApplyFunction = "⁡"; +const Arin = "Å"; +const Aring = "Å"; +const Ascr = "𝒜"; +const Assign = "≔"; +const Atild = "Ã"; +const Atilde = "Ã"; +const Aum = "Ä"; +const Auml = "Ä"; +const Backslash = "∖"; +const Barv = "⫧"; +const Barwed = "⌆"; +const Bcy = "Б"; +const Because = "∵"; +const Bernoullis = "ℬ"; +const Beta = "Β"; +const Bfr = "𝔅"; +const Bopf = "𝔹"; +const Breve = "˘"; +const Bscr = "ℬ"; +const Bumpeq = "≎"; +const CHcy = "Ч"; +const COP = "©"; +const COPY = "©"; +const Cacute = "Ć"; +const Cap = "⋒"; +const CapitalDifferentialD = "ⅅ"; +const Cayleys = "ℭ"; +const Ccaron = "Č"; +const Ccedi = "Ç"; +const Ccedil = "Ç"; +const Ccirc = "Ĉ"; +const Cconint = "∰"; +const Cdot = "Ċ"; +const Cedilla = "¸"; +const CenterDot = "·"; +const Cfr = "ℭ"; +const Chi = "Χ"; +const CircleDot = "⊙"; +const CircleMinus = "⊖"; +const CirclePlus = "⊕"; +const CircleTimes = "⊗"; +const ClockwiseContourIntegral = "∲"; +const CloseCurlyDoubleQuote = "”"; +const CloseCurlyQuote = "’"; +const Colon = "∷"; +const Colone = "⩴"; +const Congruent = "≡"; +const Conint = "∯"; +const ContourIntegral = "∮"; +const Copf = "ℂ"; +const Coproduct = "∐"; +const CounterClockwiseContourIntegral = "∳"; +const Cross = "⨯"; +const Cscr = "𝒞"; +const Cup = "⋓"; +const CupCap = "≍"; +const DD = "ⅅ"; +const DDotrahd = "⤑"; +const DJcy = "Ђ"; +const DScy = "Ѕ"; +const DZcy = "Џ"; +const Dagger = "‡"; +const Darr = "↡"; +const Dashv = "⫤"; +const Dcaron = "Ď"; +const Dcy = "Д"; +const Del = "∇"; +const Delta = "Δ"; +const Dfr = "𝔇"; +const DiacriticalAcute = "´"; +const DiacriticalDot = "˙"; +const DiacriticalDoubleAcute = "˝"; +const DiacriticalGrave = "`"; +const DiacriticalTilde = "˜"; +const Diamond = "⋄"; +const DifferentialD = "ⅆ"; +const Dopf = "𝔻"; +const Dot = "¨"; +const DotDot = "⃜"; +const DotEqual = "≐"; +const DoubleContourIntegral = "∯"; +const DoubleDot = "¨"; +const DoubleDownArrow = "⇓"; +const DoubleLeftArrow = "⇐"; +const DoubleLeftRightArrow = "⇔"; +const DoubleLeftTee = "⫤"; +const DoubleLongLeftArrow = "⟸"; +const DoubleLongLeftRightArrow = "⟺"; +const DoubleLongRightArrow = "⟹"; +const DoubleRightArrow = "⇒"; +const DoubleRightTee = "⊨"; +const DoubleUpArrow = "⇑"; +const DoubleUpDownArrow = "⇕"; +const DoubleVerticalBar = "∥"; +const DownArrow = "↓"; +const DownArrowBar = "⤓"; +const DownArrowUpArrow = "⇵"; +const DownBreve = "̑"; +const DownLeftRightVector = "⥐"; +const DownLeftTeeVector = "⥞"; +const DownLeftVector = "↽"; +const DownLeftVectorBar = "⥖"; +const DownRightTeeVector = "⥟"; +const DownRightVector = "⇁"; +const DownRightVectorBar = "⥗"; +const DownTee = "⊤"; +const DownTeeArrow = "↧"; +const Downarrow = "⇓"; +const Dscr = "𝒟"; +const Dstrok = "Đ"; +const ENG = "Ŋ"; +const ET = "Ð"; +const ETH = "Ð"; +const Eacut = "É"; +const Eacute = "É"; +const Ecaron = "Ě"; +const Ecir = "Ê"; +const Ecirc = "Ê"; +const Ecy = "Э"; +const Edot = "Ė"; +const Efr = "𝔈"; +const Egrav = "È"; +const Egrave = "È"; +const Element = "∈"; +const Emacr = "Ē"; +const EmptySmallSquare = "◻"; +const EmptyVerySmallSquare = "▫"; +const Eogon = "Ę"; +const Eopf = "𝔼"; +const Epsilon = "Ε"; +const Equal = "⩵"; +const EqualTilde = "≂"; +const Equilibrium = "⇌"; +const Escr = "ℰ"; +const Esim = "⩳"; +const Eta = "Η"; +const Eum = "Ë"; +const Euml = "Ë"; +const Exists = "∃"; +const ExponentialE = "ⅇ"; +const Fcy = "Ф"; +const Ffr = "𝔉"; +const FilledSmallSquare = "◼"; +const FilledVerySmallSquare = "▪"; +const Fopf = "𝔽"; +const ForAll = "∀"; +const Fouriertrf = "ℱ"; +const Fscr = "ℱ"; +const GJcy = "Ѓ"; +const G = ">"; +const GT = ">"; +const Gamma = "Γ"; +const Gammad = "Ϝ"; +const Gbreve = "Ğ"; +const Gcedil = "Ģ"; +const Gcirc = "Ĝ"; +const Gcy = "Г"; +const Gdot = "Ġ"; +const Gfr = "𝔊"; +const Gg = "⋙"; +const Gopf = "𝔾"; +const GreaterEqual = "≥"; +const GreaterEqualLess = "⋛"; +const GreaterFullEqual = "≧"; +const GreaterGreater = "⪢"; +const GreaterLess = "≷"; +const GreaterSlantEqual = "⩾"; +const GreaterTilde = "≳"; +const Gscr = "𝒢"; +const Gt = "≫"; +const HARDcy = "Ъ"; +const Hacek = "ˇ"; +const Hat = "^"; +const Hcirc = "Ĥ"; +const Hfr = "ℌ"; +const HilbertSpace = "ℋ"; +const Hopf = "ℍ"; +const HorizontalLine = "─"; +const Hscr = "ℋ"; +const Hstrok = "Ħ"; +const HumpDownHump = "≎"; +const HumpEqual = "≏"; +const IEcy = "Е"; +const IJlig = "IJ"; +const IOcy = "Ё"; +const Iacut = "Í"; +const Iacute = "Í"; +const Icir = "Î"; +const Icirc = "Î"; +const Icy = "И"; +const Idot = "İ"; +const Ifr = "ℑ"; +const Igrav = "Ì"; +const Igrave = "Ì"; +const Im = "ℑ"; +const Imacr = "Ī"; +const ImaginaryI = "ⅈ"; +const Implies = "⇒"; +const Int = "∬"; +const Integral = "∫"; +const Intersection = "⋂"; +const InvisibleComma = "⁣"; +const InvisibleTimes = "⁢"; +const Iogon = "Į"; +const Iopf = "𝕀"; +const Iota = "Ι"; +const Iscr = "ℐ"; +const Itilde = "Ĩ"; +const Iukcy = "І"; +const Ium = "Ï"; +const Iuml = "Ï"; +const Jcirc = "Ĵ"; +const Jcy = "Й"; +const Jfr = "𝔍"; +const Jopf = "𝕁"; +const Jscr = "𝒥"; +const Jsercy = "Ј"; +const Jukcy = "Є"; +const KHcy = "Х"; +const KJcy = "Ќ"; +const Kappa = "Κ"; +const Kcedil = "Ķ"; +const Kcy = "К"; +const Kfr = "𝔎"; +const Kopf = "𝕂"; +const Kscr = "𝒦"; +const LJcy = "Љ"; +const L = "<"; +const LT = "<"; +const Lacute = "Ĺ"; +const Lambda = "Λ"; +const Lang = "⟪"; +const Laplacetrf = "ℒ"; +const Larr = "↞"; +const Lcaron = "Ľ"; +const Lcedil = "Ļ"; +const Lcy = "Л"; +const LeftAngleBracket = "⟨"; +const LeftArrow = "←"; +const LeftArrowBar = "⇤"; +const LeftArrowRightArrow = "⇆"; +const LeftCeiling = "⌈"; +const LeftDoubleBracket = "⟦"; +const LeftDownTeeVector = "⥡"; +const LeftDownVector = "⇃"; +const LeftDownVectorBar = "⥙"; +const LeftFloor = "⌊"; +const LeftRightArrow = "↔"; +const LeftRightVector = "⥎"; +const LeftTee = "⊣"; +const LeftTeeArrow = "↤"; +const LeftTeeVector = "⥚"; +const LeftTriangle = "⊲"; +const LeftTriangleBar = "⧏"; +const LeftTriangleEqual = "⊴"; +const LeftUpDownVector = "⥑"; +const LeftUpTeeVector = "⥠"; +const LeftUpVector = "↿"; +const LeftUpVectorBar = "⥘"; +const LeftVector = "↼"; +const LeftVectorBar = "⥒"; +const Leftarrow = "⇐"; +const Leftrightarrow = "⇔"; +const LessEqualGreater = "⋚"; +const LessFullEqual = "≦"; +const LessGreater = "≶"; +const LessLess = "⪡"; +const LessSlantEqual = "⩽"; +const LessTilde = "≲"; +const Lfr = "𝔏"; +const Ll = "⋘"; +const Lleftarrow = "⇚"; +const Lmidot = "Ŀ"; +const LongLeftArrow = "⟵"; +const LongLeftRightArrow = "⟷"; +const LongRightArrow = "⟶"; +const Longleftarrow = "⟸"; +const Longleftrightarrow = "⟺"; +const Longrightarrow = "⟹"; +const Lopf = "𝕃"; +const LowerLeftArrow = "↙"; +const LowerRightArrow = "↘"; +const Lscr = "ℒ"; +const Lsh = "↰"; +const Lstrok = "Ł"; +const Lt = "≪"; +const Mcy = "М"; +const MediumSpace = " "; +const Mellintrf = "ℳ"; +const Mfr = "𝔐"; +const MinusPlus = "∓"; +const Mopf = "𝕄"; +const Mscr = "ℳ"; +const Mu = "Μ"; +const NJcy = "Њ"; +const Nacute = "Ń"; +const Ncaron = "Ň"; +const Ncedil = "Ņ"; +const Ncy = "Н"; +const NegativeMediumSpace = "​"; +const NegativeThickSpace = "​"; +const NegativeThinSpace = "​"; +const NegativeVeryThinSpace = "​"; +const NestedGreaterGreater = "≫"; +const NestedLessLess = "≪"; +const NewLine = "\n"; +const Nfr = "𝔑"; +const NoBreak = "⁠"; +const NonBreakingSpace = " "; +const Nopf = "ℕ"; +const Not = "⫬"; +const NotCongruent = "≢"; +const NotCupCap = "≭"; +const NotDoubleVerticalBar = "∦"; +const NotElement = "∉"; +const NotEqual = "≠"; +const NotEqualTilde = "≂̸"; +const NotExists = "∄"; +const NotGreater = "≯"; +const NotGreaterEqual = "≱"; +const NotGreaterFullEqual = "≧̸"; +const NotGreaterGreater = "≫̸"; +const NotGreaterLess = "≹"; +const NotGreaterSlantEqual = "⩾̸"; +const NotGreaterTilde = "≵"; +const NotHumpDownHump = "≎̸"; +const NotHumpEqual = "≏̸"; +const NotLeftTriangle = "⋪"; +const NotLeftTriangleBar = "⧏̸"; +const NotLeftTriangleEqual = "⋬"; +const NotLess = "≮"; +const NotLessEqual = "≰"; +const NotLessGreater = "≸"; +const NotLessLess = "≪̸"; +const NotLessSlantEqual = "⩽̸"; +const NotLessTilde = "≴"; +const NotNestedGreaterGreater = "⪢̸"; +const NotNestedLessLess = "⪡̸"; +const NotPrecedes = "⊀"; +const NotPrecedesEqual = "⪯̸"; +const NotPrecedesSlantEqual = "⋠"; +const NotReverseElement = "∌"; +const NotRightTriangle = "⋫"; +const NotRightTriangleBar = "⧐̸"; +const NotRightTriangleEqual = "⋭"; +const NotSquareSubset = "⊏̸"; +const NotSquareSubsetEqual = "⋢"; +const NotSquareSuperset = "⊐̸"; +const NotSquareSupersetEqual = "⋣"; +const NotSubset = "⊂⃒"; +const NotSubsetEqual = "⊈"; +const NotSucceeds = "⊁"; +const NotSucceedsEqual = "⪰̸"; +const NotSucceedsSlantEqual = "⋡"; +const NotSucceedsTilde = "≿̸"; +const NotSuperset = "⊃⃒"; +const NotSupersetEqual = "⊉"; +const NotTilde = "≁"; +const NotTildeEqual = "≄"; +const NotTildeFullEqual = "≇"; +const NotTildeTilde = "≉"; +const NotVerticalBar = "∤"; +const Nscr = "𝒩"; +const Ntild = "Ñ"; +const Ntilde = "Ñ"; +const Nu = "Ν"; +const OElig = "Œ"; +const Oacut = "Ó"; +const Oacute = "Ó"; +const Ocir = "Ô"; +const Ocirc = "Ô"; +const Ocy = "О"; +const Odblac = "Ő"; +const Ofr = "𝔒"; +const Ograv = "Ò"; +const Ograve = "Ò"; +const Omacr = "Ō"; +const Omega = "Ω"; +const Omicron = "Ο"; +const Oopf = "𝕆"; +const OpenCurlyDoubleQuote = "“"; +const OpenCurlyQuote = "‘"; +const Or = "⩔"; +const Oscr = "𝒪"; +const Oslas = "Ø"; +const Oslash = "Ø"; +const Otild = "Õ"; +const Otilde = "Õ"; +const Otimes = "⨷"; +const Oum = "Ö"; +const Ouml = "Ö"; +const OverBar = "‾"; +const OverBrace = "⏞"; +const OverBracket = "⎴"; +const OverParenthesis = "⏜"; +const PartialD = "∂"; +const Pcy = "П"; +const Pfr = "𝔓"; +const Phi = "Φ"; +const Pi = "Π"; +const PlusMinus = "±"; +const Poincareplane = "ℌ"; +const Popf = "ℙ"; +const Pr = "⪻"; +const Precedes = "≺"; +const PrecedesEqual = "⪯"; +const PrecedesSlantEqual = "≼"; +const PrecedesTilde = "≾"; +const Prime = "″"; +const Product = "∏"; +const Proportion = "∷"; +const Proportional = "∝"; +const Pscr = "𝒫"; +const Psi = "Ψ"; +const QUO = "\""; +const QUOT = "\""; +const Qfr = "𝔔"; +const Qopf = "ℚ"; +const Qscr = "𝒬"; +const RBarr = "⤐"; +const RE = "®"; +const REG = "®"; +const Racute = "Ŕ"; +const Rang = "⟫"; +const Rarr = "↠"; +const Rarrtl = "⤖"; +const Rcaron = "Ř"; +const Rcedil = "Ŗ"; +const Rcy = "Р"; +const Re = "ℜ"; +const ReverseElement = "∋"; +const ReverseEquilibrium = "⇋"; +const ReverseUpEquilibrium = "⥯"; +const Rfr = "ℜ"; +const Rho = "Ρ"; +const RightAngleBracket = "⟩"; +const RightArrow = "→"; +const RightArrowBar = "⇥"; +const RightArrowLeftArrow = "⇄"; +const RightCeiling = "⌉"; +const RightDoubleBracket = "⟧"; +const RightDownTeeVector = "⥝"; +const RightDownVector = "⇂"; +const RightDownVectorBar = "⥕"; +const RightFloor = "⌋"; +const RightTee = "⊢"; +const RightTeeArrow = "↦"; +const RightTeeVector = "⥛"; +const RightTriangle = "⊳"; +const RightTriangleBar = "⧐"; +const RightTriangleEqual = "⊵"; +const RightUpDownVector = "⥏"; +const RightUpTeeVector = "⥜"; +const RightUpVector = "↾"; +const RightUpVectorBar = "⥔"; +const RightVector = "⇀"; +const RightVectorBar = "⥓"; +const Rightarrow = "⇒"; +const Ropf = "ℝ"; +const RoundImplies = "⥰"; +const Rrightarrow = "⇛"; +const Rscr = "ℛ"; +const Rsh = "↱"; +const RuleDelayed = "⧴"; +const SHCHcy = "Щ"; +const SHcy = "Ш"; +const SOFTcy = "Ь"; +const Sacute = "Ś"; +const Sc = "⪼"; +const Scaron = "Š"; +const Scedil = "Ş"; +const Scirc = "Ŝ"; +const Scy = "С"; +const Sfr = "𝔖"; +const ShortDownArrow = "↓"; +const ShortLeftArrow = "←"; +const ShortRightArrow = "→"; +const ShortUpArrow = "↑"; +const Sigma = "Σ"; +const SmallCircle = "∘"; +const Sopf = "𝕊"; +const Sqrt = "√"; +const Square = "□"; +const SquareIntersection = "⊓"; +const SquareSubset = "⊏"; +const SquareSubsetEqual = "⊑"; +const SquareSuperset = "⊐"; +const SquareSupersetEqual = "⊒"; +const SquareUnion = "⊔"; +const Sscr = "𝒮"; +const Star = "⋆"; +const Sub = "⋐"; +const Subset = "⋐"; +const SubsetEqual = "⊆"; +const Succeeds = "≻"; +const SucceedsEqual = "⪰"; +const SucceedsSlantEqual = "≽"; +const SucceedsTilde = "≿"; +const SuchThat = "∋"; +const Sum = "∑"; +const Sup = "⋑"; +const Superset = "⊃"; +const SupersetEqual = "⊇"; +const Supset = "⋑"; +const THOR = "Þ"; +const THORN = "Þ"; +const TRADE = "™"; +const TSHcy = "Ћ"; +const TScy = "Ц"; +const Tab = "\t"; +const Tau = "Τ"; +const Tcaron = "Ť"; +const Tcedil = "Ţ"; +const Tcy = "Т"; +const Tfr = "𝔗"; +const Therefore = "∴"; +const Theta = "Θ"; +const ThickSpace = "  "; +const ThinSpace = " "; +const Tilde = "∼"; +const TildeEqual = "≃"; +const TildeFullEqual = "≅"; +const TildeTilde = "≈"; +const Topf = "𝕋"; +const TripleDot = "⃛"; +const Tscr = "𝒯"; +const Tstrok = "Ŧ"; +const Uacut = "Ú"; +const Uacute = "Ú"; +const Uarr = "↟"; +const Uarrocir = "⥉"; +const Ubrcy = "Ў"; +const Ubreve = "Ŭ"; +const Ucir = "Û"; +const Ucirc = "Û"; +const Ucy = "У"; +const Udblac = "Ű"; +const Ufr = "𝔘"; +const Ugrav = "Ù"; +const Ugrave = "Ù"; +const Umacr = "Ū"; +const UnderBar = "_"; +const UnderBrace = "⏟"; +const UnderBracket = "⎵"; +const UnderParenthesis = "⏝"; +const Union = "⋃"; +const UnionPlus = "⊎"; +const Uogon = "Ų"; +const Uopf = "𝕌"; +const UpArrow = "↑"; +const UpArrowBar = "⤒"; +const UpArrowDownArrow = "⇅"; +const UpDownArrow = "↕"; +const UpEquilibrium = "⥮"; +const UpTee = "⊥"; +const UpTeeArrow = "↥"; +const Uparrow = "⇑"; +const Updownarrow = "⇕"; +const UpperLeftArrow = "↖"; +const UpperRightArrow = "↗"; +const Upsi = "ϒ"; +const Upsilon = "Υ"; +const Uring = "Ů"; +const Uscr = "𝒰"; +const Utilde = "Ũ"; +const Uum = "Ü"; +const Uuml = "Ü"; +const VDash = "⊫"; +const Vbar = "⫫"; +const Vcy = "В"; +const Vdash = "⊩"; +const Vdashl = "⫦"; +const Vee = "⋁"; +const Verbar = "‖"; +const Vert = "‖"; +const VerticalBar = "∣"; +const VerticalLine = "|"; +const VerticalSeparator = "❘"; +const VerticalTilde = "≀"; +const VeryThinSpace = " "; +const Vfr = "𝔙"; +const Vopf = "𝕍"; +const Vscr = "𝒱"; +const Vvdash = "⊪"; +const Wcirc = "Ŵ"; +const Wedge = "⋀"; +const Wfr = "𝔚"; +const Wopf = "𝕎"; +const Wscr = "𝒲"; +const Xfr = "𝔛"; +const Xi = "Ξ"; +const Xopf = "𝕏"; +const Xscr = "𝒳"; +const YAcy = "Я"; +const YIcy = "Ї"; +const YUcy = "Ю"; +const Yacut = "Ý"; +const Yacute = "Ý"; +const Ycirc = "Ŷ"; +const Ycy = "Ы"; +const Yfr = "𝔜"; +const Yopf = "𝕐"; +const Yscr = "𝒴"; +const Yuml = "Ÿ"; +const ZHcy = "Ж"; +const Zacute = "Ź"; +const Zcaron = "Ž"; +const Zcy = "З"; +const Zdot = "Ż"; +const ZeroWidthSpace = "​"; +const Zeta = "Ζ"; +const Zfr = "ℨ"; +const Zopf = "ℤ"; +const Zscr = "𝒵"; +const aacut = "á"; +const aacute = "á"; +const abreve = "ă"; +const ac = "∾"; +const acE = "∾̳"; +const acd = "∿"; +const acir = "â"; +const acirc = "â"; +const acut = "´"; +const acute = "´"; +const acy = "а"; +const aeli = "æ"; +const aelig = "æ"; +const af = "⁡"; +const afr = "𝔞"; +const agrav = "à"; +const agrave = "à"; +const alefsym = "ℵ"; +const aleph = "ℵ"; +const alpha = "α"; +const amacr = "ā"; +const amalg = "⨿"; +const am = "&"; +const amp = "&"; +const and = "∧"; +const andand = "⩕"; +const andd = "⩜"; +const andslope = "⩘"; +const andv = "⩚"; +const ang = "∠"; +const ange = "⦤"; +const angle = "∠"; +const angmsd = "∡"; +const angmsdaa = "⦨"; +const angmsdab = "⦩"; +const angmsdac = "⦪"; +const angmsdad = "⦫"; +const angmsdae = "⦬"; +const angmsdaf = "⦭"; +const angmsdag = "⦮"; +const angmsdah = "⦯"; +const angrt = "∟"; +const angrtvb = "⊾"; +const angrtvbd = "⦝"; +const angsph = "∢"; +const angst = "Å"; +const angzarr = "⍼"; +const aogon = "ą"; +const aopf = "𝕒"; +const ap = "≈"; +const apE = "⩰"; +const apacir = "⩯"; +const ape = "≊"; +const apid = "≋"; +const apos = "'"; +const approx = "≈"; +const approxeq = "≊"; +const arin = "å"; +const aring = "å"; +const ascr = "𝒶"; +const ast = "*"; +const asymp = "≈"; +const asympeq = "≍"; +const atild = "ã"; +const atilde = "ã"; +const aum = "ä"; +const auml = "ä"; +const awconint = "∳"; +const awint = "⨑"; +const bNot = "⫭"; +const backcong = "≌"; +const backepsilon = "϶"; +const backprime = "‵"; +const backsim = "∽"; +const backsimeq = "⋍"; +const barvee = "⊽"; +const barwed = "⌅"; +const barwedge = "⌅"; +const bbrk = "⎵"; +const bbrktbrk = "⎶"; +const bcong = "≌"; +const bcy = "б"; +const bdquo = "„"; +const becaus = "∵"; +const because = "∵"; +const bemptyv = "⦰"; +const bepsi = "϶"; +const bernou = "ℬ"; +const beta = "β"; +const beth = "ℶ"; +const between = "≬"; +const bfr = "𝔟"; +const bigcap = "⋂"; +const bigcirc = "◯"; +const bigcup = "⋃"; +const bigodot = "⨀"; +const bigoplus = "⨁"; +const bigotimes = "⨂"; +const bigsqcup = "⨆"; +const bigstar = "★"; +const bigtriangledown = "▽"; +const bigtriangleup = "△"; +const biguplus = "⨄"; +const bigvee = "⋁"; +const bigwedge = "⋀"; +const bkarow = "⤍"; +const blacklozenge = "⧫"; +const blacksquare = "▪"; +const blacktriangle = "▴"; +const blacktriangledown = "▾"; +const blacktriangleleft = "◂"; +const blacktriangleright = "▸"; +const blank = "␣"; +const blk12 = "▒"; +const blk14 = "░"; +const blk34 = "▓"; +const block = "█"; +const bne = "=⃥"; +const bnequiv = "≡⃥"; +const bnot = "⌐"; +const bopf = "𝕓"; +const bot = "⊥"; +const bottom = "⊥"; +const bowtie = "⋈"; +const boxDL = "╗"; +const boxDR = "╔"; +const boxDl = "╖"; +const boxDr = "╓"; +const boxH = "═"; +const boxHD = "╦"; +const boxHU = "╩"; +const boxHd = "╤"; +const boxHu = "╧"; +const boxUL = "╝"; +const boxUR = "╚"; +const boxUl = "╜"; +const boxUr = "╙"; +const boxV = "║"; +const boxVH = "╬"; +const boxVL = "╣"; +const boxVR = "╠"; +const boxVh = "╫"; +const boxVl = "╢"; +const boxVr = "╟"; +const boxbox = "⧉"; +const boxdL = "╕"; +const boxdR = "╒"; +const boxdl = "┐"; +const boxdr = "┌"; +const boxh = "─"; +const boxhD = "╥"; +const boxhU = "╨"; +const boxhd = "┬"; +const boxhu = "┴"; +const boxminus = "⊟"; +const boxplus = "⊞"; +const boxtimes = "⊠"; +const boxuL = "╛"; +const boxuR = "╘"; +const boxul = "┘"; +const boxur = "└"; +const boxv = "│"; +const boxvH = "╪"; +const boxvL = "╡"; +const boxvR = "╞"; +const boxvh = "┼"; +const boxvl = "┤"; +const boxvr = "├"; +const bprime = "‵"; +const breve = "˘"; +const brvba = "¦"; +const brvbar = "¦"; +const bscr = "𝒷"; +const bsemi = "⁏"; +const bsim = "∽"; +const bsime = "⋍"; +const bsol = "\\"; +const bsolb = "⧅"; +const bsolhsub = "⟈"; +const bull = "•"; +const bullet = "•"; +const bump = "≎"; +const bumpE = "⪮"; +const bumpe = "≏"; +const bumpeq = "≏"; +const cacute = "ć"; +const cap = "∩"; +const capand = "⩄"; +const capbrcup = "⩉"; +const capcap = "⩋"; +const capcup = "⩇"; +const capdot = "⩀"; +const caps = "∩︀"; +const caret = "⁁"; +const caron = "ˇ"; +const ccaps = "⩍"; +const ccaron = "č"; +const ccedi = "ç"; +const ccedil = "ç"; +const ccirc = "ĉ"; +const ccups = "⩌"; +const ccupssm = "⩐"; +const cdot = "ċ"; +const cedi = "¸"; +const cedil = "¸"; +const cemptyv = "⦲"; +const cen = "¢"; +const cent = "¢"; +const centerdot = "·"; +const cfr = "𝔠"; +const chcy = "ч"; +const check$2 = "✓"; +const checkmark = "✓"; +const chi = "χ"; +const cir = "○"; +const cirE = "⧃"; +const circ = "ˆ"; +const circeq = "≗"; +const circlearrowleft = "↺"; +const circlearrowright = "↻"; +const circledR = "®"; +const circledS = "Ⓢ"; +const circledast = "⊛"; +const circledcirc = "⊚"; +const circleddash = "⊝"; +const cire = "≗"; +const cirfnint = "⨐"; +const cirmid = "⫯"; +const cirscir = "⧂"; +const clubs = "♣"; +const clubsuit = "♣"; +const colon = ":"; +const colone = "≔"; +const coloneq = "≔"; +const comma = ","; +const commat = "@"; +const comp = "∁"; +const compfn = "∘"; +const complement = "∁"; +const complexes = "ℂ"; +const cong = "≅"; +const congdot = "⩭"; +const conint = "∮"; +const copf = "𝕔"; +const coprod = "∐"; +const cop = "©"; +const copy$1 = "©"; +const copysr = "℗"; +const crarr = "↵"; +const cross = "✗"; +const cscr = "𝒸"; +const csub = "⫏"; +const csube = "⫑"; +const csup = "⫐"; +const csupe = "⫒"; +const ctdot = "⋯"; +const cudarrl = "⤸"; +const cudarrr = "⤵"; +const cuepr = "⋞"; +const cuesc = "⋟"; +const cularr = "↶"; +const cularrp = "⤽"; +const cup = "∪"; +const cupbrcap = "⩈"; +const cupcap = "⩆"; +const cupcup = "⩊"; +const cupdot = "⊍"; +const cupor = "⩅"; +const cups = "∪︀"; +const curarr = "↷"; +const curarrm = "⤼"; +const curlyeqprec = "⋞"; +const curlyeqsucc = "⋟"; +const curlyvee = "⋎"; +const curlywedge = "⋏"; +const curre = "¤"; +const curren = "¤"; +const curvearrowleft = "↶"; +const curvearrowright = "↷"; +const cuvee = "⋎"; +const cuwed = "⋏"; +const cwconint = "∲"; +const cwint = "∱"; +const cylcty = "⌭"; +const dArr = "⇓"; +const dHar = "⥥"; +const dagger = "†"; +const daleth = "ℸ"; +const darr = "↓"; +const dash = "‐"; +const dashv = "⊣"; +const dbkarow = "⤏"; +const dblac = "˝"; +const dcaron = "ď"; +const dcy = "д"; +const dd = "ⅆ"; +const ddagger = "‡"; +const ddarr = "⇊"; +const ddotseq = "⩷"; +const de = "°"; +const deg = "°"; +const delta = "δ"; +const demptyv = "⦱"; +const dfisht = "⥿"; +const dfr = "𝔡"; +const dharl = "⇃"; +const dharr = "⇂"; +const diam = "⋄"; +const diamond = "⋄"; +const diamondsuit = "♦"; +const diams = "♦"; +const die = "¨"; +const digamma = "ϝ"; +const disin = "⋲"; +const div = "÷"; +const divid = "÷"; +const divide = "÷"; +const divideontimes = "⋇"; +const divonx = "⋇"; +const djcy = "ђ"; +const dlcorn = "⌞"; +const dlcrop = "⌍"; +const dollar = "$"; +const dopf = "𝕕"; +const dot = "˙"; +const doteq = "≐"; +const doteqdot = "≑"; +const dotminus = "∸"; +const dotplus = "∔"; +const dotsquare = "⊡"; +const doublebarwedge = "⌆"; +const downarrow = "↓"; +const downdownarrows = "⇊"; +const downharpoonleft = "⇃"; +const downharpoonright = "⇂"; +const drbkarow = "⤐"; +const drcorn = "⌟"; +const drcrop = "⌌"; +const dscr = "𝒹"; +const dscy = "ѕ"; +const dsol = "⧶"; +const dstrok = "đ"; +const dtdot = "⋱"; +const dtri = "▿"; +const dtrif = "▾"; +const duarr = "⇵"; +const duhar = "⥯"; +const dwangle = "⦦"; +const dzcy = "џ"; +const dzigrarr = "⟿"; +const eDDot = "⩷"; +const eDot = "≑"; +const eacut = "é"; +const eacute = "é"; +const easter = "⩮"; +const ecaron = "ě"; +const ecir = "ê"; +const ecirc = "ê"; +const ecolon = "≕"; +const ecy = "э"; +const edot = "ė"; +const ee = "ⅇ"; +const efDot = "≒"; +const efr = "𝔢"; +const eg = "⪚"; +const egrav = "è"; +const egrave = "è"; +const egs = "⪖"; +const egsdot = "⪘"; +const el = "⪙"; +const elinters = "⏧"; +const ell = "ℓ"; +const els = "⪕"; +const elsdot = "⪗"; +const emacr = "ē"; +const empty = "∅"; +const emptyset = "∅"; +const emptyv = "∅"; +const emsp13 = " "; +const emsp14 = " "; +const emsp = " "; +const eng = "ŋ"; +const ensp = " "; +const eogon = "ę"; +const eopf = "𝕖"; +const epar = "⋕"; +const eparsl = "⧣"; +const eplus = "⩱"; +const epsi = "ε"; +const epsilon = "ε"; +const epsiv = "ϵ"; +const eqcirc = "≖"; +const eqcolon = "≕"; +const eqsim = "≂"; +const eqslantgtr = "⪖"; +const eqslantless = "⪕"; +const equals = "="; +const equest = "≟"; +const equiv = "≡"; +const equivDD = "⩸"; +const eqvparsl = "⧥"; +const erDot = "≓"; +const erarr = "⥱"; +const escr = "ℯ"; +const esdot = "≐"; +const esim = "≂"; +const eta = "η"; +const et = "ð"; +const eth = "ð"; +const eum = "ë"; +const euml = "ë"; +const euro = "€"; +const excl = "!"; +const exist = "∃"; +const expectation = "ℰ"; +const exponentiale = "ⅇ"; +const fallingdotseq = "≒"; +const fcy = "ф"; +const female = "♀"; +const ffilig = "ffi"; +const fflig = "ff"; +const ffllig = "ffl"; +const ffr = "𝔣"; +const filig = "fi"; +const fjlig = "fj"; +const flat = "♭"; +const fllig = "fl"; +const fltns = "▱"; +const fnof = "ƒ"; +const fopf = "𝕗"; +const forall = "∀"; +const fork = "⋔"; +const forkv = "⫙"; +const fpartint = "⨍"; +const frac1 = "¼"; +const frac12 = "½"; +const frac13 = "⅓"; +const frac14 = "¼"; +const frac15 = "⅕"; +const frac16 = "⅙"; +const frac18 = "⅛"; +const frac23 = "⅔"; +const frac25 = "⅖"; +const frac3 = "¾"; +const frac34 = "¾"; +const frac35 = "⅗"; +const frac38 = "⅜"; +const frac45 = "⅘"; +const frac56 = "⅚"; +const frac58 = "⅝"; +const frac78 = "⅞"; +const frasl = "⁄"; +const frown = "⌢"; +const fscr = "𝒻"; +const gE = "≧"; +const gEl = "⪌"; +const gacute = "ǵ"; +const gamma = "γ"; +const gammad = "ϝ"; +const gap = "⪆"; +const gbreve = "ğ"; +const gcirc = "ĝ"; +const gcy = "г"; +const gdot = "ġ"; +const ge = "≥"; +const gel = "⋛"; +const geq = "≥"; +const geqq = "≧"; +const geqslant = "⩾"; +const ges = "⩾"; +const gescc = "⪩"; +const gesdot = "⪀"; +const gesdoto = "⪂"; +const gesdotol = "⪄"; +const gesl = "⋛︀"; +const gesles = "⪔"; +const gfr = "𝔤"; +const gg = "≫"; +const ggg = "⋙"; +const gimel = "ℷ"; +const gjcy = "ѓ"; +const gl = "≷"; +const glE = "⪒"; +const gla = "⪥"; +const glj = "⪤"; +const gnE = "≩"; +const gnap = "⪊"; +const gnapprox = "⪊"; +const gne = "⪈"; +const gneq = "⪈"; +const gneqq = "≩"; +const gnsim = "⋧"; +const gopf = "𝕘"; +const grave = "`"; +const gscr = "ℊ"; +const gsim = "≳"; +const gsime = "⪎"; +const gsiml = "⪐"; +const g = ">"; +const gt = ">"; +const gtcc = "⪧"; +const gtcir = "⩺"; +const gtdot = "⋗"; +const gtlPar = "⦕"; +const gtquest = "⩼"; +const gtrapprox = "⪆"; +const gtrarr = "⥸"; +const gtrdot = "⋗"; +const gtreqless = "⋛"; +const gtreqqless = "⪌"; +const gtrless = "≷"; +const gtrsim = "≳"; +const gvertneqq = "≩︀"; +const gvnE = "≩︀"; +const hArr = "⇔"; +const hairsp = " "; +const half = "½"; +const hamilt = "ℋ"; +const hardcy = "ъ"; +const harr = "↔"; +const harrcir = "⥈"; +const harrw = "↭"; +const hbar = "ℏ"; +const hcirc = "ĥ"; +const hearts = "♥"; +const heartsuit = "♥"; +const hellip = "…"; +const hercon = "⊹"; +const hfr = "𝔥"; +const hksearow = "⤥"; +const hkswarow = "⤦"; +const hoarr = "⇿"; +const homtht = "∻"; +const hookleftarrow = "↩"; +const hookrightarrow = "↪"; +const hopf = "𝕙"; +const horbar = "―"; +const hscr = "𝒽"; +const hslash = "ℏ"; +const hstrok = "ħ"; +const hybull = "⁃"; +const hyphen = "‐"; +const iacut = "í"; +const iacute = "í"; +const ic = "⁣"; +const icir = "î"; +const icirc = "î"; +const icy = "и"; +const iecy = "е"; +const iexc = "¡"; +const iexcl = "¡"; +const iff = "⇔"; +const ifr = "𝔦"; +const igrav = "ì"; +const igrave = "ì"; +const ii = "ⅈ"; +const iiiint = "⨌"; +const iiint = "∭"; +const iinfin = "⧜"; +const iiota = "℩"; +const ijlig = "ij"; +const imacr = "ī"; +const image = "ℑ"; +const imagline = "ℐ"; +const imagpart = "ℑ"; +const imath = "ı"; +const imof = "⊷"; +const imped = "Ƶ"; +const incare = "℅"; +const infin = "∞"; +const infintie = "⧝"; +const inodot = "ı"; +const int$1 = "∫"; +const intcal = "⊺"; +const integers = "ℤ"; +const intercal = "⊺"; +const intlarhk = "⨗"; +const intprod = "⨼"; +const iocy = "ё"; +const iogon = "į"; +const iopf = "𝕚"; +const iota = "ι"; +const iprod = "⨼"; +const iques = "¿"; +const iquest = "¿"; +const iscr = "𝒾"; +const isin = "∈"; +const isinE = "⋹"; +const isindot = "⋵"; +const isins = "⋴"; +const isinsv = "⋳"; +const isinv = "∈"; +const it = "⁢"; +const itilde = "ĩ"; +const iukcy = "і"; +const ium = "ï"; +const iuml = "ï"; +const jcirc = "ĵ"; +const jcy = "й"; +const jfr = "𝔧"; +const jmath = "ȷ"; +const jopf = "𝕛"; +const jscr = "𝒿"; +const jsercy = "ј"; +const jukcy = "є"; +const kappa = "κ"; +const kappav = "ϰ"; +const kcedil = "ķ"; +const kcy = "к"; +const kfr = "𝔨"; +const kgreen = "ĸ"; +const khcy = "х"; +const kjcy = "ќ"; +const kopf = "𝕜"; +const kscr = "𝓀"; +const lAarr = "⇚"; +const lArr = "⇐"; +const lAtail = "⤛"; +const lBarr = "⤎"; +const lE = "≦"; +const lEg = "⪋"; +const lHar = "⥢"; +const lacute = "ĺ"; +const laemptyv = "⦴"; +const lagran = "ℒ"; +const lambda = "λ"; +const lang = "⟨"; +const langd = "⦑"; +const langle = "⟨"; +const lap = "⪅"; +const laqu = "«"; +const laquo = "«"; +const larr = "←"; +const larrb = "⇤"; +const larrbfs = "⤟"; +const larrfs = "⤝"; +const larrhk = "↩"; +const larrlp = "↫"; +const larrpl = "⤹"; +const larrsim = "⥳"; +const larrtl = "↢"; +const lat = "⪫"; +const latail = "⤙"; +const late = "⪭"; +const lates = "⪭︀"; +const lbarr = "⤌"; +const lbbrk = "❲"; +const lbrace = "{"; +const lbrack = "["; +const lbrke = "⦋"; +const lbrksld = "⦏"; +const lbrkslu = "⦍"; +const lcaron = "ľ"; +const lcedil = "ļ"; +const lceil = "⌈"; +const lcub = "{"; +const lcy = "л"; +const ldca = "⤶"; +const ldquo = "“"; +const ldquor = "„"; +const ldrdhar = "⥧"; +const ldrushar = "⥋"; +const ldsh = "↲"; +const le = "≤"; +const leftarrow = "←"; +const leftarrowtail = "↢"; +const leftharpoondown = "↽"; +const leftharpoonup = "↼"; +const leftleftarrows = "⇇"; +const leftrightarrow = "↔"; +const leftrightarrows = "⇆"; +const leftrightharpoons = "⇋"; +const leftrightsquigarrow = "↭"; +const leftthreetimes = "⋋"; +const leg = "⋚"; +const leq = "≤"; +const leqq = "≦"; +const leqslant = "⩽"; +const les = "⩽"; +const lescc = "⪨"; +const lesdot = "⩿"; +const lesdoto = "⪁"; +const lesdotor = "⪃"; +const lesg = "⋚︀"; +const lesges = "⪓"; +const lessapprox = "⪅"; +const lessdot = "⋖"; +const lesseqgtr = "⋚"; +const lesseqqgtr = "⪋"; +const lessgtr = "≶"; +const lesssim = "≲"; +const lfisht = "⥼"; +const lfloor = "⌊"; +const lfr = "𝔩"; +const lg = "≶"; +const lgE = "⪑"; +const lhard = "↽"; +const lharu = "↼"; +const lharul = "⥪"; +const lhblk = "▄"; +const ljcy = "љ"; +const ll = "≪"; +const llarr = "⇇"; +const llcorner = "⌞"; +const llhard = "⥫"; +const lltri = "◺"; +const lmidot = "ŀ"; +const lmoust = "⎰"; +const lmoustache = "⎰"; +const lnE = "≨"; +const lnap = "⪉"; +const lnapprox = "⪉"; +const lne = "⪇"; +const lneq = "⪇"; +const lneqq = "≨"; +const lnsim = "⋦"; +const loang = "⟬"; +const loarr = "⇽"; +const lobrk = "⟦"; +const longleftarrow = "⟵"; +const longleftrightarrow = "⟷"; +const longmapsto = "⟼"; +const longrightarrow = "⟶"; +const looparrowleft = "↫"; +const looparrowright = "↬"; +const lopar = "⦅"; +const lopf = "𝕝"; +const loplus = "⨭"; +const lotimes = "⨴"; +const lowast = "∗"; +const lowbar = "_"; +const loz = "◊"; +const lozenge = "◊"; +const lozf = "⧫"; +const lpar = "("; +const lparlt = "⦓"; +const lrarr = "⇆"; +const lrcorner = "⌟"; +const lrhar = "⇋"; +const lrhard = "⥭"; +const lrm = "‎"; +const lrtri = "⊿"; +const lsaquo = "‹"; +const lscr = "𝓁"; +const lsh = "↰"; +const lsim = "≲"; +const lsime = "⪍"; +const lsimg = "⪏"; +const lsqb = "["; +const lsquo = "‘"; +const lsquor = "‚"; +const lstrok = "ł"; +const l = "<"; +const lt = "<"; +const ltcc = "⪦"; +const ltcir = "⩹"; +const ltdot = "⋖"; +const lthree = "⋋"; +const ltimes = "⋉"; +const ltlarr = "⥶"; +const ltquest = "⩻"; +const ltrPar = "⦖"; +const ltri = "◃"; +const ltrie = "⊴"; +const ltrif = "◂"; +const lurdshar = "⥊"; +const luruhar = "⥦"; +const lvertneqq = "≨︀"; +const lvnE = "≨︀"; +const mDDot = "∺"; +const mac = "¯"; +const macr = "¯"; +const male = "♂"; +const malt = "✠"; +const maltese = "✠"; +const map$2 = "↦"; +const mapsto = "↦"; +const mapstodown = "↧"; +const mapstoleft = "↤"; +const mapstoup = "↥"; +const marker = "▮"; +const mcomma = "⨩"; +const mcy = "м"; +const mdash = "—"; +const measuredangle = "∡"; +const mfr = "𝔪"; +const mho = "℧"; +const micr = "µ"; +const micro = "µ"; +const mid = "∣"; +const midast = "*"; +const midcir = "⫰"; +const middo = "·"; +const middot = "·"; +const minus = "−"; +const minusb = "⊟"; +const minusd = "∸"; +const minusdu = "⨪"; +const mlcp = "⫛"; +const mldr = "…"; +const mnplus = "∓"; +const models$2 = "⊧"; +const mopf = "𝕞"; +const mp = "∓"; +const mscr = "𝓂"; +const mstpos = "∾"; +const mu = "μ"; +const multimap = "⊸"; +const mumap = "⊸"; +const nGg = "⋙̸"; +const nGt = "≫⃒"; +const nGtv = "≫̸"; +const nLeftarrow = "⇍"; +const nLeftrightarrow = "⇎"; +const nLl = "⋘̸"; +const nLt = "≪⃒"; +const nLtv = "≪̸"; +const nRightarrow = "⇏"; +const nVDash = "⊯"; +const nVdash = "⊮"; +const nabla = "∇"; +const nacute = "ń"; +const nang = "∠⃒"; +const nap = "≉"; +const napE = "⩰̸"; +const napid = "≋̸"; +const napos = "ʼn"; +const napprox = "≉"; +const natur = "♮"; +const natural = "♮"; +const naturals = "ℕ"; +const nbs = " "; +const nbsp = " "; +const nbump = "≎̸"; +const nbumpe = "≏̸"; +const ncap = "⩃"; +const ncaron = "ň"; +const ncedil = "ņ"; +const ncong = "≇"; +const ncongdot = "⩭̸"; +const ncup = "⩂"; +const ncy = "н"; +const ndash = "–"; +const ne = "≠"; +const neArr = "⇗"; +const nearhk = "⤤"; +const nearr = "↗"; +const nearrow = "↗"; +const nedot = "≐̸"; +const nequiv = "≢"; +const nesear = "⤨"; +const nesim = "≂̸"; +const nexist = "∄"; +const nexists = "∄"; +const nfr = "𝔫"; +const ngE = "≧̸"; +const nge = "≱"; +const ngeq = "≱"; +const ngeqq = "≧̸"; +const ngeqslant = "⩾̸"; +const nges = "⩾̸"; +const ngsim = "≵"; +const ngt = "≯"; +const ngtr = "≯"; +const nhArr = "⇎"; +const nharr = "↮"; +const nhpar = "⫲"; +const ni = "∋"; +const nis = "⋼"; +const nisd = "⋺"; +const niv = "∋"; +const njcy = "њ"; +const nlArr = "⇍"; +const nlE = "≦̸"; +const nlarr = "↚"; +const nldr = "‥"; +const nle = "≰"; +const nleftarrow = "↚"; +const nleftrightarrow = "↮"; +const nleq = "≰"; +const nleqq = "≦̸"; +const nleqslant = "⩽̸"; +const nles = "⩽̸"; +const nless = "≮"; +const nlsim = "≴"; +const nlt = "≮"; +const nltri = "⋪"; +const nltrie = "⋬"; +const nmid = "∤"; +const nopf = "𝕟"; +const no = "¬"; +const not = "¬"; +const notin = "∉"; +const notinE = "⋹̸"; +const notindot = "⋵̸"; +const notinva = "∉"; +const notinvb = "⋷"; +const notinvc = "⋶"; +const notni = "∌"; +const notniva = "∌"; +const notnivb = "⋾"; +const notnivc = "⋽"; +const npar = "∦"; +const nparallel = "∦"; +const nparsl = "⫽⃥"; +const npart = "∂̸"; +const npolint = "⨔"; +const npr = "⊀"; +const nprcue = "⋠"; +const npre = "⪯̸"; +const nprec = "⊀"; +const npreceq = "⪯̸"; +const nrArr = "⇏"; +const nrarr = "↛"; +const nrarrc = "⤳̸"; +const nrarrw = "↝̸"; +const nrightarrow = "↛"; +const nrtri = "⋫"; +const nrtrie = "⋭"; +const nsc = "⊁"; +const nsccue = "⋡"; +const nsce = "⪰̸"; +const nscr = "𝓃"; +const nshortmid = "∤"; +const nshortparallel = "∦"; +const nsim = "≁"; +const nsime = "≄"; +const nsimeq = "≄"; +const nsmid = "∤"; +const nspar = "∦"; +const nsqsube = "⋢"; +const nsqsupe = "⋣"; +const nsub = "⊄"; +const nsubE = "⫅̸"; +const nsube = "⊈"; +const nsubset = "⊂⃒"; +const nsubseteq = "⊈"; +const nsubseteqq = "⫅̸"; +const nsucc = "⊁"; +const nsucceq = "⪰̸"; +const nsup = "⊅"; +const nsupE = "⫆̸"; +const nsupe = "⊉"; +const nsupset = "⊃⃒"; +const nsupseteq = "⊉"; +const nsupseteqq = "⫆̸"; +const ntgl = "≹"; +const ntild = "ñ"; +const ntilde = "ñ"; +const ntlg = "≸"; +const ntriangleleft = "⋪"; +const ntrianglelefteq = "⋬"; +const ntriangleright = "⋫"; +const ntrianglerighteq = "⋭"; +const nu = "ν"; +const num = "#"; +const numero = "№"; +const numsp = " "; +const nvDash = "⊭"; +const nvHarr = "⤄"; +const nvap = "≍⃒"; +const nvdash = "⊬"; +const nvge = "≥⃒"; +const nvgt = ">⃒"; +const nvinfin = "⧞"; +const nvlArr = "⤂"; +const nvle = "≤⃒"; +const nvlt = "<⃒"; +const nvltrie = "⊴⃒"; +const nvrArr = "⤃"; +const nvrtrie = "⊵⃒"; +const nvsim = "∼⃒"; +const nwArr = "⇖"; +const nwarhk = "⤣"; +const nwarr = "↖"; +const nwarrow = "↖"; +const nwnear = "⤧"; +const oS = "Ⓢ"; +const oacut = "ó"; +const oacute = "ó"; +const oast = "⊛"; +const ocir = "ô"; +const ocirc = "ô"; +const ocy = "о"; +const odash = "⊝"; +const odblac = "ő"; +const odiv = "⨸"; +const odot = "⊙"; +const odsold = "⦼"; +const oelig = "œ"; +const ofcir = "⦿"; +const ofr = "𝔬"; +const ogon = "˛"; +const ograv = "ò"; +const ograve = "ò"; +const ogt = "⧁"; +const ohbar = "⦵"; +const ohm = "Ω"; +const oint = "∮"; +const olarr = "↺"; +const olcir = "⦾"; +const olcross = "⦻"; +const oline = "‾"; +const olt = "⧀"; +const omacr = "ō"; +const omega = "ω"; +const omicron = "ο"; +const omid = "⦶"; +const ominus = "⊖"; +const oopf = "𝕠"; +const opar = "⦷"; +const operp = "⦹"; +const oplus = "⊕"; +const or = "∨"; +const orarr = "↻"; +const ord = "º"; +const order$1 = "ℴ"; +const orderof = "ℴ"; +const ordf = "ª"; +const ordm = "º"; +const origof = "⊶"; +const oror = "⩖"; +const orslope = "⩗"; +const orv = "⩛"; +const oscr = "ℴ"; +const oslas = "ø"; +const oslash = "ø"; +const osol = "⊘"; +const otild = "õ"; +const otilde = "õ"; +const otimes = "⊗"; +const otimesas = "⨶"; +const oum = "ö"; +const ouml = "ö"; +const ovbar = "⌽"; +const par = "¶"; +const para = "¶"; +const parallel = "∥"; +const parsim = "⫳"; +const parsl = "⫽"; +const part = "∂"; +const pcy = "п"; +const percnt = "%"; +const period = "."; +const permil = "‰"; +const perp = "⊥"; +const pertenk = "‱"; +const pfr = "𝔭"; +const phi = "φ"; +const phiv = "ϕ"; +const phmmat = "ℳ"; +const phone = "☎"; +const pi = "π"; +const pitchfork = "⋔"; +const piv = "ϖ"; +const planck = "ℏ"; +const planckh = "ℎ"; +const plankv = "ℏ"; +const plus = "+"; +const plusacir = "⨣"; +const plusb = "⊞"; +const pluscir = "⨢"; +const plusdo = "∔"; +const plusdu = "⨥"; +const pluse = "⩲"; +const plusm = "±"; +const plusmn = "±"; +const plussim = "⨦"; +const plustwo = "⨧"; +const pm = "±"; +const pointint = "⨕"; +const popf = "𝕡"; +const poun = "£"; +const pound = "£"; +const pr = "≺"; +const prE = "⪳"; +const prap = "⪷"; +const prcue = "≼"; +const pre = "⪯"; +const prec = "≺"; +const precapprox = "⪷"; +const preccurlyeq = "≼"; +const preceq = "⪯"; +const precnapprox = "⪹"; +const precneqq = "⪵"; +const precnsim = "⋨"; +const precsim = "≾"; +const prime = "′"; +const primes = "ℙ"; +const prnE = "⪵"; +const prnap = "⪹"; +const prnsim = "⋨"; +const prod = "∏"; +const profalar = "⌮"; +const profline = "⌒"; +const profsurf = "⌓"; +const prop = "∝"; +const propto = "∝"; +const prsim = "≾"; +const prurel = "⊰"; +const pscr = "𝓅"; +const psi = "ψ"; +const puncsp = " "; +const qfr = "𝔮"; +const qint = "⨌"; +const qopf = "𝕢"; +const qprime = "⁗"; +const qscr = "𝓆"; +const quaternions = "ℍ"; +const quatint = "⨖"; +const quest = "?"; +const questeq = "≟"; +const quo = "\""; +const quot = "\""; +const rAarr = "⇛"; +const rArr = "⇒"; +const rAtail = "⤜"; +const rBarr = "⤏"; +const rHar = "⥤"; +const race = "∽̱"; +const racute = "ŕ"; +const radic = "√"; +const raemptyv = "⦳"; +const rang = "⟩"; +const rangd = "⦒"; +const range$1 = "⦥"; +const rangle = "⟩"; +const raqu = "»"; +const raquo = "»"; +const rarr = "→"; +const rarrap = "⥵"; +const rarrb = "⇥"; +const rarrbfs = "⤠"; +const rarrc = "⤳"; +const rarrfs = "⤞"; +const rarrhk = "↪"; +const rarrlp = "↬"; +const rarrpl = "⥅"; +const rarrsim = "⥴"; +const rarrtl = "↣"; +const rarrw = "↝"; +const ratail = "⤚"; +const ratio = "∶"; +const rationals = "ℚ"; +const rbarr = "⤍"; +const rbbrk = "❳"; +const rbrace = "}"; +const rbrack = "]"; +const rbrke = "⦌"; +const rbrksld = "⦎"; +const rbrkslu = "⦐"; +const rcaron = "ř"; +const rcedil = "ŗ"; +const rceil = "⌉"; +const rcub = "}"; +const rcy = "р"; +const rdca = "⤷"; +const rdldhar = "⥩"; +const rdquo = "”"; +const rdquor = "”"; +const rdsh = "↳"; +const real = "ℜ"; +const realine = "ℛ"; +const realpart = "ℜ"; +const reals = "ℝ"; +const rect = "▭"; +const re = "®"; +const reg = "®"; +const rfisht = "⥽"; +const rfloor = "⌋"; +const rfr = "𝔯"; +const rhard = "⇁"; +const rharu = "⇀"; +const rharul = "⥬"; +const rho = "ρ"; +const rhov = "ϱ"; +const rightarrow = "→"; +const rightarrowtail = "↣"; +const rightharpoondown = "⇁"; +const rightharpoonup = "⇀"; +const rightleftarrows = "⇄"; +const rightleftharpoons = "⇌"; +const rightrightarrows = "⇉"; +const rightsquigarrow = "↝"; +const rightthreetimes = "⋌"; +const ring = "˚"; +const risingdotseq = "≓"; +const rlarr = "⇄"; +const rlhar = "⇌"; +const rlm = "‏"; +const rmoust = "⎱"; +const rmoustache = "⎱"; +const rnmid = "⫮"; +const roang = "⟭"; +const roarr = "⇾"; +const robrk = "⟧"; +const ropar = "⦆"; +const ropf = "𝕣"; +const roplus = "⨮"; +const rotimes = "⨵"; +const rpar = ")"; +const rpargt = "⦔"; +const rppolint = "⨒"; +const rrarr = "⇉"; +const rsaquo = "›"; +const rscr = "𝓇"; +const rsh = "↱"; +const rsqb = "]"; +const rsquo = "’"; +const rsquor = "’"; +const rthree = "⋌"; +const rtimes = "⋊"; +const rtri = "▹"; +const rtrie = "⊵"; +const rtrif = "▸"; +const rtriltri = "⧎"; +const ruluhar = "⥨"; +const rx = "℞"; +const sacute = "ś"; +const sbquo = "‚"; +const sc = "≻"; +const scE = "⪴"; +const scap = "⪸"; +const scaron = "š"; +const sccue = "≽"; +const sce = "⪰"; +const scedil = "ş"; +const scirc = "ŝ"; +const scnE = "⪶"; +const scnap = "⪺"; +const scnsim = "⋩"; +const scpolint = "⨓"; +const scsim = "≿"; +const scy = "с"; +const sdot = "⋅"; +const sdotb = "⊡"; +const sdote = "⩦"; +const seArr = "⇘"; +const searhk = "⤥"; +const searr = "↘"; +const searrow = "↘"; +const sec = "§"; +const sect = "§"; +const semi = ";"; +const seswar = "⤩"; +const setminus = "∖"; +const setmn = "∖"; +const sext = "✶"; +const sfr = "𝔰"; +const sfrown = "⌢"; +const sharp = "♯"; +const shchcy = "щ"; +const shcy = "ш"; +const shortmid = "∣"; +const shortparallel = "∥"; +const sh = "­"; +const shy = "­"; +const sigma = "σ"; +const sigmaf = "ς"; +const sigmav = "ς"; +const sim = "∼"; +const simdot = "⩪"; +const sime = "≃"; +const simeq = "≃"; +const simg = "⪞"; +const simgE = "⪠"; +const siml = "⪝"; +const simlE = "⪟"; +const simne = "≆"; +const simplus = "⨤"; +const simrarr = "⥲"; +const slarr = "←"; +const smallsetminus = "∖"; +const smashp = "⨳"; +const smeparsl = "⧤"; +const smid = "∣"; +const smile = "⌣"; +const smt = "⪪"; +const smte = "⪬"; +const smtes = "⪬︀"; +const softcy = "ь"; +const sol = "/"; +const solb = "⧄"; +const solbar = "⌿"; +const sopf = "𝕤"; +const spades = "♠"; +const spadesuit = "♠"; +const spar = "∥"; +const sqcap = "⊓"; +const sqcaps = "⊓︀"; +const sqcup = "⊔"; +const sqcups = "⊔︀"; +const sqsub = "⊏"; +const sqsube = "⊑"; +const sqsubset = "⊏"; +const sqsubseteq = "⊑"; +const sqsup = "⊐"; +const sqsupe = "⊒"; +const sqsupset = "⊐"; +const sqsupseteq = "⊒"; +const squ = "□"; +const square = "□"; +const squarf = "▪"; +const squf = "▪"; +const srarr = "→"; +const sscr = "𝓈"; +const ssetmn = "∖"; +const ssmile = "⌣"; +const sstarf = "⋆"; +const star$1 = "☆"; +const starf = "★"; +const straightepsilon = "ϵ"; +const straightphi = "ϕ"; +const strns = "¯"; +const sub = "⊂"; +const subE = "⫅"; +const subdot = "⪽"; +const sube = "⊆"; +const subedot = "⫃"; +const submult = "⫁"; +const subnE = "⫋"; +const subne = "⊊"; +const subplus = "⪿"; +const subrarr = "⥹"; +const subset = "⊂"; +const subseteq = "⊆"; +const subseteqq = "⫅"; +const subsetneq = "⊊"; +const subsetneqq = "⫋"; +const subsim = "⫇"; +const subsub = "⫕"; +const subsup = "⫓"; +const succ = "≻"; +const succapprox = "⪸"; +const succcurlyeq = "≽"; +const succeq = "⪰"; +const succnapprox = "⪺"; +const succneqq = "⪶"; +const succnsim = "⋩"; +const succsim = "≿"; +const sum = "∑"; +const sung = "♪"; +const sup = "⊃"; +const sup1 = "¹"; +const sup2 = "²"; +const sup3 = "³"; +const supE = "⫆"; +const supdot = "⪾"; +const supdsub = "⫘"; +const supe = "⊇"; +const supedot = "⫄"; +const suphsol = "⟉"; +const suphsub = "⫗"; +const suplarr = "⥻"; +const supmult = "⫂"; +const supnE = "⫌"; +const supne = "⊋"; +const supplus = "⫀"; +const supset = "⊃"; +const supseteq = "⊇"; +const supseteqq = "⫆"; +const supsetneq = "⊋"; +const supsetneqq = "⫌"; +const supsim = "⫈"; +const supsub = "⫔"; +const supsup = "⫖"; +const swArr = "⇙"; +const swarhk = "⤦"; +const swarr = "↙"; +const swarrow = "↙"; +const swnwar = "⤪"; +const szli = "ß"; +const szlig = "ß"; +const target = "⌖"; +const tau = "τ"; +const tbrk = "⎴"; +const tcaron = "ť"; +const tcedil = "ţ"; +const tcy = "т"; +const tdot = "⃛"; +const telrec = "⌕"; +const tfr = "𝔱"; +const there4 = "∴"; +const therefore = "∴"; +const theta = "θ"; +const thetasym = "ϑ"; +const thetav = "ϑ"; +const thickapprox = "≈"; +const thicksim = "∼"; +const thinsp = " "; +const thkap = "≈"; +const thksim = "∼"; +const thor = "þ"; +const thorn = "þ"; +const tilde = "˜"; +const time = "×"; +const times = "×"; +const timesb = "⊠"; +const timesbar = "⨱"; +const timesd = "⨰"; +const tint = "∭"; +const toea = "⤨"; +const top = "⊤"; +const topbot = "⌶"; +const topcir = "⫱"; +const topf = "𝕥"; +const topfork = "⫚"; +const tosa = "⤩"; +const tprime = "‴"; +const trade = "™"; +const triangle = "▵"; +const triangledown = "▿"; +const triangleleft = "◃"; +const trianglelefteq = "⊴"; +const triangleq = "≜"; +const triangleright = "▹"; +const trianglerighteq = "⊵"; +const tridot = "◬"; +const trie = "≜"; +const triminus = "⨺"; +const triplus = "⨹"; +const trisb = "⧍"; +const tritime = "⨻"; +const trpezium = "⏢"; +const tscr = "𝓉"; +const tscy = "ц"; +const tshcy = "ћ"; +const tstrok = "ŧ"; +const twixt = "≬"; +const twoheadleftarrow = "↞"; +const twoheadrightarrow = "↠"; +const uArr = "⇑"; +const uHar = "⥣"; +const uacut = "ú"; +const uacute = "ú"; +const uarr = "↑"; +const ubrcy = "ў"; +const ubreve = "ŭ"; +const ucir = "û"; +const ucirc = "û"; +const ucy = "у"; +const udarr = "⇅"; +const udblac = "ű"; +const udhar = "⥮"; +const ufisht = "⥾"; +const ufr = "𝔲"; +const ugrav = "ù"; +const ugrave = "ù"; +const uharl = "↿"; +const uharr = "↾"; +const uhblk = "▀"; +const ulcorn = "⌜"; +const ulcorner = "⌜"; +const ulcrop = "⌏"; +const ultri = "◸"; +const umacr = "ū"; +const um = "¨"; +const uml = "¨"; +const uogon = "ų"; +const uopf = "𝕦"; +const uparrow = "↑"; +const updownarrow = "↕"; +const upharpoonleft = "↿"; +const upharpoonright = "↾"; +const uplus = "⊎"; +const upsi = "υ"; +const upsih = "ϒ"; +const upsilon = "υ"; +const upuparrows = "⇈"; +const urcorn = "⌝"; +const urcorner = "⌝"; +const urcrop = "⌎"; +const uring = "ů"; +const urtri = "◹"; +const uscr = "𝓊"; +const utdot = "⋰"; +const utilde = "ũ"; +const utri = "▵"; +const utrif = "▴"; +const uuarr = "⇈"; +const uum = "ü"; +const uuml = "ü"; +const uwangle = "⦧"; +const vArr = "⇕"; +const vBar = "⫨"; +const vBarv = "⫩"; +const vDash = "⊨"; +const vangrt = "⦜"; +const varepsilon = "ϵ"; +const varkappa = "ϰ"; +const varnothing = "∅"; +const varphi = "ϕ"; +const varpi = "ϖ"; +const varpropto = "∝"; +const varr = "↕"; +const varrho = "ϱ"; +const varsigma = "ς"; +const varsubsetneq = "⊊︀"; +const varsubsetneqq = "⫋︀"; +const varsupsetneq = "⊋︀"; +const varsupsetneqq = "⫌︀"; +const vartheta = "ϑ"; +const vartriangleleft = "⊲"; +const vartriangleright = "⊳"; +const vcy = "в"; +const vdash = "⊢"; +const vee = "∨"; +const veebar = "⊻"; +const veeeq = "≚"; +const vellip = "⋮"; +const verbar = "|"; +const vert = "|"; +const vfr = "𝔳"; +const vltri = "⊲"; +const vnsub = "⊂⃒"; +const vnsup = "⊃⃒"; +const vopf = "𝕧"; +const vprop = "∝"; +const vrtri = "⊳"; +const vscr = "𝓋"; +const vsubnE = "⫋︀"; +const vsubne = "⊊︀"; +const vsupnE = "⫌︀"; +const vsupne = "⊋︀"; +const vzigzag = "⦚"; +const wcirc = "ŵ"; +const wedbar = "⩟"; +const wedge = "∧"; +const wedgeq = "≙"; +const weierp = "℘"; +const wfr = "𝔴"; +const wopf = "𝕨"; +const wp = "℘"; +const wr = "≀"; +const wreath = "≀"; +const wscr = "𝓌"; +const xcap = "⋂"; +const xcirc = "◯"; +const xcup = "⋃"; +const xdtri = "▽"; +const xfr = "𝔵"; +const xhArr = "⟺"; +const xharr = "⟷"; +const xi = "ξ"; +const xlArr = "⟸"; +const xlarr = "⟵"; +const xmap = "⟼"; +const xnis = "⋻"; +const xodot = "⨀"; +const xopf = "𝕩"; +const xoplus = "⨁"; +const xotime = "⨂"; +const xrArr = "⟹"; +const xrarr = "⟶"; +const xscr = "𝓍"; +const xsqcup = "⨆"; +const xuplus = "⨄"; +const xutri = "△"; +const xvee = "⋁"; +const xwedge = "⋀"; +const yacut = "ý"; +const yacute = "ý"; +const yacy = "я"; +const ycirc = "ŷ"; +const ycy = "ы"; +const ye = "¥"; +const yen = "¥"; +const yfr = "𝔶"; +const yicy = "ї"; +const yopf = "𝕪"; +const yscr = "𝓎"; +const yucy = "ю"; +const yum = "ÿ"; +const yuml = "ÿ"; +const zacute = "ź"; +const zcaron = "ž"; +const zcy = "з"; +const zdot = "ż"; +const zeetrf = "ℨ"; +const zeta = "ζ"; +const zfr = "𝔷"; +const zhcy = "ж"; +const zigrarr = "⇝"; +const zopf = "𝕫"; +const zscr = "𝓏"; +const zwj = "‍"; +const zwnj = "‌"; +var characterEntities = { + AEli: AEli, + AElig: AElig, + AM: AM, + AMP: AMP, + Aacut: Aacut, + Aacute: Aacute, + Abreve: Abreve, + Acir: Acir, + Acirc: Acirc, + Acy: Acy, + Afr: Afr, + Agrav: Agrav, + Agrave: Agrave, + Alpha: Alpha, + Amacr: Amacr, + And: And, + Aogon: Aogon, + Aopf: Aopf, + ApplyFunction: ApplyFunction, + Arin: Arin, + Aring: Aring, + Ascr: Ascr, + Assign: Assign, + Atild: Atild, + Atilde: Atilde, + Aum: Aum, + Auml: Auml, + Backslash: Backslash, + Barv: Barv, + Barwed: Barwed, + Bcy: Bcy, + Because: Because, + Bernoullis: Bernoullis, + Beta: Beta, + Bfr: Bfr, + Bopf: Bopf, + Breve: Breve, + Bscr: Bscr, + Bumpeq: Bumpeq, + CHcy: CHcy, + COP: COP, + COPY: COPY, + Cacute: Cacute, + Cap: Cap, + CapitalDifferentialD: CapitalDifferentialD, + Cayleys: Cayleys, + Ccaron: Ccaron, + Ccedi: Ccedi, + Ccedil: Ccedil, + Ccirc: Ccirc, + Cconint: Cconint, + Cdot: Cdot, + Cedilla: Cedilla, + CenterDot: CenterDot, + Cfr: Cfr, + Chi: Chi, + CircleDot: CircleDot, + CircleMinus: CircleMinus, + CirclePlus: CirclePlus, + CircleTimes: CircleTimes, + ClockwiseContourIntegral: ClockwiseContourIntegral, + CloseCurlyDoubleQuote: CloseCurlyDoubleQuote, + CloseCurlyQuote: CloseCurlyQuote, + Colon: Colon, + Colone: Colone, + Congruent: Congruent, + Conint: Conint, + ContourIntegral: ContourIntegral, + Copf: Copf, + Coproduct: Coproduct, + CounterClockwiseContourIntegral: CounterClockwiseContourIntegral, + Cross: Cross, + Cscr: Cscr, + Cup: Cup, + CupCap: CupCap, + DD: DD, + DDotrahd: DDotrahd, + DJcy: DJcy, + DScy: DScy, + DZcy: DZcy, + Dagger: Dagger, + Darr: Darr, + Dashv: Dashv, + Dcaron: Dcaron, + Dcy: Dcy, + Del: Del, + Delta: Delta, + Dfr: Dfr, + DiacriticalAcute: DiacriticalAcute, + DiacriticalDot: DiacriticalDot, + DiacriticalDoubleAcute: DiacriticalDoubleAcute, + DiacriticalGrave: DiacriticalGrave, + DiacriticalTilde: DiacriticalTilde, + Diamond: Diamond, + DifferentialD: DifferentialD, + Dopf: Dopf, + Dot: Dot, + DotDot: DotDot, + DotEqual: DotEqual, + DoubleContourIntegral: DoubleContourIntegral, + DoubleDot: DoubleDot, + DoubleDownArrow: DoubleDownArrow, + DoubleLeftArrow: DoubleLeftArrow, + DoubleLeftRightArrow: DoubleLeftRightArrow, + DoubleLeftTee: DoubleLeftTee, + DoubleLongLeftArrow: DoubleLongLeftArrow, + DoubleLongLeftRightArrow: DoubleLongLeftRightArrow, + DoubleLongRightArrow: DoubleLongRightArrow, + DoubleRightArrow: DoubleRightArrow, + DoubleRightTee: DoubleRightTee, + DoubleUpArrow: DoubleUpArrow, + DoubleUpDownArrow: DoubleUpDownArrow, + DoubleVerticalBar: DoubleVerticalBar, + DownArrow: DownArrow, + DownArrowBar: DownArrowBar, + DownArrowUpArrow: DownArrowUpArrow, + DownBreve: DownBreve, + DownLeftRightVector: DownLeftRightVector, + DownLeftTeeVector: DownLeftTeeVector, + DownLeftVector: DownLeftVector, + DownLeftVectorBar: DownLeftVectorBar, + DownRightTeeVector: DownRightTeeVector, + DownRightVector: DownRightVector, + DownRightVectorBar: DownRightVectorBar, + DownTee: DownTee, + DownTeeArrow: DownTeeArrow, + Downarrow: Downarrow, + Dscr: Dscr, + Dstrok: Dstrok, + ENG: ENG, + ET: ET, + ETH: ETH, + Eacut: Eacut, + Eacute: Eacute, + Ecaron: Ecaron, + Ecir: Ecir, + Ecirc: Ecirc, + Ecy: Ecy, + Edot: Edot, + Efr: Efr, + Egrav: Egrav, + Egrave: Egrave, + Element: Element, + Emacr: Emacr, + EmptySmallSquare: EmptySmallSquare, + EmptyVerySmallSquare: EmptyVerySmallSquare, + Eogon: Eogon, + Eopf: Eopf, + Epsilon: Epsilon, + Equal: Equal, + EqualTilde: EqualTilde, + Equilibrium: Equilibrium, + Escr: Escr, + Esim: Esim, + Eta: Eta, + Eum: Eum, + Euml: Euml, + Exists: Exists, + ExponentialE: ExponentialE, + Fcy: Fcy, + Ffr: Ffr, + FilledSmallSquare: FilledSmallSquare, + FilledVerySmallSquare: FilledVerySmallSquare, + Fopf: Fopf, + ForAll: ForAll, + Fouriertrf: Fouriertrf, + Fscr: Fscr, + GJcy: GJcy, + G: G, + GT: GT, + Gamma: Gamma, + Gammad: Gammad, + Gbreve: Gbreve, + Gcedil: Gcedil, + Gcirc: Gcirc, + Gcy: Gcy, + Gdot: Gdot, + Gfr: Gfr, + Gg: Gg, + Gopf: Gopf, + GreaterEqual: GreaterEqual, + GreaterEqualLess: GreaterEqualLess, + GreaterFullEqual: GreaterFullEqual, + GreaterGreater: GreaterGreater, + GreaterLess: GreaterLess, + GreaterSlantEqual: GreaterSlantEqual, + GreaterTilde: GreaterTilde, + Gscr: Gscr, + Gt: Gt, + HARDcy: HARDcy, + Hacek: Hacek, + Hat: Hat, + Hcirc: Hcirc, + Hfr: Hfr, + HilbertSpace: HilbertSpace, + Hopf: Hopf, + HorizontalLine: HorizontalLine, + Hscr: Hscr, + Hstrok: Hstrok, + HumpDownHump: HumpDownHump, + HumpEqual: HumpEqual, + IEcy: IEcy, + IJlig: IJlig, + IOcy: IOcy, + Iacut: Iacut, + Iacute: Iacute, + Icir: Icir, + Icirc: Icirc, + Icy: Icy, + Idot: Idot, + Ifr: Ifr, + Igrav: Igrav, + Igrave: Igrave, + Im: Im, + Imacr: Imacr, + ImaginaryI: ImaginaryI, + Implies: Implies, + Int: Int, + Integral: Integral, + Intersection: Intersection, + InvisibleComma: InvisibleComma, + InvisibleTimes: InvisibleTimes, + Iogon: Iogon, + Iopf: Iopf, + Iota: Iota, + Iscr: Iscr, + Itilde: Itilde, + Iukcy: Iukcy, + Ium: Ium, + Iuml: Iuml, + Jcirc: Jcirc, + Jcy: Jcy, + Jfr: Jfr, + Jopf: Jopf, + Jscr: Jscr, + Jsercy: Jsercy, + Jukcy: Jukcy, + KHcy: KHcy, + KJcy: KJcy, + Kappa: Kappa, + Kcedil: Kcedil, + Kcy: Kcy, + Kfr: Kfr, + Kopf: Kopf, + Kscr: Kscr, + LJcy: LJcy, + L: L, + LT: LT, + Lacute: Lacute, + Lambda: Lambda, + Lang: Lang, + Laplacetrf: Laplacetrf, + Larr: Larr, + Lcaron: Lcaron, + Lcedil: Lcedil, + Lcy: Lcy, + LeftAngleBracket: LeftAngleBracket, + LeftArrow: LeftArrow, + LeftArrowBar: LeftArrowBar, + LeftArrowRightArrow: LeftArrowRightArrow, + LeftCeiling: LeftCeiling, + LeftDoubleBracket: LeftDoubleBracket, + LeftDownTeeVector: LeftDownTeeVector, + LeftDownVector: LeftDownVector, + LeftDownVectorBar: LeftDownVectorBar, + LeftFloor: LeftFloor, + LeftRightArrow: LeftRightArrow, + LeftRightVector: LeftRightVector, + LeftTee: LeftTee, + LeftTeeArrow: LeftTeeArrow, + LeftTeeVector: LeftTeeVector, + LeftTriangle: LeftTriangle, + LeftTriangleBar: LeftTriangleBar, + LeftTriangleEqual: LeftTriangleEqual, + LeftUpDownVector: LeftUpDownVector, + LeftUpTeeVector: LeftUpTeeVector, + LeftUpVector: LeftUpVector, + LeftUpVectorBar: LeftUpVectorBar, + LeftVector: LeftVector, + LeftVectorBar: LeftVectorBar, + Leftarrow: Leftarrow, + Leftrightarrow: Leftrightarrow, + LessEqualGreater: LessEqualGreater, + LessFullEqual: LessFullEqual, + LessGreater: LessGreater, + LessLess: LessLess, + LessSlantEqual: LessSlantEqual, + LessTilde: LessTilde, + Lfr: Lfr, + Ll: Ll, + Lleftarrow: Lleftarrow, + Lmidot: Lmidot, + LongLeftArrow: LongLeftArrow, + LongLeftRightArrow: LongLeftRightArrow, + LongRightArrow: LongRightArrow, + Longleftarrow: Longleftarrow, + Longleftrightarrow: Longleftrightarrow, + Longrightarrow: Longrightarrow, + Lopf: Lopf, + LowerLeftArrow: LowerLeftArrow, + LowerRightArrow: LowerRightArrow, + Lscr: Lscr, + Lsh: Lsh, + Lstrok: Lstrok, + Lt: Lt, + "Map": "⤅", + Mcy: Mcy, + MediumSpace: MediumSpace, + Mellintrf: Mellintrf, + Mfr: Mfr, + MinusPlus: MinusPlus, + Mopf: Mopf, + Mscr: Mscr, + Mu: Mu, + NJcy: NJcy, + Nacute: Nacute, + Ncaron: Ncaron, + Ncedil: Ncedil, + Ncy: Ncy, + NegativeMediumSpace: NegativeMediumSpace, + NegativeThickSpace: NegativeThickSpace, + NegativeThinSpace: NegativeThinSpace, + NegativeVeryThinSpace: NegativeVeryThinSpace, + NestedGreaterGreater: NestedGreaterGreater, + NestedLessLess: NestedLessLess, + NewLine: NewLine, + Nfr: Nfr, + NoBreak: NoBreak, + NonBreakingSpace: NonBreakingSpace, + Nopf: Nopf, + Not: Not, + NotCongruent: NotCongruent, + NotCupCap: NotCupCap, + NotDoubleVerticalBar: NotDoubleVerticalBar, + NotElement: NotElement, + NotEqual: NotEqual, + NotEqualTilde: NotEqualTilde, + NotExists: NotExists, + NotGreater: NotGreater, + NotGreaterEqual: NotGreaterEqual, + NotGreaterFullEqual: NotGreaterFullEqual, + NotGreaterGreater: NotGreaterGreater, + NotGreaterLess: NotGreaterLess, + NotGreaterSlantEqual: NotGreaterSlantEqual, + NotGreaterTilde: NotGreaterTilde, + NotHumpDownHump: NotHumpDownHump, + NotHumpEqual: NotHumpEqual, + NotLeftTriangle: NotLeftTriangle, + NotLeftTriangleBar: NotLeftTriangleBar, + NotLeftTriangleEqual: NotLeftTriangleEqual, + NotLess: NotLess, + NotLessEqual: NotLessEqual, + NotLessGreater: NotLessGreater, + NotLessLess: NotLessLess, + NotLessSlantEqual: NotLessSlantEqual, + NotLessTilde: NotLessTilde, + NotNestedGreaterGreater: NotNestedGreaterGreater, + NotNestedLessLess: NotNestedLessLess, + NotPrecedes: NotPrecedes, + NotPrecedesEqual: NotPrecedesEqual, + NotPrecedesSlantEqual: NotPrecedesSlantEqual, + NotReverseElement: NotReverseElement, + NotRightTriangle: NotRightTriangle, + NotRightTriangleBar: NotRightTriangleBar, + NotRightTriangleEqual: NotRightTriangleEqual, + NotSquareSubset: NotSquareSubset, + NotSquareSubsetEqual: NotSquareSubsetEqual, + NotSquareSuperset: NotSquareSuperset, + NotSquareSupersetEqual: NotSquareSupersetEqual, + NotSubset: NotSubset, + NotSubsetEqual: NotSubsetEqual, + NotSucceeds: NotSucceeds, + NotSucceedsEqual: NotSucceedsEqual, + NotSucceedsSlantEqual: NotSucceedsSlantEqual, + NotSucceedsTilde: NotSucceedsTilde, + NotSuperset: NotSuperset, + NotSupersetEqual: NotSupersetEqual, + NotTilde: NotTilde, + NotTildeEqual: NotTildeEqual, + NotTildeFullEqual: NotTildeFullEqual, + NotTildeTilde: NotTildeTilde, + NotVerticalBar: NotVerticalBar, + Nscr: Nscr, + Ntild: Ntild, + Ntilde: Ntilde, + Nu: Nu, + OElig: OElig, + Oacut: Oacut, + Oacute: Oacute, + Ocir: Ocir, + Ocirc: Ocirc, + Ocy: Ocy, + Odblac: Odblac, + Ofr: Ofr, + Ograv: Ograv, + Ograve: Ograve, + Omacr: Omacr, + Omega: Omega, + Omicron: Omicron, + Oopf: Oopf, + OpenCurlyDoubleQuote: OpenCurlyDoubleQuote, + OpenCurlyQuote: OpenCurlyQuote, + Or: Or, + Oscr: Oscr, + Oslas: Oslas, + Oslash: Oslash, + Otild: Otild, + Otilde: Otilde, + Otimes: Otimes, + Oum: Oum, + Ouml: Ouml, + OverBar: OverBar, + OverBrace: OverBrace, + OverBracket: OverBracket, + OverParenthesis: OverParenthesis, + PartialD: PartialD, + Pcy: Pcy, + Pfr: Pfr, + Phi: Phi, + Pi: Pi, + PlusMinus: PlusMinus, + Poincareplane: Poincareplane, + Popf: Popf, + Pr: Pr, + Precedes: Precedes, + PrecedesEqual: PrecedesEqual, + PrecedesSlantEqual: PrecedesSlantEqual, + PrecedesTilde: PrecedesTilde, + Prime: Prime, + Product: Product, + Proportion: Proportion, + Proportional: Proportional, + Pscr: Pscr, + Psi: Psi, + QUO: QUO, + QUOT: QUOT, + Qfr: Qfr, + Qopf: Qopf, + Qscr: Qscr, + RBarr: RBarr, + RE: RE, + REG: REG, + Racute: Racute, + Rang: Rang, + Rarr: Rarr, + Rarrtl: Rarrtl, + Rcaron: Rcaron, + Rcedil: Rcedil, + Rcy: Rcy, + Re: Re, + ReverseElement: ReverseElement, + ReverseEquilibrium: ReverseEquilibrium, + ReverseUpEquilibrium: ReverseUpEquilibrium, + Rfr: Rfr, + Rho: Rho, + RightAngleBracket: RightAngleBracket, + RightArrow: RightArrow, + RightArrowBar: RightArrowBar, + RightArrowLeftArrow: RightArrowLeftArrow, + RightCeiling: RightCeiling, + RightDoubleBracket: RightDoubleBracket, + RightDownTeeVector: RightDownTeeVector, + RightDownVector: RightDownVector, + RightDownVectorBar: RightDownVectorBar, + RightFloor: RightFloor, + RightTee: RightTee, + RightTeeArrow: RightTeeArrow, + RightTeeVector: RightTeeVector, + RightTriangle: RightTriangle, + RightTriangleBar: RightTriangleBar, + RightTriangleEqual: RightTriangleEqual, + RightUpDownVector: RightUpDownVector, + RightUpTeeVector: RightUpTeeVector, + RightUpVector: RightUpVector, + RightUpVectorBar: RightUpVectorBar, + RightVector: RightVector, + RightVectorBar: RightVectorBar, + Rightarrow: Rightarrow, + Ropf: Ropf, + RoundImplies: RoundImplies, + Rrightarrow: Rrightarrow, + Rscr: Rscr, + Rsh: Rsh, + RuleDelayed: RuleDelayed, + SHCHcy: SHCHcy, + SHcy: SHcy, + SOFTcy: SOFTcy, + Sacute: Sacute, + Sc: Sc, + Scaron: Scaron, + Scedil: Scedil, + Scirc: Scirc, + Scy: Scy, + Sfr: Sfr, + ShortDownArrow: ShortDownArrow, + ShortLeftArrow: ShortLeftArrow, + ShortRightArrow: ShortRightArrow, + ShortUpArrow: ShortUpArrow, + Sigma: Sigma, + SmallCircle: SmallCircle, + Sopf: Sopf, + Sqrt: Sqrt, + Square: Square, + SquareIntersection: SquareIntersection, + SquareSubset: SquareSubset, + SquareSubsetEqual: SquareSubsetEqual, + SquareSuperset: SquareSuperset, + SquareSupersetEqual: SquareSupersetEqual, + SquareUnion: SquareUnion, + Sscr: Sscr, + Star: Star, + Sub: Sub, + Subset: Subset, + SubsetEqual: SubsetEqual, + Succeeds: Succeeds, + SucceedsEqual: SucceedsEqual, + SucceedsSlantEqual: SucceedsSlantEqual, + SucceedsTilde: SucceedsTilde, + SuchThat: SuchThat, + Sum: Sum, + Sup: Sup, + Superset: Superset, + SupersetEqual: SupersetEqual, + Supset: Supset, + THOR: THOR, + THORN: THORN, + TRADE: TRADE, + TSHcy: TSHcy, + TScy: TScy, + Tab: Tab, + Tau: Tau, + Tcaron: Tcaron, + Tcedil: Tcedil, + Tcy: Tcy, + Tfr: Tfr, + Therefore: Therefore, + Theta: Theta, + ThickSpace: ThickSpace, + ThinSpace: ThinSpace, + Tilde: Tilde, + TildeEqual: TildeEqual, + TildeFullEqual: TildeFullEqual, + TildeTilde: TildeTilde, + Topf: Topf, + TripleDot: TripleDot, + Tscr: Tscr, + Tstrok: Tstrok, + Uacut: Uacut, + Uacute: Uacute, + Uarr: Uarr, + Uarrocir: Uarrocir, + Ubrcy: Ubrcy, + Ubreve: Ubreve, + Ucir: Ucir, + Ucirc: Ucirc, + Ucy: Ucy, + Udblac: Udblac, + Ufr: Ufr, + Ugrav: Ugrav, + Ugrave: Ugrave, + Umacr: Umacr, + UnderBar: UnderBar, + UnderBrace: UnderBrace, + UnderBracket: UnderBracket, + UnderParenthesis: UnderParenthesis, + Union: Union, + UnionPlus: UnionPlus, + Uogon: Uogon, + Uopf: Uopf, + UpArrow: UpArrow, + UpArrowBar: UpArrowBar, + UpArrowDownArrow: UpArrowDownArrow, + UpDownArrow: UpDownArrow, + UpEquilibrium: UpEquilibrium, + UpTee: UpTee, + UpTeeArrow: UpTeeArrow, + Uparrow: Uparrow, + Updownarrow: Updownarrow, + UpperLeftArrow: UpperLeftArrow, + UpperRightArrow: UpperRightArrow, + Upsi: Upsi, + Upsilon: Upsilon, + Uring: Uring, + Uscr: Uscr, + Utilde: Utilde, + Uum: Uum, + Uuml: Uuml, + VDash: VDash, + Vbar: Vbar, + Vcy: Vcy, + Vdash: Vdash, + Vdashl: Vdashl, + Vee: Vee, + Verbar: Verbar, + Vert: Vert, + VerticalBar: VerticalBar, + VerticalLine: VerticalLine, + VerticalSeparator: VerticalSeparator, + VerticalTilde: VerticalTilde, + VeryThinSpace: VeryThinSpace, + Vfr: Vfr, + Vopf: Vopf, + Vscr: Vscr, + Vvdash: Vvdash, + Wcirc: Wcirc, + Wedge: Wedge, + Wfr: Wfr, + Wopf: Wopf, + Wscr: Wscr, + Xfr: Xfr, + Xi: Xi, + Xopf: Xopf, + Xscr: Xscr, + YAcy: YAcy, + YIcy: YIcy, + YUcy: YUcy, + Yacut: Yacut, + Yacute: Yacute, + Ycirc: Ycirc, + Ycy: Ycy, + Yfr: Yfr, + Yopf: Yopf, + Yscr: Yscr, + Yuml: Yuml, + ZHcy: ZHcy, + Zacute: Zacute, + Zcaron: Zcaron, + Zcy: Zcy, + Zdot: Zdot, + ZeroWidthSpace: ZeroWidthSpace, + Zeta: Zeta, + Zfr: Zfr, + Zopf: Zopf, + Zscr: Zscr, + aacut: aacut, + aacute: aacute, + abreve: abreve, + ac: ac, + acE: acE, + acd: acd, + acir: acir, + acirc: acirc, + acut: acut, + acute: acute, + acy: acy, + aeli: aeli, + aelig: aelig, + af: af, + afr: afr, + agrav: agrav, + agrave: agrave, + alefsym: alefsym, + aleph: aleph, + alpha: alpha, + amacr: amacr, + amalg: amalg, + am: am, + amp: amp, + and: and, + andand: andand, + andd: andd, + andslope: andslope, + andv: andv, + ang: ang, + ange: ange, + angle: angle, + angmsd: angmsd, + angmsdaa: angmsdaa, + angmsdab: angmsdab, + angmsdac: angmsdac, + angmsdad: angmsdad, + angmsdae: angmsdae, + angmsdaf: angmsdaf, + angmsdag: angmsdag, + angmsdah: angmsdah, + angrt: angrt, + angrtvb: angrtvb, + angrtvbd: angrtvbd, + angsph: angsph, + angst: angst, + angzarr: angzarr, + aogon: aogon, + aopf: aopf, + ap: ap, + apE: apE, + apacir: apacir, + ape: ape, + apid: apid, + apos: apos, + approx: approx, + approxeq: approxeq, + arin: arin, + aring: aring, + ascr: ascr, + ast: ast, + asymp: asymp, + asympeq: asympeq, + atild: atild, + atilde: atilde, + aum: aum, + auml: auml, + awconint: awconint, + awint: awint, + bNot: bNot, + backcong: backcong, + backepsilon: backepsilon, + backprime: backprime, + backsim: backsim, + backsimeq: backsimeq, + barvee: barvee, + barwed: barwed, + barwedge: barwedge, + bbrk: bbrk, + bbrktbrk: bbrktbrk, + bcong: bcong, + bcy: bcy, + bdquo: bdquo, + becaus: becaus, + because: because, + bemptyv: bemptyv, + bepsi: bepsi, + bernou: bernou, + beta: beta, + beth: beth, + between: between, + bfr: bfr, + bigcap: bigcap, + bigcirc: bigcirc, + bigcup: bigcup, + bigodot: bigodot, + bigoplus: bigoplus, + bigotimes: bigotimes, + bigsqcup: bigsqcup, + bigstar: bigstar, + bigtriangledown: bigtriangledown, + bigtriangleup: bigtriangleup, + biguplus: biguplus, + bigvee: bigvee, + bigwedge: bigwedge, + bkarow: bkarow, + blacklozenge: blacklozenge, + blacksquare: blacksquare, + blacktriangle: blacktriangle, + blacktriangledown: blacktriangledown, + blacktriangleleft: blacktriangleleft, + blacktriangleright: blacktriangleright, + blank: blank, + blk12: blk12, + blk14: blk14, + blk34: blk34, + block: block, + bne: bne, + bnequiv: bnequiv, + bnot: bnot, + bopf: bopf, + bot: bot, + bottom: bottom, + bowtie: bowtie, + boxDL: boxDL, + boxDR: boxDR, + boxDl: boxDl, + boxDr: boxDr, + boxH: boxH, + boxHD: boxHD, + boxHU: boxHU, + boxHd: boxHd, + boxHu: boxHu, + boxUL: boxUL, + boxUR: boxUR, + boxUl: boxUl, + boxUr: boxUr, + boxV: boxV, + boxVH: boxVH, + boxVL: boxVL, + boxVR: boxVR, + boxVh: boxVh, + boxVl: boxVl, + boxVr: boxVr, + boxbox: boxbox, + boxdL: boxdL, + boxdR: boxdR, + boxdl: boxdl, + boxdr: boxdr, + boxh: boxh, + boxhD: boxhD, + boxhU: boxhU, + boxhd: boxhd, + boxhu: boxhu, + boxminus: boxminus, + boxplus: boxplus, + boxtimes: boxtimes, + boxuL: boxuL, + boxuR: boxuR, + boxul: boxul, + boxur: boxur, + boxv: boxv, + boxvH: boxvH, + boxvL: boxvL, + boxvR: boxvR, + boxvh: boxvh, + boxvl: boxvl, + boxvr: boxvr, + bprime: bprime, + breve: breve, + brvba: brvba, + brvbar: brvbar, + bscr: bscr, + bsemi: bsemi, + bsim: bsim, + bsime: bsime, + bsol: bsol, + bsolb: bsolb, + bsolhsub: bsolhsub, + bull: bull, + bullet: bullet, + bump: bump, + bumpE: bumpE, + bumpe: bumpe, + bumpeq: bumpeq, + cacute: cacute, + cap: cap, + capand: capand, + capbrcup: capbrcup, + capcap: capcap, + capcup: capcup, + capdot: capdot, + caps: caps, + caret: caret, + caron: caron, + ccaps: ccaps, + ccaron: ccaron, + ccedi: ccedi, + ccedil: ccedil, + ccirc: ccirc, + ccups: ccups, + ccupssm: ccupssm, + cdot: cdot, + cedi: cedi, + cedil: cedil, + cemptyv: cemptyv, + cen: cen, + cent: cent, + centerdot: centerdot, + cfr: cfr, + chcy: chcy, + check: check$2, + checkmark: checkmark, + chi: chi, + cir: cir, + cirE: cirE, + circ: circ, + circeq: circeq, + circlearrowleft: circlearrowleft, + circlearrowright: circlearrowright, + circledR: circledR, + circledS: circledS, + circledast: circledast, + circledcirc: circledcirc, + circleddash: circleddash, + cire: cire, + cirfnint: cirfnint, + cirmid: cirmid, + cirscir: cirscir, + clubs: clubs, + clubsuit: clubsuit, + colon: colon, + colone: colone, + coloneq: coloneq, + comma: comma, + commat: commat, + comp: comp, + compfn: compfn, + complement: complement, + complexes: complexes, + cong: cong, + congdot: congdot, + conint: conint, + copf: copf, + coprod: coprod, + cop: cop, + copy: copy$1, + copysr: copysr, + crarr: crarr, + cross: cross, + cscr: cscr, + csub: csub, + csube: csube, + csup: csup, + csupe: csupe, + ctdot: ctdot, + cudarrl: cudarrl, + cudarrr: cudarrr, + cuepr: cuepr, + cuesc: cuesc, + cularr: cularr, + cularrp: cularrp, + cup: cup, + cupbrcap: cupbrcap, + cupcap: cupcap, + cupcup: cupcup, + cupdot: cupdot, + cupor: cupor, + cups: cups, + curarr: curarr, + curarrm: curarrm, + curlyeqprec: curlyeqprec, + curlyeqsucc: curlyeqsucc, + curlyvee: curlyvee, + curlywedge: curlywedge, + curre: curre, + curren: curren, + curvearrowleft: curvearrowleft, + curvearrowright: curvearrowright, + cuvee: cuvee, + cuwed: cuwed, + cwconint: cwconint, + cwint: cwint, + cylcty: cylcty, + dArr: dArr, + dHar: dHar, + dagger: dagger, + daleth: daleth, + darr: darr, + dash: dash, + dashv: dashv, + dbkarow: dbkarow, + dblac: dblac, + dcaron: dcaron, + dcy: dcy, + dd: dd, + ddagger: ddagger, + ddarr: ddarr, + ddotseq: ddotseq, + de: de, + deg: deg, + delta: delta, + demptyv: demptyv, + dfisht: dfisht, + dfr: dfr, + dharl: dharl, + dharr: dharr, + diam: diam, + diamond: diamond, + diamondsuit: diamondsuit, + diams: diams, + die: die, + digamma: digamma, + disin: disin, + div: div, + divid: divid, + divide: divide, + divideontimes: divideontimes, + divonx: divonx, + djcy: djcy, + dlcorn: dlcorn, + dlcrop: dlcrop, + dollar: dollar, + dopf: dopf, + dot: dot, + doteq: doteq, + doteqdot: doteqdot, + dotminus: dotminus, + dotplus: dotplus, + dotsquare: dotsquare, + doublebarwedge: doublebarwedge, + downarrow: downarrow, + downdownarrows: downdownarrows, + downharpoonleft: downharpoonleft, + downharpoonright: downharpoonright, + drbkarow: drbkarow, + drcorn: drcorn, + drcrop: drcrop, + dscr: dscr, + dscy: dscy, + dsol: dsol, + dstrok: dstrok, + dtdot: dtdot, + dtri: dtri, + dtrif: dtrif, + duarr: duarr, + duhar: duhar, + dwangle: dwangle, + dzcy: dzcy, + dzigrarr: dzigrarr, + eDDot: eDDot, + eDot: eDot, + eacut: eacut, + eacute: eacute, + easter: easter, + ecaron: ecaron, + ecir: ecir, + ecirc: ecirc, + ecolon: ecolon, + ecy: ecy, + edot: edot, + ee: ee, + efDot: efDot, + efr: efr, + eg: eg, + egrav: egrav, + egrave: egrave, + egs: egs, + egsdot: egsdot, + el: el, + elinters: elinters, + ell: ell, + els: els, + elsdot: elsdot, + emacr: emacr, + empty: empty, + emptyset: emptyset, + emptyv: emptyv, + emsp13: emsp13, + emsp14: emsp14, + emsp: emsp, + eng: eng, + ensp: ensp, + eogon: eogon, + eopf: eopf, + epar: epar, + eparsl: eparsl, + eplus: eplus, + epsi: epsi, + epsilon: epsilon, + epsiv: epsiv, + eqcirc: eqcirc, + eqcolon: eqcolon, + eqsim: eqsim, + eqslantgtr: eqslantgtr, + eqslantless: eqslantless, + equals: equals, + equest: equest, + equiv: equiv, + equivDD: equivDD, + eqvparsl: eqvparsl, + erDot: erDot, + erarr: erarr, + escr: escr, + esdot: esdot, + esim: esim, + eta: eta, + et: et, + eth: eth, + eum: eum, + euml: euml, + euro: euro, + excl: excl, + exist: exist, + expectation: expectation, + exponentiale: exponentiale, + fallingdotseq: fallingdotseq, + fcy: fcy, + female: female, + ffilig: ffilig, + fflig: fflig, + ffllig: ffllig, + ffr: ffr, + filig: filig, + fjlig: fjlig, + flat: flat, + fllig: fllig, + fltns: fltns, + fnof: fnof, + fopf: fopf, + forall: forall, + fork: fork, + forkv: forkv, + fpartint: fpartint, + frac1: frac1, + frac12: frac12, + frac13: frac13, + frac14: frac14, + frac15: frac15, + frac16: frac16, + frac18: frac18, + frac23: frac23, + frac25: frac25, + frac3: frac3, + frac34: frac34, + frac35: frac35, + frac38: frac38, + frac45: frac45, + frac56: frac56, + frac58: frac58, + frac78: frac78, + frasl: frasl, + frown: frown, + fscr: fscr, + gE: gE, + gEl: gEl, + gacute: gacute, + gamma: gamma, + gammad: gammad, + gap: gap, + gbreve: gbreve, + gcirc: gcirc, + gcy: gcy, + gdot: gdot, + ge: ge, + gel: gel, + geq: geq, + geqq: geqq, + geqslant: geqslant, + ges: ges, + gescc: gescc, + gesdot: gesdot, + gesdoto: gesdoto, + gesdotol: gesdotol, + gesl: gesl, + gesles: gesles, + gfr: gfr, + gg: gg, + ggg: ggg, + gimel: gimel, + gjcy: gjcy, + gl: gl, + glE: glE, + gla: gla, + glj: glj, + gnE: gnE, + gnap: gnap, + gnapprox: gnapprox, + gne: gne, + gneq: gneq, + gneqq: gneqq, + gnsim: gnsim, + gopf: gopf, + grave: grave, + gscr: gscr, + gsim: gsim, + gsime: gsime, + gsiml: gsiml, + g: g, + gt: gt, + gtcc: gtcc, + gtcir: gtcir, + gtdot: gtdot, + gtlPar: gtlPar, + gtquest: gtquest, + gtrapprox: gtrapprox, + gtrarr: gtrarr, + gtrdot: gtrdot, + gtreqless: gtreqless, + gtreqqless: gtreqqless, + gtrless: gtrless, + gtrsim: gtrsim, + gvertneqq: gvertneqq, + gvnE: gvnE, + hArr: hArr, + hairsp: hairsp, + half: half, + hamilt: hamilt, + hardcy: hardcy, + harr: harr, + harrcir: harrcir, + harrw: harrw, + hbar: hbar, + hcirc: hcirc, + hearts: hearts, + heartsuit: heartsuit, + hellip: hellip, + hercon: hercon, + hfr: hfr, + hksearow: hksearow, + hkswarow: hkswarow, + hoarr: hoarr, + homtht: homtht, + hookleftarrow: hookleftarrow, + hookrightarrow: hookrightarrow, + hopf: hopf, + horbar: horbar, + hscr: hscr, + hslash: hslash, + hstrok: hstrok, + hybull: hybull, + hyphen: hyphen, + iacut: iacut, + iacute: iacute, + ic: ic, + icir: icir, + icirc: icirc, + icy: icy, + iecy: iecy, + iexc: iexc, + iexcl: iexcl, + iff: iff, + ifr: ifr, + igrav: igrav, + igrave: igrave, + ii: ii, + iiiint: iiiint, + iiint: iiint, + iinfin: iinfin, + iiota: iiota, + ijlig: ijlig, + imacr: imacr, + image: image, + imagline: imagline, + imagpart: imagpart, + imath: imath, + imof: imof, + imped: imped, + "in": "∈", + incare: incare, + infin: infin, + infintie: infintie, + inodot: inodot, + int: int$1, + intcal: intcal, + integers: integers, + intercal: intercal, + intlarhk: intlarhk, + intprod: intprod, + iocy: iocy, + iogon: iogon, + iopf: iopf, + iota: iota, + iprod: iprod, + iques: iques, + iquest: iquest, + iscr: iscr, + isin: isin, + isinE: isinE, + isindot: isindot, + isins: isins, + isinsv: isinsv, + isinv: isinv, + it: it, + itilde: itilde, + iukcy: iukcy, + ium: ium, + iuml: iuml, + jcirc: jcirc, + jcy: jcy, + jfr: jfr, + jmath: jmath, + jopf: jopf, + jscr: jscr, + jsercy: jsercy, + jukcy: jukcy, + kappa: kappa, + kappav: kappav, + kcedil: kcedil, + kcy: kcy, + kfr: kfr, + kgreen: kgreen, + khcy: khcy, + kjcy: kjcy, + kopf: kopf, + kscr: kscr, + lAarr: lAarr, + lArr: lArr, + lAtail: lAtail, + lBarr: lBarr, + lE: lE, + lEg: lEg, + lHar: lHar, + lacute: lacute, + laemptyv: laemptyv, + lagran: lagran, + lambda: lambda, + lang: lang, + langd: langd, + langle: langle, + lap: lap, + laqu: laqu, + laquo: laquo, + larr: larr, + larrb: larrb, + larrbfs: larrbfs, + larrfs: larrfs, + larrhk: larrhk, + larrlp: larrlp, + larrpl: larrpl, + larrsim: larrsim, + larrtl: larrtl, + lat: lat, + latail: latail, + late: late, + lates: lates, + lbarr: lbarr, + lbbrk: lbbrk, + lbrace: lbrace, + lbrack: lbrack, + lbrke: lbrke, + lbrksld: lbrksld, + lbrkslu: lbrkslu, + lcaron: lcaron, + lcedil: lcedil, + lceil: lceil, + lcub: lcub, + lcy: lcy, + ldca: ldca, + ldquo: ldquo, + ldquor: ldquor, + ldrdhar: ldrdhar, + ldrushar: ldrushar, + ldsh: ldsh, + le: le, + leftarrow: leftarrow, + leftarrowtail: leftarrowtail, + leftharpoondown: leftharpoondown, + leftharpoonup: leftharpoonup, + leftleftarrows: leftleftarrows, + leftrightarrow: leftrightarrow, + leftrightarrows: leftrightarrows, + leftrightharpoons: leftrightharpoons, + leftrightsquigarrow: leftrightsquigarrow, + leftthreetimes: leftthreetimes, + leg: leg, + leq: leq, + leqq: leqq, + leqslant: leqslant, + les: les, + lescc: lescc, + lesdot: lesdot, + lesdoto: lesdoto, + lesdotor: lesdotor, + lesg: lesg, + lesges: lesges, + lessapprox: lessapprox, + lessdot: lessdot, + lesseqgtr: lesseqgtr, + lesseqqgtr: lesseqqgtr, + lessgtr: lessgtr, + lesssim: lesssim, + lfisht: lfisht, + lfloor: lfloor, + lfr: lfr, + lg: lg, + lgE: lgE, + lhard: lhard, + lharu: lharu, + lharul: lharul, + lhblk: lhblk, + ljcy: ljcy, + ll: ll, + llarr: llarr, + llcorner: llcorner, + llhard: llhard, + lltri: lltri, + lmidot: lmidot, + lmoust: lmoust, + lmoustache: lmoustache, + lnE: lnE, + lnap: lnap, + lnapprox: lnapprox, + lne: lne, + lneq: lneq, + lneqq: lneqq, + lnsim: lnsim, + loang: loang, + loarr: loarr, + lobrk: lobrk, + longleftarrow: longleftarrow, + longleftrightarrow: longleftrightarrow, + longmapsto: longmapsto, + longrightarrow: longrightarrow, + looparrowleft: looparrowleft, + looparrowright: looparrowright, + lopar: lopar, + lopf: lopf, + loplus: loplus, + lotimes: lotimes, + lowast: lowast, + lowbar: lowbar, + loz: loz, + lozenge: lozenge, + lozf: lozf, + lpar: lpar, + lparlt: lparlt, + lrarr: lrarr, + lrcorner: lrcorner, + lrhar: lrhar, + lrhard: lrhard, + lrm: lrm, + lrtri: lrtri, + lsaquo: lsaquo, + lscr: lscr, + lsh: lsh, + lsim: lsim, + lsime: lsime, + lsimg: lsimg, + lsqb: lsqb, + lsquo: lsquo, + lsquor: lsquor, + lstrok: lstrok, + l: l, + lt: lt, + ltcc: ltcc, + ltcir: ltcir, + ltdot: ltdot, + lthree: lthree, + ltimes: ltimes, + ltlarr: ltlarr, + ltquest: ltquest, + ltrPar: ltrPar, + ltri: ltri, + ltrie: ltrie, + ltrif: ltrif, + lurdshar: lurdshar, + luruhar: luruhar, + lvertneqq: lvertneqq, + lvnE: lvnE, + mDDot: mDDot, + mac: mac, + macr: macr, + male: male, + malt: malt, + maltese: maltese, + map: map$2, + mapsto: mapsto, + mapstodown: mapstodown, + mapstoleft: mapstoleft, + mapstoup: mapstoup, + marker: marker, + mcomma: mcomma, + mcy: mcy, + mdash: mdash, + measuredangle: measuredangle, + mfr: mfr, + mho: mho, + micr: micr, + micro: micro, + mid: mid, + midast: midast, + midcir: midcir, + middo: middo, + middot: middot, + minus: minus, + minusb: minusb, + minusd: minusd, + minusdu: minusdu, + mlcp: mlcp, + mldr: mldr, + mnplus: mnplus, + models: models$2, + mopf: mopf, + mp: mp, + mscr: mscr, + mstpos: mstpos, + mu: mu, + multimap: multimap, + mumap: mumap, + nGg: nGg, + nGt: nGt, + nGtv: nGtv, + nLeftarrow: nLeftarrow, + nLeftrightarrow: nLeftrightarrow, + nLl: nLl, + nLt: nLt, + nLtv: nLtv, + nRightarrow: nRightarrow, + nVDash: nVDash, + nVdash: nVdash, + nabla: nabla, + nacute: nacute, + nang: nang, + nap: nap, + napE: napE, + napid: napid, + napos: napos, + napprox: napprox, + natur: natur, + natural: natural, + naturals: naturals, + nbs: nbs, + nbsp: nbsp, + nbump: nbump, + nbumpe: nbumpe, + ncap: ncap, + ncaron: ncaron, + ncedil: ncedil, + ncong: ncong, + ncongdot: ncongdot, + ncup: ncup, + ncy: ncy, + ndash: ndash, + ne: ne, + neArr: neArr, + nearhk: nearhk, + nearr: nearr, + nearrow: nearrow, + nedot: nedot, + nequiv: nequiv, + nesear: nesear, + nesim: nesim, + nexist: nexist, + nexists: nexists, + nfr: nfr, + ngE: ngE, + nge: nge, + ngeq: ngeq, + ngeqq: ngeqq, + ngeqslant: ngeqslant, + nges: nges, + ngsim: ngsim, + ngt: ngt, + ngtr: ngtr, + nhArr: nhArr, + nharr: nharr, + nhpar: nhpar, + ni: ni, + nis: nis, + nisd: nisd, + niv: niv, + njcy: njcy, + nlArr: nlArr, + nlE: nlE, + nlarr: nlarr, + nldr: nldr, + nle: nle, + nleftarrow: nleftarrow, + nleftrightarrow: nleftrightarrow, + nleq: nleq, + nleqq: nleqq, + nleqslant: nleqslant, + nles: nles, + nless: nless, + nlsim: nlsim, + nlt: nlt, + nltri: nltri, + nltrie: nltrie, + nmid: nmid, + nopf: nopf, + no: no, + not: not, + notin: notin, + notinE: notinE, + notindot: notindot, + notinva: notinva, + notinvb: notinvb, + notinvc: notinvc, + notni: notni, + notniva: notniva, + notnivb: notnivb, + notnivc: notnivc, + npar: npar, + nparallel: nparallel, + nparsl: nparsl, + npart: npart, + npolint: npolint, + npr: npr, + nprcue: nprcue, + npre: npre, + nprec: nprec, + npreceq: npreceq, + nrArr: nrArr, + nrarr: nrarr, + nrarrc: nrarrc, + nrarrw: nrarrw, + nrightarrow: nrightarrow, + nrtri: nrtri, + nrtrie: nrtrie, + nsc: nsc, + nsccue: nsccue, + nsce: nsce, + nscr: nscr, + nshortmid: nshortmid, + nshortparallel: nshortparallel, + nsim: nsim, + nsime: nsime, + nsimeq: nsimeq, + nsmid: nsmid, + nspar: nspar, + nsqsube: nsqsube, + nsqsupe: nsqsupe, + nsub: nsub, + nsubE: nsubE, + nsube: nsube, + nsubset: nsubset, + nsubseteq: nsubseteq, + nsubseteqq: nsubseteqq, + nsucc: nsucc, + nsucceq: nsucceq, + nsup: nsup, + nsupE: nsupE, + nsupe: nsupe, + nsupset: nsupset, + nsupseteq: nsupseteq, + nsupseteqq: nsupseteqq, + ntgl: ntgl, + ntild: ntild, + ntilde: ntilde, + ntlg: ntlg, + ntriangleleft: ntriangleleft, + ntrianglelefteq: ntrianglelefteq, + ntriangleright: ntriangleright, + ntrianglerighteq: ntrianglerighteq, + nu: nu, + num: num, + numero: numero, + numsp: numsp, + nvDash: nvDash, + nvHarr: nvHarr, + nvap: nvap, + nvdash: nvdash, + nvge: nvge, + nvgt: nvgt, + nvinfin: nvinfin, + nvlArr: nvlArr, + nvle: nvle, + nvlt: nvlt, + nvltrie: nvltrie, + nvrArr: nvrArr, + nvrtrie: nvrtrie, + nvsim: nvsim, + nwArr: nwArr, + nwarhk: nwarhk, + nwarr: nwarr, + nwarrow: nwarrow, + nwnear: nwnear, + oS: oS, + oacut: oacut, + oacute: oacute, + oast: oast, + ocir: ocir, + ocirc: ocirc, + ocy: ocy, + odash: odash, + odblac: odblac, + odiv: odiv, + odot: odot, + odsold: odsold, + oelig: oelig, + ofcir: ofcir, + ofr: ofr, + ogon: ogon, + ograv: ograv, + ograve: ograve, + ogt: ogt, + ohbar: ohbar, + ohm: ohm, + oint: oint, + olarr: olarr, + olcir: olcir, + olcross: olcross, + oline: oline, + olt: olt, + omacr: omacr, + omega: omega, + omicron: omicron, + omid: omid, + ominus: ominus, + oopf: oopf, + opar: opar, + operp: operp, + oplus: oplus, + or: or, + orarr: orarr, + ord: ord, + order: order$1, + orderof: orderof, + ordf: ordf, + ordm: ordm, + origof: origof, + oror: oror, + orslope: orslope, + orv: orv, + oscr: oscr, + oslas: oslas, + oslash: oslash, + osol: osol, + otild: otild, + otilde: otilde, + otimes: otimes, + otimesas: otimesas, + oum: oum, + ouml: ouml, + ovbar: ovbar, + par: par, + para: para, + parallel: parallel, + parsim: parsim, + parsl: parsl, + part: part, + pcy: pcy, + percnt: percnt, + period: period, + permil: permil, + perp: perp, + pertenk: pertenk, + pfr: pfr, + phi: phi, + phiv: phiv, + phmmat: phmmat, + phone: phone, + pi: pi, + pitchfork: pitchfork, + piv: piv, + planck: planck, + planckh: planckh, + plankv: plankv, + plus: plus, + plusacir: plusacir, + plusb: plusb, + pluscir: pluscir, + plusdo: plusdo, + plusdu: plusdu, + pluse: pluse, + plusm: plusm, + plusmn: plusmn, + plussim: plussim, + plustwo: plustwo, + pm: pm, + pointint: pointint, + popf: popf, + poun: poun, + pound: pound, + pr: pr, + prE: prE, + prap: prap, + prcue: prcue, + pre: pre, + prec: prec, + precapprox: precapprox, + preccurlyeq: preccurlyeq, + preceq: preceq, + precnapprox: precnapprox, + precneqq: precneqq, + precnsim: precnsim, + precsim: precsim, + prime: prime, + primes: primes, + prnE: prnE, + prnap: prnap, + prnsim: prnsim, + prod: prod, + profalar: profalar, + profline: profline, + profsurf: profsurf, + prop: prop, + propto: propto, + prsim: prsim, + prurel: prurel, + pscr: pscr, + psi: psi, + puncsp: puncsp, + qfr: qfr, + qint: qint, + qopf: qopf, + qprime: qprime, + qscr: qscr, + quaternions: quaternions, + quatint: quatint, + quest: quest, + questeq: questeq, + quo: quo, + quot: quot, + rAarr: rAarr, + rArr: rArr, + rAtail: rAtail, + rBarr: rBarr, + rHar: rHar, + race: race, + racute: racute, + radic: radic, + raemptyv: raemptyv, + rang: rang, + rangd: rangd, + range: range$1, + rangle: rangle, + raqu: raqu, + raquo: raquo, + rarr: rarr, + rarrap: rarrap, + rarrb: rarrb, + rarrbfs: rarrbfs, + rarrc: rarrc, + rarrfs: rarrfs, + rarrhk: rarrhk, + rarrlp: rarrlp, + rarrpl: rarrpl, + rarrsim: rarrsim, + rarrtl: rarrtl, + rarrw: rarrw, + ratail: ratail, + ratio: ratio, + rationals: rationals, + rbarr: rbarr, + rbbrk: rbbrk, + rbrace: rbrace, + rbrack: rbrack, + rbrke: rbrke, + rbrksld: rbrksld, + rbrkslu: rbrkslu, + rcaron: rcaron, + rcedil: rcedil, + rceil: rceil, + rcub: rcub, + rcy: rcy, + rdca: rdca, + rdldhar: rdldhar, + rdquo: rdquo, + rdquor: rdquor, + rdsh: rdsh, + real: real, + realine: realine, + realpart: realpart, + reals: reals, + rect: rect, + re: re, + reg: reg, + rfisht: rfisht, + rfloor: rfloor, + rfr: rfr, + rhard: rhard, + rharu: rharu, + rharul: rharul, + rho: rho, + rhov: rhov, + rightarrow: rightarrow, + rightarrowtail: rightarrowtail, + rightharpoondown: rightharpoondown, + rightharpoonup: rightharpoonup, + rightleftarrows: rightleftarrows, + rightleftharpoons: rightleftharpoons, + rightrightarrows: rightrightarrows, + rightsquigarrow: rightsquigarrow, + rightthreetimes: rightthreetimes, + ring: ring, + risingdotseq: risingdotseq, + rlarr: rlarr, + rlhar: rlhar, + rlm: rlm, + rmoust: rmoust, + rmoustache: rmoustache, + rnmid: rnmid, + roang: roang, + roarr: roarr, + robrk: robrk, + ropar: ropar, + ropf: ropf, + roplus: roplus, + rotimes: rotimes, + rpar: rpar, + rpargt: rpargt, + rppolint: rppolint, + rrarr: rrarr, + rsaquo: rsaquo, + rscr: rscr, + rsh: rsh, + rsqb: rsqb, + rsquo: rsquo, + rsquor: rsquor, + rthree: rthree, + rtimes: rtimes, + rtri: rtri, + rtrie: rtrie, + rtrif: rtrif, + rtriltri: rtriltri, + ruluhar: ruluhar, + rx: rx, + sacute: sacute, + sbquo: sbquo, + sc: sc, + scE: scE, + scap: scap, + scaron: scaron, + sccue: sccue, + sce: sce, + scedil: scedil, + scirc: scirc, + scnE: scnE, + scnap: scnap, + scnsim: scnsim, + scpolint: scpolint, + scsim: scsim, + scy: scy, + sdot: sdot, + sdotb: sdotb, + sdote: sdote, + seArr: seArr, + searhk: searhk, + searr: searr, + searrow: searrow, + sec: sec, + sect: sect, + semi: semi, + seswar: seswar, + setminus: setminus, + setmn: setmn, + sext: sext, + sfr: sfr, + sfrown: sfrown, + sharp: sharp, + shchcy: shchcy, + shcy: shcy, + shortmid: shortmid, + shortparallel: shortparallel, + sh: sh, + shy: shy, + sigma: sigma, + sigmaf: sigmaf, + sigmav: sigmav, + sim: sim, + simdot: simdot, + sime: sime, + simeq: simeq, + simg: simg, + simgE: simgE, + siml: siml, + simlE: simlE, + simne: simne, + simplus: simplus, + simrarr: simrarr, + slarr: slarr, + smallsetminus: smallsetminus, + smashp: smashp, + smeparsl: smeparsl, + smid: smid, + smile: smile, + smt: smt, + smte: smte, + smtes: smtes, + softcy: softcy, + sol: sol, + solb: solb, + solbar: solbar, + sopf: sopf, + spades: spades, + spadesuit: spadesuit, + spar: spar, + sqcap: sqcap, + sqcaps: sqcaps, + sqcup: sqcup, + sqcups: sqcups, + sqsub: sqsub, + sqsube: sqsube, + sqsubset: sqsubset, + sqsubseteq: sqsubseteq, + sqsup: sqsup, + sqsupe: sqsupe, + sqsupset: sqsupset, + sqsupseteq: sqsupseteq, + squ: squ, + square: square, + squarf: squarf, + squf: squf, + srarr: srarr, + sscr: sscr, + ssetmn: ssetmn, + ssmile: ssmile, + sstarf: sstarf, + star: star$1, + starf: starf, + straightepsilon: straightepsilon, + straightphi: straightphi, + strns: strns, + sub: sub, + subE: subE, + subdot: subdot, + sube: sube, + subedot: subedot, + submult: submult, + subnE: subnE, + subne: subne, + subplus: subplus, + subrarr: subrarr, + subset: subset, + subseteq: subseteq, + subseteqq: subseteqq, + subsetneq: subsetneq, + subsetneqq: subsetneqq, + subsim: subsim, + subsub: subsub, + subsup: subsup, + succ: succ, + succapprox: succapprox, + succcurlyeq: succcurlyeq, + succeq: succeq, + succnapprox: succnapprox, + succneqq: succneqq, + succnsim: succnsim, + succsim: succsim, + sum: sum, + sung: sung, + sup: sup, + sup1: sup1, + sup2: sup2, + sup3: sup3, + supE: supE, + supdot: supdot, + supdsub: supdsub, + supe: supe, + supedot: supedot, + suphsol: suphsol, + suphsub: suphsub, + suplarr: suplarr, + supmult: supmult, + supnE: supnE, + supne: supne, + supplus: supplus, + supset: supset, + supseteq: supseteq, + supseteqq: supseteqq, + supsetneq: supsetneq, + supsetneqq: supsetneqq, + supsim: supsim, + supsub: supsub, + supsup: supsup, + swArr: swArr, + swarhk: swarhk, + swarr: swarr, + swarrow: swarrow, + swnwar: swnwar, + szli: szli, + szlig: szlig, + target: target, + tau: tau, + tbrk: tbrk, + tcaron: tcaron, + tcedil: tcedil, + tcy: tcy, + tdot: tdot, + telrec: telrec, + tfr: tfr, + there4: there4, + therefore: therefore, + theta: theta, + thetasym: thetasym, + thetav: thetav, + thickapprox: thickapprox, + thicksim: thicksim, + thinsp: thinsp, + thkap: thkap, + thksim: thksim, + thor: thor, + thorn: thorn, + tilde: tilde, + time: time, + times: times, + timesb: timesb, + timesbar: timesbar, + timesd: timesd, + tint: tint, + toea: toea, + top: top, + topbot: topbot, + topcir: topcir, + topf: topf, + topfork: topfork, + tosa: tosa, + tprime: tprime, + trade: trade, + triangle: triangle, + triangledown: triangledown, + triangleleft: triangleleft, + trianglelefteq: trianglelefteq, + triangleq: triangleq, + triangleright: triangleright, + trianglerighteq: trianglerighteq, + tridot: tridot, + trie: trie, + triminus: triminus, + triplus: triplus, + trisb: trisb, + tritime: tritime, + trpezium: trpezium, + tscr: tscr, + tscy: tscy, + tshcy: tshcy, + tstrok: tstrok, + twixt: twixt, + twoheadleftarrow: twoheadleftarrow, + twoheadrightarrow: twoheadrightarrow, + uArr: uArr, + uHar: uHar, + uacut: uacut, + uacute: uacute, + uarr: uarr, + ubrcy: ubrcy, + ubreve: ubreve, + ucir: ucir, + ucirc: ucirc, + ucy: ucy, + udarr: udarr, + udblac: udblac, + udhar: udhar, + ufisht: ufisht, + ufr: ufr, + ugrav: ugrav, + ugrave: ugrave, + uharl: uharl, + uharr: uharr, + uhblk: uhblk, + ulcorn: ulcorn, + ulcorner: ulcorner, + ulcrop: ulcrop, + ultri: ultri, + umacr: umacr, + um: um, + uml: uml, + uogon: uogon, + uopf: uopf, + uparrow: uparrow, + updownarrow: updownarrow, + upharpoonleft: upharpoonleft, + upharpoonright: upharpoonright, + uplus: uplus, + upsi: upsi, + upsih: upsih, + upsilon: upsilon, + upuparrows: upuparrows, + urcorn: urcorn, + urcorner: urcorner, + urcrop: urcrop, + uring: uring, + urtri: urtri, + uscr: uscr, + utdot: utdot, + utilde: utilde, + utri: utri, + utrif: utrif, + uuarr: uuarr, + uum: uum, + uuml: uuml, + uwangle: uwangle, + vArr: vArr, + vBar: vBar, + vBarv: vBarv, + vDash: vDash, + vangrt: vangrt, + varepsilon: varepsilon, + varkappa: varkappa, + varnothing: varnothing, + varphi: varphi, + varpi: varpi, + varpropto: varpropto, + varr: varr, + varrho: varrho, + varsigma: varsigma, + varsubsetneq: varsubsetneq, + varsubsetneqq: varsubsetneqq, + varsupsetneq: varsupsetneq, + varsupsetneqq: varsupsetneqq, + vartheta: vartheta, + vartriangleleft: vartriangleleft, + vartriangleright: vartriangleright, + vcy: vcy, + vdash: vdash, + vee: vee, + veebar: veebar, + veeeq: veeeq, + vellip: vellip, + verbar: verbar, + vert: vert, + vfr: vfr, + vltri: vltri, + vnsub: vnsub, + vnsup: vnsup, + vopf: vopf, + vprop: vprop, + vrtri: vrtri, + vscr: vscr, + vsubnE: vsubnE, + vsubne: vsubne, + vsupnE: vsupnE, + vsupne: vsupne, + vzigzag: vzigzag, + wcirc: wcirc, + wedbar: wedbar, + wedge: wedge, + wedgeq: wedgeq, + weierp: weierp, + wfr: wfr, + wopf: wopf, + wp: wp, + wr: wr, + wreath: wreath, + wscr: wscr, + xcap: xcap, + xcirc: xcirc, + xcup: xcup, + xdtri: xdtri, + xfr: xfr, + xhArr: xhArr, + xharr: xharr, + xi: xi, + xlArr: xlArr, + xlarr: xlarr, + xmap: xmap, + xnis: xnis, + xodot: xodot, + xopf: xopf, + xoplus: xoplus, + xotime: xotime, + xrArr: xrArr, + xrarr: xrarr, + xscr: xscr, + xsqcup: xsqcup, + xuplus: xuplus, + xutri: xutri, + xvee: xvee, + xwedge: xwedge, + yacut: yacut, + yacute: yacute, + yacy: yacy, + ycirc: ycirc, + ycy: ycy, + ye: ye, + yen: yen, + yfr: yfr, + yicy: yicy, + yopf: yopf, + yscr: yscr, + yucy: yucy, + yum: yum, + yuml: yuml, + zacute: zacute, + zcaron: zcaron, + zcy: zcy, + zdot: zdot, + zeetrf: zeetrf, + zeta: zeta, + zfr: zfr, + zhcy: zhcy, + zigrarr: zigrarr, + zopf: zopf, + zscr: zscr, + zwj: zwj, + zwnj: zwnj }; -var asciiAlpha = regexCheck_1(/[A-Za-z]/); - -var asciiAlphanumeric = regexCheck_1(/[\dA-Za-z]/); - -var asciiAtext = regexCheck_1(/[#-'*+\--9=?A-Z^-~]/); - -var asciiControl_1 = asciiControl; - -// Note: EOF is seen as ASCII control here, because `null < 32 == true`. -function asciiControl(code) { - return ( - // Special whitespace codes (which have negative values), C0 and Control - // character DEL - code < 32 || code === 127 - ) -} - -var tokenize$7 = tokenizeAutolink; - - - - - - -function tokenizeAutolink(effects, ok, nok) { - var size; - - return start - - function start(code) { - effects.enter('autolink'); - effects.enter('autolinkMarker'); - effects.consume(code); - effects.exit('autolinkMarker'); - effects.enter('autolinkProtocol'); - return open - } - - function open(code) { - if (asciiAlpha(code)) { - effects.consume(code); - size = 1; - return schemeOrEmailAtext - } - - return asciiAtext(code) ? emailAtext(code) : nok(code) - } - - function schemeOrEmailAtext(code) { - return code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code) - ? schemeInsideOrEmailAtext(code) - : emailAtext(code) - } - - function schemeInsideOrEmailAtext(code) { - if (code === 58) { - effects.consume(code); - return urlInside - } - - if ( - (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && - size++ < 32 - ) { - effects.consume(code); - return schemeInsideOrEmailAtext - } - - return emailAtext(code) - } - - function urlInside(code) { - if (code === 62) { - effects.exit('autolinkProtocol'); - return end(code) - } - - if (code === 32 || code === 60 || asciiControl_1(code)) { - return nok(code) - } - - effects.consume(code); - return urlInside - } - - function emailAtext(code) { - if (code === 64) { - effects.consume(code); - size = 0; - return emailAtSignOrDot - } - - if (asciiAtext(code)) { - effects.consume(code); - return emailAtext - } - - return nok(code) - } - - function emailAtSignOrDot(code) { - return asciiAlphanumeric(code) ? emailLabel(code) : nok(code) - } - - function emailLabel(code) { - if (code === 46) { - effects.consume(code); - size = 0; - return emailAtSignOrDot - } - - if (code === 62) { - // Exit, then change the type. - effects.exit('autolinkProtocol').type = 'autolinkEmail'; - return end(code) - } - - return emailValue(code) - } - - function emailValue(code) { - if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) { - effects.consume(code); - return code === 45 ? emailValue : emailLabel - } +var decodeEntity_1 = decodeEntity; - return nok(code) - } +var own$4 = {}.hasOwnProperty; - function end(code) { - effects.enter('autolinkMarker'); - effects.consume(code); - effects.exit('autolinkMarker'); - effects.exit('autolink'); - return ok - } +function decodeEntity(characters) { + return own$4.call(characterEntities, characters) + ? characterEntities[characters] + : false } -var autolink = { - tokenize: tokenize$7 -}; - var asciiDigit = regexCheck_1(/\d/); -var tokenize$8 = tokenizeThematicBreak; - - - - - - -function tokenizeThematicBreak(effects, ok, nok) { - var size = 0; - var marker; - - return start - - function start(code) { - effects.enter('thematicBreak'); - marker = code; - return atBreak(code) - } - - function atBreak(code) { - if (code === marker) { - effects.enter('thematicBreakSequence'); - return sequence(code) - } - - if (markdownSpace_1(code)) { - return factorySpace(effects, atBreak, 'whitespace')(code) - } - - if (size < 3 || (code !== null && !markdownLineEnding_1(code))) { - return nok(code) - } - - effects.exit('thematicBreak'); - return ok(code) - } - - function sequence(code) { - if (code === marker) { - effects.consume(code); - size++; - return sequence - } - - effects.exit('thematicBreakSequence'); - return atBreak(code) - } -} - -var thematicBreak = { - tokenize: tokenize$8 -}; - -var list = createCommonjsModule(function (module, exports) { -exports.tokenize = tokenizeListStart; -exports.continuation = {tokenize: tokenizeListContinuation}; -exports.exit = tokenizeListEnd; - - - - - - - - - - -function tokenizeListStart(effects, ok, nok) { - var self = this; - var initialSize = prefixSize_1(self.events, 'linePrefix'); - var valueSize; - - return start - - function start(code) { - if ( - (code === 42 || code === 43 || code === 45) && - (!self.containerState.marker || code === self.containerState.marker) - ) { - return code === 42 || code === 45 - ? effects.check(thematicBreak, nok, unordered)(code) - : unordered(code) - } - - if ( - asciiDigit(code) && - (!self.containerState.type || self.containerState.type === 'listOrdered') - ) { - return ordered(code) - } - - return nok(code) - } - - function unordered(code) { - if (!self.containerState.type) { - self.containerState.type = 'listUnordered'; - effects.enter(self.containerState.type, {_container: true}); - } - - effects.enter('listItemPrefix'); - return atMarker(code) - } - - function ordered(code) { - if (self.containerState.type || !self.interrupt || code === 49) { - if (!self.containerState.type) { - self.containerState.type = 'listOrdered'; - effects.enter(self.containerState.type, {_container: true}); - } - - effects.enter('listItemPrefix'); - effects.enter('listItemValue'); - effects.consume(code); - valueSize = 1; - return self.interrupt ? afterValue : inside - } - - return nok(code) - } - - function inside(code) { - if (asciiDigit(code) && ++valueSize < 10) { - effects.consume(code); - return inside - } - - return afterValue(code) - } - - function afterValue(code) { - effects.exit('listItemValue'); - - return code === 41 || code === 46 ? atMarker(code) : nok(code) - } - - function atMarker(code) { - self.containerState.marker = self.containerState.marker || code; - - if (code === self.containerState.marker) { - effects.enter('listItemMarker'); - effects.consume(code); - effects.exit('listItemMarker'); - return effects.check( - partialBlankLine, - // Can’t be empty when interrupting. - self.interrupt ? nok : onBlank, - effects.attempt( - {tokenize: tokenizeListItemPrefixWhitespace, partial: true}, - endOfPrefix, - otherPrefix - ) - ) - } - - return nok(code) - } - - function onBlank(code) { - self.containerState.initialBlankLine = true; - initialSize++; - return endOfPrefix(code) - } - - function otherPrefix(code) { - if (markdownSpace_1(code)) { - effects.enter('listItemPrefixWhitespace'); - effects.consume(code); - effects.exit('listItemPrefixWhitespace'); - return endOfPrefix - } - - return nok(code) - } - - function endOfPrefix(code) { - self.containerState.size = - initialSize + sizeChunks_1(self.sliceStream(effects.exit('listItemPrefix'))); - return ok(code) - } -} - -function tokenizeListContinuation(effects, ok, nok) { - var self = this; - - self.containerState._closeFlow = undefined; - - return effects.check(partialBlankLine, onBlank, notBlank) - - function onBlank(code) { - self.containerState.furtherBlankLines = - self.containerState.furtherBlankLines || - self.containerState.initialBlankLine; - return ok(code) - } - - function notBlank(code) { - if (self.containerState.furtherBlankLines || !markdownSpace_1(code)) { - self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined; - return notInCurrentItem(code) - } - - self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined; - return effects.attempt( - {tokenize: tokenizeIndent, partial: true}, - ok, - notInCurrentItem - )(code) - } - - function notInCurrentItem(code) { - // While we do continue, we signal that the flow should be closed. - self.containerState._closeFlow = true; - // As we’re closing flow, we’re no longer interrupting - self.interrupt = undefined; - return factorySpace( - effects, - effects.attempt(exports, ok, nok), - 'linePrefix', - 4 - )(code) - } -} - -function tokenizeIndent(effects, ok, nok) { - var self = this; - - return factorySpace( - effects, - afterPrefix, - 'listItemIndent', - - self.containerState.size + 1 - ) - - function afterPrefix(code) { - return prefixSize_1(self.events, 'listItemIndent') === - self.containerState.size - ? ok(code) - : nok(code) - } -} - -function tokenizeListEnd(effects) { - effects.exit(this.containerState.type); -} - -function tokenizeListItemPrefixWhitespace(effects, ok, nok) { - var self = this; - - return factorySpace( - effects, - afterPrefix, - 'listItemPrefixWhitespace', - - 4 + 1 - ) - - function afterPrefix(code) { - return markdownSpace_1(code) || - !prefixSize_1(self.events, 'listItemPrefixWhitespace') - ? nok(code) - : ok(code) - } -} -}); -var list_1 = list.tokenize; -var list_2 = list.continuation; -var list_3 = list.exit; - -var blockQuote = createCommonjsModule(function (module, exports) { -exports.tokenize = tokenizeBlockQuoteStart; -exports.continuation = {tokenize: tokenizeBlockQuoteContinuation}; -exports.exit = exit; - - - - - -function tokenizeBlockQuoteStart(effects, ok, nok) { - var self = this; - - return start - - function start(code) { - if (code === 62) { - if (!self.containerState.open) { - effects.enter('blockQuote', {_container: true}); - self.containerState.open = true; - } - - effects.enter('blockQuotePrefix'); - effects.enter('blockQuoteMarker'); - effects.consume(code); - effects.exit('blockQuoteMarker'); - return after - } +var asciiDigit_1 = asciiDigit; - return nok(code) - } - - function after(code) { - if (markdownSpace_1(code)) { - effects.enter('blockQuotePrefixWhitespace'); - effects.consume(code); - effects.exit('blockQuotePrefixWhitespace'); - effects.exit('blockQuotePrefix'); - return ok - } - - effects.exit('blockQuotePrefix'); - return ok(code) - } -} +var asciiHexDigit = regexCheck_1(/[\dA-Fa-f]/); -function tokenizeBlockQuoteContinuation(effects, ok, nok) { - return factorySpace( - effects, - effects.attempt(exports, ok, nok), - 'linePrefix', - 4 - ) -} +var asciiHexDigit_1 = asciiHexDigit; -function exit(effects) { - effects.exit('blockQuote'); +function _interopDefaultLegacy$1(e) { + return e && typeof e === 'object' && 'default' in e ? e : {default: e} } -}); -var blockQuote_1 = blockQuote.tokenize; -var blockQuote_2 = blockQuote.continuation; -var blockQuote_3 = blockQuote.exit; - -var asciiPunctuation = regexCheck_1(/[!-/:-@[-`{-~]/); - -var tokenize$9 = tokenizeCharacterEscape; - - - -function tokenizeCharacterEscape(effects, ok, nok) { - return start - - function start(code) { - effects.enter('characterEscape'); - effects.enter('escapeMarker'); - effects.consume(code); - effects.exit('escapeMarker'); - return open - } - - function open(code) { - if (asciiPunctuation(code)) { - effects.enter('characterEscapeValue'); - effects.consume(code); - effects.exit('characterEscapeValue'); - effects.exit('characterEscape'); - return ok - } - return nok(code) - } -} +var decodeEntity__default = /*#__PURE__*/ _interopDefaultLegacy$1(decodeEntity_1); -var characterEscape = { - tokenize: tokenize$9 +var characterReference = { + name: 'characterReference', + tokenize: tokenizeCharacterReference }; -var asciiHexDigit = regexCheck_1(/[\dA-Fa-f]/); - -var tokenize$a = tokenizeCharacterReference; - - - - - - function tokenizeCharacterReference(effects, ok, nok) { var self = this; var size = 0; var max; var test; - return start function start(code) { @@ -36901,7 +34380,7 @@ function tokenizeCharacterReference(effects, ok, nok) { effects.enter('characterReferenceValue'); max = 31; - test = asciiAlphanumeric; + test = asciiAlphanumeric_1; return value(code) } @@ -36912,13 +34391,13 @@ function tokenizeCharacterReference(effects, ok, nok) { effects.exit('characterReferenceMarkerHexadecimal'); effects.enter('characterReferenceValue'); max = 6; - test = asciiHexDigit; + test = asciiHexDigit_1; return value } effects.enter('characterReferenceValue'); max = 7; - test = asciiDigit; + test = asciiDigit_1; return value(code) } @@ -36928,7 +34407,10 @@ function tokenizeCharacterReference(effects, ok, nok) { if (code === 59 && size) { token = effects.exit('characterReferenceValue'); - if (test === asciiAlphanumeric && !decodeEntity_1(self.sliceSerialize(token))) { + if ( + test === asciiAlphanumeric_1 && + !decodeEntity__default['default'](self.sliceSerialize(token)) + ) { return nok(code) } @@ -36948,25 +34430,23 @@ function tokenizeCharacterReference(effects, ok, nok) { } } -var characterReference = { - tokenize: tokenize$a -}; - -var tokenize$b = tokenizeCodeFenced; -var concrete = true; - - - - - +var characterReference_1 = characterReference; +var codeFenced = { + name: 'codeFenced', + tokenize: tokenizeCodeFenced, + concrete: true +}; function tokenizeCodeFenced(effects, ok, nok) { var self = this; + var closingFenceConstruct = { + tokenize: tokenizeClosingFence, + partial: true + }; var initialPrefix = prefixSize_1(this.events, 'linePrefix'); var sizeOpen = 0; var marker; - return start function start(code) { @@ -36996,7 +34476,9 @@ function tokenizeCodeFenced(effects, ok, nok) { } effects.enter('codeFencedFenceInfo'); - effects.enter('chunkString', {contentType: 'string'}); + effects.enter('chunkString', { + contentType: 'string' + }); return info(code) } @@ -37018,7 +34500,9 @@ function tokenizeCodeFenced(effects, ok, nok) { } effects.enter('codeFencedFenceMeta'); - effects.enter('chunkString', {contentType: 'string'}); + effects.enter('chunkString', { + contentType: 'string' + }); return meta(code) } @@ -37049,7 +34533,7 @@ function tokenizeCodeFenced(effects, ok, nok) { effects.consume(code); effects.exit('lineEnding'); return effects.attempt( - {tokenize: tokenizeClosingFence, partial: true}, + closingFenceConstruct, after, initialPrefix ? factorySpace(effects, content, 'linePrefix', initialPrefix + 1) @@ -37078,10 +34562,16 @@ function tokenizeCodeFenced(effects, ok, nok) { function tokenizeClosingFence(effects, ok, nok) { var size = 0; + return factorySpace( + effects, + closingSequenceStart, + 'linePrefix', + this.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) - return factorySpace(effects, closingPrefixAfter, 'linePrefix', 4) - - function closingPrefixAfter(code) { + function closingSequenceStart(code) { effects.enter('codeFencedFence'); effects.enter('codeFencedFenceSequence'); return closingSequence(code) @@ -37110,21 +34600,17 @@ function tokenizeCodeFenced(effects, ok, nok) { } } -var codeFenced = { - tokenize: tokenize$b, - concrete: concrete -}; - -var tokenize$c = tokenizeCodeIndented; -var resolve$9 = resolveCodeIndented; - - +var codeFenced_1 = codeFenced; - - - - -var continuedIndent = {tokenize: tokenizeContinuedIndent, partial: true}; +var codeIndented = { + name: 'codeIndented', + tokenize: tokenizeCodeIndented, + resolve: resolveCodeIndented +}; +var indentedContentConstruct = { + tokenize: tokenizeIndentedContent, + partial: true +}; function resolveCodeIndented(events, context) { var code = { @@ -37132,34 +34618,13 @@ function resolveCodeIndented(events, context) { start: events[0][1].start, end: events[events.length - 1][1].end }; - chunkedSplice_1(events, 0, 0, [['enter', code, context]]); chunkedSplice_1(events, events.length, 0, [['exit', code, context]]); - return events } function tokenizeCodeIndented(effects, ok, nok) { - var self = this; - - return factorySpace( - effects, - afterInitial, - 'linePrefix', - - 4 + 1 - ) - - function afterInitial(code) { - // Flow checks blank lines first, so we don’t have EOL/EOF. - - if (prefixSize_1(self.events, 'linePrefix') < 4) { - return nok(code) - } - - effects.enter('codeFlowValue'); - return content(code) - } + return effects.attempt(indentedContentConstruct, afterPrefix, nok) function afterPrefix(code) { if (code === null) { @@ -37167,7 +34632,7 @@ function tokenizeCodeIndented(effects, ok, nok) { } if (markdownLineEnding_1(code)) { - return effects.attempt(continuedIndent, afterPrefix, ok)(code) + return effects.attempt(indentedContentConstruct, afterPrefix, ok)(code) } effects.enter('codeFlowValue'); @@ -37185,77 +34650,57 @@ function tokenizeCodeIndented(effects, ok, nok) { } } -function tokenizeContinuedIndent(effects, ok, nok) { +function tokenizeIndentedContent(effects, ok, nok) { var self = this; - - return factorySpace( - effects, - afterPrefix, - 'linePrefix', - - 4 + 1 - ) + return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1) function afterPrefix(code) { if (markdownLineEnding_1(code)) { effects.enter('lineEnding'); effects.consume(code); effects.exit('lineEnding'); - - return factorySpace( - effects, - afterPrefix, - 'linePrefix', - - 4 + 1 - ) + return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1) } return prefixSize_1(self.events, 'linePrefix') < 4 ? nok(code) : ok(code) } } -var codeIndented = { - tokenize: tokenize$c, - resolve: resolve$9 -}; - -var tokenize$d = tokenizeCodeText; -var resolve$a = resolveCodeText; -var previous_1 = previous; - +var codeIndented_1 = codeIndented; +var codeText = { + name: 'codeText', + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous: previous +}; function resolveCodeText(events) { var tailExitIndex = events.length - 4; var headEnterIndex = 3; var index; - var enter; + var enter; // If we start and end with an EOL or a space. - // If we start and end with an EOL or a space. if ( (events[headEnterIndex][1].type === 'lineEnding' || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === 'lineEnding' || events[tailExitIndex][1].type === 'space') ) { - index = headEnterIndex; + index = headEnterIndex; // And we have data. - // And we have data. while (++index < tailExitIndex) { if (events[index][1].type === 'codeTextData') { // Then we have padding. events[tailExitIndex][1].type = events[headEnterIndex][1].type = 'codeTextPadding'; - headEnterIndex += 2; tailExitIndex -= 2; break } } - } + } // Merge adjacent spaces and data. - // Merge adjacent spaces and data. index = headEnterIndex - 1; tailExitIndex++; @@ -37296,7 +34741,6 @@ function tokenizeCodeText(effects, ok, nok) { var sizeOpen = 0; var size; var token; - return start function start(code) { @@ -37320,17 +34764,15 @@ function tokenizeCodeText(effects, ok, nok) { // EOF. if (code === null) { return nok(code) - } - - // Closing fence? + } // Closing fence? // Could also be data. + if (code === 96) { token = effects.enter('codeTextSequence'); size = 0; return closingSequence(code) - } + } // Tabs don’t work, and virtual spaces don’t make sense. - // Tabs don’t work, and virtual spaces don’t make sense. if (code === 32) { effects.enter('space'); effects.consume(code); @@ -37343,14 +34785,12 @@ function tokenizeCodeText(effects, ok, nok) { effects.consume(code); effects.exit('lineEnding'); return gap - } + } // Data. - // Data. effects.enter('codeTextData'); return data(code) - } + } // In code. - // In code. function data(code) { if ( code === null || @@ -37364,44 +34804,31 @@ function tokenizeCodeText(effects, ok, nok) { effects.consume(code); return data - } + } // Closing fence. - // Closing fence. function closingSequence(code) { // More. if (code === 96) { effects.consume(code); size++; return closingSequence - } + } // Done! - // Done! if (size === sizeOpen) { effects.exit('codeTextSequence'); effects.exit('codeText'); return ok(code) - } + } // More or less accents: mark as data. - // More or less accents: mark as data. token.type = 'codeTextData'; return data(code) } } -var codeText = { - tokenize: tokenize$d, - resolve: resolve$a, - previous: previous_1 -}; - -var factoryDestination = createDestination; - - - - +var codeText_1 = codeText; // eslint-disable-next-line max-params -function createDestination( +function destinationFactory( effects, ok, nok, @@ -37414,7 +34841,6 @@ function createDestination( ) { var limit = max || Infinity; var balance = 0; - return start function start(code) { @@ -37434,7 +34860,9 @@ function createDestination( effects.enter(type); effects.enter(rawType); effects.enter(stringType); - effects.enter('chunkString', {contentType: 'string'}); + effects.enter('chunkString', { + contentType: 'string' + }); return destinationRaw(code) } @@ -37449,7 +34877,9 @@ function createDestination( } effects.enter(stringType); - effects.enter('chunkString', {contentType: 'string'}); + effects.enter('chunkString', { + contentType: 'string' + }); return destinationEnclosed(code) } @@ -37521,17 +34951,13 @@ function createDestination( } } -var factoryLabel = createLabel; - - - +var factoryDestination = destinationFactory; // eslint-disable-next-line max-params -function createLabel(effects, ok, nok, type, markerType, stringType) { +function labelFactory(effects, ok, nok, type, markerType, stringType) { var self = this; var size = 0; var data; - return start function start(code) { @@ -37548,9 +34974,11 @@ function createLabel(effects, ok, nok, type, markerType, stringType) { code === null || code === 91 || (code === 93 && !data) || - /* istanbul ignore next - footnotes. */ + /* c8 ignore next */ (code === 94 && + /* c8 ignore next */ !size && + /* c8 ignore next */ '_hiddenFootnoteSupport' in self.parser.constructs) || size > 999 ) { @@ -37573,7 +35001,9 @@ function createLabel(effects, ok, nok, type, markerType, stringType) { return atBreak } - effects.enter('chunkString', {contentType: 'string'}); + effects.enter('chunkString', { + contentType: 'string' + }); return label(code) } @@ -37605,14 +35035,9 @@ function createLabel(effects, ok, nok, type, markerType, stringType) { } } -var factoryWhitespace = createWhitespace; - - +var factoryLabel = labelFactory; - - - -function createWhitespace(effects, ok) { +function whitespaceFactory(effects, ok) { var seen; return start @@ -37637,16 +35062,10 @@ function createWhitespace(effects, ok) { } } -var factoryTitle = createTitle; - +var factoryWhitespace = whitespaceFactory; - - - -// eslint-disable-next-line max-params -function createTitle(effects, ok, nok, type, markerType, stringType) { +function titleFactory(effects, ok, nok, type, markerType, stringType) { var marker; - return start function start(code) { @@ -37679,9 +35098,8 @@ function createTitle(effects, ok, nok, type, markerType, stringType) { if (code === null) { return nok(code) - } + } // Note: blank lines can’t exist in content. - // Note: blank lines can’t exist in content. if (markdownLineEnding_1(code)) { effects.enter('lineEnding'); effects.consume(code); @@ -37689,7 +35107,9 @@ function createTitle(effects, ok, nok, type, markerType, stringType) { return factorySpace(effects, atTitleBreak, 'linePrefix') } - effects.enter('chunkString', {contentType: 'string'}); + effects.enter('chunkString', { + contentType: 'string' + }); return title(code) } @@ -37713,28 +35133,20 @@ function createTitle(effects, ok, nok, type, markerType, stringType) { } } -var tokenize$e = tokenizeDefinition; - - - - - - - - - +var factoryTitle = titleFactory; +var definition = { + name: 'definition', + tokenize: tokenizeDefinition +}; +var titleConstruct = { + tokenize: tokenizeTitle, + partial: true +}; function tokenizeDefinition(effects, ok, nok) { var self = this; - var destinationAfter = effects.attempt( - {tokenize: tokenizeTitle, partial: true}, - factorySpace(effects, after, 'whitespace'), - factorySpace(effects, after, 'whitespace') - ); - var identifier; - return start function start(code) { @@ -37758,14 +35170,17 @@ function tokenizeDefinition(effects, ok, nok) { if (code === 58) { effects.enter('definitionMarker'); effects.consume(code); - effects.exit('definitionMarker'); + effects.exit('definitionMarker'); // Note: blank lines can’t exist in content. - // Note: blank lines can’t exist in content. return factoryWhitespace( effects, factoryDestination( effects, - destinationAfter, + effects.attempt( + titleConstruct, + factorySpace(effects, after, 'whitespace'), + factorySpace(effects, after, 'whitespace') + ), nok, 'definitionDestination', 'definitionDestinationLiteral', @@ -37823,13 +35238,12 @@ function tokenizeTitle(effects, ok, nok) { } } -var definition = { - tokenize: tokenize$e -}; - -var tokenize$f = tokenizeHardBreakEscape; - +var definition_1 = definition; +var hardBreakEscape = { + name: 'hardBreakEscape', + tokenize: tokenizeHardBreakEscape +}; function tokenizeHardBreakEscape(effects, ok, nok) { return start @@ -37852,12 +35266,132 @@ function tokenizeHardBreakEscape(effects, ok, nok) { } } -var hardBreakEscape = { - tokenize: tokenize$f +var hardBreakEscape_1 = hardBreakEscape; + +var headingAtx = { + name: 'headingAtx', + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx }; +function resolveHeadingAtx(events, context) { + var contentEnd = events.length - 2; + var contentStart = 3; + var content; + var text; // Prefix whitespace, part of the opening. + + if (events[contentStart][1].type === 'whitespace') { + contentStart += 2; + } // Suffix whitespace, part of the closing. + + if ( + contentEnd - 2 > contentStart && + events[contentEnd][1].type === 'whitespace' + ) { + contentEnd -= 2; + } + + if ( + events[contentEnd][1].type === 'atxHeadingSequence' && + (contentStart === contentEnd - 1 || + (contentEnd - 4 > contentStart && + events[contentEnd - 2][1].type === 'whitespace')) + ) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; + } + + if (contentEnd > contentStart) { + content = { + type: 'atxHeadingText', + start: events[contentStart][1].start, + end: events[contentEnd][1].end + }; + text = { + type: 'chunkText', + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: 'text' + }; + chunkedSplice_1(events, contentStart, contentEnd - contentStart + 1, [ + ['enter', content, context], + ['enter', text, context], + ['exit', text, context], + ['exit', content, context] + ]); + } + + return events +} + +function tokenizeHeadingAtx(effects, ok, nok) { + var self = this; + var size = 0; + return start + + function start(code) { + effects.enter('atxHeading'); + effects.enter('atxHeadingSequence'); + return fenceOpenInside(code) + } + + function fenceOpenInside(code) { + if (code === 35 && size++ < 6) { + effects.consume(code); + return fenceOpenInside + } + + if (code === null || markdownLineEndingOrSpace_1(code)) { + effects.exit('atxHeadingSequence'); + return self.interrupt ? ok(code) : headingBreak(code) + } + + return nok(code) + } + + function headingBreak(code) { + if (code === 35) { + effects.enter('atxHeadingSequence'); + return sequence(code) + } + + if (code === null || markdownLineEnding_1(code)) { + effects.exit('atxHeading'); + return ok(code) + } + + if (markdownSpace_1(code)) { + return factorySpace(effects, headingBreak, 'whitespace')(code) + } + + effects.enter('atxHeadingText'); + return data(code) + } + + function sequence(code) { + if (code === 35) { + effects.consume(code); + return sequence + } + + effects.exit('atxHeadingSequence'); + return headingBreak(code) + } + + function data(code) { + if (code === null || code === 35 || markdownLineEndingOrSpace_1(code)) { + effects.exit('atxHeadingText'); + return headingBreak(code) + } + + effects.consume(code); + return data + } +} + +var headingAtx_1 = headingAtx; + // This module is copied from . -var htmlBlockNames = [ +var basics = [ 'address', 'article', 'aside', @@ -37922,29 +35456,25 @@ var htmlBlockNames = [ 'ul' ]; -// This module is copied from . -var htmlRawNames = ['pre', 'script', 'style']; - -var tokenize$g = tokenizeHtml; -var resolveTo = resolveToHtml; -var concrete$1 = true; - - - - - - - - - - - +var htmlBlockNames = basics; +// This module is copied from . +var raws = ['pre', 'script', 'style', 'textarea']; +var htmlRawNames = raws; -var nextBlank = {tokenize: tokenizeNextBlank, partial: true}; +var htmlFlow = { + name: 'htmlFlow', + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +}; +var nextBlankConstruct = { + tokenize: tokenizeNextBlank, + partial: true +}; -function resolveToHtml(events) { +function resolveToHtmlFlow(events) { var index = events.length; while (index--) { @@ -37955,24 +35485,23 @@ function resolveToHtml(events) { if (index > 1 && events[index - 2][1].type === 'linePrefix') { // Add the prefix start to the HTML token. - events[index][1].start = events[index - 2][1].start; - // Add the prefix start to the HTML line token. - events[index + 1][1].start = events[index - 2][1].start; - // Remove the line prefix. + events[index][1].start = events[index - 2][1].start; // Add the prefix start to the HTML line token. + + events[index + 1][1].start = events[index - 2][1].start; // Remove the line prefix. + events.splice(index - 2, 2); } return events } -function tokenizeHtml(effects, ok, nok) { +function tokenizeHtmlFlow(effects, ok, nok) { var self = this; var kind; var startTag; var buffer; var index; var marker; - return start function start(code) { @@ -37995,15 +35524,15 @@ function tokenizeHtml(effects, ok, nok) { if (code === 63) { effects.consume(code); - kind = 3; - // While we’re in an instruction instead of a declaration, we’re on a `?` + kind = 3; // While we’re in an instruction instead of a declaration, we’re on a `?` // right now, so we do need to search for `>`, similar to declarations. + return self.interrupt ? ok : continuationDeclarationInside } - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); - buffer = fromCharCode(code); + buffer = fromCharCode_1(code); startTag = true; return tagName } @@ -38026,7 +35555,7 @@ function tokenizeHtml(effects, ok, nok) { return cdataOpenInside } - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); kind = 4; return self.interrupt ? ok : continuationDeclarationInside @@ -38058,9 +35587,9 @@ function tokenizeHtml(effects, ok, nok) { } function tagCloseStart(code) { - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); - buffer = fromCharCode(code); + buffer = fromCharCode_1(code); return tagName } @@ -38074,7 +35603,11 @@ function tokenizeHtml(effects, ok, nok) { code === 62 || markdownLineEndingOrSpace_1(code) ) { - if (code !== 47 && startTag && htmlRawNames.indexOf(buffer.toLowerCase()) > -1) { + if ( + code !== 47 && + startTag && + htmlRawNames.indexOf(buffer.toLowerCase()) > -1 + ) { kind = 1; return self.interrupt ? ok(code) : continuation(code) } @@ -38090,8 +35623,8 @@ function tokenizeHtml(effects, ok, nok) { return self.interrupt ? ok(code) : continuation(code) } - kind = 7; - // Do not support complete HTML when interrupting. + kind = 7; // Do not support complete HTML when interrupting. + return self.interrupt ? nok(code) : startTag @@ -38099,9 +35632,9 @@ function tokenizeHtml(effects, ok, nok) { : completeClosingTagAfter(code) } - if (code === 45 || asciiAlphanumeric(code)) { + if (code === 45 || asciiAlphanumeric_1(code)) { effects.consume(code); - buffer += fromCharCode(code); + buffer += fromCharCode_1(code); return tagName } @@ -38132,7 +35665,7 @@ function tokenizeHtml(effects, ok, nok) { return completeEnd } - if (code === 58 || code === 95 || asciiAlpha(code)) { + if (code === 58 || code === 95 || asciiAlpha_1(code)) { effects.consume(code); return completeAttributeName } @@ -38151,7 +35684,7 @@ function tokenizeHtml(effects, ok, nok) { code === 46 || code === 58 || code === 95 || - asciiAlphanumeric(code) + asciiAlphanumeric_1(code) ) { effects.consume(code); return completeAttributeName @@ -38288,7 +35821,7 @@ function tokenizeHtml(effects, ok, nok) { if (markdownLineEnding_1(code) && (kind === 6 || kind === 7)) { return effects.check( - nextBlank, + nextBlankConstruct, continuationClose, continuationAtLineEnding )(code) @@ -38348,9 +35881,9 @@ function tokenizeHtml(effects, ok, nok) { return continuationClose } - if (asciiAlpha(code) && buffer.length < 6) { + if (asciiAlpha_1(code) && buffer.length < 8) { effects.consume(code); - buffer += fromCharCode(code); + buffer += fromCharCode_1(code); return continuationRawEndTag } @@ -38399,32 +35932,23 @@ function tokenizeNextBlank(effects, ok, nok) { effects.enter('lineEndingBlank'); effects.consume(code); effects.exit('lineEndingBlank'); - return effects.attempt(partialBlankLine, ok, nok) + return effects.attempt(partialBlankLine_1, ok, nok) } } -var htmlFlow = { - tokenize: tokenize$g, - resolveTo: resolveTo, - concrete: concrete$1 -}; - -var tokenize$h = tokenizeHtml$1; - - - - - - - +var htmlFlow_1 = htmlFlow; +var htmlText = { + name: 'htmlText', + tokenize: tokenizeHtmlText +}; -function tokenizeHtml$1(effects, ok, nok) { +function tokenizeHtmlText(effects, ok, nok) { + var self = this; var marker; var buffer; var index; var returnState; - return start function start(code) { @@ -38450,7 +35974,7 @@ function tokenizeHtml$1(effects, ok, nok) { return instruction } - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); return tagOpen } @@ -38471,7 +35995,7 @@ function tokenizeHtml$1(effects, ok, nok) { return cdataOpen } - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); return declaration } @@ -38556,6 +36080,11 @@ function tokenizeHtml$1(effects, ok, nok) { return cdataClose } + if (markdownLineEnding_1(code)) { + returnState = cdata; + return atLineEnding(code) + } + effects.consume(code); return cdata } @@ -38620,7 +36149,7 @@ function tokenizeHtml$1(effects, ok, nok) { } function tagCloseStart(code) { - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); return tagClose } @@ -38629,7 +36158,7 @@ function tokenizeHtml$1(effects, ok, nok) { } function tagClose(code) { - if (code === 45 || asciiAlphanumeric(code)) { + if (code === 45 || asciiAlphanumeric_1(code)) { effects.consume(code); return tagClose } @@ -38652,7 +36181,7 @@ function tokenizeHtml$1(effects, ok, nok) { } function tagOpen(code) { - if (code === 45 || asciiAlphanumeric(code)) { + if (code === 45 || asciiAlphanumeric_1(code)) { effects.consume(code); return tagOpen } @@ -38670,7 +36199,7 @@ function tokenizeHtml$1(effects, ok, nok) { return end } - if (code === 58 || code === 95 || asciiAlpha(code)) { + if (code === 58 || code === 95 || asciiAlpha_1(code)) { effects.consume(code); return tagOpenAttributeName } @@ -38694,7 +36223,7 @@ function tokenizeHtml$1(effects, ok, nok) { code === 46 || code === 58 || code === 95 || - asciiAlphanumeric(code) + asciiAlphanumeric_1(code) ) { effects.consume(code); return tagOpenAttributeName @@ -38799,16 +36328,22 @@ function tokenizeHtml$1(effects, ok, nok) { effects.consume(code); return tagOpenAttributeValueUnquoted - } - - // We can’t have blank lines in content, so no need to worry about empty + } // We can’t have blank lines in content, so no need to worry about empty // tokens. + function atLineEnding(code) { effects.exit('htmlTextData'); effects.enter('lineEnding'); effects.consume(code); effects.exit('lineEnding'); - return factorySpace(effects, afterPrefix, 'linePrefix', 4) + return factorySpace( + effects, + afterPrefix, + 'linePrefix', + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + ) } function afterPrefix(code) { @@ -38828,28 +36363,23 @@ function tokenizeHtml$1(effects, ok, nok) { } } -var htmlText = { - tokenize: tokenize$h -}; - -var tokenize$i = tokenizeLabelEnd; -var resolveTo$1 = resolveToLabelEnd; -var resolveAll_1$2 = resolveAllLabelEnd; - - - - - - +var htmlText_1 = htmlText; - - - - - -var resource = {tokenize: tokenizeResource}; -var fullReference = {tokenize: tokenizeFullReference}; -var collapsedReference = {tokenize: tokenizeCollapsedReference}; +var labelEnd = { + name: 'labelEnd', + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +}; +var resourceConstruct = { + tokenize: tokenizeResource +}; +var fullReferenceConstruct = { + tokenize: tokenizeFullReference +}; +var collapsedReferenceConstruct = { + tokenize: tokenizeCollapsedReference +}; function resolveAllLabelEnd(events) { var index = -1; @@ -38883,9 +36413,8 @@ function resolveToLabelEnd(events, context) { var token; var open; var close; - var media; + var media; // Find an opening. - // Find an opening. while (index--) { token = events[index][1]; @@ -38896,10 +36425,9 @@ function resolveToLabelEnd(events, context) { (token.type === 'labelLink' && token._inactive) ) { break - } - - // Mark other link openings as inactive, as we can’t have links in + } // Mark other link openings as inactive, as we can’t have links in // links. + if (events[index][0] === 'enter' && token.type === 'labelLink') { token._inactive = true; } @@ -38926,63 +36454,45 @@ function resolveToLabelEnd(events, context) { start: shallow_1(events[open][1].start), end: shallow_1(events[events.length - 1][1].end) }; - label = { type: 'label', start: shallow_1(events[open][1].start), end: shallow_1(events[close][1].end) }; - text = { type: 'labelText', start: shallow_1(events[open + offset + 2][1].end), end: shallow_1(events[close - 2][1].start) }; - media = [ ['enter', group, context], ['enter', label, context] - ]; + ]; // Opening marker. - // Opening marker. - chunkedSplice_1( - media, - media.length, - 0, - events.slice(open + 1, open + offset + 3) - ); + media = chunkedPush_1(media, events.slice(open + 1, open + offset + 3)); // Text open. - // Text open. - chunkedSplice_1(media, media.length, 0, [['enter', text, context]]); + media = chunkedPush_1(media, [['enter', text, context]]); // Between. - // Between. - chunkedSplice_1( + media = chunkedPush_1( media, - media.length, - 0, resolveAll_1( context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context ) - ); + ); // Text close, marker close, label close. - // Text close, marker close, label close. - chunkedSplice_1(media, media.length, 0, [ + media = chunkedPush_1(media, [ ['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context] - ]); + ]); // Reference, resource, or so. - // Reference, resource, or so. - chunkedSplice_1(media, media.length, 0, events.slice(close + 1)); - - // Media close. - chunkedSplice_1(media, media.length, 0, [['exit', group, context]]); + media = chunkedPush_1(media, events.slice(close + 1)); // Media close. + media = chunkedPush_1(media, [['exit', group, context]]); chunkedSplice_1(events, open, events.length, media); - return events } @@ -38990,9 +36500,8 @@ function tokenizeLabelEnd(effects, ok, nok) { var self = this; var index = self.events.length; var labelStart; - var defined; + var defined; // Find an opening. - // Find an opening. while (index--) { if ( (self.events[index][1].type === 'labelImage' || @@ -39009,14 +36518,16 @@ function tokenizeLabelEnd(effects, ok, nok) { function start(code) { if (!labelStart) { return nok(code) - } + } // It’s a balanced bracket, but contains a link. - // It’s a balanced bracket, but contains a link. if (labelStart._inactive) return balanced(code) defined = self.parser.defined.indexOf( normalizeIdentifier_1( - self.sliceSerialize({start: labelStart.end, end: self.now()}) + self.sliceSerialize({ + start: labelStart.end, + end: self.now() + }) ) ) > -1; effects.enter('labelEnd'); @@ -39030,19 +36541,23 @@ function tokenizeLabelEnd(effects, ok, nok) { function afterLabelEnd(code) { // Resource: `[asd](fgh)`. if (code === 40) { - return effects.attempt(resource, ok, defined ? ok : balanced)(code) - } + return effects.attempt( + resourceConstruct, + ok, + defined ? ok : balanced + )(code) + } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference? - // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference? if (code === 91) { return effects.attempt( - fullReference, + fullReferenceConstruct, ok, - defined ? effects.attempt(collapsedReference, ok, balanced) : balanced + defined + ? effects.attempt(collapsedReferenceConstruct, ok, balanced) + : balanced )(code) - } + } // Shortcut reference: `[asd]`? - // Shortcut reference: `[asd]`? return defined ? ok(code) : balanced(code) } @@ -39117,7 +36632,6 @@ function tokenizeResource(effects, ok, nok) { function tokenizeFullReference(effects, ok, nok) { var self = this; - return start function start(code) { @@ -39167,18 +36681,16 @@ function tokenizeCollapsedReference(effects, ok, nok) { } } -var labelEnd = { - tokenize: tokenize$i, - resolveTo: resolveTo$1, - resolveAll: resolveAll_1$2 -}; +var labelEnd_1 = labelEnd; -var tokenize$j = tokenizelabelImage; -var resolveAll$1 = labelEnd.resolveAll; +var labelStartImage = { + name: 'labelStartImage', + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd_1.resolveAll +}; -function tokenizelabelImage(effects, ok, nok) { +function tokenizeLabelStartImage(effects, ok, nok) { var self = this; - return start function start(code) { @@ -39202,65 +36714,328 @@ function tokenizelabelImage(effects, ok, nok) { } function after(code) { - /* istanbul ignore next - footnotes. */ - return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs - ? nok(code) + /* c8 ignore next */ + return code === 94 && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ + nok(code) + : ok(code) + } +} + +var labelStartImage_1 = labelStartImage; + +var labelStartLink = { + name: 'labelStartLink', + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd_1.resolveAll +}; + +function tokenizeLabelStartLink(effects, ok, nok) { + var self = this; + return start + + function start(code) { + effects.enter('labelLink'); + effects.enter('labelMarker'); + effects.consume(code); + effects.exit('labelMarker'); + effects.exit('labelLink'); + return after + } + + function after(code) { + /* c8 ignore next */ + return code === 94 && + /* c8 ignore next */ + '_hiddenFootnoteSupport' in self.parser.constructs + ? /* c8 ignore next */ + nok(code) : ok(code) } } -var labelStartImage = { - tokenize: tokenize$j, - resolveAll: resolveAll$1 -}; - -var tokenize$k = tokenizelabelLink; -var resolveAll$2 = labelEnd.resolveAll; +var labelStartLink_1 = labelStartLink; + +var lineEnding = { + name: 'lineEnding', + tokenize: tokenizeLineEnding +}; + +function tokenizeLineEnding(effects, ok) { + return start + + function start(code) { + effects.enter('lineEnding'); + effects.consume(code); + effects.exit('lineEnding'); + return factorySpace(effects, ok, 'linePrefix') + } +} + +var lineEnding_1 = lineEnding; + +var thematicBreak = { + name: 'thematicBreak', + tokenize: tokenizeThematicBreak +}; + +function tokenizeThematicBreak(effects, ok, nok) { + var size = 0; + var marker; + return start + + function start(code) { + effects.enter('thematicBreak'); + marker = code; + return atBreak(code) + } + + function atBreak(code) { + if (code === marker) { + effects.enter('thematicBreakSequence'); + return sequence(code) + } + + if (markdownSpace_1(code)) { + return factorySpace(effects, atBreak, 'whitespace')(code) + } + + if (size < 3 || (code !== null && !markdownLineEnding_1(code))) { + return nok(code) + } + + effects.exit('thematicBreak'); + return ok(code) + } + + function sequence(code) { + if (code === marker) { + effects.consume(code); + size++; + return sequence + } + + effects.exit('thematicBreakSequence'); + return atBreak(code) + } +} + +var thematicBreak_1 = thematicBreak; + +var list = { + name: 'list', + tokenize: tokenizeListStart, + continuation: { + tokenize: tokenizeListContinuation + }, + exit: tokenizeListEnd +}; +var listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +}; +var indentConstruct = { + tokenize: tokenizeIndent, + partial: true +}; + +function tokenizeListStart(effects, ok, nok) { + var self = this; + var initialSize = prefixSize_1(self.events, 'linePrefix'); + var size = 0; + return start + + function start(code) { + var kind = + self.containerState.type || + (code === 42 || code === 43 || code === 45 + ? 'listUnordered' + : 'listOrdered'); + + if ( + kind === 'listUnordered' + ? !self.containerState.marker || code === self.containerState.marker + : asciiDigit_1(code) + ) { + if (!self.containerState.type) { + self.containerState.type = kind; + effects.enter(kind, { + _container: true + }); + } + + if (kind === 'listUnordered') { + effects.enter('listItemPrefix'); + return code === 42 || code === 45 + ? effects.check(thematicBreak_1, nok, atMarker)(code) + : atMarker(code) + } + + if (!self.interrupt || code === 49) { + effects.enter('listItemPrefix'); + effects.enter('listItemValue'); + return inside(code) + } + } + + return nok(code) + } + + function inside(code) { + if (asciiDigit_1(code) && ++size < 10) { + effects.consume(code); + return inside + } + + if ( + (!self.interrupt || size < 2) && + (self.containerState.marker + ? code === self.containerState.marker + : code === 41 || code === 46) + ) { + effects.exit('listItemValue'); + return atMarker(code) + } + + return nok(code) + } + + function atMarker(code) { + effects.enter('listItemMarker'); + effects.consume(code); + effects.exit('listItemMarker'); + self.containerState.marker = self.containerState.marker || code; + return effects.check( + partialBlankLine_1, // Can’t be empty when interrupting. + self.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ) + } + + function onBlank(code) { + self.containerState.initialBlankLine = true; + initialSize++; + return endOfPrefix(code) + } + + function otherPrefix(code) { + if (markdownSpace_1(code)) { + effects.enter('listItemPrefixWhitespace'); + effects.consume(code); + effects.exit('listItemPrefixWhitespace'); + return endOfPrefix + } + + return nok(code) + } + + function endOfPrefix(code) { + self.containerState.size = + initialSize + sizeChunks_1(self.sliceStream(effects.exit('listItemPrefix'))); + return ok(code) + } +} + +function tokenizeListContinuation(effects, ok, nok) { + var self = this; + self.containerState._closeFlow = undefined; + return effects.check(partialBlankLine_1, onBlank, notBlank) + + function onBlank(code) { + self.containerState.furtherBlankLines = + self.containerState.furtherBlankLines || + self.containerState.initialBlankLine; + return ok(code) + } + + function notBlank(code) { + if (self.containerState.furtherBlankLines || !markdownSpace_1(code)) { + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined; + return notInCurrentItem(code) + } + + self.containerState.furtherBlankLines = self.containerState.initialBlankLine = undefined; + return effects.attempt(indentConstruct, ok, notInCurrentItem)(code) + } + + function notInCurrentItem(code) { + // While we do continue, we signal that the flow should be closed. + self.containerState._closeFlow = true; // As we’re closing flow, we’re no longer interrupting. + + self.interrupt = undefined; + return factorySpace( + effects, + effects.attempt(list, ok, nok), + 'linePrefix', + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + )(code) + } +} + +function tokenizeIndent(effects, ok, nok) { + var self = this; + return factorySpace( + effects, + afterPrefix, + 'listItemIndent', + self.containerState.size + 1 + ) + + function afterPrefix(code) { + return prefixSize_1(self.events, 'listItemIndent') === + self.containerState.size + ? ok(code) + : nok(code) + } +} + +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type); +} -function tokenizelabelLink(effects, ok, nok) { +function tokenizeListItemPrefixWhitespace(effects, ok, nok) { var self = this; + return factorySpace( + effects, + afterPrefix, + 'listItemPrefixWhitespace', + self.parser.constructs.disable.null.indexOf('codeIndented') > -1 + ? undefined + : 4 + 1 + ) - return start - - function start(code) { - effects.enter('labelLink'); - effects.enter('labelMarker'); - effects.consume(code); - effects.exit('labelMarker'); - effects.exit('labelLink'); - return after - } - - function after(code) { - /* istanbul ignore next - footnotes. */ - return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs + function afterPrefix(code) { + return markdownSpace_1(code) || + !prefixSize_1(self.events, 'listItemPrefixWhitespace') ? nok(code) : ok(code) } } -var labelStartLink = { - tokenize: tokenize$k, - resolveAll: resolveAll$2 -}; - -var tokenize$l = tokenizeSetextUnderline; -var resolveTo$2 = resolveToSetextUnderline; - - - - +var list_1 = list; +var setextUnderline = { + name: 'setextUnderline', + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +}; function resolveToSetextUnderline(events, context) { var index = events.length; var content; var text; var definition; - var heading; - - // Find the opening of the content. + var heading; // Find the opening of the content. // It’ll always exist: we don’t tokenize if it isn’t there. + while (index--) { if (events[index][0] === 'enter') { if (events[index][1].type === 'content') { @@ -39271,8 +37046,7 @@ function resolveToSetextUnderline(events, context) { if (events[index][1].type === 'paragraph') { text = index; } - } - // Exit + } // Exit else { if (events[index][1].type === 'content') { // Remove the content end (if needed we’ll add it later) @@ -39289,24 +37063,20 @@ function resolveToSetextUnderline(events, context) { type: 'setextHeading', start: shallow_1(events[text][1].start), end: shallow_1(events[events.length - 1][1].end) - }; - - // Change the paragraph to setext heading text. - events[text][1].type = 'setextHeadingText'; + }; // Change the paragraph to setext heading text. - // If we have definitions in the content, we’ll keep on having content, + events[text][1].type = 'setextHeadingText'; // If we have definitions in the content, we’ll keep on having content, // but we need move it. + if (definition) { events.splice(text, 0, ['enter', heading, context]); events.splice(definition + 1, 0, ['exit', events[content][1], context]); events[content][1].end = shallow_1(events[definition][1].end); } else { events[content][1] = heading; - } + } // Add the heading exit at the end. - // Add the heading exit at the end. events.push(['exit', heading, context]); - return events } @@ -39314,9 +37084,8 @@ function tokenizeSetextUnderline(effects, ok, nok) { var self = this; var index = self.events.length; var marker; - var paragraph; + var paragraph; // Find an opening. - // Find an opening. while (index--) { // Skip enter/exit of line ending, line prefix, and content. // We can now either have a definition or a paragraph. @@ -39363,613 +37132,163 @@ function tokenizeSetextUnderline(effects, ok, nok) { } } -var setextUnderline = { - tokenize: tokenize$l, - resolveTo: resolveTo$2 -}; - -var tokenize$m = tokenizeWhitespace; - - - - - -function tokenizeWhitespace(effects, ok) { - return start - - function start(code) { - effects.enter('lineEnding'); - effects.consume(code); - effects.exit('lineEnding'); - return factorySpace(effects, ok, 'linePrefix') - } -} - -var lineEnding = { - tokenize: tokenize$m -}; - -var resolveText = text.resolver; +var setextUnderline_1 = setextUnderline; var document$2 = { - 42: list, // Asterisk - 43: list, // Plus sign - 45: list, // Dash - 48: list, // 0 - 49: list, // 1 - 50: list, // 2 - 51: list, // 3 - 52: list, // 4 - 53: list, // 5 - 54: list, // 6 - 55: list, // 7 - 56: list, // 8 - 57: list, // 9 - 62: blockQuote // Greater than + 42: list_1, + // Asterisk + 43: list_1, + // Plus sign + 45: list_1, + // Dash + 48: list_1, + // 0 + 49: list_1, + // 1 + 50: list_1, + // 2 + 51: list_1, + // 3 + 52: list_1, + // 4 + 53: list_1, + // 5 + 54: list_1, + // 6 + 55: list_1, + // 7 + 56: list_1, + // 8 + 57: list_1, + // 9 + 62: blockQuote_1 // Greater than }; - var contentInitial = { - 91: definition // Left square bracket + 91: definition_1 // Left square bracket }; - var flowInitial = { - '-2': codeIndented, // Horizontal tab - '-1': codeIndented, // Virtual space - 32: codeIndented // Space + '-2': codeIndented_1, + // Horizontal tab + '-1': codeIndented_1, + // Virtual space + 32: codeIndented_1 // Space }; - var flow$1 = { - 35: headingAtx, // Number sign - 42: thematicBreak, // Asterisk - 45: [setextUnderline, thematicBreak], // Dash - 60: htmlFlow, // Less than - 61: setextUnderline, // Equals to - 95: thematicBreak, // Underscore - 96: codeFenced, // Grave accent - 126: codeFenced // Tilde + 35: headingAtx_1, + // Number sign + 42: thematicBreak_1, + // Asterisk + 45: [setextUnderline_1, thematicBreak_1], + // Dash + 60: htmlFlow_1, + // Less than + 61: setextUnderline_1, + // Equals to + 95: thematicBreak_1, + // Underscore + 96: codeFenced_1, + // Grave accent + 126: codeFenced_1 // Tilde }; - var string$1 = { - 38: characterReference, // Ampersand - 92: characterEscape // Backslash + 38: characterReference_1, + // Ampersand + 92: characterEscape_1 // Backslash }; - var text$1 = { - '-5': lineEnding, // Carriage return - '-4': lineEnding, // Line feed - '-3': lineEnding, // Carriage return + line feed - 33: labelStartImage, // Exclamation mark - 38: characterReference, // Ampersand - 42: attention, // Asterisk - 60: [autolink, htmlText], // Less than - 91: labelStartLink, // Left square bracket - 92: [hardBreakEscape, characterEscape], // Backslash - 93: labelEnd, // Right square bracket - 95: attention, // Underscore - 96: codeText // Grave accent + '-5': lineEnding_1, + // Carriage return + '-4': lineEnding_1, + // Line feed + '-3': lineEnding_1, + // Carriage return + line feed + 33: labelStartImage_1, + // Exclamation mark + 38: characterReference_1, + // Ampersand + 42: attention_1, + // Asterisk + 60: [autolink_1, htmlText_1], + // Less than + 91: labelStartLink_1, + // Left square bracket + 92: [hardBreakEscape_1, characterEscape_1], + // Backslash + 93: labelEnd_1, + // Right square bracket + 95: attention_1, + // Underscore + 96: codeText_1 // Grave accent }; - var insideSpan = { - null: [attention, resolveText] -}; - -var constructs = { - document: document$2, - contentInitial: contentInitial, - flowInitial: flowInitial, - flow: flow$1, - string: string$1, - text: text$1, - insideSpan: insideSpan -}; - -var serializeChunks_1 = serializeChunks; - - - -function serializeChunks(chunks) { - var index = -1; - var result = []; - var chunk; - var value; - var atTab; - - while (++index < chunks.length) { - chunk = chunks[index]; - - if (typeof chunk === 'string') { - value = chunk; - } else if (chunk === -5) { - value = '\r'; - } else if (chunk === -4) { - value = '\n'; - } else if (chunk === -3) { - value = '\r' + '\n'; - } else if (chunk === -2) { - value = '\t'; - } else if (chunk === -1) { - if (atTab) continue - value = ' '; - } else { - // Currently only replacement character. - value = fromCharCode(chunk); - } - - atTab = chunk === -2; - result.push(value); - } - - return result.join('') -} - -var sliceChunks_1 = sliceChunks; - -function sliceChunks(chunks, token) { - var startIndex = token.start._index; - var startBufferIndex = token.start._bufferIndex; - var endIndex = token.end._index; - var endBufferIndex = token.end._bufferIndex; - var view; - - if (startIndex === endIndex) { - view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; - } else { - view = chunks.slice(startIndex, endIndex); - - if (startBufferIndex > -1) { - view[0] = view[0].slice(startBufferIndex); - } - - if (endBufferIndex > 0) { - view.push(chunks[endIndex].slice(0, endBufferIndex)); - } - } - - return view -} - -var miniflat_1 = miniflat; - -function miniflat(value) { - return value === null || value === undefined - ? [] - : 'length' in value - ? value - : [value] -} - -var createTokenizer_1 = createTokenizer; - - - - - - - - - - - -// Create a tokenizer. -// Tokenizers deal with one type of data (e.g., containers, flow, text). -// The parser is the object dealing with it all. -// `initialize` works like other constructs, except that only its `tokenize` -// function is used, in which case it doesn’t receive an `ok` or `nok`. -// `from` can be given to set the point before the first character, although -// when further lines are indented, they must be set with `defineSkip`. -function createTokenizer(parser, initialize, from) { - var point = from ? shallow_1(from) : {line: 1, column: 1, offset: 0}; - var columnStart = {}; - var resolveAllConstructs = []; - var chunks = []; - var stack = []; - - // Tools used for tokenizing. - var effects = { - consume: consume, - enter: enter, - exit: exit, - attempt: constructFactory(onsuccessfulconstruct), - check: constructFactory(onsuccessfulcheck), - interrupt: constructFactory(onsuccessfulcheck, {interrupt: true}), - lazy: constructFactory(onsuccessfulcheck, {lazy: true}) - }; - - // State and tools for resolving and serializing. - var context = { - previous: null, - events: [], - parser: parser, - sliceStream: sliceStream, - sliceSerialize: sliceSerialize, - now: now, - defineSkip: skip, - write: write - }; - - // The state function. - var state = initialize.tokenize.call(context, effects); - - if (initialize.resolveAll) { - resolveAllConstructs.push(initialize); - } - - // Store where we are in the input stream. - point._index = 0; - point._bufferIndex = -1; - - return context - - function write(slice) { - chunkedSplice_1(chunks, chunks.length, 0, slice); - - main(); - - // Exit if we’re not done, resolve might change stuff. - if (chunks[chunks.length - 1] !== null) { - return [] - } - - addResult(initialize, 0); - - // Otherwise, resolve, and exit. - context.events = resolveAll_1(resolveAllConstructs, context.events, context); - - return context.events - } - - // - // Tools. - // - - function sliceSerialize(token) { - return serializeChunks_1(sliceStream(token)) - } - - function sliceStream(token) { - return sliceChunks_1(chunks, token) - } - - function now() { - return shallow_1(point) - } - - function skip(value) { - columnStart[value.line] = value.column; - accountForPotentialSkip(); - } - - // - // State management. - // - - // Main loop (note that `_index` and `_bufferIndex` in `point` are modified by - // `consume`). - // Here is where we walk through the chunks, which either include strings of - // several characters, or numerical character codes. - // The reason to do this in a loop instead of a call is so the stack can - // drain. - function main() { - var chunkIndex; - var chunk; - - while (point._index < chunks.length) { - chunk = chunks[point._index]; - - // If we’re in a buffer chunk, loop through it. - if (typeof chunk === 'string') { - chunkIndex = point._index; - - if (point._bufferIndex < 0) { - point._bufferIndex = 0; - } - - while ( - point._index === chunkIndex && - point._bufferIndex < chunk.length - ) { - go(chunk.charCodeAt(point._bufferIndex)); - } - } else { - go(chunk); - } - } - } - - // Deal with one code. - function go(code) { - state = state(code); - } - - // Move a character forward. - function consume(code) { - if (markdownLineEnding_1(code)) { - point.line++; - point.column = 1; - point.offset += code === -3 ? 2 : 1; - accountForPotentialSkip(); - } else if (code !== -1) { - point.column++; - point.offset++; - } - - // Not in a string chunk. - if (point._bufferIndex < 0) { - point._index++; - } else { - point._bufferIndex++; - - // At end of string chunk. - if (point._bufferIndex === chunks[point._index].length) { - point._bufferIndex = -1; - point._index++; - } - } - - // Expose the previous character. - context.previous = code; - } - - // Start a token. - function enter(type, fields) { - var token = fields || {}; - token.type = type; - token.start = now(); - - context.events.push(['enter', token, context]); - - stack.push(token); - - return token - } - - // Stop a token. - function exit(type) { - var token = stack.pop(); - token.end = now(); - - context.events.push(['exit', token, context]); - - return token - } - - // Use results. - function onsuccessfulconstruct(construct, info) { - addResult(construct, info.from); - } - - // Discard results. - function onsuccessfulcheck(construct, info) { - info.restore(); - } - - // Factory to attempt/check/interrupt. - function constructFactory(onreturn, fields) { - return hook - - // Handle either an object mapping codes to constructs, a list of - // constructs, or a single construct. - function hook(constructs, returnState, bogusState) { - var listOfConstructs; - var constructIndex; - var currentConstruct; - var info; - - return constructs.tokenize || 'length' in constructs - ? handleListOfConstructs(miniflat_1(constructs)) - : handleMapOfConstructs - - function handleMapOfConstructs(code) { - if (code in constructs || null in constructs) { - return handleListOfConstructs( - /* istanbul ignore next - `null` is used by some extensions */ - constructs.null - ? miniflat_1(constructs[code]).concat(miniflat_1(constructs.null)) - : constructs[code] - )(code) - } - - return bogusState(code) - } - - function handleListOfConstructs(list) { - listOfConstructs = list; - constructIndex = 0; - return handleConstruct(list[constructIndex]) - } - - function handleConstruct(construct) { - return start - - function start(code) { - // To do: not nede to store if there is no bogus state, probably? - // Currently doesn’t work because `inspect` in document does a check - // w/o a bogus, which doesn’t make sense. But it does seem to help perf - // by not storing. - info = store(); - currentConstruct = construct; - - if (!construct.partial) { - context.currentConstruct = construct; - } - - return construct.tokenize.call( - fields ? assign({}, context, fields) : context, - effects, - ok, - nok - )(code) - } - } - - function ok(code) { - onreturn(currentConstruct, info); - return returnState - } - - function nok(code) { - info.restore(); - - if (++constructIndex < listOfConstructs.length) { - return handleConstruct(listOfConstructs[constructIndex]) - } - - return bogusState - } - } - } - - function addResult(construct, from) { - if (construct.resolveAll && resolveAllConstructs.indexOf(construct) < 0) { - resolveAllConstructs.push(construct); - } - - if (construct.resolve) { - chunkedSplice_1( - context.events, - from, - context.events.length - from, - construct.resolve(context.events.slice(from), context) - ); - } - - if (construct.resolveTo) { - context.events = construct.resolveTo(context.events, context); - } - } - - function store() { - var startPoint = now(); - var startPrevious = context.previous; - var startCurrentConstruct = context.currentConstruct; - var startEventsIndex = context.events.length; - var startStack = Array.from(stack); - - return {restore: restore, from: startEventsIndex} - - function restore() { - point = startPoint; - context.previous = startPrevious; - context.currentConstruct = startCurrentConstruct; - context.events.length = startEventsIndex; - stack = startStack; - accountForPotentialSkip(); - } - } - - function accountForPotentialSkip() { - if (point.line in columnStart && point.column < 2) { - point.column = columnStart[point.line]; - point.offset += columnStart[point.line] - 1; - } - } -} - -var combineExtensions_1 = combineExtensions; - - - - - -// Combine several syntax extensions into one. -function combineExtensions(extensions) { - var all = {}; - var index = -1; - - while (++index < extensions.length) { - extension$1(all, extensions[index]); - } - - return all -} - -function extension$1(all, extension) { - var hook; - var left; - var right; - var code; - - for (hook in extension) { - left = hasOwnProperty_1.call(all, hook) ? all[hook] : (all[hook] = {}); - right = extension[hook]; - - for (code in right) { - left[code] = constructs$1( - miniflat_1(right[code]), - hasOwnProperty_1.call(left, code) ? left[code] : [] - ); - } - } -} - -function constructs$1(list, existing) { - var index = -1; - var before = []; - - while (++index < list.length) { -(list[index].add === 'after' ? existing : before).push(list[index]); - } - - chunkedSplice_1(existing, 0, 0, before); - return existing -} - -var parse$8 = createParser; - - - - - - - - - - -function createParser(options) { + null: [attention_1, text_1.resolver] +}; +var disable = { + null: [] +}; + +var contentInitial_1 = contentInitial; +var disable_1 = disable; +var document_1 = document$2; +var flow_1 = flow$1; +var flowInitial_1 = flowInitial; +var insideSpan_1 = insideSpan; +var string_1$1 = string$1; +var text_1$1 = text$1; + +var constructs$1 = /*#__PURE__*/Object.defineProperty({ + contentInitial: contentInitial_1, + disable: disable_1, + document: document_1, + flow: flow_1, + flowInitial: flowInitial_1, + insideSpan: insideSpan_1, + string: string_1$1, + text: text_1$1 +}, '__esModule', {value: true}); + +function parse$7(options) { var settings = options || {}; var parser = { defined: [], constructs: combineExtensions_1( - [constructs].concat(miniflat_1(settings.extensions)) + [constructs$1].concat(miniflat_1(settings.extensions)) ), - content: create(content), document: create(document$1), flow: create(flow), - string: create(text.string), - text: create(text.text) + string: create(text_1.string), + text: create(text_1.text) }; - return parser function create(initializer) { return creator + function creator(from) { return createTokenizer_1(parser, initializer, from) } } } -var preprocess = preprocessor; +var parse_1$3 = parse$7; var search$1 = /[\0\t\n\r]/g; -function preprocessor() { +function preprocess() { var start = true; var column = 1; var buffer = ''; var atCarriageReturn; + return preprocessor - return preprocess - - function preprocess(value, encoding, end) { + function preprocessor(value, encoding, end) { var chunks = []; var match; var next; var startPosition; var endPosition; var code; - value = buffer + value.toString(encoding); startPosition = 0; buffer = ''; @@ -40013,12 +37332,12 @@ function preprocessor() { } else if (code === 9) { next = Math.ceil(column / 4) * 4; chunks.push(-2); + while (column++ < next) chunks.push(-1); } else if (code === 10) { chunks.push(-4); column = 1; - } - // Must be carriage return. + } // Must be carriage return. else { atCarriageReturn = true; column = 1; @@ -40038,9 +37357,7 @@ function preprocessor() { } } -var postprocess_1 = postprocess; - - +var preprocess_1 = preprocess; function postprocess(events) { while (!subtokenize_1(events)) { @@ -40050,6 +37367,8 @@ function postprocess(events) { return events } +var postprocess_1 = postprocess; + var dist$2 = fromMarkdown; // These three are compiled away in the `dist/` @@ -40063,6 +37382,8 @@ var dist$2 = fromMarkdown; + + function fromMarkdown(value, encoding, options) { if (typeof encoding !== 'string') { options = encoding; @@ -40071,7 +37392,7 @@ function fromMarkdown(value, encoding, options) { return compiler(options)( postprocess_1( - parse$8(options).document().write(preprocess()(value, encoding, true)) + parse_1$3(options).document().write(preprocess_1()(value, encoding, true)) ) ) } @@ -40143,7 +37464,7 @@ function compiler(options) { characterEscapeValue: onexitdata, characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, characterReferenceMarkerNumeric: onexitcharacterreferencemarker, - characterReferenceValue: closer(onexitcharacterreferencevalue), + characterReferenceValue: onexitcharacterreferencevalue, codeFenced: closer(onexitcodefenced), codeFencedFence: onexitcodefencedfence, codeFencedFenceInfo: onexitcodefencedfenceinfo, @@ -40194,23 +37515,32 @@ function compiler(options) { function compile(events) { var stack = [{type: 'root', children: []}]; - var index = -1; + var tokenStack = []; var listStack = []; - var length; + var index = -1; var handler; var listStart; - var event; - while (++index < events.length) { - event = events[index]; + var context = { + stack: stack, + tokenStack: tokenStack, + config: config, + enter: enter, + exit: exit, + buffer: buffer, + resume: resume, + setData: setData, + getData: getData + }; + while (++index < events.length) { // We preprocess lists to add `listItem` tokens, and to infer whether // items the list itself are spread out. if ( - event[1].type === 'listOrdered' || - event[1].type === 'listUnordered' + events[index][1].type === 'listOrdered' || + events[index][1].type === 'listUnordered' ) { - if (event[0] === 'enter') { + if (events[index][0] === 'enter') { listStack.push(index); } else { listStart = listStack.pop(index); @@ -40220,38 +37550,39 @@ function compiler(options) { } index = -1; - length = events.length; - while (++index < length) { + while (++index < events.length) { handler = config[events[index][0]]; - if (hasOwnProperty_1.call(handler, events[index][1].type)) { + if (hasOwnProperty.call(handler, events[index][1].type)) { handler[events[index][1].type].call( - { - stack: stack, - config: config, - enter: enter, - exit: exit, - buffer: buffer, - resume: resume, - sliceSerialize: events[index][2].sliceSerialize, - setData: setData, - getData: getData - }, - + assign_1({sliceSerialize: events[index][2].sliceSerialize}, context), events[index][1] ); } } + if (tokenStack.length) { + throw new Error( + 'Cannot close document, a token (`' + + tokenStack[tokenStack.length - 1].type + + '`, ' + + unistUtilStringifyPosition({ + start: tokenStack[tokenStack.length - 1].start, + end: tokenStack[tokenStack.length - 1].end + }) + + ') is still open' + ) + } + // Figure out `root` position. stack[0].position = { start: point( - length ? events[0][1].start : {line: 1, column: 1, offset: 0} + events.length ? events[0][1].start : {line: 1, column: 1, offset: 0} ), end: point( - length + events.length ? events[events.length - 2][1].end : {line: 1, column: 1, offset: 0} ) @@ -40416,6 +37747,7 @@ function compiler(options) { function enter(node, token) { this.stack[this.stack.length - 1].children.push(node); this.stack.push(node); + this.tokenStack.push(token); node.position = {start: point(token.start)}; return node } @@ -40431,13 +37763,36 @@ function compiler(options) { function exit(token) { var node = this.stack.pop(); + var open = this.tokenStack.pop(); + + if (!open) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + unistUtilStringifyPosition({start: token.start, end: token.end}) + + '): it’s not open' + ) + } else if (open.type !== token.type) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + unistUtilStringifyPosition({start: token.start, end: token.end}) + + '): a different token (`' + + open.type + + '`, ' + + unistUtilStringifyPosition({start: open.start, end: open.end}) + + ') is open' + ) + } + node.position.end = point(token.end); return node } function resume() { - var value = mdastUtilToString(this.stack.pop()); - return value + return mdastUtilToString(this.stack.pop()) } // @@ -40564,11 +37919,10 @@ function compiler(options) { return } - if (getData('setextHeadingSlurpLineEnding')) { - return - } - - if (config.canContainEols.indexOf(context.type) !== -1) { + if ( + !getData('setextHeadingSlurpLineEnding') && + config.canContainEols.indexOf(context.type) > -1 + ) { onenterdata.call(this, token); onexitdata.call(this, token); } @@ -40686,6 +38040,7 @@ function compiler(options) { var data = this.sliceSerialize(token); var type = getData('characterReferenceType'); var value; + var tail; if (type) { value = safeFromInt_1( @@ -40698,7 +38053,9 @@ function compiler(options) { value = decodeEntity_1(data); } - this.stack[this.stack.length - 1].value += value; + tail = this.stack.pop(); + tail.value += value; + tail.position.end = point(token.end); } function onexitautolinkprotocol(token) { @@ -40799,10 +38156,9 @@ function compiler(options) { } function configure$2(config, extensions) { - var length = extensions.length; var index = -1; - while (++index < length) { + while (++index < extensions.length) { extension$2(config, extensions[index]); } @@ -40812,27 +38168,25 @@ function configure$2(config, extensions) { function extension$2(config, extension) { var key; var left; - var right; for (key in extension) { - left = hasOwnProperty_1.call(config, key) ? config[key] : (config[key] = {}); - right = extension[key]; + left = hasOwnProperty.call(config, key) ? config[key] : (config[key] = {}); if (key === 'canContainEols') { - config[key] = [].concat(left, right); + config[key] = [].concat(left, extension[key]); } else { - Object.assign(left, right); + Object.assign(left, extension[key]); } } } var mdastUtilFromMarkdown = dist$2; -var remarkParse = parse$9; +var remarkParse = parse$8; -function parse$9(options) { +function parse$8(options) { var self = this; this.Parser = parse; @@ -40853,8 +38207,8 @@ function parse$9(options) { var zwitch = factory$1; -var noop$2 = Function.prototype; -var own$4 = {}.hasOwnProperty; +var noop$1 = Function.prototype; +var own$5 = {}.hasOwnProperty; // Handle values based on a property. function factory$1(key, options) { @@ -40864,11 +38218,11 @@ function factory$1(key, options) { var fn = one.invalid; var handlers = one.handlers; - if (value && own$4.call(value, key)) { - fn = own$4.call(handlers, value[key]) ? handlers[value[key]] : one.unknown; + if (value && own$5.call(value, key)) { + fn = own$5.call(handlers, value[key]) ? handlers[value[key]] : one.unknown; } - return (fn || noop$2).apply(this, arguments) + return (fn || noop$1).apply(this, arguments) } one.handlers = settings.handlers || {}; @@ -40878,6 +38232,32 @@ function factory$1(key, options) { return one } +var configure_1$2 = configure$3; + +function configure$3(base, extension) { + var index = -1; + var key; + + // First do subextensions. + if (extension.extensions) { + while (++index < extension.extensions.length) { + configure$3(base, extension.extensions[index]); + } + } + + for (key in extension) { + if (key === 'extensions') ; else if (key === 'unsafe' || key === 'join') { + base[key] = base[key].concat(extension[key] || []); + } else if (key === 'handlers') { + base[key] = Object.assign(base[key], extension[key] || {}); + } else { + base.options[key] = extension[key]; + } + } + + return base +} + var containerFlow = flow$2; @@ -41013,8 +38393,8 @@ var formatCodeAsIndented_1 = formatCodeAsIndented; function formatCodeAsIndented(node, context) { return ( - node.value && !context.options.fences && + node.value && // If there’s no info… !node.lang && // And there’s a non-whitespace character… @@ -41057,8 +38437,8 @@ function safe(context, input, config) { var start; var end; - while (++index < context.unsafePatterns.length) { - pattern = context.unsafePatterns[index]; + while (++index < context.unsafe.length) { + pattern = context.unsafe[index]; if ( !inScope(context.stack, pattern.inConstruct, true) || @@ -41301,7 +38681,7 @@ function checkQuote(context) { return marker } -var definition_1 = definition$1; +var definition_1$1 = definition$1; @@ -41618,14 +38998,19 @@ var formatLinkAsAutolink_1 = formatLinkAsAutolink; -function formatLinkAsAutolink(node) { +function formatLinkAsAutolink(node, context) { var raw = mdastUtilToString(node); return ( + !context.options.resourceLink && // If there’s a url… node.url && // And there’s a no title… !node.title && + // And the content of `node` is a single text node… + node.children && + node.children.length === 1 && + node.children[0].type === 'text' && // And if the url is the same as the content… (raw === node.url || 'mailto:' + raw === node.url) && // And that starts w/ a protocol… @@ -41652,7 +39037,7 @@ function link$2(node, _, context) { var value; var stack; - if (formatLinkAsAutolink_1(node)) { + if (formatLinkAsAutolink_1(node, context)) { // Hide the fact that we’re in phrasing, because escapes don’t work. stack = context.stack; context.stack = []; @@ -41703,8 +39088,8 @@ function link$2(node, _, context) { return value } -function linkPeek(node) { - return formatLinkAsAutolink_1(node) ? '<' : '[' +function linkPeek(node, _, context) { + return formatLinkAsAutolink_1(node, context) ? '<' : '[' } var linkReference_1 = linkReference; @@ -41900,7 +39285,7 @@ function strongPeek(node, _, context) { return context.options.strong || '*' } -var text_1$1 = text$2; +var text_1$2 = text$2; @@ -41940,7 +39325,7 @@ function checkRule$1(context) { return marker } -var thematicBreak_1 = thematicBreak$1; +var thematicBreak_1$1 = thematicBreak$1; @@ -41958,7 +39343,7 @@ function thematicBreak$1(node, parent, context) { var blockquote$1 = blockquote_1; var _break$1 = _break; var code$1 = code_1; -var definition$2 = definition_1; +var definition$2 = definition_1$1; var emphasis$1 = emphasis_1; var hardBreak$1 = _break; var heading$1 = heading_1; @@ -41973,8 +39358,8 @@ var listItem$1 = listItem_1; var paragraph$1 = paragraph_1; var root$2 = root_1; var strong$1 = strong_1; -var text$3 = text_1$1; -var thematicBreak$2 = thematicBreak_1; +var text$3 = text_1$2; +var thematicBreak$2 = thematicBreak_1$1; var handle = { blockquote: blockquote$1, @@ -41999,6 +39384,44 @@ var handle = { thematicBreak: thematicBreak$2 }; +var join$2 = [joinDefaults]; + + + + +function joinDefaults(left, right, parent, context) { + if ( + // Two lists with the same marker. + (right.type === 'list' && + right.type === left.type && + Boolean(left.ordered) === Boolean(right.ordered)) || + // Indented code after list or another indented code. + (right.type === 'code' && + formatCodeAsIndented_1(right, context) && + (left.type === 'list' || + (left.type === right.type && formatCodeAsIndented_1(left, context)))) + ) { + return false + } + + // Join children of a list or an item. + // In which case, `parent` has a `spread` field. + if (typeof parent.spread === 'boolean') { + if ( + left.type === 'paragraph' && + // Two paragraphs. + (left.type === right.type || + right.type === 'definition' || + // Paragraph followed by a setext heading. + (right.type === 'heading' && formatHeadingAsSetext_1(right, context))) + ) { + return + } + + return parent.spread ? 1 : 0 + } +} + var unsafe = [ { character: '\t', @@ -42112,69 +39535,44 @@ var unsafe = [ {atBreak: true, character: '~'} ]; -var join$2 = [joinDefaults]; - +var lib$8 = toMarkdown; -function joinDefaults(left, right, parent, context) { - if ( - // Two lists with the same marker. - (right.type === 'list' && - right.type === left.type && - Boolean(left.ordered) === Boolean(right.ordered)) || - // Indented code after list or another indented code. - (right.type === 'code' && - formatCodeAsIndented_1(right, context) && - (left.type === 'list' || - (left.type === right.type && formatCodeAsIndented_1(left, context)))) - ) { - return false - } - - // Join children of a list or an item. - // In which case, `parent` has a `spread` field. - if (typeof parent.spread === 'boolean') { - if ( - left.type === 'paragraph' && - // Two paragraphs. - (left.type === right.type || - right.type === 'definition' || - // Paragraph followed by a setext heading. - (right.type === 'heading' && formatHeadingAsSetext_1(right, context))) - ) { - return - } - - return parent.spread ? 1 : 0 - } -} -var lib$7 = toMarkdown; +function toMarkdown(tree, options) { + var settings = options || {}; + var context = { + enter: enter, + stack: [], + unsafe: [], + join: [], + handlers: {}, + options: {} + }; + var result; + configure_1$2(context, { + unsafe: unsafe, + join: join$2, + handlers: handle + }); + configure_1$2(context, settings); + if (context.options.tightDefinitions) { + context.join = [joinDefinition].concat(context.join); + } -function toMarkdown(tree, options) { - var settings = options || {}; - var extensions = configure$3(settings); - var stack = []; - var handle = zwitch('type', { + context.handle = zwitch('type', { invalid: invalid, unknown: unknown, - handlers: extensions.handlers + handlers: context.handlers }); - var context = { - handle: handle, - stack: stack, - enter: enter, - options: settings, - unsafePatterns: extensions.unsafe, - join: extensions.join - }; - var result = handle(tree, null, context, {before: '\n', after: '\n'}); + + result = context.handle(tree, null, context, {before: '\n', after: '\n'}); if ( result && @@ -42187,11 +39585,11 @@ function toMarkdown(tree, options) { return result function enter(name) { - stack.push(name); + context.stack.push(name); return exit function exit() { - stack.pop(); + context.stack.pop(); } } } @@ -42204,28 +39602,6 @@ function unknown(node) { throw new Error('Cannot handle unknown node `' + node.type + '`') } -function configure$3(settings) { - var extensions = [ - {unsafe: settings.unsafe, handlers: settings.handlers, join: settings.join} - ].concat(settings.extensions || []); - var unsafe$1 = unsafe; - var join = join$2; - var handlers = Object.assign({}, handle); - var index = -1; - - if (settings.tightDefinitions) { - join = [joinDefinition].concat(join); - } - - while (++index < extensions.length) { - unsafe$1 = unsafe$1.concat(extensions[index].unsafe || []); - join = join.concat(extensions[index].join || []); - Object.assign(handlers, extensions[index].handlers || {}); - } - - return {unsafe: unsafe$1, join: join, handlers: handlers} -} - function joinDefinition(left, right) { // No blank line between adjacent definitions. if (left.type === 'definition' && left.type === right.type) { @@ -42233,7 +39609,7 @@ function joinDefinition(left, right) { } } -var mdastUtilToMarkdown = lib$7; +var mdastUtilToMarkdown = lib$8; var remarkStringify = stringify$6; @@ -42263,7 +39639,7 @@ const name = "remark"; const version$1 = "13.0.0"; const description = "Markdown processor powered by plugins part of the unified collective"; const license = "MIT"; -const keywords = [ +const keywords$1 = [ "unified", "remark", "markdown", @@ -42303,12 +39679,12 @@ const scripts = { test: "tape test.js" }; const xo = false; -var _package = { +var proc = { name: name, version: version$1, description: description, license: license, - keywords: keywords, + keywords: keywords$1, homepage: homepage, repository: repository, bugs: bugs, @@ -42322,51 +39698,30 @@ var _package = { xo: xo }; -var _package$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - name: name, - version: version$1, - description: description, - license: license, - keywords: keywords, - homepage: homepage, - repository: repository, - bugs: bugs, - funding: funding, - author: author, - contributors: contributors, - files: files, - types: types, - dependencies: dependencies, - scripts: scripts, - xo: xo, - 'default': _package -}); - const name$1 = "node-lint-md-cli-rollup"; const description$1 = "remark packaged for Node.js Markdown linting"; const version$2 = "2.0.2"; const devDependencies = { - "@rollup/plugin-commonjs": "^11.0.1", - "@rollup/plugin-json": "^4.0.1", - "@rollup/plugin-node-resolve": "^7.0.0", - rollup: "^2.32.1", + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^11.0.1", + rollup: "^2.36.1", shx: "^0.3.3" }; const dependencies$1 = { "markdown-extensions": "^1.1.1", remark: "^13.0.0", "remark-gfm": "^1.0.0", - "remark-lint": "^7.0.0", + "remark-lint": "^8.0.0", "remark-preset-lint-node": "^2.0.0", - "unified-args": "^8.0.0" + "unified-args": "^8.1.0" }; const main = "dist/index.js"; const scripts$1 = { build: "npx rollup -c", "build-node": "npm run build && npx shx cp dist/index.js ../lint-md.js" }; -var _package$2 = { +var cli = { name: name$1, description: description$1, version: version$2, @@ -42376,106 +39731,72 @@ var _package$2 = { scripts: scripts$1 }; -var _package$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - name: name$1, - description: description$1, - version: version$2, - devDependencies: devDependencies, - dependencies: dependencies$1, - main: main, - scripts: scripts$1, - 'default': _package$2 -}); - var vfileLocation = factory$2; function factory$2(file) { - var contents = indices(String(file)); - var toPoint = offsetToPointFactory(contents); + var value = String(file); + var indices = []; + var search = /\r?\n|\r/g; - return { - toPoint: toPoint, - toPosition: toPoint, - toOffset: pointToOffsetFactory(contents) + while (search.exec(value)) { + indices.push(search.lastIndex); } -} -// Factory to get the line and column-based `point` for `offset` in the bound -// indices. -function offsetToPointFactory(indices) { - return offsetToPoint + 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; - var length = indices.length; - if (offset < 0) { - return {} - } - - while (++index < length) { - if (indices[index] > offset) { - return { - line: index + 1, - column: offset - (indices[index - 1] || 0) + 1, - offset: offset + 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 {} } -} - -// Factory to get the `offset` for a line and column-based `point` in the -// bound indices. -function pointToOffsetFactory(indices) { - return pointToOffset // 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) { - return (indices[line - 2] || 0) + column - 1 || 0 + offset = (indices[line - 2] || 0) + column - 1 || 0; } - return -1 + return offset > -1 && offset < indices[indices.length - 1] ? offset : -1 } } -// Get indices of line-breaks in `value`. -function indices(value) { - var result = []; - var index = value.indexOf('\n'); - - while (index !== -1) { - result.push(index + 1); - index = value.indexOf('\n', index + 1); - } - - result.push(value.length + 1); - - return result -} - var convert_1 = convert$3; function convert$3(test) { - if (typeof test === 'string') { - return typeFactory(test) + if (test == null) { + return ok$1 } - if (test === null || test === undefined) { - return ok$1 + if (typeof test === 'string') { + return typeFactory(test) } if (typeof test === 'object') { - return ('length' in test ? anyFactory : matchesFactory)(test) + return 'length' in test ? anyFactory(test) : allFactory(test) } if (typeof test === 'function') { @@ -42485,30 +39806,16 @@ function convert$3(test) { throw new Error('Expected function, string, or object as test') } -function convertAll(tests) { - var results = []; - var length = tests.length; - var index = -1; - - while (++index < length) { - results[index] = convert$3(tests[index]); - } - - return results -} - // Utility assert each property in `test` is represented in `node`, and each // values are strictly equal. -function matchesFactory(test) { - return matches +function allFactory(test) { + return all - function matches(node) { + function all(node) { var key; for (key in test) { - if (node[key] !== test[key]) { - return false - } + if (node[key] !== test[key]) return false } return true @@ -42516,15 +39823,19 @@ function matchesFactory(test) { } function anyFactory(tests) { - var checks = convertAll(tests); - var length = checks.length; + var checks = []; + var index = -1; - return matches + while (++index < tests.length) { + checks[index] = convert$3(tests[index]); + } - function matches() { + return any + + function any() { var index = -1; - while (++index < length) { + while (++index < checks.length) { if (checks[index].apply(this, arguments)) { return true } @@ -42568,79 +39879,74 @@ visitParents.SKIP = SKIP; visitParents.EXIT = EXIT; function visitParents(tree, test, visitor, reverse) { + var step; var is; - if (func(test) && !func(visitor)) { + if (typeof test === 'function' && typeof visitor !== 'function') { reverse = visitor; visitor = test; test = null; } is = convert_1(test); + step = reverse ? -1 : 1; - one(tree, null, [])(); + factory(tree, null, [])(); - function one(child, index, parents) { - var value = object(child) ? child : {}; + function factory(node, index, parents) { + var value = typeof node === 'object' && node !== null ? node : {}; var name; - if (string$2(value.type)) { - name = string$2(value.tagName) - ? value.tagName - : string$2(value.name) - ? value.name - : undefined; + if (typeof value.type === 'string') { + name = + typeof value.tagName === 'string' + ? value.tagName + : typeof value.name === 'string' + ? value.name + : undefined; - node.displayName = + visit.displayName = 'node (' + color_1(value.type + (name ? '<' + name + '>' : '')) + ')'; } - return node + return visit - function node() { + function visit() { + var grandparents = parents.concat(node); var result = []; var subresult; + var offset; - if (!test || is(child, index, parents[parents.length - 1] || null)) { - result = toResult(visitor(child, parents)); + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)); if (result[0] === EXIT) { return result } } - if (!child.children || result[0] === SKIP) { - return result - } - - subresult = toResult(children(child.children, parents.concat(child))); - return subresult[0] === EXIT ? subresult : result - } - } + if (node.children && result[0] !== SKIP) { + offset = (reverse ? node.children.length : -1) + step; - // Visit children in `parent`. - function children(children, parents) { - var min = -1; - var step = reverse ? -1 : 1; - var index = (reverse ? children.length : min) + step; - var child; - var result; + while (offset > -1 && offset < node.children.length) { + subresult = factory(node.children[offset], offset, grandparents)(); - while (index > min && index < children.length) { - child = children[index]; - result = one(child, index, parents)(); + if (subresult[0] === EXIT) { + return subresult + } - if (result[0] === EXIT) { - return result + offset = + typeof subresult[1] === 'number' ? subresult[1] : offset + step; + } } - index = typeof result[1] === 'number' ? result[1] : index + step; + return result } } } function toResult(value) { - if (object(value) && 'length' in value) { + if (value !== null && typeof value === 'object' && 'length' in value) { return value } @@ -42651,18 +39957,6 @@ function toResult(value) { return [value] } -function func(d) { - return typeof d === 'function' -} - -function string$2(d) { - return typeof d === 'string' -} - -function object(d) { - return typeof d === 'object' && d !== null -} - var unistUtilVisit = visit; @@ -42695,25 +39989,23 @@ var unifiedMessageControl = messageControl; function messageControl(options) { var settings = options || {}; - var name = settings.name; - var marker = settings.marker; - var test = settings.test; - var sources = settings.source; - var known = settings.known; - var reset = settings.reset; var enable = settings.enable || []; var disable = settings.disable || []; + var sources = settings.source; + var reset = settings.reset; - if (!name) { - throw new Error('Expected `name` in `options`, got `' + name + '`') + if (!settings.name) { + throw new Error('Expected `name` in `options`, got `' + settings.name + '`') } - if (!marker) { - throw new Error('Expected `marker` in `options`, got `' + marker + '`') + if (!settings.marker) { + throw new Error( + 'Expected `marker` in `options`, got `' + settings.marker + '`' + ) } if (!sources) { - sources = [name]; + sources = [settings.name]; } else if (typeof sources === 'string') { sources = [sources]; } @@ -42727,30 +40019,31 @@ function messageControl(options) { var scope = {}; var globals = []; - unistUtilVisit(tree, test, visitor); + unistUtilVisit(tree, settings.test, visitor); file.messages = file.messages.filter(filter); function visitor(node, position, parent) { - var mark = marker(node); + var mark = settings.marker(node); var ruleIds; - var ruleId; var verb; - var index; - var length; - var next; var pos; var tail; + var index; + var ruleId; - if (!mark || mark.name !== name) { + if (!mark || mark.name !== settings.name) { return } ruleIds = mark.attributes.split(/\s/g); verb = ruleIds.shift(); - next = parent.children[position + 1]; pos = mark.node.position && mark.node.position.start; - tail = next && next.position && next.position.end; + tail = + parent.children[position + 1] && + parent.children[position + 1].position && + parent.children[position + 1].position.end; + index = -1; if (verb !== 'enable' && verb !== 'disable' && verb !== 'ignore') { file.fail( @@ -42762,20 +40055,9 @@ function messageControl(options) { ); } - length = ruleIds.length; - index = -1; - // Apply to all rules. - if (length === 0) { - if (verb === 'ignore') { - toggle(pos, false); - toggle(tail, true); - } else { - toggle(pos, verb === 'enable'); - reset = verb !== 'enable'; - } - } else { - while (++index < length) { + if (ruleIds.length) { + while (++index < ruleIds.length) { ruleId = ruleIds[index]; if (isKnown(ruleId, verb, mark.node)) { @@ -42786,13 +40068,17 @@ function messageControl(options) { } } } + } else if (verb === 'ignore') { + toggle(pos, false); + toggle(tail, true); + } else { + toggle(pos, verb === 'enable'); + reset = verb !== 'enable'; } } function filter(message) { var gapIndex = gaps.length; - var ruleId = message.ruleId; - var ranges = scope[ruleId]; var pos; // Keep messages from a different source. @@ -42820,12 +40106,15 @@ function messageControl(options) { } // Check whether allowed by specific and global states. - return check(message, ranges, ruleId) && check(message, globals) + return ( + check(message, scope[message.ruleId], message.ruleId) && + check(message, globals) + ) } // Helper to check (and possibly warn) if a `ruleId` is unknown. function isKnown(ruleId, verb, pos) { - var result = known ? known.indexOf(ruleId) !== -1 : true; + var result = settings.known ? settings.known.indexOf(ruleId) !== -1 : true; if (!result) { file.message( @@ -42842,7 +40131,7 @@ function messageControl(options) { function getState(ruleId) { var ranges = ruleId ? scope[ruleId] : globals; - if (ranges && ranges.length !== 0) { + if (ranges && ranges.length) { return ranges[ranges.length - 1].state } @@ -42850,11 +40139,7 @@ function messageControl(options) { return !reset } - if (reset) { - return enable.indexOf(ruleId) !== -1 - } - - return disable.indexOf(ruleId) === -1 + return reset ? enable.indexOf(ruleId) > -1 : disable.indexOf(ruleId) < 0 } // Handle a rule. @@ -42882,36 +40167,30 @@ function messageControl(options) { } // Check all `ranges` for `message`. - function check(message, ranges, id) { + function check(message, ranges, ruleId) { // Check the state at the message’s position. var index = ranges && ranges.length; - var length = -1; - var range; - - while (--index > length) { - range = ranges[index]; - - /* istanbul ignore if - Generated marker. */ - if (!range.position || !range.position.line || !range.position.column) { - continue - } + while (index--) { if ( - range.position.line < message.line || - (range.position.line === message.line && - range.position.column <= message.column) + ranges[index].position && + ranges[index].position.line && + ranges[index].position.column && + (ranges[index].position.line < message.line || + (ranges[index].position.line === message.line && + ranges[index].position.column <= message.column)) ) { - return range.state === true + return ranges[index].state === true } } // The first marker ocurred after the first message, so we check the // initial state. - if (!id) { + if (!ruleId) { return initial || reset } - return reset ? enable.indexOf(id) !== -1 : disable.indexOf(id) === -1 + return reset ? enable.indexOf(ruleId) > -1 : disable.indexOf(ruleId) < 0 } } } @@ -42920,8 +40199,8 @@ function messageControl(options) { function detectGaps(tree, file) { var lastNode = tree.children[tree.children.length - 1]; var offset = 0; - var isGap = false; var gaps = []; + var gap; // Find all gaps. unistUtilVisit(tree, one); @@ -42947,37 +40226,30 @@ function detectGaps(tree, file) { return gaps function one(node) { - var pos = node.position; - - update(pos && pos.start && pos.start.offset); + update(node.position && node.position.start && node.position.start.offset); if (!node.children) { - update(pos && pos.end && pos.end.offset); + update(node.position && node.position.end && node.position.end.offset); } } // Detect a new position. function update(latest) { if (latest === null || latest === undefined) { - isGap = true; - return - } - - if (offset >= latest) { - return - } + gap = true; + } else if (offset < latest) { + if (gap) { + gaps.push({start: offset, end: latest}); + gap = null; + } - if (isGap) { - gaps.push({start: offset, end: latest}); - isGap = false; + offset = latest; } - - offset = latest; } } function trim(value) { - return value.replace(/^\s*|\s*$/g, '') + return value.replace(/^\s+|\s+$/g, '') } var mdastCommentMarker = marker$1; @@ -43081,19 +40353,6 @@ function lintMessageControl() { return remarkMessageControl({name: 'lint', source: 'remark-lint'}) } -var remarkLint$1 = lint$1; - -// `remark-lint`. -// This adds support for ignoring stuff from messages (``). -// All rules are in their own packages and presets. -function lint$1() { - this.use(lintMessageControl$1); -} - -function lintMessageControl$1() { - return remarkMessageControl({name: 'lint', source: 'remark-lint'}) -} - /** * An Array.prototype.slice.call(arguments) alternative * @@ -43424,8 +40683,7 @@ function error(err) { * Module Dependencies */ - -var noop$3 = function(){}; +var noop$2 = function(){}; /** @@ -43450,7 +40708,7 @@ function wrapped(fn) { var ctx = this; // done - var done = typeof last == 'function' ? args.pop() : noop$3; + var done = typeof last == 'function' ? args.pop() : noop$2; // nothing if (!fn) { @@ -43646,6 +40904,60 @@ function coerce(name, value) { return result } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module final-newline + * @fileoverview + * Warn when a line feed at the end of a file is missing. + * Empty files are allowed. + * + * See [StackExchange](https://unix.stackexchange.com/questions/18743) for why. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * always adds a final line feed to files. + * + * 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 + * + * ##### `ok.md` + * + * ###### In + * + * Note: `␊` represents LF. + * + * ```markdown + * Alpha␊ + * ``` + * + * ###### Out + * + * No messages. + * + * ##### `not-ok.md` + * + * ###### In + * + * Note: The below file does not have a final newline. + * + * ```markdown + * Bravo + * ``` + * + * ###### Out + * + * ```text + * 1:1: Missing newline character at end of file + * ``` + */ + + + var remarkLintFinalNewline = unifiedLintRule('remark-lint:final-newline', finalNewline); function finalNewline(tree, file) { @@ -43657,9 +40969,9 @@ function finalNewline(tree, file) { } } -var pluralize = createCommonjsModule(function (module, exports) { /* global define */ +var pluralize = createCommonjsModule(function (module, exports) { (function (root, pluralize) { /* istanbul ignore else */ if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') { @@ -44173,6 +41485,47 @@ function generated(node) { ) } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module list-item-bullet-indent + * @fileoverview + * Warn when list item bullets are indented. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * removes all indentation before bullets. + * + * 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"} + * + * Paragraph. + * + * * List item + * * List item + * + * @example {"name": "not-ok.md", "label": "input"} + * + * Paragraph. + * + * ·* List item + * ·* List item + * + * @example {"name": "not-ok.md", "label": "output"} + * + * 3:2: Incorrect indentation before bullet: remove 1 space + * 4:2: Incorrect indentation before bullet: remove 1 space + */ + + + + + + var remarkLintListItemBulletIndent = unifiedLintRule( 'remark-lint:list-item-bullet-indent', listItemBulletIndent @@ -44238,6 +41591,117 @@ function factory$4(type) { } } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module list-item-indent + * @fileoverview + * Warn when the spacing between a list item’s bullet and its content violates + * a given style. + * + * Options: `'tab-size'`, `'mixed'`, or `'space'`, default: `'tab-size'`. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * uses `'tab-size'` (named `'tab'` there) by default to ensure Markdown is + * seen the same way across vendors. + * This can be configured with the + * [`listItemIndent`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionslistitemindent) + * option. + * This rule’s `'space'` option is named `'1'` there. + * + * 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"} + * + * *···List + * ····item. + * + * Paragraph. + * + * 11.·List + * ····item. + * + * Paragraph. + * + * *···List + * ····item. + * + * *···List + * ····item. + * + * @example {"name": "ok.md", "setting": "mixed"} + * + * *·List item. + * + * Paragraph. + * + * 11.·List item + * + * Paragraph. + * + * *···List + * ····item. + * + * *···List + * ····item. + * + * @example {"name": "ok.md", "setting": "space"} + * + * *·List item. + * + * Paragraph. + * + * 11.·List item + * + * Paragraph. + * + * *·List + * ··item. + * + * *·List + * ··item. + * + * @example {"name": "not-ok.md", "setting": "space", "label": "input"} + * + * *···List + * ····item. + * + * @example {"name": "not-ok.md", "setting": "space", "label": "output"} + * + * 1:5: Incorrect list-item indent: remove 2 spaces + * + * @example {"name": "not-ok.md", "setting": "tab-size", "label": "input"} + * + * *·List + * ··item. + * + * @example {"name": "not-ok.md", "setting": "tab-size", "label": "output"} + * + * 1:3: Incorrect list-item indent: add 2 spaces + * + * @example {"name": "not-ok.md", "setting": "mixed", "label": "input"} + * + * *···List item. + * + * @example {"name": "not-ok.md", "setting": "mixed", "label": "output"} + * + * 1:5: Incorrect list-item indent: remove 2 spaces + * + * @example {"name": "not-ok.md", "setting": "💩", "label": "output", "config": {"positionless": true}} + * + * 1:1: Incorrect list-item indent style `💩`: use either `'tab-size'`, `'space'`, or `'mixed'` + */ + + + + + + + var remarkLintListItemIndent = unifiedLintRule('remark-lint:list-item-indent', listItemIndent); var start$2 = unistUtilPosition.start; @@ -44304,6 +41768,76 @@ function listItemIndent(tree, file, option) { } } +var mdastUtilToString$1 = toString$4; + +// 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. +function toString$4(node) { + return ( + (node && + (node.value || + node.alt || + node.title || + ('children' in node && all$1(node.children)) || + ('length' in node && all$1(node)))) || + '' + ) +} + +function all$1(values) { + var result = []; + var length = values.length; + var index = -1; + + while (++index < length) { + result[index] = toString$4(values[index]); + } + + return result.join('') +} + +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-auto-link-without-protocol + * @fileoverview + * Warn for autolinks without protocol. + * Autolinks are URLs enclosed in `<` (less than) and `>` (greater than) + * characters. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * adds a protocol where 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"} + * + * + * + * + * Most Markdown vendors don’t recognize the following as a link: + * + * + * @example {"name": "not-ok.md", "label": "input"} + * + * + * + * @example {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:14: All automatic links must start with a protocol + */ + + + + + + + var remarkLintNoAutoLinkWithoutProtocol = unifiedLintRule( 'remark-lint:no-auto-link-without-protocol', noAutoLinkWithoutProtocol @@ -44330,7 +41864,7 @@ function noAutoLinkWithoutProtocol(tree, file) { if ( start$3(node).column === start$3(children[0]).column - 1 && end$1(node).column === end$1(children[children.length - 1]).column + 1 && - !protocol.test(mdastUtilToString(node)) + !protocol.test(mdastUtilToString$1(node)) ) { file.message(reason, node); } @@ -44338,6 +41872,63 @@ function noAutoLinkWithoutProtocol(tree, file) { } } +/** + * @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. + * + * ## Fix + * + * [`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 + */ + + + + + + + var remarkLintNoBlockquoteWithoutMarker = unifiedLintRule( 'remark-lint:no-blockquote-without-marker', noBlockquoteWithoutMarker @@ -44381,6 +41972,74 @@ function noBlockquoteWithoutMarker(tree, file) { } } +var mdastUtilToString$2 = toString$5; + +// 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. +function toString$5(node) { + return ( + (node && + (node.value || + node.alt || + node.title || + ('children' in node && all$2(node.children)) || + ('length' in node && all$2(node)))) || + '' + ) +} + +function all$2(values) { + var result = []; + var length = values.length; + var index = -1; + + while (++index < length) { + result[index] = toString$5(values[index]); + } + + return result.join('') +} + +/** + * @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). + * + * ## 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"} + * + * + * + * @example {"name": "not-ok.md", "label": "input"} + * + * http://foo.bar/baz + * + * @example {"name": "not-ok.md", "label": "output"} + * + * 1:1-1:19: Don’t use literal URLs without angle brackets + */ + + + + + + + var remarkLintNoLiteralUrls = unifiedLintRule('remark-lint:no-literal-urls', noLiteralURLs); var start$4 = unistUtilPosition.start; @@ -44393,7 +42052,7 @@ function noLiteralURLs(tree, file) { function visitor(node) { var children = node.children; - var value = mdastUtilToString(node); + var value = mdastUtilToString$2(node); if ( !unistUtilGenerated(node) && @@ -44406,6 +42065,66 @@ function noLiteralURLs(tree, file) { } } +/** + * @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. + * + * Options: `'consistent'`, `'.'`, or `')'`, default: `'consistent'`. + * + * `'consistent'` detects the first used list style and warns when subsequent + * lists use different styles. + * + * Note: `)` is only supported in CommonMark. + * + * @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": ")", "config": {"commonmark": true}} + * + * + * + * 1) Foo + * + * 2) Bar + * + * @example {"name": "not-ok.md", "label": "input", "config": {"commonmark": true}} + * + * 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": "💩", "config": {"positionless": true}} + * + * 1:1: Incorrect ordered list item marker style `💩`: use either `'.'` or `')'` + */ + + + + + + var remarkLintOrderedListMarkerStyle = unifiedLintRule( 'remark-lint:ordered-list-marker-style', orderedListMarkerStyle @@ -44462,6 +42181,34 @@ function orderedListMarkerStyle(tree, file, option) { } } +/** + * @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. + * + * @example {"name": "ok.md"} + * + * 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 + */ + + + + + + var remarkLintHardBreakSpaces = unifiedLintRule('remark-lint:hard-break-spaces', hardBreakSpaces); var reason$3 = 'Use two spaces for hard line breaks'; @@ -44487,6 +42234,35 @@ function hardBreakSpaces(tree, file) { } } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module no-duplicate-definitions + * @fileoverview + * Warn when duplicate definitions are found. + * + * @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) + */ + + + + + + + var remarkLintNoDuplicateDefinitions = unifiedLintRule( 'remark-lint:no-duplicate-definitions', noDuplicateDefinitions @@ -44562,6 +42338,61 @@ function consolidate(depth, relative) { : 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 + * + * @example {"name": "not-ok.md", "label": "output"} + * + * 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": "empty-heading.md"} + * + * #·· + */ + + + + + + + + var remarkLintNoHeadingContentIndent = unifiedLintRule( 'remark-lint:no-heading-content-indent', noHeadingContentIndent @@ -44635,6 +42466,64 @@ function noHeadingContentIndent(tree, file) { } } +var mdastUtilToString$3 = toString$6; + +// 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. +function toString$6(node) { + return ( + (node && + (node.value || + node.alt || + node.title || + ('children' in node && all$3(node.children)) || + ('length' in node && all$3(node)))) || + '' + ) +} + +function all$3(values) { + var result = []; + var length = values.length; + var index = -1; + + while (++index < length) { + result[index] = toString$6(values[index]); + } + + return result.join('') +} + +/** + * @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 + */ + + + + + + var remarkLintNoInlinePadding = unifiedLintRule('remark-lint:no-inline-padding', noInlinePadding); function noInlinePadding(tree, file) { @@ -44646,7 +42535,7 @@ function noInlinePadding(tree, file) { var contents; if (!unistUtilGenerated(node)) { - contents = mdastUtilToString(node); + contents = mdastUtilToString$3(node); if ( contents.charAt(0) === ' ' || @@ -44658,6 +42547,41 @@ function noInlinePadding(tree, file) { } } +/** + * @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 + */ + + + + + var remarkLintNoShortcutReferenceImage = unifiedLintRule( 'remark-lint:no-shortcut-reference-image', noShortcutReferenceImage @@ -44675,6 +42599,41 @@ function noShortcutReferenceImage(tree, file) { } } +/** + * @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 + */ + + + + + var remarkLintNoShortcutReferenceLink = unifiedLintRule( 'remark-lint:no-shortcut-reference-link', noShortcutReferenceLink @@ -44699,6 +42658,77 @@ function collapse(value) { return String(value).replace(/\s+/g, ' ') } +/** + * @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 + */ + + + + + + + + var remarkLintNoUndefinedReferences = unifiedLintRule( 'remark-lint:no-undefined-references', noUndefinedReferences @@ -44883,6 +42913,33 @@ function noUndefinedReferences(tree, file, option) { } } +/** + * @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 + */ + + + + + var remarkLintNoUnusedDefinitions = unifiedLintRule('remark-lint:no-unused-definitions', noUnusedDefinitions); var reason$8 = 'Found unused definition'; @@ -44918,8 +42975,14 @@ function noUnusedDefinitions(tree, file) { } } +/** + * @fileoverview + * remark preset to configure `remark-lint` with settings that prevent + * mistakes or syntaxes that do not work correctly across vendors. + */ + var plugins$1 = [ - remarkLint$1, + remarkLint, // Unix compatibility. remarkLintFinalNewline, // Rendering across vendors differs greatly if using other styles. @@ -44945,6 +43008,89 @@ var remarkPresetLintRecommended = { plugins: plugins$1 }; +var mdastUtilToString$4 = toString$7; + +// 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. +function toString$7(node) { + return ( + (node && + (node.value || + node.alt || + node.title || + ('children' in node && all$4(node.children)) || + ('length' in node && all$4(node)))) || + '' + ) +} + +function all$4(values) { + var result = []; + var length = values.length; + var index = -1; + + while (++index < length) { + result[index] = toString$7(values[index]); + } + + return result.join('') +} + +/** + * @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:3: Remove 1 space between block quote and content + * 9:3: Add 1 space between block quote and content + */ + + + + + + + + var remarkLintBlockquoteIndentation = unifiedLintRule( 'remark-lint:blockquote-indentation', blockquoteIndentation @@ -44988,7 +43134,7 @@ function blockquoteIndentation(tree, file, option) { function check$3(node) { var head = node.children[0]; var indentation = unistUtilPosition.start(head).column - unistUtilPosition.start(node).column; - var padding = mdastUtilToString(head).match(/^ +/); + var padding = mdastUtilToString$4(head).match(/^ +/); if (padding) { indentation += padding[0].length; @@ -44997,6 +43143,82 @@ function check$3(node) { return indentation } +/** + * @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'` + */ + + + + + + var remarkLintCheckboxCharacterStyle = unifiedLintRule( 'remark-lint:checkbox-character-style', checkboxCharacterStyle @@ -45081,6 +43303,41 @@ function checkboxCharacterStyle(tree, file, option) { } } +/** + * @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 + */ + + + + + + + var remarkLintCheckboxContentIndent = unifiedLintRule( 'remark-lint:checkbox-content-indent', checkboxContentIndent @@ -45137,6 +43394,105 @@ function checkboxContentIndent(tree, file) { } } +/** + * @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:13: Code blocks should be fenced + * 5:1-5:13: 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", "config": {"positionless": true}} + * + * 1:1: Incorrect code block style `💩`: use either `'consistent'`, `'fenced'`, or `'indented'` + */ + + + + + + var remarkLintCodeBlockStyle = unifiedLintRule('remark-lint:code-block-style', codeBlockStyle); var start$9 = unistUtilPosition.start; @@ -45186,6 +43542,32 @@ function codeBlockStyle(tree, file, option) { } } +/** + * @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 + */ + + + + + + var remarkLintDefinitionSpacing = unifiedLintRule('remark-lint:definition-spacing', definitionSpacing); var label = /^\s*\[((?:\\[\s\S]|[^[\]])+)]/; @@ -45209,6 +43591,77 @@ function definitionSpacing(tree, file) { } } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module fenced-code-flag + * @fileoverview + * Check fenced code block flags. + * + * Options: `Array.` 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": "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 + */ + + + + + + var remarkLintFencedCodeFlag = unifiedLintRule('remark-lint:fenced-code-flag', fencedCodeFlag); var start$a = unistUtilPosition.start; @@ -45254,6 +43707,94 @@ function fencedCodeFlag(tree, file, option) { } } +/** + * @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", "config": {"positionless": true}} + * + * 1:1: Incorrect fenced code marker `💩`: use either `'consistent'`, `` '`' ``, or `'~'` + */ + + + + + + var remarkLintFencedCodeMarker = unifiedLintRule('remark-lint:fenced-code-marker', fencedCodeMarker); var markers = { @@ -45307,6 +43848,32 @@ function fencedCodeMarker(tree, file, option) { } } +/** + * @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", "config": {"positionless": true}} + * + * 1:1: Incorrect extension: use `md` + * + * @example {"name": "readme.mkd", "setting": "mkd"} + */ + + + var remarkLintFileExtension = unifiedLintRule('remark-lint:file-extension', fileExtension); function fileExtension(tree, file, option) { @@ -45318,6 +43885,49 @@ function fileExtension(tree, file, option) { } } +/** + * @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/ + * + * + * + * [example-2]: http://example.com/two/ + */ + + + + + + var remarkLintFinalDefinition = unifiedLintRule('remark-lint:final-definition', finalDefinition); var start$b = unistUtilPosition.start; @@ -45350,6 +43960,89 @@ function finalDefinition(tree, file) { } } +/** + * @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"} + * + *

An HTML heading is also seen by this rule.

+ * + * @example {"name": "ok-delayed.md"} + * + * You can use markdown content before the heading. + * + *
Or non-heading HTML
+ * + *

So the first heading, be it HTML or markdown, is checked

+ * + * @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"} + * + *

Charlie

+ * + * 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} + * + *

Echo

+ * + * 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"} + * + *

Golf

+ * + * Paragraph. + * + * @example {"name": "not-ok-html.md", "setting": 2, "label": "output"} + * + * 1:1-1:14: First heading level should be `2` + */ + + + + + var remarkLintFirstHeadingLevel = unifiedLintRule('remark-lint:first-heading-level', firstHeadingLevel); var re$1 = / + * + * + * + * `alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscarPapaQuebec.romeo()` + * + * [foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) + * + * + * + * ![foo](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 | | | | | | | | | | . | + * + *

alpha bravo charlie delta echo foxtrot golf

+ * + * The following is also fine, because there is no whitespace. + * + * . + * + * In addition, definitions are also fine: + * + * [foo]: + * + * @example {"name": "not-ok.md", "setting": 80, "label": "input", "config": {"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: + * + * 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", "config": {"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, "config": {"positionless": true}} + * + * 0123456789␍␊ + * 0123456789␊ + * 01234␍␊ + * 01234␊ + * + * @example {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "input", "config": {"positionless": true}} + * + * 012345678901␍␊ + * 012345678901␊ + * 01234567890␍␊ + * 01234567890␊ + * + * @example {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "output", "config": {"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 remarkLintMaximumLineLength = unifiedLintRule('remark-lint:maximum-line-length', maximumLineLength); var start$c = unistUtilPosition.start; @@ -45492,6 +44355,54 @@ function maximumLineLength(tree, file, option) { } } +/** + * @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 + */ + + + + + + + var remarkLintNoConsecutiveBlankLines = unifiedLintRule( 'remark-lint:no-consecutive-blank-lines', noConsecutiveBlankLines @@ -45555,6 +44466,35 @@ function noConsecutiveBlankLines(tree, file) { } } +/** + * @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", "config": {"positionless": true}} + * + * 1:1: Do not start file names with `a` + * + * @example {"name": "the-title.md", "label": "output", "config": {"positionless": true}} + * + * 1:1: Do not start file names with `the` + * + * @example {"name": "teh-title.md", "label": "output", "config": {"positionless": true}} + * + * 1:1: Do not start file names with `teh` + * + * @example {"name": "an-article.md", "label": "output", "config": {"positionless": true}} + * + * 1:1: Do not start file names with `an` + */ + + + var remarkLintNoFileNameArticles = unifiedLintRule('remark-lint:no-file-name-articles', noFileNameArticles); function noFileNameArticles(tree, file) { @@ -45565,6 +44505,23 @@ function noFileNameArticles(tree, file) { } } +/** + * @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", "config": {"positionless": true}} + * + * 1:1: Do not use consecutive dashes in a file name + */ + + + var remarkLintNoFileNameConsecutiveDashes = unifiedLintRule( 'remark-lint:no-file-name-consecutive-dashes', noFileNameConsecutiveDashes @@ -45578,6 +44535,27 @@ function noFileNameConsecutiveDashes(tree, file) { } } +/** + * @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", "config": {"positionless": true}} + * + * 1:1: Do not use initial or final dashes in a file name + * + * @example {"name": "readme-.md", "label": "output", "config": {"positionless": true}} + * + * 1:1: Do not use initial or final dashes in a file name + */ + + + var remarkLintNoFileNameOuterDashes = unifiedLintRule( 'remark-lint:no-file-name-outer-dashes', noFileNameOuterDashes @@ -45591,6 +44569,60 @@ function noFileNameOuterDashes(tree, file) { } } +/** + * @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 + */ + + + + + + + var remarkLintNoHeadingIndent = unifiedLintRule('remark-lint:no-heading-indent', noHeadingIndent); var start$d = unistUtilPosition.start; @@ -45618,6 +44650,35 @@ function noHeadingIndent(tree, file) { } } +/** + * @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) + */ + + + var start$e = unistUtilPosition.start; @@ -45647,6 +44708,65 @@ function noMultipleToplevelHeadings(tree, file, option) { } } +/** + * @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 + */ + + + + + var remarkLintNoShellDollars = unifiedLintRule('remark-lint:no-shell-dollars', noShellDollars); var reason$d = 'Do not use dollar signs before shell commands'; @@ -45703,6 +44823,70 @@ function noShellDollars(tree, file) { } } +/** + * @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 + */ + + + + + + var remarkLintNoTableIndentation = unifiedLintRule('remark-lint:no-table-indentation', noTableIndentation); var reason$e = 'Do not indent table rows'; @@ -45770,6 +44954,61 @@ function noTableIndentation(tree, file) { } } +/** + * @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", "config": {"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 + */ + + + + var remarkLintNoTabs = unifiedLintRule('remark-lint:no-tabs', noTabs); var reason$f = 'Use spaces instead of tabs'; @@ -46020,12 +45259,18 @@ createToken('STAR', '(<|>)?=?\\s*\\*'); createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$'); createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$'); }); -var re_2 = re_1.re; -var re_3 = re_1.src; -var re_4 = re_1.t; -var re_5 = re_1.tildeTrimReplace; -var re_6 = re_1.caretTrimReplace; -var re_7 = re_1.comparatorTrimReplace; + +// 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 = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true; + return options + }, {}); +var parseOptions_1 = parseOptions; const numeric$1 = /^[0-9]+$/; const compareIdentifiers = (a, b) => { @@ -46054,15 +45299,12 @@ var identifiers = { const { MAX_LENGTH: MAX_LENGTH$3, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1 } = constants$3; const { re: re$2, t } = re_1; + const { compareIdentifiers: compareIdentifiers$1 } = identifiers; class SemVer { constructor (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } + options = parseOptions_1(options); + if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { @@ -46345,13 +45587,9 @@ const {MAX_LENGTH: MAX_LENGTH$4} = constants$3; const { re: re$3, t: t$1 } = re_1; -const parse$a = (version, options) => { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - }; - } + +const parse$9 = (version, options) => { + options = parseOptions_1(options); if (version instanceof semver) { return version @@ -46377,7 +45615,7 @@ const parse$a = (version, options) => { } }; -var parse_1$3 = parse$a; +var parse_1$4 = parse$9; const compare$2 = (a, b, loose) => new semver(a, loose).compare(new semver(b, loose)); @@ -46396,7 +45634,7 @@ const allowedKeys = [ ]; const changesExpectedKeys = ["version", "pr-url", "description"]; const VERSION_PLACEHOLDER = "REPLACEME"; -const MAX_SAFE_SEMVER_VERSION = parse_1$3( +const MAX_SAFE_SEMVER_VERSION = parse_1$4( Array.from({ length: 3 }, () => Number.MAX_SAFE_INTEGER).join(".") ); const validVersionNumberRegex = /^v\d+\.\d+\.\d+$/; @@ -46696,6 +45934,63 @@ function prohibitedStrings (ast, file, strings) { } } +/** + * @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": "💩", "config": {"positionless": true}} + * + * 1:1: Incorrect preferred rule style: provide a correct markdown rule or `'consistent'` + */ + var rule = unifiedLintRule; @@ -46738,6 +46033,64 @@ function ruleStyle(tree, file, option) { } } +/** + * @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": "💩", "config": {"positionless": true}} + * + * 1:1: Incorrect strong marker `💩`: use either `'consistent'`, `'*'`, or `'_'` + */ + + + + + + var remarkLintStrongMarker = unifiedLintRule('remark-lint:strong-marker', strongMarker); var markers$1 = {'*': true, _: true, null: true}; @@ -46775,6 +46128,167 @@ function strongMarker(tree, file, option) { } } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module table-cell-padding + * @fileoverview + * Warn when table cells are incorrectly padded. + * + * Options: `'consistent'`, `'padded'`, or `'compact'`, default: `'consistent'`. + * + * `'consistent'` detects the first used cell padding style and warns when + * subsequent cells use different styles. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * formats tables with padding by default. + * Pass + * [`spacedTable: false`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsspacedtable) + * to not use padding. + * + * 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": "padded", "gfm": true} + * + * | A | B | + * | ----- | ----- | + * | Alpha | Bravo | + * + * @example {"name": "not-ok.md", "label": "input", "setting": "padded", "gfm": true} + * + * | A | B | + * | :----|----: | + * | Alpha|Bravo | + * + * | C | D | + * | :----- | ---: | + * |Charlie | Delta| + * + * Too much padding isn’t good either: + * + * | E | F | G | H | + * | :---- | -------- | :----: | -----: | + * | Echo | Foxtrot | Golf | Hotel | + * + * @example {"name": "not-ok.md", "label": "output", "setting": "padded", "gfm": true} + * + * 3:8: Cell should be padded + * 3:9: Cell should be padded + * 7:2: Cell should be padded + * 7:17: Cell should be padded + * 13:9: Cell should be padded with 1 space, not 2 + * 13:20: Cell should be padded with 1 space, not 2 + * 13:21: Cell should be padded with 1 space, not 2 + * 13:29: Cell should be padded with 1 space, not 2 + * 13:30: Cell should be padded with 1 space, not 2 + * + * @example {"name": "ok.md", "setting": "compact", "gfm": true} + * + * |A |B | + * |-----|-----| + * |Alpha|Bravo| + * + * @example {"name": "not-ok.md", "label": "input", "setting": "compact", "gfm": true} + * + * | A | B | + * | -----| -----| + * | Alpha| Bravo| + * + * |C | D| + * |:------|-----:| + * |Charlie|Delta | + * + * @example {"name": "not-ok.md", "label": "output", "setting": "compact", "gfm": true} + * + * 3:2: Cell should be compact + * 3:11: Cell should be compact + * 7:16: Cell should be compact + * + * @example {"name": "ok-padded.md", "setting": "consistent", "gfm": true} + * + * | A | B | + * | ----- | ----- | + * | Alpha | Bravo | + * + * | C | D | + * | ------- | ----- | + * | Charlie | Delta | + * + * @example {"name": "not-ok-padded.md", "label": "input", "setting": "consistent", "gfm": true} + * + * | A | B | + * | ----- | ----- | + * | 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} + * + * + * + * | | 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} + * + * + * + * | Alpha | Bravo | Charlie | + * | ----- | ------- | ------- | + * | Delta | + * | Echo | Foxtrot | + */ + + + + + + var remarkLintTableCellPadding = unifiedLintRule('remark-lint:table-cell-padding', tableCellPadding); var start$h = unistUtilPosition.start; @@ -46876,7 +46390,7 @@ function tableCellPadding(tree, file, option) { if (style === 0) { // Ignore every cell except the biggest in the column. - if (size(cell) < sizes[column]) { + if (size$1(cell) < sizes[column]) { return } @@ -46886,7 +46400,7 @@ function tableCellPadding(tree, file, option) { if (spacing > style) { // May be right or center aligned. - if (size(cell) < sizes[column]) { + if (size$1(cell) < sizes[column]) { return } @@ -46910,13 +46424,57 @@ function tableCellPadding(tree, file, option) { } } -function size(node) { +function size$1(node) { return ( end$a(node.children[node.children.length - 1]).offset - start$h(node.children[0]).offset ) } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module table-pipes + * @fileoverview + * Warn when table rows are not fenced with pipes. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * creates fenced rows with initial and final pipes by default. + * Pass + * [`looseTable: true`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsloosetable) + * to not use row fences. + * + * 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} + * + * | A | B | + * | ----- | ----- | + * | Alpha | Bravo | + * + * @example {"name": "not-ok.md", "label": "input", "gfm": true} + * + * A | B + * ----- | ----- + * Alpha | Bravo + * + * @example {"name": "not-ok.md", "label": "output", "gfm": true} + * + * 1:1: Missing initial pipe in table fence + * 1:10: Missing final pipe in table fence + * 3:1: Missing initial pipe in table fence + * 3:14: Missing final pipe in table fence + */ + + + + + + var remarkLintTablePipes = unifiedLintRule('remark-lint:table-pipes', tablePipes); var start$i = unistUtilPosition.start; @@ -46952,6 +46510,79 @@ function tablePipes(tree, file) { } } +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module unordered-list-marker-style + * @fileoverview + * Warn when the list item marker style of unordered lists violate a given + * style. + * + * Options: `'consistent'`, `'-'`, `'*'`, or `'+'`, default: `'consistent'`. + * + * `'consistent'` detects the first used list style and warns when subsequent + * lists use different styles. + * + * ## Fix + * + * [`remark-stringify`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify) + * formats unordered lists using `-` (hyphen-minus) by default. + * Pass + * [`bullet: '*'` or `bullet: '+'`](https://github.com/remarkjs/remark/tree/HEAD/packages/remark-stringify#optionsbullet) + * to use `*` (asterisk) or `+` (plus sign) 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"} + * + * By default (`'consistent'`), if the file uses only one marker, + * that’s OK. + * + * * Foo + * * Bar + * * Baz + * + * Ordered lists are not affected. + * + * 1. Foo + * 2. Bar + * 3. Baz + * + * @example {"name": "ok.md", "setting": "*"} + * + * * Foo + * + * @example {"name": "ok.md", "setting": "-"} + * + * - Foo + * + * @example {"name": "ok.md", "setting": "+"} + * + * + Foo + * + * @example {"name": "not-ok.md", "label": "input"} + * + * * Foo + * - Bar + * + Baz + * + * @example {"name": "not-ok.md", "label": "output"} + * + * 2:1-2:6: Marker style should be `*` + * 3:1-3:6: Marker style should be `*` + * + * @example {"name": "not-ok.md", "label": "output", "setting": "💩", "config": {"positionless": true}} + * + * 1:1: Incorrect unordered list item marker style `💩`: use either `'-'`, `'*'`, or `'+'` + */ + + + + + + var remarkLintUnorderedListMarkerStyle = unifiedLintRule( 'remark-lint:unordered-list-marker-style', unorderedListMarkerStyle @@ -47092,9 +46723,12 @@ var remarkPresetLintNode = { plugins: plugins$2 }; +var www = {tokenize: tokenizeWww}; +var http = {tokenize: tokenizeHttp}; var domain = {tokenize: tokenizeDomain}; var path$1 = {tokenize: tokenizePath}; var punctuation = {tokenize: tokenizePunctuation}; +var domainPunctuation = {tokenize: tokenizeDomainPunctuation}; var paren = {tokenize: tokenizeParen}; var namedCharacterReference = {tokenize: tokenizeNamedCharacterReference}; @@ -47105,7 +46739,7 @@ var emailAutolink = {tokenize: tokenizeEmailAutolink, previous: previous$1}; var text$4 = {}; // Export hooked constructs. -var text_1$2 = text$4; +var text_1$3 = text$4; // `0` var code$2 = 48; @@ -47182,7 +46816,7 @@ function tokenizeEmailAutolink(effects, ok, nok) { return effects.check(punctuation, nok, dashOrUnderscoreContinuation)(code) } - if (asciiAlphanumeric(code)) { + if (asciiAlphanumeric_1(code)) { effects.consume(code); return label } @@ -47234,38 +46868,11 @@ function tokenizeWwwAutolink(effects, ok, nok) { effects.enter('literalAutolink'); effects.enter('literalAutolinkWww'); - effects.consume(code); - return w2 - } - - function w2(code) { - // `w` - if (code === 87 || code - 32 === 87) { - effects.consume(code); - return w3 - } - - return nok(code) - } - - function w3(code) { - // `w` - if (code === 87 || code - 32 === 87) { - effects.consume(code); - return dot - } - - return nok(code) - } - - function dot(code) { - // `.` - if (code === 46) { - effects.consume(code); - return effects.attempt(domain, effects.attempt(path$1, done), nok) - } - - return nok(code) + return effects.check( + www, + effects.attempt(domain, effects.attempt(path$1, done), nok), + nok + )(code) } function done(code) { @@ -47288,6 +46895,25 @@ function tokenizeHttpAutolink(effects, ok, nok) { effects.enter('literalAutolink'); effects.enter('literalAutolinkHttp'); + return effects.check( + http, + effects.attempt(domain, effects.attempt(path$1, done), nok), + nok + )(code) + } + + function done(code) { + effects.exit('literalAutolinkHttp'); + effects.exit('literalAutolink'); + return ok(code) + } +} + +function tokenizeHttp(effects, ok, nok) { + return start + + function start(code) { + // Assume a `h`. effects.consume(code); return t1 } @@ -47356,66 +46982,136 @@ function tokenizeHttpAutolink(effects, ok, nok) { // `/` if (code === 47) { effects.consume(code); - return effects.attempt(domain, effects.attempt(path$1, done), nok) + return after } return nok(code) } - function done(code) { - effects.exit('literalAutolinkHttp'); - effects.exit('literalAutolink'); - return ok(code) + function after(code) { + return asciiControl_1(code) || + unicodeWhitespace_1(code) || + unicodePunctuation_1(code) + ? nok(code) + : ok(code) } } -function tokenizeDomain(effects, ok, nok) { - var hasUnderscoreInLastSegment; - var hasUnderscoreInLastLastSegment; - var hasDot; - +function tokenizeWww(effects, ok, nok) { return start function start(code) { - effects.enter('literalAutolinkDomain'); - return domain(code) + // Assume a `w`. + effects.consume(code); + return w2 + } + + function w2(code) { + // `w` + if (code === 87 || code - 32 === 87) { + effects.consume(code); + return w3 + } + + return nok(code) + } + + function w3(code) { + // `w` + if (code === 87 || code - 32 === 87) { + effects.consume(code); + return dot + } + + return nok(code) + } + + function dot(code) { + // `.` + if (code === 46) { + effects.consume(code); + return after + } + + return nok(code) } + function after(code) { + return code === null || markdownLineEnding_1(code) ? nok(code) : ok(code) + } +} + +function tokenizeDomain(effects, ok, nok) { + var opened; + var hasUnderscoreInLastSegment; + var hasUnderscoreInLastLastSegment; + + return domain + function domain(code) { if ( - // `-` - code === 45 || - // `_` - code === 95 || - asciiAlphanumeric(code) + // `/` + code === 47 || + asciiControl_1(code) || + unicodeWhitespace_1(code) ) { - if (code === 95) { - hasUnderscoreInLastSegment = true; - } + return done(code) + } - effects.consume(code); - return domain + // `&` + if (code === 38) { + return effects.check( + namedCharacterReference, + done, + punctuationContinuation + )(code) + } + + if ( + // `.` + code === 46 || + trailingPunctuation(code) + ) { + return effects.check( + domainPunctuation, + done, + punctuationContinuation + )(code) } + open(); + effects.consume(code); + return domain + } + + function punctuationContinuation(code) { // `.` if (code === 46) { - return effects.check(punctuation, done, dotContinuation)(code) + hasUnderscoreInLastLastSegment = hasUnderscoreInLastSegment; + hasUnderscoreInLastSegment = undefined; + open(); + effects.consume(code); + return domain } - return done(code) - } + // `_` + if (code === 95) hasUnderscoreInLastSegment = true; - function dotContinuation(code) { + open(); effects.consume(code); - hasDot = true; - hasUnderscoreInLastLastSegment = hasUnderscoreInLastSegment; - hasUnderscoreInLastSegment = undefined; return domain } + function open() { + if (!opened) { + effects.enter('literalAutolinkDomain'); + opened = true; + } + } + function done(code) { if ( - hasDot && + opened && !hasUnderscoreInLastLastSegment && !hasUnderscoreInLastSegment ) { @@ -47433,19 +47129,12 @@ function tokenizePath(effects, ok) { return start function start(code) { - if (pathEnd(code)) { - return ok(code) - } - - if (trailingPunctuation(code)) { - return effects.check(punctuation, ok, atPathStart)(code) - } - - return atPathStart(code) + // `/` + return code === 47 ? atPathStart(code) : ok(code) } function atPathStart(code) { - effects.enter('literalAutolinkWwwPath'); + effects.enter('literalAutolinkPath'); return inPath(code) } @@ -47492,7 +47181,7 @@ function tokenizePath(effects, ok) { } function atPathEnd(code) { - effects.exit('literalAutolinkWwwPath'); + effects.exit('literalAutolinkPath'); return ok(code) } } @@ -47508,7 +47197,7 @@ function tokenizeNamedCharacterReference(effects, ok, nok) { } function inside(code) { - if (asciiAlpha(code)) { + if (asciiAlpha_1(code)) { effects.consume(code); return inside } @@ -47570,23 +47259,57 @@ function tokenizePunctuation(effects, ok, nok) { } } +function tokenizeDomainPunctuation(effects, ok, nok) { + return start + + function start(code) { + effects.enter('literalAutolinkPunctuation'); + // Always a valid trailing punctuation marker. + effects.consume(code); + return after + } + + function after(code) { + // Check the next. + if (trailingPunctuation(code)) { + effects.consume(code); + return after + } + + // If the punctuation marker is followed by the end of the path, it’s not + // continued punctuation. + effects.exit('literalAutolinkPunctuation'); + return pathEnd(code) ? ok(code) : nok(code) + } +} + function trailingPunctuation(code) { return ( - // Exclamation mark. + // `!` code === 33 || - // Asterisk. + // `"` + code === 34 || + // `'` + code === 39 || + // `)` + code === 41 || + // `*` code === 42 || - // Comma. + // `,` code === 44 || - // Dot. + // `.` code === 46 || - // Colon. + // `:` code === 58 || - // Question mark. + // `;` + code === 59 || + // `<` + code === 60 || + // `?` code === 63 || - // Underscore. + // `_`. code === 95 || - // Tilde. + // `~` code === 126 ) } @@ -47599,7 +47322,7 @@ function pathEnd(code) { code < 0 || // Space. code === 32 || - // Less than. + // `<` code === 60 ) } @@ -47614,7 +47337,7 @@ function gfmAtext(code) { code === 46 || // `_` code === 95 || - asciiAlphanumeric(code) + asciiAlphanumeric_1(code) ) } @@ -47626,19 +47349,19 @@ function previous$1(code) { code < 0 || // Space. code === 32 || - // Left paren. + // `(` code === 40 || - // Asterisk. + // `*` code === 42 || - // Underscore. + // `_`. code === 95 || - // Tilde. + // `~` code === 126 ) } var syntax = { - text: text_1$2 + text: text_1$3 }; var micromarkExtensionGfmAutolinkLiteral = syntax; @@ -48440,19 +48163,24 @@ function tokenizeTasklistCheck(effects, ok, nok) { effects.consume(code); effects.exit('taskListCheckMarker'); effects.exit('taskListCheck'); - return after + return effects.check({tokenize: spaceThenNonSpace}, ok, nok) } return nok(code) } +} - function after(code) { - // Tab or space. - if (code === -2 || code === 32) { - return ok(code) - } +function spaceThenNonSpace(effects, ok, nok) { + var self = this; - return nok(code) + return factorySpace(effects, after, 'whitespace') + + function after(code) { + return prefixSize_1(self.events, 'whitespace') && + code !== null && + !markdownLineEndingOrSpace_1(code) + ? ok(code) + : nok(code) } } @@ -48476,7 +48204,7 @@ var enter = { literalAutolinkHttp: enterLiteralAutolinkValue, literalAutolinkWww: enterLiteralAutolinkValue }; -var exit = { +var exit$1 = { literalAutolink: exitLiteralAutolink, literalAutolinkEmail: exitLiteralAutolinkEmail, literalAutolinkHttp: exitLiteralAutolinkHttp, @@ -48510,12 +48238,12 @@ function exitLiteralAutolink(token) { var fromMarkdown$1 = { enter: enter, - exit: exit + exit: exit$1 }; var canContainEols = ['delete']; var enter$1 = {strikethrough: enterStrikethrough}; -var exit$1 = {strikethrough: exitStrikethrough}; +var exit$2 = {strikethrough: exitStrikethrough}; function enterStrikethrough(token) { this.enter({type: 'delete', children: []}, token); @@ -48528,7 +48256,7 @@ function exitStrikethrough(token) { var fromMarkdown$2 = { canContainEols: canContainEols, enter: enter$1, - exit: exit$1 + exit: exit$2 }; var enter$2 = { @@ -48540,9 +48268,9 @@ var enter$2 = { var exit_1 = { codeText: exitCodeText, table: exitTable, - tableData: exit$2, - tableHeader: exit$2, - tableRow: exit$2 + tableData: exit$3, + tableHeader: exit$3, + tableRow: exit$3 }; function enterTable(token) { @@ -48559,7 +48287,7 @@ function enterRow(token) { this.enter({type: 'tableRow', children: []}, token); } -function exit$2(token) { +function exit$3(token) { this.exit(token); } @@ -48590,7 +48318,7 @@ var fromMarkdown$3 = { exit: exit_1 }; -var exit$3 = { +var exit$4 = { taskListCheckValueChecked: exitCheck, taskListCheckValueUnchecked: exitCheck, paragraph: exitParagraphWithTaskListItem @@ -48603,24 +48331,38 @@ function exitCheck(token) { } function exitParagraphWithTaskListItem(token) { - var node = this.stack[this.stack.length - 1]; var parent = this.stack[this.stack.length - 2]; + var node = this.stack[this.stack.length - 1]; + var siblings = parent.children; var head = node.children[0]; + var index = -1; + var firstParaghraph; if ( + parent && parent.type === 'listItem' && typeof parent.checked === 'boolean' && head && head.type === 'text' ) { - // Must start with a space or a tab. - head.value = head.value.slice(1); - if (head.value.length === 0) { - node.children.shift(); - } else { - head.position.start.column++; - head.position.start.offset++; - node.position.start = Object.assign({}, head.position.start); + while (++index < siblings.length) { + if (siblings[index].type === 'paragraph') { + firstParaghraph = siblings[index]; + break + } + } + + if (firstParaghraph === node) { + // Must start with a space or a tab. + head.value = head.value.slice(1); + + if (head.value.length === 0) { + node.children.shift(); + } else { + head.position.start.column++; + head.position.start.offset++; + node.position.start = Object.assign({}, head.position.start); + } } } @@ -48628,10 +48370,10 @@ function exitParagraphWithTaskListItem(token) { } var fromMarkdown$4 = { - exit: exit$3 + exit: exit$4 }; -var own$5 = {}.hasOwnProperty; +var own$6 = {}.hasOwnProperty; var fromMarkdown$5 = configure$4([ fromMarkdown$1, @@ -48658,7 +48400,7 @@ function extension$3(config, extension) { var right; for (key in extension) { - left = own$5.call(config, key) ? config[key] : (config[key] = {}); + left = own$6.call(config, key) ? config[key] : (config[key] = {}); right = extension[key]; if (key === 'canContainEols') { @@ -48670,7 +48412,7 @@ function extension$3(config, extension) { } var inConstruct = 'phrasing'; -var notInConstruct = ['autolink', 'link', 'image']; +var notInConstruct = ['autolink', 'link', 'image', 'label']; var unsafe$1 = [ { @@ -49069,7 +48811,7 @@ function toMarkdown$3(options) { var value = inlineCode_1(node); if (context.stack.indexOf('tableCell') !== -1) { - value = value.replace(/\|/, '\\$&'); + value = value.replace(/\|/g, '\\$&'); } return value @@ -49105,26 +48847,18 @@ var toMarkdown$4 = { var toMarkdown_1$1 = toMarkdown$5; function toMarkdown$5(options) { - var extensions = [ - toMarkdown$1, - toMarkdown$2, - toMarkdown_1(options), - toMarkdown$4 - ]; - var length = extensions.length; - var index = -1; - var extension; - var unsafe = []; - var handlers = {}; - - while (++index < length) { - extension = extensions[index]; - // istanbul ignore next - unsafe always exists, for now. - unsafe = unsafe.concat(extension.unsafe || []); - handlers = Object.assign(handlers, extension.handlers || {}); - } + var config = configure_1$2( + {handlers: {}, join: [], unsafe: [], options: {}}, + { + extensions: [toMarkdown$1, toMarkdown$2, toMarkdown_1(options), toMarkdown$4] + } + ); - return {unsafe: unsafe, handlers: handlers} + return Object.assign(config.options, { + handlers: config.handlers, + join: config.join, + unsafe: config.unsafe + }) } var warningIssued; @@ -49161,10 +48895,6 @@ function gfm(options) { } } -var proc = getCjsExportFromNamespace(_package$1); - -var cli = getCjsExportFromNamespace(_package$3); - // To aid in future maintenance, this layout closely matches remark-cli/cli.js. // https://github.com/remarkjs/remark/blob/master/packages/remark-cli/cli.js @@ -49189,6 +48919,12 @@ unifiedArgs({ packageField: proc.name + 'Config', rcName: '.' + proc.name + 'rc', ignoreName: '.' + proc.name + 'ignore', - extensions: markdownExtensions$2, + extensions: markdownExtensions, detectConfig: false, }); + +var cliEntry = { + +}; + +module.exports = cliEntry; diff --git a/tools/node-lint-md-cli-rollup/package-lock.json b/tools/node-lint-md-cli-rollup/package-lock.json index ed6381ae379b9b..7abb785af84d2c 100644 --- a/tools/node-lint-md-cli-rollup/package-lock.json +++ b/tools/node-lint-md-cli-rollup/package-lock.json @@ -10,30 +10,30 @@ "markdown-extensions": "^1.1.1", "remark": "^13.0.0", "remark-gfm": "^1.0.0", - "remark-lint": "^7.0.0", + "remark-lint": "^8.0.0", "remark-preset-lint-node": "^2.0.0", - "unified-args": "^8.0.0" + "unified-args": "^8.1.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "^11.0.1", - "@rollup/plugin-json": "^4.0.1", - "@rollup/plugin-node-resolve": "^7.0.0", - "rollup": "^2.32.1", + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^11.0.1", + "rollup": "^2.36.1", "shx": "^0.3.3" } }, "node_modules/@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dependencies": { "@babel/highlight": "^7.10.4" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" }, "node_modules/@babel/highlight": { "version": "7.10.4", @@ -51,6 +51,9 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dependencies": { "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/chalk": { @@ -61,6 +64,9 @@ "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/@babel/highlight/node_modules/color-convert": { @@ -79,12 +85,18 @@ "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", @@ -92,21 +104,30 @@ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dependencies": { "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/@rollup/plugin-commonjs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz", - "integrity": "sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.0.0.tgz", + "integrity": "sha512-/omBIJG1nHQc+bgkYDuLpb/V08QyutP9amOrJRUSlYJZP+b/68gM//D8sxJe3Yry2QnYIr3QjR3x4AlxJEN3GA==", "dev": true, "dependencies": { - "@rollup/pluginutils": "^3.0.8", + "@rollup/pluginutils": "^3.1.0", "commondir": "^1.0.1", - "estree-walker": "^1.0.1", - "glob": "^7.1.2", - "is-reference": "^1.1.2", - "magic-string": "^0.25.2", - "resolve": "^1.11.0" + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^2.30.0" } }, "node_modules/@rollup/plugin-json": { @@ -116,19 +137,29 @@ "dev": true, "dependencies": { "@rollup/pluginutils": "^3.0.8" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" } }, "node_modules/@rollup/plugin-node-resolve": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz", - "integrity": "sha512-RxtSL3XmdTAE2byxekYLnx+98kEUOrPHF/KRVjLH+DEIHy6kjIw7YINQzn+NXiH/NTrQLAwYs0GWB+csWygA9Q==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz", + "integrity": "sha512-ltlsj/4Bhwwhb+Nb5xCz/6vieuEj2/BAkkqVIKmZwC7pIdl8srmgmglE4S0jFlZa32K4qvdQ6NHdmpRKD/LwoQ==", "dev": true, "dependencies": { - "@rollup/pluginutils": "^3.0.8", - "@types/resolve": "0.0.8", + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", "is-module": "^1.0.0", - "resolve": "^1.14.2" + "resolve": "^1.19.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, "node_modules/@rollup/pluginutils": { @@ -140,8 +171,20 @@ "@types/estree": "0.0.39", "estree-walker": "^1.0.1", "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + }, "node_modules/@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", @@ -157,15 +200,15 @@ } }, "node_modules/@types/node": { - "version": "14.11.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", - "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", + "version": "14.14.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz", + "integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==", "dev": true }, "node_modules/@types/resolve": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", - "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", "dev": true, "dependencies": { "@types/node": "*" @@ -179,7 +222,10 @@ "node_modules/ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "engines": { + "node": ">=8" + } }, "node_modules/ansi-styles": { "version": "4.3.0", @@ -187,6 +233,12 @@ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/anymatch": { @@ -196,6 +248,9 @@ "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" } }, "node_modules/argparse": { @@ -223,7 +278,10 @@ "node_modules/binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "engines": { + "node": ">=8" + } }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -240,6 +298,9 @@ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dependencies": { "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/buffer-from": { @@ -248,15 +309,24 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "node_modules/builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", - "dev": true + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } }, "node_modules/chalk": { "version": "3.0.0", @@ -265,6 +335,9 @@ "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/character-entities": { @@ -295,21 +368,37 @@ } }, "node_modules/chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.0.tgz", + "integrity": "sha512-JgQM9JS92ZbFR4P90EvmzNpSGhpPBGBSj10PILeDyYFwp4h2/D9OM03wsJ4zW1fEp4ka2DGrnUeD7FuvQ2aZ2Q==", "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.5.0" }, + "engines": { + "node": ">= 8.10.0" + }, "optionalDependencies": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" + } + }, + "node_modules/chokidar/node_modules/fsevents": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz", + "integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/co": { @@ -332,6 +421,9 @@ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { @@ -354,6 +446,9 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", @@ -362,11 +457,28 @@ } }, "node_modules/debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dependencies": { "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/emoji-regex": { @@ -396,12 +508,19 @@ "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, "node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, "node_modules/extend": { @@ -415,6 +534,10 @@ "integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==", "dependencies": { "format": "^0.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/figgy-pudding": { @@ -428,12 +551,21 @@ "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dependencies": { "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/figures/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } }, "node_modules/fill-range": { "version": "7.0.1", @@ -441,6 +573,9 @@ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dependencies": { "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/find-up": { @@ -449,12 +584,18 @@ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dependencies": { "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/format": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", - "integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=" + "integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=", + "engines": { + "node": ">=0.4.x" + } }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -465,7 +606,22 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "optional": true + "deprecated": "\"Please update to latest v2.3 or v2.2\"", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/glob": { "version": "7.1.6", @@ -478,6 +634,12 @@ "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { @@ -486,17 +648,38 @@ "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dependencies": { "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" } }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } }, "node_modules/ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "engines": { + "node": ">= 4" + } }, "node_modules/inflight": { "version": "1.0.6", @@ -513,9 +696,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", - "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/interpret": { "version": "1.4.0", @@ -559,12 +742,44 @@ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dependencies": { "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, + "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==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/is-decimal": { "version": "1.0.4", @@ -583,12 +798,18 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } }, "node_modules/is-glob": { "version": "4.0.1", @@ -596,6 +817,9 @@ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dependencies": { "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/is-hexadecimal": { @@ -616,12 +840,18 @@ "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } }, "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==" + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "engines": { + "node": ">=8" + } }, "node_modules/is-reference": { "version": "1.2.1", @@ -638,12 +868,15 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, "node_modules/json-parse-even-better-errors": { @@ -657,6 +890,12 @@ "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dependencies": { "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, "node_modules/libnpmconfig": { @@ -681,6 +920,10 @@ "dependencies": { "libnpmconfig": "^1.0.0", "resolve-from": "^5.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, "node_modules/locate-path": { @@ -690,6 +933,9 @@ "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/longest-streak": { @@ -701,6 +947,17 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -713,7 +970,10 @@ "node_modules/markdown-extensions": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz", - "integrity": "sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q==" + "integrity": "sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q==", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/markdown-table": { "version": "2.0.0", @@ -730,17 +990,22 @@ "node_modules/mdast-comment-marker": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-1.1.2.tgz", - "integrity": "sha512-vTFXtmbbF3rgnTh3Zl3irso4LtvwUq/jaDvT2D1JqTGAwaipcS7RpTxzi6KjoRqI9n2yuAhzLDAC8xVTF3XYVQ==" + "integrity": "sha512-vTFXtmbbF3rgnTh3Zl3irso4LtvwUq/jaDvT2D1JqTGAwaipcS7RpTxzi6KjoRqI9n2yuAhzLDAC8xVTF3XYVQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, "node_modules/mdast-util-from-markdown": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.1.tgz", - "integrity": "sha512-qJXNcFcuCSPqUF0Tb0uYcFDIq67qwB3sxo9RPdf9vG8T90ViKnksFqdB/Coq2a7sTnxL/Ify2y7aIQXDkQFH0w==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz", + "integrity": "sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw==", "dependencies": { "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^1.0.0", - "micromark": "~2.10.0", - "parse-entities": "^2.0.0" + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" }, "funding": { "type": "opencollective", @@ -748,14 +1013,15 @@ } }, "node_modules/mdast-util-gfm": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.0.tgz", - "integrity": "sha512-HLfygQL6HdhJhFbLta4Ki9hClrzyAxRjyRvpm5caN65QZL+NyHPmqFlnF9vm1Rn58JT2+AbLwNcEDY4MEvkk8Q==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.1.tgz", + "integrity": "sha512-oE1W1zSXU2L2LHg91V22HC3Z1fbsOZTBYUQq+kpM29f9297TbRm0C1l3bQ88RREl0WaUQaB49G7trvwy5utUKQ==", "dependencies": { "mdast-util-gfm-autolink-literal": "^0.1.0", "mdast-util-gfm-strikethrough": "^0.2.0", "mdast-util-gfm-table": "^0.1.0", - "mdast-util-gfm-task-list-item": "^0.1.0" + "mdast-util-gfm-task-list-item": "^0.1.0", + "mdast-util-to-markdown": "^0.6.1" }, "funding": { "type": "opencollective", @@ -763,20 +1029,20 @@ } }, "node_modules/mdast-util-gfm-autolink-literal": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.1.tgz", - "integrity": "sha512-gJ2xSpqKCetSr22GEWpZH3f5ffb4pPn/72m4piY0v7T/S+O7n7rw+sfoPLhb2b4O7WdnERoYdALRcmD68FMtlw==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.2.tgz", + "integrity": "sha512-WFeIrcNNsfBety0gyWuiBIPing9UkVcl/m2iZOyW1uHEH2evjFocet2h77M24ub0WyZ4ucnQn/jWhO5Ozl6j4g==", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-gfm-strikethrough": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.2.tgz", - "integrity": "sha512-T37ZbaokJcRbHROXmoVAieWnesPD5N21tv2ifYzaGRLbkh1gknItUGhZzHefUn5Zc/eaO/iTDSAFOBrn/E8kWw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz", + "integrity": "sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA==", "dependencies": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "^0.6.0" }, "funding": { "type": "opencollective", @@ -784,12 +1050,12 @@ } }, "node_modules/mdast-util-gfm-table": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.4.tgz", - "integrity": "sha512-T4xFSON9kUb/IpYA5N+KGWcsdGczAvILvKiXQwUGind6V9fvjPCR9yhZnIeaLdBWXaz3m/Gq77ZtuLMjtFR4IQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz", + "integrity": "sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ==", "dependencies": { "markdown-table": "^2.0.0", - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" }, "funding": { "type": "opencollective", @@ -797,11 +1063,11 @@ } }, "node_modules/mdast-util-gfm-task-list-item": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.4.tgz", - "integrity": "sha512-AMiHyBHvaYN2p3ztFv7gDgTF7keZDaA9plTixRXWT0aqL0QdN43QaG5+hzcRNbjCsEWBxWhpcNk1Diq0TiIEvw==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz", + "integrity": "sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A==", "dependencies": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" }, "funding": { "type": "opencollective", @@ -818,13 +1084,13 @@ } }, "node_modules/mdast-util-to-markdown": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.5.3.tgz", - "integrity": "sha512-sr8q7fQJ1xoCqZSXW6dO/MYu2Md+a4Hfk9uO+XHCfiBhVM0EgWtfAV7BuN+ff6otUeu2xDyt1o7vhZGwOG3+BA==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.2.tgz", + "integrity": "sha512-iRczns6WMvu0hUw02LXsPDJshBIwtUPbvHBWo19IQeU0YqmzlA8Pd30U8V7uiI0VPkxzS7A/NXBXH6u+HS87Zg==", "dependencies": { "@types/unist": "^2.0.0", "longest-streak": "^2.0.0", - "mdast-util-to-string": "^1.0.0", + "mdast-util-to-string": "^2.0.0", "parse-entities": "^2.0.0", "repeat-string": "^1.0.0", "zwitch": "^1.0.0" @@ -835,14 +1101,18 @@ } }, "node_modules/mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", + "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, "node_modules/micromark": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz", - "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.2.tgz", + "integrity": "sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ==", "funding": [ { "type": "GitHub Sponsors", @@ -859,11 +1129,11 @@ } }, "node_modules/micromark-extension-gfm": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.1.tgz", - "integrity": "sha512-lJlhcOqzoJdjQg+LMumVHdUQ61LjtqGdmZtrAdfvatRUnJTqZlRwXXHdLQgNDYlFw4mycZ4NSTKlya5QcQXl1A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.2.tgz", + "integrity": "sha512-ToQEpLkRgg7Tp8D3GM/SjZFPV0cCwWNxZmoEVIOQivOswRtPg7gg2WlCrtHhUWFNX+DgDjbq0iLOPGp4Y15oug==", "dependencies": { - "micromark": "~2.10.0", + "micromark": "~2.11.0", "micromark-extension-gfm-autolink-literal": "~0.5.0", "micromark-extension-gfm-strikethrough": "~0.6.0", "micromark-extension-gfm-table": "~0.4.0", @@ -876,11 +1146,11 @@ } }, "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.1.tgz", - "integrity": "sha512-j30923tDp0faCNDjwqe4cMi+slegbGfc3VEAExEU8d54Q/F6pR6YxCVH+6xV0ItRoj3lCn1XkUWcy6FC3S9BOw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.4.tgz", + "integrity": "sha512-471VKd4k3SiX7vx9fC+IYeGQL0RnxwBBXeEc5WConb7naJDG5m16guA+VoFzyXchrvmU08t0dUWWPZ0mkJSXVw==", "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -888,11 +1158,11 @@ } }, "node_modules/micromark-extension-gfm-strikethrough": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.2.tgz", - "integrity": "sha512-aehEEqtTn3JekJNwZZxa7ZJVfzmuaWp4ew6x6sl3VAKIwdDZdqYeYSQIrNKwNgH7hX0g56fAwnSDLusJggjlCQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.3.tgz", + "integrity": "sha512-MKMoP9x2dsr1aeX46ibBwVf4Q6nJsi5aaUFTOMOID5VOLSxwl4CrqUV4OGFQd6AqhtzBJAxaV+N2trlTBtZDNQ==", "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -900,11 +1170,11 @@ } }, "node_modules/micromark-extension-gfm-table": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.1.tgz", - "integrity": "sha512-xVpqOnfFaa2OtC/Y7rlt4tdVFlUHdoLH3RXAZgb/KP3DDyKsAOx6BRS3UxiiyvmD/p2l6VUpD4bMIniuP4o4JA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.2.tgz", + "integrity": "sha512-AAzmj85XO1ydHYX0Lz52HGhcH2sZLm2AVvkwzELXWgZF6vGdq5yZ3CTByFRsqNUPyQBSIYFKLDAtc6KlnO42aw==", "dependencies": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" }, "funding": { "type": "opencollective", @@ -921,9 +1191,12 @@ } }, "node_modules/micromark-extension-gfm-task-list-item": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.1.tgz", - "integrity": "sha512-3ZiolwyLEF+t2KvGqKdBNEybiacQCsBgDx4PRZz/dttwo0PkcVKh7jpxc6UdHQuNMJ/YRUNuCSal0WuoAlefAA==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz", + "integrity": "sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ==", + "dependencies": { + "micromark": "~2.11.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -935,6 +1208,9 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, "node_modules/minimist": { @@ -950,7 +1226,10 @@ "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/once": { "version": "1.4.0", @@ -966,6 +1245,12 @@ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dependencies": { "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { @@ -974,12 +1259,18 @@ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dependencies": { "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } }, "node_modules/parse-entities": { "version": "2.0.0", @@ -1007,17 +1298,29 @@ "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "engines": { + "node": ">=4" + } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/path-parse": { "version": "1.0.6", @@ -1028,7 +1331,13 @@ "node_modules/picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } }, "node_modules/pluralize": { "version": "8.0.0", @@ -1046,6 +1355,9 @@ "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, "node_modules/readdirp": { @@ -1054,6 +1366,9 @@ "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", "dependencies": { "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" } }, "node_modules/rechoir": { @@ -1096,11 +1411,15 @@ } }, "node_modules/remark-lint": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-7.0.1.tgz", - "integrity": "sha512-caZXo3qhuBxzvq9JSJFVQ/ERDq/6TJVgWn0KDwKOIJCGOuLXfQhby5XttUq+Rn7kLbNMtvwfWHJlte14LpaeXQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-8.0.0.tgz", + "integrity": "sha512-ESI8qJQ/TIRjABDnqoFsTiZntu+FRifZ5fJ77yX63eIDijl/arvmDvT+tAf75/Nm5BFL4R2JFUtkHRGVjzYUsg==", "dependencies": { "remark-message-control": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/remark-lint-blockquote-indentation": { @@ -1120,6 +1439,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-lint-blockquote-indentation/node_modules/mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-lint-checkbox-character-style": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/remark-lint-checkbox-character-style/-/remark-lint-checkbox-character-style-3.0.0.tgz", @@ -1356,6 +1684,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-lint-no-auto-link-without-protocol/node_modules/mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-lint-no-blockquote-without-marker": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-4.0.0.tgz", @@ -1488,6 +1825,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-lint-no-inline-padding/node_modules/mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-lint-no-literal-urls": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-2.0.1.tgz", @@ -1504,6 +1850,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-lint-no-literal-urls/node_modules/mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-lint-no-multiple-toplevel-headings": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-2.0.1.tgz", @@ -1738,6 +2093,10 @@ "dependencies": { "mdast-comment-marker": "^1.0.0", "unified-message-control": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/remark-parse": { @@ -1756,7 +2115,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/remark-preset-lint-node/-/remark-preset-lint-node-2.0.0.tgz", "integrity": "sha512-gjJlRK+ed3rW/k+YFENGyDDfzMS2iUyuo+MQR3pQWUl7L6Yawg6OYGKjO9eVBN/1jaourq0N515O1nXq64Qm1Q==", - "license": "MIT", "dependencies": { "js-yaml": "^3.14.0", "remark-lint": "^8.0.0", @@ -1793,18 +2151,6 @@ "semver": "^7.3.2" } }, - "node_modules/remark-preset-lint-node/node_modules/remark-lint": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-8.0.0.tgz", - "integrity": "sha512-ESI8qJQ/TIRjABDnqoFsTiZntu+FRifZ5fJ77yX63eIDijl/arvmDvT+tAf75/Nm5BFL4R2JFUtkHRGVjzYUsg==", - "dependencies": { - "remark-message-control": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-preset-lint-recommended": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/remark-preset-lint-recommended/-/remark-preset-lint-recommended-5.0.0.tgz", @@ -1832,24 +2178,12 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/remark-preset-lint-recommended/node_modules/remark-lint": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-8.0.0.tgz", - "integrity": "sha512-ESI8qJQ/TIRjABDnqoFsTiZntu+FRifZ5fJ77yX63eIDijl/arvmDvT+tAf75/Nm5BFL4R2JFUtkHRGVjzYUsg==", - "dependencies": { - "remark-message-control": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/remark-stringify": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.0.tgz", - "integrity": "sha512-8x29DpTbVzEc6Dwb90qhxCtbZ6hmj3BxWWDpMhA+1WM4dOEGH5U5/GFe3Be5Hns5MvPSFAr1e2KSVtKZkK5nUw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.1.tgz", + "integrity": "sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==", "dependencies": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "^0.6.0" }, "funding": { "type": "opencollective", @@ -1859,31 +2193,36 @@ "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "node_modules/replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "engines": { + "node": ">=0.10" + } }, "node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", "dev": true, "dependencies": { + "is-core-module": "^2.1.0", "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "engines": { + "node": ">=8" + } }, "node_modules/rollup": { - "version": "2.32.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.32.1.tgz", - "integrity": "sha512-Op2vWTpvK7t6/Qnm1TTh7VjEZZkN8RWgf0DHbkKzQBwNf748YhXbozHVefqpPp/Fuyk/PQPAnYsBxAEtlMvpUw==", + "version": "2.36.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.1.tgz", + "integrity": "sha512-eAfqho8dyzuVvrGqpR0ITgEdq0zG2QJeWYh+HeuTbpcaXk8vNFc48B7bJa1xYosTCKx0CuW+447oQOW8HgBIZQ==", "dev": true, "dependencies": { "fsevents": "~2.1.2" @@ -1901,12 +2240,29 @@ "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" }, @@ -1979,6 +2335,9 @@ "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/strip-ansi": { @@ -1987,6 +2346,9 @@ "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dependencies": { "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/supports-color": { @@ -1995,6 +2357,9 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dependencies": { "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/text-table": { @@ -2008,6 +2373,9 @@ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dependencies": { "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, "node_modules/to-vfile": { @@ -2017,12 +2385,20 @@ "dependencies": { "is-buffer": "^2.0.0", "vfile": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/trough": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", - "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==" + "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, "node_modules/typedarray": { "version": "0.0.6", @@ -2059,6 +2435,10 @@ "minimist": "^1.2.0", "text-table": "^0.2.0", "unified-engine": "^8.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/unified-engine": { @@ -2083,6 +2463,10 @@ "unist-util-inspect": "^5.0.0", "vfile-reporter": "^6.0.0", "vfile-statistics": "^1.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/unified-lint-rule": { @@ -2098,12 +2482,16 @@ } }, "node_modules/unified-message-control": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-3.0.1.tgz", - "integrity": "sha512-K2Kvvp1DBzeuxYLLsumZh/gDWUTl4e2z/P3VReFirC78cfHKtQifbhnfRrSBtKtd1Uc6cvYTW0/SZIUaMAEcTg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-3.0.2.tgz", + "integrity": "sha512-lhF8fKjDo2cIPx1re5X1QinqUonl+AN6F0XfEaab8w/hjqX7FZAhzu4P8g6pmYp09ld+HSWFwdRJj+Y8xD0q7Q==", "dependencies": { "unist-util-visit": "^2.0.0", "vfile-location": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-generated": { @@ -2121,12 +2509,20 @@ "integrity": "sha512-fPNWewS593JSmg49HbnE86BJKuBi1/nMWhDSccBvbARfxezEuJV85EaARR9/VplveiwCoLm2kWq+DhP8TBaDpw==", "dependencies": { "is-empty": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-is": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz", - "integrity": "sha512-Ofx8uf6haexJwI1gxWMGg6I/dLnF2yE+KibhD3/diOqY2TinLcqHXCV6OI5gFVn3xQqDH+u0M625pfKwIwgBKQ==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.4.tgz", + "integrity": "sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, "node_modules/unist-util-position": { "version": "3.1.0", @@ -2143,6 +2539,10 @@ "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", "dependencies": { "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-visit": { @@ -2153,15 +2553,23 @@ "@types/unist": "^2.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/unist-util-visit-parents": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", - "integrity": "sha512-0g4wbluTF93npyPrp/ymd3tCDTMnP0yo2akFD2FIBAYXq/Sga3lwaU1D8OYKbtpioaI6CkDcQ6fsMnmtzt7htw==", + "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": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/util-deprecate": { @@ -2170,21 +2578,28 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/vfile": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.0.tgz", - "integrity": "sha512-a/alcwCvtuc8OX92rqqo7PflxiCgXRFjdyoGVuYV+qbgCb0GgZJRvIgCD4+U/Kl1yhaRsaTwksF88xbPyGsgpw==", + "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", - "replace-ext": "1.0.0", "unist-util-stringify-position": "^2.0.0", "vfile-message": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/vfile-location": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.1.0.tgz", - "integrity": "sha512-FCZ4AN9xMcjFIG1oGmZKo61PjwJHRVA+0/tPUP2ul4uIwjGGndIxavEMRpWn5p4xwm/ZsdXp9YNygf1ZyE4x8g==" + "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/vfile-message": { "version": "2.0.4", @@ -2193,12 +2608,16 @@ "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/vfile-reporter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-6.0.1.tgz", - "integrity": "sha512-0OppK9mo8G2XUpv+hIKLVSDsoxJrXnOy73+vIm0jQUOUFYRduqpFHX+QqAQfvRHyX9B0UFiRuNJnBOjQCIsw1g==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-6.0.2.tgz", + "integrity": "sha512-GN2bH2gs4eLnw/4jPSgfBjo+XCuvnX9elHICJZjVD4+NM0nsUrMTvdjGY5Sc/XG69XVTgLwj7hknQVc6M9FukA==", "dependencies": { "repeat-string": "^1.5.0", "string-width": "^4.0.0", @@ -2206,12 +2625,19 @@ "unist-util-stringify-position": "^2.0.0", "vfile-sort": "^2.1.2", "vfile-statistics": "^1.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/vfile-reporter/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "engines": { + "node": ">=4" + } }, "node_modules/vfile-reporter/node_modules/supports-color": { "version": "6.1.0", @@ -2219,17 +2645,28 @@ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dependencies": { "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/vfile-sort": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/vfile-sort/-/vfile-sort-2.2.2.tgz", - "integrity": "sha512-tAyUqD2R1l/7Rn7ixdGkhXLD3zsg+XLAeUDUhXearjfIcpL1Hcsj5hHpCoy/gvfK/Ws61+e972fm0F7up7hfYA==" + "integrity": "sha512-tAyUqD2R1l/7Rn7ixdGkhXLD3zsg+XLAeUDUhXearjfIcpL1Hcsj5hHpCoy/gvfK/Ws61+e972fm0F7up7hfYA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, "node_modules/vfile-statistics": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/vfile-statistics/-/vfile-statistics-1.1.4.tgz", - "integrity": "sha512-lXhElVO0Rq3frgPvFBwahmed3X03vjPF8OcjKMy8+F1xU/3Q3QU3tKEDp743SFtb74PdF0UWpxPvtOP0GCLheA==" + "integrity": "sha512-lXhElVO0Rq3frgPvFBwahmed3X03vjPF8OcjKMy8+F1xU/3Q3QU3tKEDp743SFtb74PdF0UWpxPvtOP0GCLheA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } }, "node_modules/wrapped": { "version": "1.0.1", @@ -2245,6 +2682,11 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/zwitch": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", @@ -2257,17 +2699,17 @@ }, "dependencies": { "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "requires": { "@babel/highlight": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" }, "@babel/highlight": { "version": "7.10.4", @@ -2331,18 +2773,18 @@ } }, "@rollup/plugin-commonjs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.1.0.tgz", - "integrity": "sha512-Ycr12N3ZPN96Fw2STurD21jMqzKwL9QuFhms3SD7KKRK7oaXUsBU9Zt0jL/rOPHiPYisI21/rXGO3jr9BnLHUA==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.0.0.tgz", + "integrity": "sha512-/omBIJG1nHQc+bgkYDuLpb/V08QyutP9amOrJRUSlYJZP+b/68gM//D8sxJe3Yry2QnYIr3QjR3x4AlxJEN3GA==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.0.8", + "@rollup/pluginutils": "^3.1.0", "commondir": "^1.0.1", - "estree-walker": "^1.0.1", - "glob": "^7.1.2", - "is-reference": "^1.1.2", - "magic-string": "^0.25.2", - "resolve": "^1.11.0" + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" } }, "@rollup/plugin-json": { @@ -2355,16 +2797,17 @@ } }, "@rollup/plugin-node-resolve": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz", - "integrity": "sha512-RxtSL3XmdTAE2byxekYLnx+98kEUOrPHF/KRVjLH+DEIHy6kjIw7YINQzn+NXiH/NTrQLAwYs0GWB+csWygA9Q==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz", + "integrity": "sha512-ltlsj/4Bhwwhb+Nb5xCz/6vieuEj2/BAkkqVIKmZwC7pIdl8srmgmglE4S0jFlZa32K4qvdQ6NHdmpRKD/LwoQ==", "dev": true, "requires": { - "@rollup/pluginutils": "^3.0.8", - "@types/resolve": "0.0.8", + "@rollup/pluginutils": "^3.1.0", + "@types/resolve": "1.17.1", "builtin-modules": "^3.1.0", + "deepmerge": "^4.2.2", "is-module": "^1.0.0", - "resolve": "^1.14.2" + "resolve": "^1.19.0" } }, "@rollup/pluginutils": { @@ -2376,6 +2819,14 @@ "@types/estree": "0.0.39", "estree-walker": "^1.0.1", "picomatch": "^2.2.2" + }, + "dependencies": { + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + } } }, "@types/estree": { @@ -2393,15 +2844,15 @@ } }, "@types/node": { - "version": "14.11.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", - "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", + "version": "14.14.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz", + "integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==", "dev": true }, "@types/resolve": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", - "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", "dev": true, "requires": { "@types/node": "*" @@ -2480,9 +2931,9 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", + "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", "dev": true }, "camelcase": { @@ -2515,18 +2966,26 @@ "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==" }, "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.0.tgz", + "integrity": "sha512-JgQM9JS92ZbFR4P90EvmzNpSGhpPBGBSj10PILeDyYFwp4h2/D9OM03wsJ4zW1fEp4ka2DGrnUeD7FuvQ2aZ2Q==", "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.5.0" + }, + "dependencies": { + "fsevents": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz", + "integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==", + "optional": true + } } }, "co": { @@ -2575,13 +3034,19 @@ } }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { "ms": "2.1.2" } }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2606,9 +3071,9 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, "extend": { @@ -2674,8 +3139,15 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -2697,6 +3169,15 @@ "is-glob": "^4.0.1" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2722,9 +3203,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", - "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "interpret": { "version": "1.4.0", @@ -2760,9 +3241,18 @@ } }, "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "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==", + "dev": true, + "requires": { + "has": "^1.0.3" + } }, "is-decimal": { "version": "1.0.4", @@ -2828,9 +3318,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -2887,6 +3377,14 @@ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==" }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -2915,55 +3413,57 @@ "integrity": "sha512-vTFXtmbbF3rgnTh3Zl3irso4LtvwUq/jaDvT2D1JqTGAwaipcS7RpTxzi6KjoRqI9n2yuAhzLDAC8xVTF3XYVQ==" }, "mdast-util-from-markdown": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.1.tgz", - "integrity": "sha512-qJXNcFcuCSPqUF0Tb0uYcFDIq67qwB3sxo9RPdf9vG8T90ViKnksFqdB/Coq2a7sTnxL/Ify2y7aIQXDkQFH0w==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.4.tgz", + "integrity": "sha512-jj891B5pV2r63n2kBTFh8cRI2uR9LQHsXG1zSDqfhXkIlDzrTcIlbB5+5aaYEkl8vOPIOPLf8VT7Ere1wWTMdw==", "requires": { "@types/mdast": "^3.0.0", - "mdast-util-to-string": "^1.0.0", - "micromark": "~2.10.0", - "parse-entities": "^2.0.0" + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" } }, "mdast-util-gfm": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.0.tgz", - "integrity": "sha512-HLfygQL6HdhJhFbLta4Ki9hClrzyAxRjyRvpm5caN65QZL+NyHPmqFlnF9vm1Rn58JT2+AbLwNcEDY4MEvkk8Q==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.1.tgz", + "integrity": "sha512-oE1W1zSXU2L2LHg91V22HC3Z1fbsOZTBYUQq+kpM29f9297TbRm0C1l3bQ88RREl0WaUQaB49G7trvwy5utUKQ==", "requires": { "mdast-util-gfm-autolink-literal": "^0.1.0", "mdast-util-gfm-strikethrough": "^0.2.0", "mdast-util-gfm-table": "^0.1.0", - "mdast-util-gfm-task-list-item": "^0.1.0" + "mdast-util-gfm-task-list-item": "^0.1.0", + "mdast-util-to-markdown": "^0.6.1" } }, "mdast-util-gfm-autolink-literal": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.1.tgz", - "integrity": "sha512-gJ2xSpqKCetSr22GEWpZH3f5ffb4pPn/72m4piY0v7T/S+O7n7rw+sfoPLhb2b4O7WdnERoYdALRcmD68FMtlw==" + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.2.tgz", + "integrity": "sha512-WFeIrcNNsfBety0gyWuiBIPing9UkVcl/m2iZOyW1uHEH2evjFocet2h77M24ub0WyZ4ucnQn/jWhO5Ozl6j4g==" }, "mdast-util-gfm-strikethrough": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.2.tgz", - "integrity": "sha512-T37ZbaokJcRbHROXmoVAieWnesPD5N21tv2ifYzaGRLbkh1gknItUGhZzHefUn5Zc/eaO/iTDSAFOBrn/E8kWw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz", + "integrity": "sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA==", "requires": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "^0.6.0" } }, "mdast-util-gfm-table": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.4.tgz", - "integrity": "sha512-T4xFSON9kUb/IpYA5N+KGWcsdGczAvILvKiXQwUGind6V9fvjPCR9yhZnIeaLdBWXaz3m/Gq77ZtuLMjtFR4IQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz", + "integrity": "sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ==", "requires": { "markdown-table": "^2.0.0", - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" } }, "mdast-util-gfm-task-list-item": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.4.tgz", - "integrity": "sha512-AMiHyBHvaYN2p3ztFv7gDgTF7keZDaA9plTixRXWT0aqL0QdN43QaG5+hzcRNbjCsEWBxWhpcNk1Diq0TiIEvw==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz", + "integrity": "sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A==", "requires": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "~0.6.0" } }, "mdast-util-heading-style": { @@ -2972,38 +3472,38 @@ "integrity": "sha512-8ZuuegRqS0KESgjAGW8zTx4tJ3VNIiIaGFNEzFpRSAQBavVc7AvOo9I4g3crcZBfYisHs4seYh0rAVimO6HyOw==" }, "mdast-util-to-markdown": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.5.3.tgz", - "integrity": "sha512-sr8q7fQJ1xoCqZSXW6dO/MYu2Md+a4Hfk9uO+XHCfiBhVM0EgWtfAV7BuN+ff6otUeu2xDyt1o7vhZGwOG3+BA==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.2.tgz", + "integrity": "sha512-iRczns6WMvu0hUw02LXsPDJshBIwtUPbvHBWo19IQeU0YqmzlA8Pd30U8V7uiI0VPkxzS7A/NXBXH6u+HS87Zg==", "requires": { "@types/unist": "^2.0.0", "longest-streak": "^2.0.0", - "mdast-util-to-string": "^1.0.0", + "mdast-util-to-string": "^2.0.0", "parse-entities": "^2.0.0", "repeat-string": "^1.0.0", "zwitch": "^1.0.0" } }, "mdast-util-to-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", - "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", + "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==" }, "micromark": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz", - "integrity": "sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.2.tgz", + "integrity": "sha512-IXuP76p2uj8uMg4FQc1cRE7lPCLsfAXuEfdjtdO55VRiFO1asrCSQ5g43NmPqFtRwzEnEhafRVzn2jg0UiKArQ==", "requires": { "debug": "^4.0.0", "parse-entities": "^2.0.0" } }, "micromark-extension-gfm": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.1.tgz", - "integrity": "sha512-lJlhcOqzoJdjQg+LMumVHdUQ61LjtqGdmZtrAdfvatRUnJTqZlRwXXHdLQgNDYlFw4mycZ4NSTKlya5QcQXl1A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.2.tgz", + "integrity": "sha512-ToQEpLkRgg7Tp8D3GM/SjZFPV0cCwWNxZmoEVIOQivOswRtPg7gg2WlCrtHhUWFNX+DgDjbq0iLOPGp4Y15oug==", "requires": { - "micromark": "~2.10.0", + "micromark": "~2.11.0", "micromark-extension-gfm-autolink-literal": "~0.5.0", "micromark-extension-gfm-strikethrough": "~0.6.0", "micromark-extension-gfm-table": "~0.4.0", @@ -3012,27 +3512,27 @@ } }, "micromark-extension-gfm-autolink-literal": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.1.tgz", - "integrity": "sha512-j30923tDp0faCNDjwqe4cMi+slegbGfc3VEAExEU8d54Q/F6pR6YxCVH+6xV0ItRoj3lCn1XkUWcy6FC3S9BOw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.4.tgz", + "integrity": "sha512-471VKd4k3SiX7vx9fC+IYeGQL0RnxwBBXeEc5WConb7naJDG5m16guA+VoFzyXchrvmU08t0dUWWPZ0mkJSXVw==", "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "micromark-extension-gfm-strikethrough": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.2.tgz", - "integrity": "sha512-aehEEqtTn3JekJNwZZxa7ZJVfzmuaWp4ew6x6sl3VAKIwdDZdqYeYSQIrNKwNgH7hX0g56fAwnSDLusJggjlCQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.3.tgz", + "integrity": "sha512-MKMoP9x2dsr1aeX46ibBwVf4Q6nJsi5aaUFTOMOID5VOLSxwl4CrqUV4OGFQd6AqhtzBJAxaV+N2trlTBtZDNQ==", "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "micromark-extension-gfm-table": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.1.tgz", - "integrity": "sha512-xVpqOnfFaa2OtC/Y7rlt4tdVFlUHdoLH3RXAZgb/KP3DDyKsAOx6BRS3UxiiyvmD/p2l6VUpD4bMIniuP4o4JA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.2.tgz", + "integrity": "sha512-AAzmj85XO1ydHYX0Lz52HGhcH2sZLm2AVvkwzELXWgZF6vGdq5yZ3CTByFRsqNUPyQBSIYFKLDAtc6KlnO42aw==", "requires": { - "micromark": "~2.10.0" + "micromark": "~2.11.0" } }, "micromark-extension-gfm-tagfilter": { @@ -3041,9 +3541,12 @@ "integrity": "sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q==" }, "micromark-extension-gfm-task-list-item": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.1.tgz", - "integrity": "sha512-3ZiolwyLEF+t2KvGqKdBNEybiacQCsBgDx4PRZz/dttwo0PkcVKh7jpxc6UdHQuNMJ/YRUNuCSal0WuoAlefAA==" + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz", + "integrity": "sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ==", + "requires": { + "micromark": "~2.11.0" + } }, "minimatch": { "version": "3.0.4", @@ -3194,9 +3697,9 @@ } }, "remark-lint": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-7.0.1.tgz", - "integrity": "sha512-caZXo3qhuBxzvq9JSJFVQ/ERDq/6TJVgWn0KDwKOIJCGOuLXfQhby5XttUq+Rn7kLbNMtvwfWHJlte14LpaeXQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-8.0.0.tgz", + "integrity": "sha512-ESI8qJQ/TIRjABDnqoFsTiZntu+FRifZ5fJ77yX63eIDijl/arvmDvT+tAf75/Nm5BFL4R2JFUtkHRGVjzYUsg==", "requires": { "remark-message-control": "^6.0.0" } @@ -3212,6 +3715,13 @@ "unist-util-generated": "^1.1.0", "unist-util-position": "^3.0.0", "unist-util-visit": "^2.0.0" + }, + "dependencies": { + "mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==" + } } }, "remark-lint-checkbox-character-style": { @@ -3384,6 +3894,13 @@ "unist-util-generated": "^1.1.0", "unist-util-position": "^3.0.0", "unist-util-visit": "^2.0.0" + }, + "dependencies": { + "mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==" + } } }, "remark-lint-no-blockquote-without-marker": { @@ -3480,6 +3997,13 @@ "unified-lint-rule": "^1.0.0", "unist-util-generated": "^1.1.0", "unist-util-visit": "^2.0.0" + }, + "dependencies": { + "mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==" + } } }, "remark-lint-no-literal-urls": { @@ -3492,6 +4016,13 @@ "unist-util-generated": "^1.1.0", "unist-util-position": "^3.0.0", "unist-util-visit": "^2.0.0" + }, + "dependencies": { + "mdast-util-to-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz", + "integrity": "sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A==" + } } }, "remark-lint-no-multiple-toplevel-headings": { @@ -3720,16 +4251,6 @@ "remark-lint-unordered-list-marker-style": "^2.0.0", "remark-preset-lint-recommended": "^5.0.0", "semver": "^7.3.2" - }, - "dependencies": { - "remark-lint": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-8.0.0.tgz", - "integrity": "sha512-ESI8qJQ/TIRjABDnqoFsTiZntu+FRifZ5fJ77yX63eIDijl/arvmDvT+tAf75/Nm5BFL4R2JFUtkHRGVjzYUsg==", - "requires": { - "remark-message-control": "^6.0.0" - } - } } }, "remark-preset-lint-recommended": { @@ -3753,24 +4274,14 @@ "remark-lint-no-undefined-references": "^3.0.0", "remark-lint-no-unused-definitions": "^2.0.0", "remark-lint-ordered-list-marker-style": "^2.0.0" - }, - "dependencies": { - "remark-lint": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-8.0.0.tgz", - "integrity": "sha512-ESI8qJQ/TIRjABDnqoFsTiZntu+FRifZ5fJ77yX63eIDijl/arvmDvT+tAf75/Nm5BFL4R2JFUtkHRGVjzYUsg==", - "requires": { - "remark-message-control": "^6.0.0" - } - } } }, "remark-stringify": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.0.tgz", - "integrity": "sha512-8x29DpTbVzEc6Dwb90qhxCtbZ6hmj3BxWWDpMhA+1WM4dOEGH5U5/GFe3Be5Hns5MvPSFAr1e2KSVtKZkK5nUw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.1.tgz", + "integrity": "sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==", "requires": { - "mdast-util-to-markdown": "^0.5.0" + "mdast-util-to-markdown": "^0.6.0" } }, "repeat-string": { @@ -3778,17 +4289,13 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" - }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", "dev": true, "requires": { + "is-core-module": "^2.1.0", "path-parse": "^1.0.6" } }, @@ -3798,9 +4305,9 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" }, "rollup": { - "version": "2.32.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.32.1.tgz", - "integrity": "sha512-Op2vWTpvK7t6/Qnm1TTh7VjEZZkN8RWgf0DHbkKzQBwNf748YhXbozHVefqpPp/Fuyk/PQPAnYsBxAEtlMvpUw==", + "version": "2.36.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.1.tgz", + "integrity": "sha512-eAfqho8dyzuVvrGqpR0ITgEdq0zG2QJeWYh+HeuTbpcaXk8vNFc48B7bJa1xYosTCKx0CuW+447oQOW8HgBIZQ==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -3812,9 +4319,12 @@ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } }, "shelljs": { "version": "0.8.4", @@ -3980,9 +4490,9 @@ } }, "unified-message-control": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-3.0.1.tgz", - "integrity": "sha512-K2Kvvp1DBzeuxYLLsumZh/gDWUTl4e2z/P3VReFirC78cfHKtQifbhnfRrSBtKtd1Uc6cvYTW0/SZIUaMAEcTg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-3.0.2.tgz", + "integrity": "sha512-lhF8fKjDo2cIPx1re5X1QinqUonl+AN6F0XfEaab8w/hjqX7FZAhzu4P8g6pmYp09ld+HSWFwdRJj+Y8xD0q7Q==", "requires": { "unist-util-visit": "^2.0.0", "vfile-location": "^3.0.0" @@ -4002,9 +4512,9 @@ } }, "unist-util-is": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz", - "integrity": "sha512-Ofx8uf6haexJwI1gxWMGg6I/dLnF2yE+KibhD3/diOqY2TinLcqHXCV6OI5gFVn3xQqDH+u0M625pfKwIwgBKQ==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.4.tgz", + "integrity": "sha512-3dF39j/u423v4BBQrk1AQ2Ve1FxY5W3JKwXxVFzBODQ6WEvccguhgp802qQLKSnxPODE6WuRZtV+ohlUg4meBA==" }, "unist-util-position": { "version": "3.1.0", @@ -4030,9 +4540,9 @@ } }, "unist-util-visit-parents": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", - "integrity": "sha512-0g4wbluTF93npyPrp/ymd3tCDTMnP0yo2akFD2FIBAYXq/Sga3lwaU1D8OYKbtpioaI6CkDcQ6fsMnmtzt7htw==", + "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": "^4.0.0" @@ -4044,21 +4554,20 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "vfile": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.0.tgz", - "integrity": "sha512-a/alcwCvtuc8OX92rqqo7PflxiCgXRFjdyoGVuYV+qbgCb0GgZJRvIgCD4+U/Kl1yhaRsaTwksF88xbPyGsgpw==", + "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", - "replace-ext": "1.0.0", "unist-util-stringify-position": "^2.0.0", "vfile-message": "^2.0.0" } }, "vfile-location": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.1.0.tgz", - "integrity": "sha512-FCZ4AN9xMcjFIG1oGmZKo61PjwJHRVA+0/tPUP2ul4uIwjGGndIxavEMRpWn5p4xwm/ZsdXp9YNygf1ZyE4x8g==" + "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==" }, "vfile-message": { "version": "2.0.4", @@ -4070,9 +4579,9 @@ } }, "vfile-reporter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-6.0.1.tgz", - "integrity": "sha512-0OppK9mo8G2XUpv+hIKLVSDsoxJrXnOy73+vIm0jQUOUFYRduqpFHX+QqAQfvRHyX9B0UFiRuNJnBOjQCIsw1g==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-6.0.2.tgz", + "integrity": "sha512-GN2bH2gs4eLnw/4jPSgfBjo+XCuvnX9elHICJZjVD4+NM0nsUrMTvdjGY5Sc/XG69XVTgLwj7hknQVc6M9FukA==", "requires": { "repeat-string": "^1.5.0", "string-width": "^4.0.0", @@ -4121,6 +4630,11 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "zwitch": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", diff --git a/tools/node-lint-md-cli-rollup/package.json b/tools/node-lint-md-cli-rollup/package.json index e55115fa1f6cb6..7776ad0d5dcc5b 100644 --- a/tools/node-lint-md-cli-rollup/package.json +++ b/tools/node-lint-md-cli-rollup/package.json @@ -3,19 +3,19 @@ "description": "remark packaged for Node.js Markdown linting", "version": "2.0.2", "devDependencies": { - "@rollup/plugin-commonjs": "^11.0.1", - "@rollup/plugin-json": "^4.0.1", - "@rollup/plugin-node-resolve": "^7.0.0", - "rollup": "^2.32.1", + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^11.0.1", + "rollup": "^2.36.1", "shx": "^0.3.3" }, "dependencies": { "markdown-extensions": "^1.1.1", "remark": "^13.0.0", "remark-gfm": "^1.0.0", - "remark-lint": "^7.0.0", + "remark-lint": "^8.0.0", "remark-preset-lint-node": "^2.0.0", - "unified-args": "^8.0.0" + "unified-args": "^8.1.0" }, "main": "dist/index.js", "scripts": { diff --git a/tools/node-lint-md-cli-rollup/rollup.config.js b/tools/node-lint-md-cli-rollup/rollup.config.js index 967f81865c6d3a..654f033cf65b8d 100644 --- a/tools/node-lint-md-cli-rollup/rollup.config.js +++ b/tools/node-lint-md-cli-rollup/rollup.config.js @@ -1,6 +1,6 @@ 'use strict'; -const resolve = require('@rollup/plugin-node-resolve'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); const commonjs = require('@rollup/plugin-commonjs'); const json = require('@rollup/plugin-json'); @@ -10,6 +10,7 @@ module.exports = { file: 'dist/index.js', format: 'cjs', sourcemap: false, + exports: 'default', }, external: [ 'stream', @@ -44,7 +45,7 @@ module.exports = { json({ preferConst: true }), - resolve(), // tells Rollup how to find date-fns in node_modules + nodeResolve(), // tells Rollup how to find date-fns in node_modules commonjs(), // Converts date-fns to ES modules { name: 'banner', From c23cca2de98d9012843770a1434c0940ee571502 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 31 Dec 2020 12:49:44 +0100 Subject: [PATCH 144/161] tls: refactor to avoid unsafe array iteration PR-URL: https://github.com/nodejs/node/pull/36772 Reviewed-By: Rich Trott --- lib/_tls_common.js | 25 +++++++++++++------------ lib/internal/tls.js | 5 +++-- lib/tls.js | 11 +++++++---- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 616b7b47f46dac..7cda18be31de30 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -24,6 +24,7 @@ const { ArrayIsArray, ArrayPrototypeFilter, + ArrayPrototypeForEach, ArrayPrototypeJoin, ArrayPrototypePush, ObjectCreate, @@ -142,18 +143,18 @@ function processCiphers(ciphers) { return { cipherList, cipherSuites }; } -function addCACerts(context, ...certs) { - for (const cert of certs) { +function addCACerts(context, certs) { + ArrayPrototypeForEach(certs, (cert) => { validateKeyOrCertOption('ca', cert); context.addCACert(cert); - } + }); } -function setCerts(context, ...certs) { - for (const cert of certs) { +function setCerts(context, certs) { + ArrayPrototypeForEach(certs, (cert) => { validateKeyOrCertOption('cert', cert); context.setCert(cert); - } + }); } exports.createSecureContext = function createSecureContext(options) { @@ -196,18 +197,18 @@ exports.createSecureContext = function createSecureContext(options) { // change the checks to !== undefined checks. if (ca) { if (ArrayIsArray(ca)) - addCACerts(c.context, ...ca); - else addCACerts(c.context, ca); + else + addCACerts(c.context, [ca]); } else { c.context.addRootCerts(); } if (cert) { if (ArrayIsArray(cert)) - setCerts(c.context, ...cert); - else setCerts(c.context, cert); + else + setCerts(c.context, [cert]); } // Set the key after the cert. @@ -318,7 +319,7 @@ exports.createSecureContext = function createSecureContext(options) { if (pfx !== undefined) { if (ArrayIsArray(pfx)) { - for (const val of pfx) { + ArrayPrototypeForEach(pfx, (val) => { const raw = val.buf ? val.buf : val; const pass = val.passphrase || passphrase; if (pass !== undefined) { @@ -326,7 +327,7 @@ exports.createSecureContext = function createSecureContext(options) { } else { c.context.loadPKCS12(toBuf(raw)); } - } + }); } else if (passphrase) { c.context.loadPKCS12(toBuf(pfx), toBuf(passphrase)); } else { diff --git a/lib/internal/tls.js b/lib/internal/tls.js index da40f635286bfe..57366839c170ae 100644 --- a/lib/internal/tls.js +++ b/lib/internal/tls.js @@ -2,6 +2,7 @@ const { ArrayIsArray, + ArrayPrototypeForEach, ArrayPrototypePush, StringPrototypeIndexOf, StringPrototypeSlice, @@ -13,7 +14,7 @@ const { // C=US\nST=CA\nL=SF\nO=Joyent\nOU=Node.js\nCN=ca1\nemailAddress=ry@clouds.org function parseCertString(s) { const out = ObjectCreate(null); - for (const part of StringPrototypeSplit(s, '\n')) { + ArrayPrototypeForEach(StringPrototypeSplit(s, '\n'), (part) => { const sepIndex = StringPrototypeIndexOf(part, '='); if (sepIndex > 0) { const key = StringPrototypeSlice(part, 0, sepIndex); @@ -27,7 +28,7 @@ function parseCertString(s) { out[key] = value; } } - } + }); return out; } diff --git a/lib/tls.js b/lib/tls.js index 7ee9ae49f03a68..49c7d245171b10 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -24,6 +24,7 @@ const { Array, ArrayIsArray, + ArrayPrototypeForEach, ArrayPrototypeIncludes, ArrayPrototypeJoin, ArrayPrototypePush, @@ -31,6 +32,7 @@ const { ArrayPrototypeSome, ObjectDefineProperty, ObjectFreeze, + ReflectConstruct, RegExpPrototypeTest, StringFromCharCode, StringPrototypeCharCodeAt, @@ -214,7 +216,7 @@ function check(hostParts, pattern, wildcards) { if (patternParts.length <= 2) return false; - const [prefix, suffix] = patternSubdomainParts; + const { 0: prefix, 1: suffix } = patternSubdomainParts; if (prefix.length + suffix.length > hostSubdomain.length) return false; @@ -239,7 +241,8 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) { hostname = '' + hostname; if (altNames) { - for (const name of StringPrototypeSplit(altNames, ', ')) { + const splitAltNames = StringPrototypeSplit(altNames, ', '); + ArrayPrototypeForEach(splitAltNames, (name) => { if (StringPrototypeStartsWith(name, 'DNS:')) { ArrayPrototypePush(dnsNames, StringPrototypeSlice(name, 4)); } else if (StringPrototypeStartsWith(name, 'URI:')) { @@ -264,7 +267,7 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) { } else if (StringPrototypeStartsWith(name, 'IP Address:')) { ArrayPrototypePush(ips, canonicalizeIP(StringPrototypeSlice(name, 11))); } - } + }); } let valid = false; @@ -359,7 +362,7 @@ exports.connect = _tls_wrap.connect; exports.createSecurePair = internalUtil.deprecate( function createSecurePair(...args) { - return new SecurePair(...args); + return ReflectConstruct(SecurePair, args); }, 'tls.createSecurePair() is deprecated. Please use ' + 'tls.TLSSocket instead.', 'DEP0064'); From 1c9ec2529e845db52b3db9da913c20e60d28a6e4 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Thu, 7 Jan 2021 16:12:19 -0500 Subject: [PATCH 145/161] deps: upgrade npm to 7.4.0 PR-URL: https://github.com/nodejs/node/pull/36829 Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Myles Borins Reviewed-By: Gireesh Punathil --- deps/npm/AUTHORS | 5 + deps/npm/CHANGELOG.md | 46 ++ deps/npm/README.md | 2 +- deps/npm/docs/content/commands/npm-ls.md | 2 +- deps/npm/docs/content/using-npm/config.md | 12 + deps/npm/docs/output/commands/npm-ls.html | 4 +- deps/npm/docs/output/commands/npm.html | 2 +- deps/npm/docs/output/using-npm/config.html | 12 +- deps/npm/lib/ci.js | 40 +- deps/npm/lib/exec.js | 5 +- deps/npm/lib/publish.js | 12 +- deps/npm/lib/update.js | 2 +- deps/npm/lib/utils/config.js | 4 +- deps/npm/lib/utils/flat-options.js | 1 + deps/npm/man/man1/npm-access.1 | 2 +- deps/npm/man/man1/npm-adduser.1 | 2 +- deps/npm/man/man1/npm-audit.1 | 2 +- deps/npm/man/man1/npm-bin.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-ci.1 | 2 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 2 +- deps/npm/man/man1/npm-dedupe.1 | 2 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-dist-tag.1 | 2 +- deps/npm/man/man1/npm-docs.1 | 2 +- deps/npm/man/man1/npm-doctor.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-exec.1 | 2 +- deps/npm/man/man1/npm-explain.1 | 2 +- deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-fund.1 | 2 +- deps/npm/man/man1/npm-help-search.1 | 2 +- deps/npm/man/man1/npm-help.1 | 2 +- deps/npm/man/man1/npm-hook.1 | 2 +- deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-install-ci-test.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 2 +- deps/npm/man/man1/npm-install.1 | 2 +- deps/npm/man/man1/npm-link.1 | 2 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 6 +- deps/npm/man/man1/npm-org.1 | 2 +- deps/npm/man/man1/npm-outdated.1 | 2 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.1 | 2 +- deps/npm/man/man1/npm-ping.1 | 2 +- deps/npm/man/man1/npm-prefix.1 | 2 +- deps/npm/man/man1/npm-profile.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 2 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 2 +- deps/npm/man/man1/npm-search.1 | 2 +- deps/npm/man/man1/npm-set-script.1 | 2 +- deps/npm/man/man1/npm-shrinkwrap.1 | 2 +- deps/npm/man/man1/npm-star.1 | 2 +- deps/npm/man/man1/npm-stars.1 | 2 +- deps/npm/man/man1/npm-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-team.1 | 2 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-token.1 | 2 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 2 +- deps/npm/man/man1/npm-unstar.1 | 2 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man1/npx.1 | 2 +- deps/npm/man/man5/folders.5 | 2 +- deps/npm/man/man5/install.5 | 2 +- deps/npm/man/man5/npmrc.5 | 2 +- deps/npm/man/man5/package-json.5 | 2 +- deps/npm/man/man5/package-lock-json.5 | 2 +- deps/npm/man/man5/package-locks.5 | 2 +- deps/npm/man/man5/shrinkwrap-json.5 | 2 +- deps/npm/man/man7/config.7 | 17 +- deps/npm/man/man7/developers.7 | 2 +- deps/npm/man/man7/disputes.7 | 2 +- deps/npm/man/man7/orgs.7 | 2 +- deps/npm/man/man7/registry.7 | 2 +- deps/npm/man/man7/removal.7 | 2 +- deps/npm/man/man7/scope.7 | 2 +- deps/npm/man/man7/scripts.7 | 2 +- deps/npm/man/man7/semver.7 | 2 +- deps/npm/man/man7/workspaces.7 | 2 +- .../@npmcli/arborist/lib/arborist/rebuild.js | 45 +- .../@npmcli/arborist/lib/arborist/reify.js | 12 +- .../@npmcli/arborist/package.json | 5 +- deps/npm/node_modules/pacote/lib/fetcher.js | 13 +- deps/npm/node_modules/pacote/package.json | 4 +- deps/npm/node_modules/tar/README.md | 17 +- deps/npm/node_modules/tar/lib/create.js | 19 +- deps/npm/node_modules/tar/lib/extract.js | 20 +- deps/npm/node_modules/tar/lib/header.js | 26 +- .../node_modules/tar/lib/high-level-opt.js | 6 +- .../npm/node_modules/tar/lib/large-numbers.js | 30 +- deps/npm/node_modules/tar/lib/list.js | 21 +- deps/npm/node_modules/tar/lib/mkdir.js | 20 +- deps/npm/node_modules/tar/lib/mode-fix.js | 5 +- deps/npm/node_modules/tar/lib/pack.js | 24 +- deps/npm/node_modules/tar/lib/parse.js | 16 +- .../node_modules/tar/lib/path-reservations.js | 12 +- deps/npm/node_modules/tar/lib/pax.js | 12 +- deps/npm/node_modules/tar/lib/read-entry.js | 9 +- deps/npm/node_modules/tar/lib/replace.js | 33 +- deps/npm/node_modules/tar/lib/types.js | 2 +- deps/npm/node_modules/tar/lib/unpack.js | 44 +- deps/npm/node_modules/tar/lib/update.js | 2 +- deps/npm/node_modules/tar/lib/warn-mixin.js | 4 +- deps/npm/node_modules/tar/lib/winchars.js | 4 +- deps/npm/node_modules/tar/lib/write-entry.js | 33 +- deps/npm/node_modules/tar/package.json | 11 +- deps/npm/package.json | 8 +- .../test-lib-utils-config.js-TAP.test.js | 535 +----------------- ...test-lib-utils-flat-options.js-TAP.test.js | 1 + deps/npm/test/lib/birthday.js | 30 + deps/npm/test/lib/ci.js | 35 ++ deps/npm/test/lib/exec.js | 29 +- deps/npm/test/lib/install.js | 36 +- deps/npm/test/lib/publish.js | 6 +- deps/npm/test/lib/utils/config.js | 32 -- 129 files changed, 600 insertions(+), 889 deletions(-) diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 0d3cedb68c8695..ff19da4cf80a63 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -741,3 +741,8 @@ Daniel Fischer Yash-Singh1 Edu93Jer Tieg Zaharia +Aki <71239005+AkiaCode@users.noreply.github.com> +fuhao.xu +marsonya <16393876+marsonya@users.noreply.github.com> +Jeff Griffiths +Michael Garvin diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index accfdafe6643e4..6688fb0f5bd47b 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,49 @@ +## v7.4.0 (2021-01-07) + +### FEATURES + +* [`47ed2dfd8`](https://github.com/npm/cli/commit/47ed2dfd865566643bc1d39e8a4f98d2e1add99a) + [#2456](https://github.com/npm/cli/issues/2456) add + `--foreground-scripts` option ([@isaacs](https://github.com/isaacs)) + +### BUG FIXES + +* [`d01746a5a`](https://github.com/npm/cli/commit/d01746a5a6dde115ee6a600cdf54c9b35afcab3f) + [#2444](https://github.com/npm/cli/issues/2444) + [#1103](https://github.com/npm/cli/issues/1103) Remove deprecated + `process.umask()` ([@isaacs](https://github.com/isaacs)) +* [`b2e2edf8a`](https://github.com/npm/cli/commit/b2e2edf8aee57347c96a61209c7a10139a0cc85a) + [#2422](https://github.com/npm/cli/issues/2422) npm publish --dry-run + should not check login status ([@buyan302](https://github.com/buyan302)) +* [`99156df80`](https://github.com/npm/cli/commit/99156df8099f55bc69dfa99d7ddcf8d1d569016e) + [#2448](https://github.com/npm/cli/issues/2448) + [#2425](https://github.com/npm/cli/issues/2425) pass extra arguments + directly to run-script as an array ([@nlf](https://github.com/nlf)) +* [`907b34b2e`](https://github.com/npm/cli/commit/907b34b2ecc34ac376d989f824f7492064e43ef4) + [#2455](https://github.com/npm/cli/issues/2455) fix(ci): pay attention to + --ignore-scripts ([@wraithgar](https://github.com/wraithgar)) + +### DEPENDENCIES + +* [`7a49fd4af`](https://github.com/npm/cli/commit/7a49fd4afc8cd24db40aee008031ea648583d0bc) + `tar@6.1.0`, `pacote@11.1.14` +* [`54a7bd16c`](https://github.com/npm/cli/commit/54a7bd16c130525ade71ec9894af71c2825d8584) + `@npmcli/arborist@2.0.3` + +### DOCUMENTATION + +* [`a390d7456`](https://github.com/npm/cli/commit/a390d74561b72f0b13cba65844ce60c379198087) + [#2440](https://github.com/npm/cli/issues/2440) Updated the url for RFC + 19 so that it isn't a 404. + ([@therealjeffg](https://github.com/therealjeffg)) +* [`e02b46ad7`](https://github.com/npm/cli/commit/e02b46ad7acdeb9fbb63f782e546c2f8db94ae6e) + [#2436](https://github.com/npm/cli/issues/2436) Grammatical Fix in npm-ls + Documentation 'Therefore' is spelled 'Therefor' + ([@marsonya](https://github.com/marsonya)) +* [`0fed44dea`](https://github.com/npm/cli/commit/0fed44dea12f125b639b5e3575adcea74a86d3a0) + [#2417](https://github.com/npm/cli/issues/2417) Fix npm bug reporting url + ([@AkiaCode](https://github.com/AkiaCode)) + ## 7.3.0 (2020-12-18) ### FEATURES diff --git a/deps/npm/README.md b/deps/npm/README.md index 3366c4b271f739..794a24b6b15207 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -150,7 +150,7 @@ you should [read this](https://docs.npmjs.com/misc/developers). When you find issues, please report them: * web: - + * archived web: diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 54787bd6389c6c..7abdbf82a57129 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -62,7 +62,7 @@ this gets even more curious, as `peerDependencies` are logically physically at or above their location on disk. Also, in the years since npm got an `ls` command (in version 0.0.2!), -dependency graphs have gotten much larger as a general rule. Therefor, in +dependency graphs have gotten much larger as a general rule. Therefore, in order to avoid dumping an excessive amount of content to the terminal, `npm ls` now only shows the _top_ level dependencies, unless `--all` is provided. diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 2d9a4f8698a98a..3a2517d34ef9a8 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -419,6 +419,18 @@ mistakes, unnecessary performance degradation, and malicious input. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +#### foreground-scripts + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much +noisier, but can be useful for debugging. + #### format-package-lock * Default: true diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 1348f9c4ba6094..b3991e6400e862 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -159,7 +159,7 @@

Description

the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm’s source tree will show:

-
npm@7.3.0 /path/to/npm
+
npm@7.4.0 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 
@@ -185,7 +185,7 @@

Note: Design Changes Pending

“underneath” their dependents in the dependency graph, but are always physically at or above their location on disk.

Also, in the years since npm got an ls command (in version 0.0.2!), -dependency graphs have gotten much larger as a general rule. Therefor, in +dependency graphs have gotten much larger as a general rule. Therefore, in order to avoid dumping an excessive amount of content to the terminal, npm ls now only shows the top level dependencies, unless --all is provided.

A thorough re-examination of the use cases, intention, behavior, and output diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 6e9e2a618f154e..de9bf85161d1e0 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -148,7 +148,7 @@

Table of contents

npm <command> [args]
 

Version

-

7.3.0

+

7.4.0

Description

npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index ad9c8c44a1fc0b..97a554adbd00e6 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -141,7 +141,7 @@

config

Table of contents

- +

Description

@@ -488,6 +488,16 @@

force

If you don’t have a clear idea of what you want to do, it is strongly recommended that you do not use this option!

+

foreground-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

+

Note that this will generally make installs run slower, and be much +noisier, but can be useful for debugging.

format-package-lock

  • Default: true
  • diff --git a/deps/npm/lib/ci.js b/deps/npm/lib/ci.js index 2917899c82551d..89c6b8f4207428 100644 --- a/deps/npm/lib/ci.js +++ b/deps/npm/lib/ci.js @@ -21,7 +21,7 @@ const ci = async () => { } const where = npm.prefix - const { scriptShell } = npm.flatOptions + const { scriptShell, ignoreScripts } = npm.flatOptions const arb = new Arborist({ ...npm.flatOptions, path: where }) await Promise.all([ @@ -39,24 +39,26 @@ const ci = async () => { await arb.reify({ ...npm.flatOptions, save: false }) // run the same set of scripts that `npm install` runs. - const scripts = [ - 'preinstall', - 'install', - 'postinstall', - 'prepublish', // XXX should we remove this finally?? - 'preprepare', - 'prepare', - 'postprepare', - ] - for (const event of scripts) { - await runScript({ - path: where, - args: [], - scriptShell, - stdio: 'inherit', - stdioString: true, - event, - }) + if (!ignoreScripts) { + const scripts = [ + 'preinstall', + 'install', + 'postinstall', + 'prepublish', // XXX should we remove this finally?? + 'preprepare', + 'prepare', + 'postprepare', + ] + for (const event of scripts) { + await runScript({ + path: where, + args: [], + scriptShell, + stdio: 'inherit', + stdioString: true, + event, + }) + } } await reifyFinish(arb) } diff --git a/deps/npm/lib/exec.js b/deps/npm/lib/exec.js index d4bcac0252b2dd..d36dd87cfb9712 100644 --- a/deps/npm/lib/exec.js +++ b/deps/npm/lib/exec.js @@ -67,7 +67,7 @@ const cmd = (args, cb) => exec(args).then(() => cb()).catch(cb) const run = async ({ args, call, pathArr, shell }) => { // turn list of args into command string - const script = call || args.join(' ').trim() || shell + const script = call || args.shift() || shell // do the fakey runScript dance // still should work if no package.json in cwd @@ -98,6 +98,7 @@ const run = async ({ args, call, pathArr, shell }) => { path: process.cwd(), stdioString: true, event: 'npx', + args, env: { PATH: pathArr.join(delimiter), }, @@ -144,7 +145,7 @@ const exec = async args => { if (binExists) { return await run({ args, - call: [args[0], ...args.slice(1)].join(' ').trim(), + call, pathArr, shell, }) diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index 0a4123303e6be5..8ef7eff4c8a64d 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -43,11 +43,13 @@ const publish = async args => { }) } - const creds = npm.config.getCredentialsByURI(registry) - if (!creds.token && !creds.username) { - throw Object.assign(new Error('This command requires you to be logged in.'), { - code: 'ENEEDAUTH', - }) + if (!opts.dryRun) { + const creds = npm.config.getCredentialsByURI(registry) + if (!creds.token && !creds.username) { + throw Object.assign(new Error('This command requires you to be logged in.'), { + code: 'ENEEDAUTH', + }) + } } if (semver.validRange(defaultTag)) diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index bbc6732dba6d0d..6eaa085b8766dc 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -24,7 +24,7 @@ const update = async args => { if (npm.flatOptions.depth) { log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' + - 'https://github.com/npm/rfcs/blob/latest/accepted/0019-remove-update-depth-option.md') + 'https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md') } const arb = new Arborist({ diff --git a/deps/npm/lib/utils/config.js b/deps/npm/lib/utils/config.js index 2b6b96e5c81900..511215769893e3 100644 --- a/deps/npm/lib/utils/config.js +++ b/deps/npm/lib/utils/config.js @@ -83,6 +83,7 @@ const defaults = { 'fetch-retry-mintimeout': 10000, 'fetch-timeout': 5 * 60 * 1000, force: false, + 'foreground-script': false, 'format-package-lock': true, fund: true, git: 'git', @@ -170,7 +171,7 @@ const defaults = { 'tag-version-prefix': 'v', timing: false, tmp: tmpdir(), - umask: process.umask ? process.umask() : 0o22, + umask: 0, unicode, 'update-notifier': true, usage: false, @@ -224,6 +225,7 @@ const types = { 'fetch-retry-mintimeout': Number, 'fetch-timeout': Number, force: Boolean, + 'foreground-script': Boolean, 'format-package-lock': Boolean, fund: Boolean, git: String, diff --git a/deps/npm/lib/utils/flat-options.js b/deps/npm/lib/utils/flat-options.js index 828481930369c1..a161ff2e6a70fa 100644 --- a/deps/npm/lib/utils/flat-options.js +++ b/deps/npm/lib/utils/flat-options.js @@ -133,6 +133,7 @@ const flatten = obj => ({ packageLockOnly: obj['package-lock-only'], globalStyle: obj['global-style'], legacyBundling: obj['legacy-bundling'], + foregroundScripts: !!obj['foreground-scripts'], scriptShell: obj['script-shell'] || undefined, shell: obj.shell, omit: buildOmitList(obj), diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 9d7e11f24ea024..173e6b1cfd1001 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "December 2020" "" "" +.TH "NPM\-ACCESS" "1" "January 2021" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 2ca265c5388954..dd8fb918e1b3c7 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "December 2020" "" "" +.TH "NPM\-ADDUSER" "1" "January 2021" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SS Synopsis diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index a7ec23cf49fb68..03f3c3f2bccb95 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-AUDIT" "1" "December 2020" "" "" +.TH "NPM\-AUDIT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-audit\fR \- Run a security audit .SS Synopsis diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 36c609858c3811..771197e4b14fcc 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "December 2020" "" "" +.TH "NPM\-BIN" "1" "January 2021" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 4abbb02740825c..3318f3a4bf7532 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "December 2020" "" "" +.TH "NPM\-BUGS" "1" "January 2021" "" "" .SH "NAME" \fBnpm-bugs\fR \- Report bugs for a package in a web browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 09f9b1c225b899..eb65d7c37290ec 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "December 2020" "" "" +.TH "NPM\-CACHE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SS Synopsis diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index fee1a3a78871e4..e7092af6f34758 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CI" "1" "December 2020" "" "" +.TH "NPM\-CI" "1" "January 2021" "" "" .SH "NAME" \fBnpm-ci\fR \- Install a project with a clean slate .SS Synopsis diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 26ca627f899c15..6842e6aa08188c 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "December 2020" "" "" +.TH "NPM\-COMPLETION" "1" "January 2021" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index eb2d8bfead011e..cf6114cd93e495 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "December 2020" "" "" +.TH "NPM\-CONFIG" "1" "January 2021" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SS Synopsis diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 5e4ef93d9030c6..fe5ed775b45c53 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "December 2020" "" "" +.TH "NPM\-DEDUPE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SS Synopsis diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 303e7edfec1688..81e16e669350e0 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "December 2020" "" "" +.TH "NPM\-DEPRECATE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index bc70f7dc80bfc6..4729a069d0a057 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "December 2020" "" "" +.TH "NPM\-DIST\-TAG" "1" "January 2021" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SS Synopsis diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index a53481b7ba7168..5bedabb0aecc90 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "December 2020" "" "" +.TH "NPM\-DOCS" "1" "January 2021" "" "" .SH "NAME" \fBnpm-docs\fR \- Open documentation for a package in a web browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index 96772d5c7e2706..dda1886ebeb757 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCTOR" "1" "December 2020" "" "" +.TH "NPM\-DOCTOR" "1" "January 2021" "" "" .SH "NAME" \fBnpm-doctor\fR \- Check your npm environment .SS Synopsis diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 14e28635a91b42..844e2ee7d0302f 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "December 2020" "" "" +.TH "NPM\-EDIT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 5628bda39d4143..a4c45df72e8b27 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXEC" "1" "December 2020" "" "" +.TH "NPM\-EXEC" "1" "January 2021" "" "" .SH "NAME" \fBnpm-exec\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index 17d8b35a2da796..05def6f9953406 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLAIN" "1" "December 2020" "" "" +.TH "NPM\-EXPLAIN" "1" "January 2021" "" "" .SH "NAME" \fBnpm-explain\fR \- Explain installed packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 1d58315a08708e..75e19e0ccfb79b 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "December 2020" "" "" +.TH "NPM\-EXPLORE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index 25871805d9aea1..5ecc397d5d3129 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -1,4 +1,4 @@ -.TH "NPM\-FUND" "1" "December 2020" "" "" +.TH "NPM\-FUND" "1" "January 2021" "" "" .SH "NAME" \fBnpm-fund\fR \- Retrieve funding information .SS Synopsis diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 737aab6e131113..0fb25c5afeb018 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "December 2020" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "January 2021" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SS Synopsis diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index ef5f950c95f90d..01151c5d9ca768 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "December 2020" "" "" +.TH "NPM\-HELP" "1" "January 2021" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index c3ed5ac6c043b1..d7715658890357 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HOOK" "1" "December 2020" "" "" +.TH "NPM\-HOOK" "1" "January 2021" "" "" .SH "NAME" \fBnpm-hook\fR \- Manage registry hooks .SS Synopsis diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index bf0b98145a214b..05dbd6d80a6110 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "December 2020" "" "" +.TH "NPM\-INIT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-init\fR \- create a package\.json file .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index 48e2956f3ff941..bc0ec6ef2fd0c6 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-CI\-TEST" "1" "December 2020" "" "" +.TH "NPM\-INSTALL\-CI\-TEST" "1" "January 2021" "" "" .SH "NAME" \fBnpm-install-ci-test\fR \- Install a project with a clean slate and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index e9bd0501e75187..73fccaf4154e38 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-TEST" "1" "December 2020" "" "" +.TH "NPM\-INSTALL\-TEST" "1" "January 2021" "" "" .SH "NAME" \fBnpm-install-test\fR \- Install package(s) and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 95ab212127ebe7..b0f567e254a19b 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "December 2020" "" "" +.TH "NPM\-INSTALL" "1" "January 2021" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 4d055aab4f1a70..881ee1f87fb089 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "December 2020" "" "" +.TH "NPM\-LINK" "1" "January 2021" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 5fd41d2ced4777..c0bbf0e803b1a3 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "December 2020" "" "" +.TH "NPM\-LOGOUT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index f0ac3f7b6cbddb..94df47109a032e 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "December 2020" "" "" +.TH "NPM\-LS" "1" "January 2021" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SS Synopsis @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@7\.3\.0 /path/to/npm +npm@7\.4\.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi @@ -61,7 +61,7 @@ this gets even more curious, as \fBpeerDependencies\fP are logically physically at or above their location on disk\. .P Also, in the years since npm got an \fBls\fP command (in version 0\.0\.2!), -dependency graphs have gotten much larger as a general rule\. Therefor, in +dependency graphs have gotten much larger as a general rule\. Therefore, in order to avoid dumping an excessive amount of content to the terminal, \fBnpm ls\fP now only shows the \fItop\fR level dependencies, unless \fB\-\-all\fP is provided\. diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index c0e0a34972f5ec..a25119964ae99f 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ORG" "1" "December 2020" "" "" +.TH "NPM\-ORG" "1" "January 2021" "" "" .SH "NAME" \fBnpm-org\fR \- Manage orgs .SS Synopsis diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 72f60b816786aa..a9e59718c243e6 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "December 2020" "" "" +.TH "NPM\-OUTDATED" "1" "January 2021" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 55b7580b94edf9..f7709d7c27ba48 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "December 2020" "" "" +.TH "NPM\-OWNER" "1" "January 2021" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SS Synopsis diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index d6fbeef43eb678..08445b378405b5 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "December 2020" "" "" +.TH "NPM\-PACK" "1" "January 2021" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 95caf91ba5c414..e0277ea3f1bfae 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "December 2020" "" "" +.TH "NPM\-PING" "1" "January 2021" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 6d569b40f30640..cc1e99d664e124 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "December 2020" "" "" +.TH "NPM\-PREFIX" "1" "January 2021" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SS Synopsis diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 906ce6f9a08fe1..0b6116664d98ca 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "December 2020" "" "" +.TH "NPM\-PROFILE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SS Synopsis diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 0e56bdfa73d458..20b229b52ac7a5 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "December 2020" "" "" +.TH "NPM\-PRUNE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 2ade35c42e411a..c6fafeca620642 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "December 2020" "" "" +.TH "NPM\-PUBLISH" "1" "January 2021" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index d7fff484e3a546..75a132f16a1674 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "December 2020" "" "" +.TH "NPM\-REBUILD" "1" "January 2021" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index fce87ad18e580d..5f95ca52ee3200 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "December 2020" "" "" +.TH "NPM\-REPO" "1" "January 2021" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 60e00a33d51b29..2663343dc1eb8e 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "December 2020" "" "" +.TH "NPM\-RESTART" "1" "January 2021" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index e1ba4ef6caaf5c..dc36c04e495c29 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "December 2020" "" "" +.TH "NPM\-ROOT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SS Synopsis diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 308e4498a8d175..12d53610de0fbd 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "December 2020" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SS Synopsis diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index d597664d37db75..061bdc5458e20c 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "December 2020" "" "" +.TH "NPM\-SEARCH" "1" "January 2021" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-set-script.1 b/deps/npm/man/man1/npm-set-script.1 index 97979b100a937a..cbadcbe53100ec 100644 --- a/deps/npm/man/man1/npm-set-script.1 +++ b/deps/npm/man/man1/npm-set-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SET\-SCRIPT" "1" "December 2020" "" "" +.TH "NPM\-SET\-SCRIPT" "1" "January 2021" "" "" .SH "NAME" \fBnpm-set-script\fR \- Set tasks in the scripts section of package\.json .SS Synopsis diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 71f8c4bd9188d4..73ef9c3ce307ed 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "December 2020" "" "" +.TH "NPM\-SHRINKWRAP" "1" "January 2021" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SS Synopsis diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 412283276b8c55..914b98c81a9de4 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "December 2020" "" "" +.TH "NPM\-STAR" "1" "January 2021" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index bb620239917412..48f404639c7b23 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "December 2020" "" "" +.TH "NPM\-STARS" "1" "January 2021" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SS Synopsis diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index fecca5eb0841bf..44bf825b2d6d88 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "December 2020" "" "" +.TH "NPM\-START" "1" "January 2021" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 2653090795adc8..9ca8142296a454 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "December 2020" "" "" +.TH "NPM\-STOP" "1" "January 2021" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 0df7c41164899c..bb3bc1d5d006ca 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "December 2020" "" "" +.TH "NPM\-TEAM" "1" "January 2021" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SS Synopsis diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index fa5bf03c36bf04..5844149a7306f9 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "December 2020" "" "" +.TH "NPM\-TEST" "1" "January 2021" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index b67902828222e3..86ba1819106808 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "December 2020" "" "" +.TH "NPM\-TOKEN" "1" "January 2021" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SS Synopsis diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index d098c88415d57a..f341264506be1c 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "December 2020" "" "" +.TH "NPM\-UNINSTALL" "1" "January 2021" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 0c7d946a4da332..7c965107871bae 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "December 2020" "" "" +.TH "NPM\-UNPUBLISH" "1" "January 2021" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index d3115ff7ab57c9..70df2998f8825b 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNSTAR" "1" "December 2020" "" "" +.TH "NPM\-UNSTAR" "1" "January 2021" "" "" .SH "NAME" \fBnpm-unstar\fR \- Remove an item from your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 2df28cd28e24eb..7eee932e92c5b0 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "December 2020" "" "" +.TH "NPM\-UPDATE" "1" "January 2021" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index f6df51bfba9597..aa3a5f1c1ba320 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "December 2020" "" "" +.TH "NPM\-VERSION" "1" "January 2021" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SS Synopsis diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 7334357ccfd685..ea6c1ec5db4f6b 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "December 2020" "" "" +.TH "NPM\-VIEW" "1" "January 2021" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SS Synopsis diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index 73de7540360b63..dc944670c188e0 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "December 2020" "" "" +.TH "NPM\-WHOAMI" "1" "January 2021" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SS Synopsis diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 68e6ace0478cf9..73b67d8a52cdba 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "December 2020" "" "" +.TH "NPM" "1" "January 2021" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SS Synopsis @@ -10,7 +10,7 @@ npm [args] .RE .SS Version .P -7\.3\.0 +7\.4\.0 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index c11f9600e16da2..a6535f3e54680a 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "December 2020" "" "" +.TH "NPX" "1" "January 2021" "" "" .SH "NAME" \fBnpx\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index 6d838019c6ce8f..8ba0a19d9d33a0 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "December 2020" "" "" +.TH "FOLDERS" "5" "January 2021" "" "" .SH "NAME" \fBfolders\fR \- Folder Structures Used by npm .SS Description diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index e827d11bdb9aea..4aa76d059bf8f4 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "December 2020" "" "" +.TH "INSTALL" "5" "January 2021" "" "" .SH "NAME" \fBinstall\fR \- Download and install node and npm .SS Description diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index ea60e39a2494b9..877c2175a486a8 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "December 2020" "" "" +.TH "NPMRC" "5" "January 2021" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SS Description diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index 5b8b5037634bd9..17946fd18fb559 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "December 2020" "" "" +.TH "PACKAGE\.JSON" "5" "January 2021" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SS Description diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 77d8ab1c3eefaf..4c69eefe99ef0a 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "December 2020" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "January 2021" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SS Description diff --git a/deps/npm/man/man5/package-locks.5 b/deps/npm/man/man5/package-locks.5 index 0fc35cfb5a0298..c71959c743fa77 100644 --- a/deps/npm/man/man5/package-locks.5 +++ b/deps/npm/man/man5/package-locks.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCKS" "5" "December 2020" "" "" +.TH "PACKAGE\-LOCKS" "5" "January 2021" "" "" .SH "NAME" \fBpackage-locks\fR \- An explanation of npm lockfiles .SS Description diff --git a/deps/npm/man/man5/shrinkwrap-json.5 b/deps/npm/man/man5/shrinkwrap-json.5 index 7457df20e4bf32..606b2179a10a40 100644 --- a/deps/npm/man/man5/shrinkwrap-json.5 +++ b/deps/npm/man/man5/shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "SHRINKWRAP\.JSON" "5" "December 2020" "" "" +.TH "SHRINKWRAP\.JSON" "5" "January 2021" "" "" .SH "NAME" \fBshrinkwrap.json\fR \- A publishable lockfile .SS Description diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index a23a78b24722cf..c6235e825d08bc 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "December 2020" "" "" +.TH "CONFIG" "7" "January 2021" "" "" .SH "NAME" \fBconfig\fR \- More than you probably want to know about npm configuration .SS Description @@ -557,6 +557,21 @@ Allow unpublishing all versions of a published package\. .P If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! +.SS foreground\-scripts +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Run all build scripts (ie, \fBpreinstall\fP, \fBinstall\fP, and \fBpostinstall\fP) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process\. +.P +Note that this will generally make installs run slower, and be much +noisier, but can be useful for debugging\. .SS format\-package\-lock .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index e24b78cff7ba9a..fbe0a455020d74 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "December 2020" "" "" +.TH "DEVELOPERS" "7" "January 2021" "" "" .SH "NAME" \fBdevelopers\fR \- Developer Guide .SS Description diff --git a/deps/npm/man/man7/disputes.7 b/deps/npm/man/man7/disputes.7 index 8e955059910560..8ef02443c9c9bd 100644 --- a/deps/npm/man/man7/disputes.7 +++ b/deps/npm/man/man7/disputes.7 @@ -1,4 +1,4 @@ -.TH "DISPUTES" "7" "December 2020" "" "" +.TH "DISPUTES" "7" "January 2021" "" "" .SH "NAME" \fBdisputes\fR \- Handling Module Name Disputes .P diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index d496e4d4a9446e..b2be9c387f6dc2 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "December 2020" "" "" +.TH "ORGS" "7" "January 2021" "" "" .SH "NAME" \fBorgs\fR \- Working with Teams & Orgs .SS Description diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index cf6b02faeb9643..c72c1168ff4ff9 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "December 2020" "" "" +.TH "REGISTRY" "7" "January 2021" "" "" .SH "NAME" \fBregistry\fR \- The JavaScript Package Registry .SS Description diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index 24f08abfff760d..3f6d0187c87459 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "December 2020" "" "" +.TH "REMOVAL" "7" "January 2021" "" "" .SH "NAME" \fBremoval\fR \- Cleaning the Slate .SS Synopsis diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index 534b064c89b13d..fcbff4d89247c3 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "December 2020" "" "" +.TH "SCOPE" "7" "January 2021" "" "" .SH "NAME" \fBscope\fR \- Scoped packages .SS Description diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index b062f4ea1cda4d..b00c208140b07f 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "December 2020" "" "" +.TH "SCRIPTS" "7" "January 2021" "" "" .SH "NAME" \fBscripts\fR \- How npm handles the "scripts" field .SS Description diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index 0a08bf9abb3eed..1a271545d1e18a 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "December 2020" "" "" +.TH "SEMVER" "7" "January 2021" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Install diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index ade7d238bd616a..c2b3e30e539c35 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "December 2020" "" "" +.TH "WORKSPACES" "7" "January 2021" "" "" .SH "NAME" \fBworkspaces\fR \- Working with workspaces .SS Description diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js index f4f3ca12b70117..9c52d009d6fd8d 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -49,6 +49,7 @@ module.exports = cls => class Builder extends cls { rebuildBundle = true, } = options + this.scriptsRun = new Set() this[_binLinks] = binLinks this[_ignoreScripts] = !!ignoreScripts this[_scriptShell] = scriptShell @@ -241,6 +242,8 @@ module.exports = cls => class Builder extends cls { return process.emit('time', `build:run:${event}`) + const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe' + const limit = this.options.foregroundScripts ? 1 : undefined await promiseCallLimit(queue.map(node => async () => { const { path, @@ -261,27 +264,41 @@ module.exports = cls => class Builder extends cls { const timer = `build:run:${event}:${location}` process.emit('time', timer) this.log.info('run', pkg._id, event, location, pkg.scripts[event]) - const p = runScript({ + const env = { + npm_package_resolved: resolved, + npm_package_integrity: integrity, + npm_package_json: resolve(path, 'package.json'), + npm_package_optional: boolEnv(optional), + npm_package_dev: boolEnv(dev), + npm_package_peer: boolEnv(peer), + npm_package_dev_optional: + boolEnv(devOptional && !dev && !optional), + } + const runOpts = { event, path, pkg, stdioString: true, - env: { - npm_package_resolved: resolved, - npm_package_integrity: integrity, - npm_package_json: resolve(path, 'package.json'), - npm_package_optional: boolEnv(optional), - npm_package_dev: boolEnv(dev), - npm_package_peer: boolEnv(peer), - npm_package_dev_optional: - boolEnv(devOptional && !dev && !optional), - }, + stdio, + env, scriptShell: this[_scriptShell], - }).catch(er => { + } + const p = runScript(runOpts).catch(er => { const { code, signal } = er this.log.info('run', pkg._id, event, {code, signal}) throw er - }).then(({code, signal}) => { + }).then(({args, code, signal, stdout, stderr}) => { + this.scriptsRun.add({ + pkg, + path, + event, + cmd: args && args[args.length - 1], + env, + code, + signal, + stdout, + stderr, + }) this.log.info('run', pkg._id, event, {code, signal}) }) @@ -290,7 +307,7 @@ module.exports = cls => class Builder extends cls { : p) process.emit('timeEnd', timer) - })) + }), limit) process.emit('timeEnd', `build:run:${event}`) } diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js index 1f979ba1402c3e..661d879eb19e64 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -66,6 +66,7 @@ const _copyIdealToActual = Symbol('copyIdealToActual') const _addOmitsToTrashList = Symbol('addOmitsToTrashList') const _packageLockOnly = Symbol('packageLockOnly') const _dryRun = Symbol('dryRun') +const _validatePath = Symbol('validatePath') const _reifyPackages = Symbol('reifyPackages') const _omitDev = Symbol('omitDev') @@ -120,7 +121,8 @@ module.exports = cls => class Reifier extends cls { // start tracker block this.addTracker('reify') process.emit('time', 'reify') - await this[_loadTrees](options) + await this[_validatePath]() + .then(() => this[_loadTrees](options)) .then(() => this[_diffTrees]()) .then(() => this[_reifyPackages]()) .then(() => this[_saveIdealTree](options)) @@ -132,6 +134,14 @@ module.exports = cls => class Reifier extends cls { return treeCheck(this.actualTree) } + async [_validatePath] () { + // don't create missing dirs on dry runs + if (this[_packageLockOnly] || this[_dryRun] || this[_global]) + return + + await mkdirp(resolve(this.path)) + } + async [_reifyPackages] () { // we don't submit the audit report or write to disk on dry runs if (this[_dryRun]) diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index b8b27c29fdf3c2..6300a5e867d4cd 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "2.0.2", + "version": "2.0.3", "description": "Manage node_modules trees", "dependencies": { "@npmcli/installed-package-contents": "^1.0.5", @@ -19,13 +19,14 @@ "npm-install-checks": "^4.0.0", "npm-package-arg": "^8.1.0", "npm-pick-manifest": "^6.1.0", - "pacote": "^11.1.13", + "pacote": "^11.1.14", "parse-conflict-json": "^1.1.1", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.1", "read-package-json-fast": "^1.2.1", "readdir-scoped-modules": "^1.1.0", "semver": "^7.3.4", + "tar": "^6.1.0", "treeverse": "^1.0.4", "walk-up-path": "^1.0.0" }, diff --git a/deps/npm/node_modules/pacote/lib/fetcher.js b/deps/npm/node_modules/pacote/lib/fetcher.js index 5142bb280a70c7..33fbf79c61b60f 100644 --- a/deps/npm/node_modules/pacote/lib/fetcher.js +++ b/deps/npm/node_modules/pacote/lib/fetcher.js @@ -75,7 +75,12 @@ class FetcherBase { this.type = this.constructor.name this.fmode = opts.fmode || 0o666 this.dmode = opts.dmode || 0o777 - this.umask = opts.umask || 0o022 + // we don't need a default umask, because we don't chmod files coming + // out of package tarballs. they're forced to have a mode that is + // valid, regardless of what's in the tarball entry, and then we let + // the process's umask setting do its job. but if configured, we do + // respect it. + this.umask = opts.umask || 0 this.log = opts.log || procLog this.preferOnline = !!opts.preferOnline @@ -290,7 +295,7 @@ class FetcherBase { return cacache.rm.content(this.cache, this.integrity, this.opts) } - [_chown] (path, uid, gid) { + async [_chown] (path, uid, gid) { return selfOwner && (selfOwner.gid !== gid || selfOwner.uid !== uid) ? chownr(path, uid, gid) : /* istanbul ignore next - we don't test in root-owned folders */ null @@ -388,13 +393,15 @@ class FetcherBase { // make sure package bins are executable const exe = isPackageBin(this.package, path) ? 0o111 : 0 - return ((mode | m) & ~this.umask) | exe + // always ensure that files are read/writable by the owner + return ((mode | m) & ~this.umask) | exe | 0o600 } [_tarxOptions] ({ cwd, uid, gid }) { const sawIgnores = new Set() return { cwd, + noChmod: true, filter: (name, entry) => { if (/Link$/.test(entry.type)) return false diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index bef19b66228a66..085e8f66af175f 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "11.1.13", + "version": "11.1.14", "description": "JavaScript package downloader", "author": "Isaac Z. Schlueter (https://izs.me)", "bin": { @@ -54,7 +54,7 @@ "read-package-json-fast": "^1.1.3", "rimraf": "^3.0.2", "ssri": "^8.0.0", - "tar": "^6.0.1" + "tar": "^6.1.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/tar/README.md b/deps/npm/node_modules/tar/README.md index 1d6969405272c1..42afb1aa7d1ade 100644 --- a/deps/npm/node_modules/tar/README.md +++ b/deps/npm/node_modules/tar/README.md @@ -1,7 +1,5 @@ # node-tar -[![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar) - [Fast](./benchmarks) and full-featured Tar for Node.js The API is designed to mimic the behavior of `tar(1)` on unix systems. @@ -304,7 +302,6 @@ The following options are supported: - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. - The following options are mostly internal, but can be modified in some advanced use cases, such as re-using caches between runs. @@ -398,6 +395,13 @@ The following options are supported: the `filter` option described above.) - `onentry` A function that gets called with `(entry)` for each entry that passes the filter. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") +- `noChmod` Set to true to omit calling `fs.chmod()` to ensure that the + extracted file matches the entry mode. This also suppresses the call to + `process.umask()` to determine the default umask value, since tar will + extract with whatever mode is provided, and let the process `umask` apply + normally. The following options are mostly internal, but can be modified in some advanced use cases, such as re-using caches between runs. @@ -453,6 +457,8 @@ The following options are supported: the call to `onentry`. Set `noResume: true` to suppress this behavior. Note that by opting into this, the stream will never complete until the entry data is consumed. +- `onwarn` A function that will get called with `(code, message, data)` for + any warnings encountered. (See "Warnings and Errors") ### tar.u(options, fileList, callback) [alias: tar.update] @@ -710,6 +716,11 @@ Most unpack errors will cause a `warn` event to be emitted. If the that passes the filter. - `onwarn` A function that will get called with `(code, message, data)` for any warnings encountered. (See "Warnings and Errors") +- `noChmod` Set to true to omit calling `fs.chmod()` to ensure that the + extracted file matches the entry mode. This also suppresses the call to + `process.umask()` to determine the default umask value, since tar will + extract with whatever mode is provided, and let the process `umask` apply + normally. ### class tar.Unpack.Sync diff --git a/deps/npm/node_modules/tar/lib/create.js b/deps/npm/node_modules/tar/lib/create.js index a37aa52e6d4c08..d033640ac3b6c8 100644 --- a/deps/npm/node_modules/tar/lib/create.js +++ b/deps/npm/node_modules/tar/lib/create.js @@ -4,12 +4,11 @@ const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') -const fs = require('fs') const fsm = require('fs-minipass') const t = require('./list.js') const path = require('path') -const c = module.exports = (opt_, files, cb) => { +module.exports = (opt_, files, cb) => { if (typeof files === 'function') cb = files @@ -38,7 +37,7 @@ const c = module.exports = (opt_, files, cb) => { const createFileSync = (opt, files) => { const p = new Pack.Sync(opt) const stream = new fsm.WriteStreamSync(opt.file, { - mode: opt.mode || 0o666 + mode: opt.mode || 0o666, }) p.pipe(stream) addFilesSync(p, files) @@ -47,7 +46,7 @@ const createFileSync = (opt, files) => { const createFile = (opt, files, cb) => { const p = new Pack(opt) const stream = new fsm.WriteStream(opt.file, { - mode: opt.mode || 0o666 + mode: opt.mode || 0o666, }) p.pipe(stream) @@ -64,14 +63,14 @@ const createFile = (opt, files, cb) => { const addFilesSync = (p, files) => { files.forEach(file => { - if (file.charAt(0) === '@') + if (file.charAt(0) === '@') { t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, - onentry: entry => p.add(entry) + onentry: entry => p.add(entry), }) - else + } else p.add(file) }) p.end() @@ -80,13 +79,13 @@ const addFilesSync = (p, files) => { const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() - if (file.charAt(0) === '@') + if (file.charAt(0) === '@') { return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, - onentry: entry => p.add(entry) + onentry: entry => p.add(entry), }).then(_ => addFilesAsync(p, files)) - else + } else p.add(file) } p.end() diff --git a/deps/npm/node_modules/tar/lib/extract.js b/deps/npm/node_modules/tar/lib/extract.js index cbb458a0a41e1b..f269145edef7ad 100644 --- a/deps/npm/node_modules/tar/lib/extract.js +++ b/deps/npm/node_modules/tar/lib/extract.js @@ -7,7 +7,7 @@ const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') -const x = module.exports = (opt_, files, cb) => { +module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) @@ -63,22 +63,20 @@ const extractFileSync = opt => { const u = new Unpack.Sync(opt) const file = opt.file - let threw = true - let fd const stat = fs.statSync(file) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation - const readSize = opt.maxReadSize || 16*1024*1024 + const readSize = opt.maxReadSize || 16 * 1024 * 1024 const stream = new fsm.ReadStreamSync(file, { readSize: readSize, - size: stat.size + size: stat.size, }) stream.pipe(u) } const extractFile = (opt, cb) => { const u = new Unpack(opt) - const readSize = opt.maxReadSize || 16*1024*1024 + const readSize = opt.maxReadSize || 16 * 1024 * 1024 const file = opt.file const p = new Promise((resolve, reject) => { @@ -93,7 +91,7 @@ const extractFile = (opt, cb) => { else { const stream = new fsm.ReadStream(file, { readSize: readSize, - size: stat.size + size: stat.size, }) stream.on('error', reject) stream.pipe(u) @@ -103,10 +101,6 @@ const extractFile = (opt, cb) => { return cb ? p.then(cb, cb) : p } -const extractSync = opt => { - return new Unpack.Sync(opt) -} +const extractSync = opt => new Unpack.Sync(opt) -const extract = opt => { - return new Unpack(opt) -} +const extract = opt => new Unpack(opt) diff --git a/deps/npm/node_modules/tar/lib/header.js b/deps/npm/node_modules/tar/lib/header.js index 5d88f6cf8268f6..129504048dfab3 100644 --- a/deps/npm/node_modules/tar/lib/header.js +++ b/deps/npm/node_modules/tar/lib/header.js @@ -95,19 +95,19 @@ class Header { } let sum = 8 * 0x20 - for (let i = off; i < off + 148; i++) { + for (let i = off; i < off + 148; i++) sum += buf[i] - } - for (let i = off + 156; i < off + 512; i++) { + + for (let i = off + 156; i < off + 512; i++) sum += buf[i] - } + this.cksumValid = sum === this.cksum if (this.cksum === null && sum === 8 * 0x20) this.nullBlock = true } [SLURP] (ex, global) { - for (let k in ex) { + for (const k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && @@ -157,12 +157,12 @@ class Header { } let sum = 8 * 0x20 - for (let i = off; i < off + 148; i++) { + for (let i = off; i < off + 148; i++) sum += buf[i] - } - for (let i = off + 156; i < off + 512; i++) { + + for (let i = off + 156; i < off + 512; i++) sum += buf[i] - } + this.cksum = sum encNumber(buf, off + 148, 8, this.cksum) this.cksumValid = true @@ -171,7 +171,7 @@ class Header { } set (data) { - for (let i in data) { + for (const i in data) { if (data[i] !== null && data[i] !== undefined) this[i] = data[i] } @@ -242,7 +242,7 @@ const numToDate = num => num === null ? null : new Date(num * 1000) const decNumber = (buf, off, size) => buf[off] & 0x80 ? large.parse(buf.slice(off, off + size)) - : decSmallNumber(buf, off, size) + : decSmallNumber(buf, off, size) const nanNull = value => isNaN(value) ? null : value @@ -254,7 +254,7 @@ const decSmallNumber = (buf, off, size) => // the maximum encodable as a null-terminated octal, by field size const MAXNUM = { 12: 0o77777777777, - 8 : 0o7777777 + 8: 0o7777777, } const encNumber = (buf, off, size, number) => @@ -283,6 +283,6 @@ const NULLS = new Array(156).join('\0') const encString = (buf, off, size, string) => string === null ? false : (buf.write(string + NULLS, off, size, 'utf8'), - string.length !== Buffer.byteLength(string) || string.length > size) + string.length !== Buffer.byteLength(string) || string.length > size) module.exports = Header diff --git a/deps/npm/node_modules/tar/lib/high-level-opt.js b/deps/npm/node_modules/tar/lib/high-level-opt.js index 7333db915c0bde..40e44180e16699 100644 --- a/deps/npm/node_modules/tar/lib/high-level-opt.js +++ b/deps/npm/node_modules/tar/lib/high-level-opt.js @@ -21,9 +21,9 @@ const argmap = new Map([ ['no-mtime', 'noMtime'], ['p', 'preserveOwner'], ['L', 'follow'], - ['h', 'follow'] + ['h', 'follow'], ]) -const parse = module.exports = opt => opt ? Object.keys(opt).map(k => [ - argmap.has(k) ? argmap.get(k) : k, opt[k] +module.exports = opt => opt ? Object.keys(opt).map(k => [ + argmap.has(k) ? argmap.get(k) : k, opt[k], ]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {} diff --git a/deps/npm/node_modules/tar/lib/large-numbers.js b/deps/npm/node_modules/tar/lib/large-numbers.js index ad30bc350b3260..dd6f690b9a8d9a 100644 --- a/deps/npm/node_modules/tar/lib/large-numbers.js +++ b/deps/npm/node_modules/tar/lib/large-numbers.js @@ -2,7 +2,7 @@ // Tar can encode large and negative numbers using a leading byte of // 0xff for negative, and 0x80 for positive. -const encode = exports.encode = (num, buf) => { +const encode = (num, buf) => { if (!Number.isSafeInteger(num)) // The number is so large that javascript cannot represent it with integer // precision. @@ -18,7 +18,7 @@ const encodePositive = (num, buf) => { buf[0] = 0x80 for (var i = buf.length; i > 1; i--) { - buf[i-1] = num & 0xff + buf[i - 1] = num & 0xff num = Math.floor(num / 0x100) } } @@ -31,25 +31,22 @@ const encodeNegative = (num, buf) => { var byte = num & 0xff num = Math.floor(num / 0x100) if (flipped) - buf[i-1] = onesComp(byte) + buf[i - 1] = onesComp(byte) else if (byte === 0) - buf[i-1] = 0 + buf[i - 1] = 0 else { flipped = true - buf[i-1] = twosComp(byte) + buf[i - 1] = twosComp(byte) } } } -const parse = exports.parse = (buf) => { - var post = buf[buf.length - 1] - var pre = buf[0] - var value; - if (pre === 0x80) - value = pos(buf.slice(1, buf.length)) - else if (pre === 0xff) - value = twos(buf) - else +const parse = (buf) => { + const pre = buf[0] + const value = pre === 0x80 ? pos(buf.slice(1, buf.length)) + : pre === 0xff ? twos(buf) + : null + if (value === null) throw Error('invalid base256 encoding') if (!Number.isSafeInteger(value)) @@ -95,3 +92,8 @@ const pos = (buf) => { const onesComp = byte => (0xff ^ byte) & 0xff const twosComp = byte => ((0xff ^ byte) + 1) & 0xff + +module.exports = { + encode, + parse, +} diff --git a/deps/npm/node_modules/tar/lib/list.js b/deps/npm/node_modules/tar/lib/list.js index 9da3f812c38cab..702cfea808d421 100644 --- a/deps/npm/node_modules/tar/lib/list.js +++ b/deps/npm/node_modules/tar/lib/list.js @@ -10,7 +10,7 @@ const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') -const t = module.exports = (opt_, files, cb) => { +module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) @@ -79,15 +79,15 @@ const listFileSync = opt => { let fd try { const stat = fs.statSync(file) - const readSize = opt.maxReadSize || 16*1024*1024 - if (stat.size < readSize) { + const readSize = opt.maxReadSize || 16 * 1024 * 1024 + if (stat.size < readSize) p.end(fs.readFileSync(file)) - } else { + else { let pos = 0 const buf = Buffer.allocUnsafe(readSize) fd = fs.openSync(file, 'r') while (pos < stat.size) { - let bytesRead = fs.readSync(fd, buf, 0, readSize, pos) + const bytesRead = fs.readSync(fd, buf, 0, readSize, pos) pos += bytesRead p.write(buf.slice(0, bytesRead)) } @@ -95,14 +95,17 @@ const listFileSync = opt => { } threw = false } finally { - if (threw && fd) - try { fs.closeSync(fd) } catch (er) {} + if (threw && fd) { + try { + fs.closeSync(fd) + } catch (er) {} + } } } const listFile = (opt, cb) => { const parse = new Parser(opt) - const readSize = opt.maxReadSize || 16*1024*1024 + const readSize = opt.maxReadSize || 16 * 1024 * 1024 const file = opt.file const p = new Promise((resolve, reject) => { @@ -115,7 +118,7 @@ const listFile = (opt, cb) => { else { const stream = new fsm.ReadStream(file, { readSize: readSize, - size: stat.size + size: stat.size, }) stream.on('error', reject) stream.pipe(parse) diff --git a/deps/npm/node_modules/tar/lib/mkdir.js b/deps/npm/node_modules/tar/lib/mkdir.js index 381d0e1b3df7ff..aed398fcdcd441 100644 --- a/deps/npm/node_modules/tar/lib/mkdir.js +++ b/deps/npm/node_modules/tar/lib/mkdir.js @@ -33,7 +33,7 @@ class CwdError extends Error { } } -const mkdir = module.exports = (dir, opt, cb) => { +module.exports = (dir, opt, cb) => { // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask @@ -44,7 +44,7 @@ const mkdir = module.exports = (dir, opt, cb) => { const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && - ( uid !== opt.processUid || gid !== opt.processGid ) + (uid !== opt.processUid || gid !== opt.processGid) const preserve = opt.preserve const unlink = opt.unlink @@ -68,12 +68,13 @@ const mkdir = module.exports = (dir, opt, cb) => { if (cache && cache.get(dir) === true) return done() - if (dir === cwd) + if (dir === cwd) { return fs.stat(dir, (er, st) => { if (er || !st.isDirectory()) er = new CwdError(dir, er && er.code || 'ENOTDIR') done(er) }) + } if (preserve) return mkdirp(dir, {mode}).then(made => done(null, made), done) @@ -104,13 +105,13 @@ const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { cb(statEr) else if (st.isDirectory()) mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) - else if (unlink) + else if (unlink) { fs.unlink(part, er => { if (er) return cb(er) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) }) - else if (st.isSymbolicLink()) + } else if (st.isSymbolicLink()) return cb(new SymlinkError(part, part + '/' + parts.join('/'))) else cb(er) @@ -121,7 +122,7 @@ const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { } } -const mkdirSync = module.exports.sync = (dir, opt) => { +module.exports.sync = (dir, opt) => { // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask @@ -132,7 +133,7 @@ const mkdirSync = module.exports.sync = (dir, opt) => { const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && - ( uid !== opt.processUid || gid !== opt.processGid ) + (uid !== opt.processUid || gid !== opt.processGid) const preserve = opt.preserve const unlink = opt.unlink @@ -172,9 +173,8 @@ const mkdirSync = module.exports.sync = (dir, opt) => { const parts = sub.split(/\/|\\/) let created = null for (let p = parts.shift(), part = cwd; - p && (part += '/' + p); - p = parts.shift()) { - + p && (part += '/' + p); + p = parts.shift()) { if (cache.get(part)) continue diff --git a/deps/npm/node_modules/tar/lib/mode-fix.js b/deps/npm/node_modules/tar/lib/mode-fix.js index c3758741c45a9a..6a045ffcaec5b7 100644 --- a/deps/npm/node_modules/tar/lib/mode-fix.js +++ b/deps/npm/node_modules/tar/lib/mode-fix.js @@ -7,9 +7,8 @@ module.exports = (mode, isDir, portable) => { // (as some linux distros do), then we'll write the // archive with 0o644 instead. Also, don't ever create // a file that is not readable/writable by the owner. - if (portable) { - mode = (mode | 0o600) &~0o22 - } + if (portable) + mode = (mode | 0o600) & ~0o22 // if dirs are readable, then they should be listable if (isDir) { diff --git a/deps/npm/node_modules/tar/lib/pack.js b/deps/npm/node_modules/tar/lib/pack.js index 0fca4ae2573ac5..492fe18ec47ee4 100644 --- a/deps/npm/node_modules/tar/lib/pack.js +++ b/deps/npm/node_modules/tar/lib/pack.js @@ -97,7 +97,7 @@ const Pack = warner(class Pack extends MiniPass { this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true - this[QUEUE] = new Yallist + this[QUEUE] = new Yallist() this[JOBS] = 0 this.jobs = +opt.jobs || 4 this[PROCESSING] = false @@ -209,8 +209,8 @@ const Pack = warner(class Pack extends MiniPass { this[PROCESSING] = true for (let w = this[QUEUE].head; - w !== null && this[JOBS] < this.jobs; - w = w.next) { + w !== null && this[JOBS] < this.jobs; + w = w.next) { this[PROCESSJOB](w.value) if (w.value.ignore) { const p = w.next @@ -297,7 +297,7 @@ const Pack = warner(class Pack extends MiniPass { linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, - mtime: this.mtime + mtime: this.mtime, } } @@ -321,7 +321,7 @@ const Pack = warner(class Pack extends MiniPass { [PIPE] (job) { job.piped = true - if (job.readdir) + if (job.readdir) { job.readdir.forEach(entry => { const p = this.prefix ? job.path.slice(this.prefix.length + 1) || './' @@ -330,20 +330,22 @@ const Pack = warner(class Pack extends MiniPass { const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) + } const source = job.entry const zip = this.zip - if (zip) + if (zip) { source.on('data', chunk => { if (!zip.write(chunk)) source.pause() }) - else + } else { source.on('data', chunk => { if (!super.write(chunk)) source.pause() }) + } } pause () { @@ -377,7 +379,7 @@ class PackSync extends Pack { const source = job.entry const zip = this.zip - if (job.readdir) + if (job.readdir) { job.readdir.forEach(entry => { const p = this.prefix ? job.path.slice(this.prefix.length + 1) || './' @@ -386,15 +388,17 @@ class PackSync extends Pack { const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) + } - if (zip) + if (zip) { source.on('data', chunk => { zip.write(chunk) }) - else + } else { source.on('data', chunk => { super[WRITE](chunk) }) + } } } diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js index d9a49ad1ff96ed..b1b4e7e47577c9 100644 --- a/deps/npm/node_modules/tar/lib/parse.js +++ b/deps/npm/node_modules/tar/lib/parse.js @@ -21,7 +21,6 @@ // ignored entries get .resume() called on them straight away const warner = require('./warn-mixin.js') -const path = require('path') const Header = require('./header.js') const EE = require('events') const Yallist = require('yallist') @@ -85,13 +84,14 @@ module.exports = warner(class Parser extends EE { if (opt.ondone) this.on(DONE, opt.ondone) - else + else { this.on(DONE, _ => { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') }) + } this.strict = !!opt.strict this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize @@ -166,9 +166,8 @@ module.exports = warner(class Parser extends EE { this[SAW_VALID_ENTRY] = true } entry.on('end', onend) - } else { + } else this[SAW_VALID_ENTRY] = true - } } if (entry.meta) { @@ -249,7 +248,7 @@ module.exports = warner(class Parser extends EE { this.emit('drain') } else re.once('drain', _ => this.emit('drain')) - } + } } [CONSUMEBODY] (chunk, position) { @@ -352,7 +351,7 @@ module.exports = warner(class Parser extends EE { this[CONSUMECHUNK]() }) this[WRITING] = true - const ret = this[UNZIP][ended ? 'end' : 'write' ](chunk) + const ret = this[UNZIP][ended ? 'end' : 'write'](chunk) this[WRITING] = false return ret } @@ -415,9 +414,8 @@ module.exports = warner(class Parser extends EE { const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) - } else { + } else this[CONSUMECHUNKSUB](chunk) - } while (this[BUFFER] && this[BUFFER].length >= 512 && @@ -438,7 +436,7 @@ module.exports = warner(class Parser extends EE { // we know that we are in CONSUMING mode, so anything written goes into // the buffer. Advance the position and put any remainder in the buffer. let position = 0 - let length = chunk.length + const length = chunk.length while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { switch (this[STATE]) { case 'begin': diff --git a/deps/npm/node_modules/tar/lib/path-reservations.js b/deps/npm/node_modules/tar/lib/path-reservations.js index 3cf0c2c121b6ac..c0a16b0a1f901e 100644 --- a/deps/npm/node_modules/tar/lib/path-reservations.js +++ b/deps/npm/node_modules/tar/lib/path-reservations.js @@ -20,8 +20,8 @@ module.exports = () => { // return a set of parent dirs for a given path const { join } = require('path') const getDirs = path => - join(path).split(/[\\\/]/).slice(0, -1).reduce((set, path) => - set.length ? set.concat(join(set[set.length-1], path)) : [path], []) + join(path).split(/[\\/]/).slice(0, -1).reduce((set, path) => + set.length ? set.concat(join(set[set.length - 1], path)) : [path], []) // functions currently running const running = new Set() @@ -80,9 +80,9 @@ module.exports = () => { dirs.forEach(dir => { const q = queues.get(dir) assert(q[0] instanceof Set) - if (q[0].size === 1 && q.length === 1) { + if (q[0].size === 1 && q.length === 1) queues.delete(dir) - } else if (q[0].size === 1) { + else if (q[0].size === 1) { q.shift() // must be a function or else the Set would've been reused @@ -112,8 +112,8 @@ module.exports = () => { const q = queues.get(dir) if (!q) queues.set(dir, [new Set([fn])]) - else if (q[q.length-1] instanceof Set) - q[q.length-1].add(fn) + else if (q[q.length - 1] instanceof Set) + q[q.length - 1].add(fn) else q.push(new Set([fn])) }) diff --git a/deps/npm/node_modules/tar/lib/pax.js b/deps/npm/node_modules/tar/lib/pax.js index 214a459f3bdde8..7768c7b454f765 100644 --- a/deps/npm/node_modules/tar/lib/pax.js +++ b/deps/npm/node_modules/tar/lib/pax.js @@ -34,9 +34,8 @@ class Pax { const buf = Buffer.allocUnsafe(bufLen) // 0-fill the header section, it might not hit every field - for (let i = 0; i < 512; i++) { + for (let i = 0; i < 512; i++) buf[i] = 0 - } new Header({ // XXX split the path @@ -55,15 +54,14 @@ class Pax { devmaj: 0, devmin: 0, atime: this.atime || null, - ctime: this.ctime || null + ctime: this.ctime || null, }).encode(buf) buf.write(body, 512, bodyLen, 'utf8') // null pad after the body - for (let i = bodyLen + 512; i < buf.length; i++) { + for (let i = bodyLen + 512; i < buf.length; i++) buf[i] = 0 - } return buf } @@ -95,7 +93,7 @@ class Pax { : this[field] const s = ' ' + (field === 'dev' || field === 'ino' || field === 'nlink' - ? 'SCHILY.' : '') + + ? 'SCHILY.' : '') + field + '=' + v + '\n' const byteLen = Buffer.byteLength(s) // the digits includes the length of the digits in ascii base-10 @@ -136,7 +134,7 @@ const parseKVLine = (set, line) => { const v = kv.join('=') set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) - ? new Date(v * 1000) + ? new Date(v * 1000) : /^[0-9]+$/.test(v) ? +v : v return set diff --git a/deps/npm/node_modules/tar/lib/read-entry.js b/deps/npm/node_modules/tar/lib/read-entry.js index 8acee94baced5d..6661cba5ff9ef3 100644 --- a/deps/npm/node_modules/tar/lib/read-entry.js +++ b/deps/npm/node_modules/tar/lib/read-entry.js @@ -1,5 +1,4 @@ 'use strict' -const types = require('./types.js') const MiniPass = require('minipass') const SLURP = Symbol('slurp') @@ -63,8 +62,10 @@ module.exports = class ReadEntry extends MiniPass { this.uname = header.uname this.gname = header.gname - if (ex) this[SLURP](ex) - if (gex) this[SLURP](gex, true) + if (ex) + this[SLURP](ex) + if (gex) + this[SLURP](gex, true) } write (data) { @@ -87,7 +88,7 @@ module.exports = class ReadEntry extends MiniPass { } [SLURP] (ex, global) { - for (let k in ex) { + for (const k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && diff --git a/deps/npm/node_modules/tar/lib/replace.js b/deps/npm/node_modules/tar/lib/replace.js index 44126d1f85c480..e5e2a425536d6d 100644 --- a/deps/npm/node_modules/tar/lib/replace.js +++ b/deps/npm/node_modules/tar/lib/replace.js @@ -3,7 +3,6 @@ // tar -r const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') -const Parse = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const t = require('./list.js') @@ -17,7 +16,7 @@ const path = require('path') const Header = require('./header.js') -const r = module.exports = (opt_, files, cb) => { +module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) @@ -68,10 +67,10 @@ const replaceSync = (opt, files) => { break POSITION } - let h = new Header(headBuf) + const h = new Header(headBuf) if (!h.cksumValid) break - let entryBlockSize = 512 * Math.ceil(h.size / 512) + const entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > st.size) break // the 512 for the header we just parsed will be added as well @@ -84,15 +83,18 @@ const replaceSync = (opt, files) => { streamSync(opt, p, position, fd, files) } finally { - if (threw) - try { fs.closeSync(fd) } catch (er) {} + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } } } const streamSync = (opt, p, position, fd, files) => { const stream = new fsm.WriteStreamSync(opt.file, { fd: fd, - start: position + start: position, }) p.pipe(stream) addFilesSync(p, files) @@ -120,11 +122,12 @@ const replace = (opt, files, cb) => { if (er) return cb(er) bufPos += bytes - if (bufPos < 512 && bytes) + if (bufPos < 512 && bytes) { return fs.read( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread ) + } if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) return cb(new Error('cannot append to compressed archives')) @@ -173,7 +176,7 @@ const replace = (opt, files, cb) => { return reject(er) const stream = new fsm.WriteStream(opt.file, { fd: fd, - start: position + start: position, }) p.pipe(stream) stream.on('error', reject) @@ -190,14 +193,14 @@ const replace = (opt, files, cb) => { const addFilesSync = (p, files) => { files.forEach(file => { - if (file.charAt(0) === '@') + if (file.charAt(0) === '@') { t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, - onentry: entry => p.add(entry) + onentry: entry => p.add(entry), }) - else + } else p.add(file) }) p.end() @@ -206,13 +209,13 @@ const addFilesSync = (p, files) => { const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() - if (file.charAt(0) === '@') + if (file.charAt(0) === '@') { return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, - onentry: entry => p.add(entry) + onentry: entry => p.add(entry), }).then(_ => addFilesAsync(p, files)) - else + } else p.add(file) } p.end() diff --git a/deps/npm/node_modules/tar/lib/types.js b/deps/npm/node_modules/tar/lib/types.js index df425652b51d2e..7bfc254658f4ee 100644 --- a/deps/npm/node_modules/tar/lib/types.js +++ b/deps/npm/node_modules/tar/lib/types.js @@ -37,7 +37,7 @@ exports.name = new Map([ // skip ['V', 'TapeVolumeHeader'], // like x - ['X', 'OldExtendedHeader'] + ['X', 'OldExtendedHeader'], ]) // map the other direction diff --git a/deps/npm/node_modules/tar/lib/unpack.js b/deps/npm/node_modules/tar/lib/unpack.js index af0e0ffa059ff2..7d4b79d9eb3f0c 100644 --- a/deps/npm/node_modules/tar/lib/unpack.js +++ b/deps/npm/node_modules/tar/lib/unpack.js @@ -7,13 +7,11 @@ // clobbering an fs object to create one of a different type.) const assert = require('assert') -const EE = require('events').EventEmitter const Parser = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const mkdir = require('./mkdir.js') -const mkdirSync = mkdir.sync const wc = require('./winchars.js') const pathReservations = require('./path-reservations.js') @@ -28,7 +26,6 @@ const LINK = Symbol('link') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const UNSUPPORTED = Symbol('unsupported') -const UNKNOWN = Symbol('unknown') const CHECKPATH = Symbol('checkPath') const MKDIR = Symbol('mkdir') const ONERROR = Symbol('onError') @@ -121,9 +118,10 @@ class Unpack extends Parser { // need both or neither if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') throw new TypeError('cannot set owner without number uid and gid') - if (opt.preserveOwner) + if (opt.preserveOwner) { throw new TypeError( 'cannot preserve owner in archive and also set owner explicitly') + } this.uid = opt.uid this.gid = opt.gid this.setOwner = true @@ -171,11 +169,14 @@ class Unpack extends Parser { this.cwd = path.resolve(opt.cwd || process.cwd()) this.strip = +opt.strip || 0 - this.processUmask = process.umask() + // if we're not chmodding, then we don't need the process umask + this.processUmask = opt.noChmod ? 0 : process.umask() this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask + // default mode for dirs created as parents this.dmode = opt.dmode || (0o0777 & (~this.umask)) this.fmode = opt.fmode || (0o0666 & (~this.umask)) + this.on('entry', entry => this[ONENTRY](entry)) } @@ -271,6 +272,7 @@ class Unpack extends Parser { case 'CharacterDevice': case 'BlockDevice': case 'FIFO': + default: return this[UNSUPPORTED](entry) } } @@ -299,7 +301,8 @@ class Unpack extends Parser { unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, - mode: mode + mode: mode, + noChmod: this.noChmod, }, cb) } @@ -308,11 +311,11 @@ class Unpack extends Parser { // in set owner mode, chown if setting doesn't match process return this.forceChown || this.preserveOwner && - ( typeof entry.uid === 'number' && entry.uid !== this.processUid || - typeof entry.gid === 'number' && entry.gid !== this.processGid ) + (typeof entry.uid === 'number' && entry.uid !== this.processUid || + typeof entry.gid === 'number' && entry.gid !== this.processGid) || - ( typeof this.uid === 'number' && this.uid !== this.processUid || - typeof this.gid === 'number' && this.gid !== this.processGid ) + (typeof this.uid === 'number' && this.uid !== this.processUid || + typeof this.gid === 'number' && this.gid !== this.processGid) } [UID] (entry) { @@ -328,7 +331,7 @@ class Unpack extends Parser { const stream = new fsm.WriteStream(entry.absolute, { flags: getFlag(entry.size), mode: mode, - autoClose: false + autoClose: false, }) stream.on('error', er => this[ONERROR](er, entry)) @@ -460,6 +463,7 @@ class Unpack extends Parser { paths.push(entry.linkpath) this.reservations.reserve(paths, done => this[CHECKFS2](entry, done)) } + [CHECKFS2] (entry, done) { this[MKDIR](path.dirname(entry.absolute), this.dmode, er => { if (er) { @@ -470,16 +474,17 @@ class Unpack extends Parser { if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { this[SKIP](entry) done() - } else if (er || this[ISREUSABLE](entry, st)) { + } else if (er || this[ISREUSABLE](entry, st)) this[MAKEFS](null, entry, done) - } + else if (st.isDirectory()) { if (entry.type === 'Directory') { - if (!entry.mode || (st.mode & 0o7777) === entry.mode) + if (!this.noChmod && (!entry.mode || (st.mode & 0o7777) === entry.mode)) this[MAKEFS](null, entry, done) - else + else { fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry, done)) + } } else fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done)) } else @@ -523,10 +528,6 @@ class Unpack extends Parser { } class UnpackSync extends Unpack { - constructor (opt) { - super(opt) - } - [CHECKFS] (entry) { const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled) if (er) @@ -541,7 +542,7 @@ class UnpackSync extends Unpack { try { if (st.isDirectory()) { if (entry.type === 'Directory') { - if (entry.mode && (st.mode & 0o7777) !== entry.mode) + if (!this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode) fs.chmodSync(entry.absolute, entry.mode) } else fs.rmdirSync(entry.absolute) @@ -571,7 +572,6 @@ class UnpackSync extends Unpack { this[ONERROR](er || closeError, entry) } - let stream let fd try { fd = fs.openSync(entry.absolute, getFlag(entry.size), mode) @@ -659,7 +659,7 @@ class UnpackSync extends Unpack { unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, - mode: mode + mode: mode, }) } catch (er) { return er diff --git a/deps/npm/node_modules/tar/lib/update.js b/deps/npm/node_modules/tar/lib/update.js index 16c3e93ed5af8c..a5784b73f3c751 100644 --- a/deps/npm/node_modules/tar/lib/update.js +++ b/deps/npm/node_modules/tar/lib/update.js @@ -6,7 +6,7 @@ const hlo = require('./high-level-opt.js') const r = require('./replace.js') // just call tar.r with the filter and mtimeCache -const u = module.exports = (opt_, files, cb) => { +module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) diff --git a/deps/npm/node_modules/tar/lib/warn-mixin.js b/deps/npm/node_modules/tar/lib/warn-mixin.js index 11eb52cc6474ea..aeebb531b5701e 100644 --- a/deps/npm/node_modules/tar/lib/warn-mixin.js +++ b/deps/npm/node_modules/tar/lib/warn-mixin.js @@ -13,9 +13,9 @@ module.exports = Base => class extends Base { message = message.message } this.emit('warn', data.tarCode, message, data) - } else if (message instanceof Error) { + } else if (message instanceof Error) this.emit('error', Object.assign(message, data)) - } else + else this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) } } diff --git a/deps/npm/node_modules/tar/lib/winchars.js b/deps/npm/node_modules/tar/lib/winchars.js index cf6ea06061c8e2..ebcab4aed3e527 100644 --- a/deps/npm/node_modules/tar/lib/winchars.js +++ b/deps/npm/node_modules/tar/lib/winchars.js @@ -8,7 +8,7 @@ const raw = [ '<', '>', '?', - ':' + ':', ] const win = raw.map(char => @@ -19,5 +19,5 @@ const toRaw = new Map(win.map((char, i) => [char, raw[i]])) module.exports = { encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), - decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s) + decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s), } diff --git a/deps/npm/node_modules/tar/lib/write-entry.js b/deps/npm/node_modules/tar/lib/write-entry.js index 0e33cb59d5e67c..1d0b746cd68183 100644 --- a/deps/npm/node_modules/tar/lib/write-entry.js +++ b/deps/npm/node_modules/tar/lib/write-entry.js @@ -2,11 +2,9 @@ const MiniPass = require('minipass') const Pax = require('./pax.js') const Header = require('./header.js') -const ReadEntry = require('./read-entry.js') const fs = require('fs') const path = require('path') -const types = require('./types.js') const maxReadSize = 16 * 1024 * 1024 const PROCESS = Symbol('process') const FILE = Symbol('file') @@ -134,12 +132,12 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { mtime: this.noMtime ? null : this.mtime || this.stat.mtime, type: this.type, uname: this.portable ? null : - this.stat.uid === this.myuid ? this.myuser : '', + this.stat.uid === this.myuid ? this.myuser : '', atime: this.portable ? null : this.stat.atime, - ctime: this.portable ? null : this.stat.ctime + ctime: this.portable ? null : this.stat.ctime, }) - if (this.header.encode() && !this.noPax) + if (this.header.encode() && !this.noPax) { this.write(new Pax({ atime: this.portable ? null : this.header.atime, ctime: this.portable ? null : this.header.ctime, @@ -152,8 +150,9 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { uname: this.portable ? null : this.header.uname, dev: this.portable ? null : this.stat.dev, ino: this.portable ? null : this.stat.ino, - nlink: this.portable ? null : this.stat.nlink + nlink: this.portable ? null : this.stat.nlink, }).encode()) + } this.write(this.header.block) } @@ -256,8 +255,8 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { if (bytesRead === remain) { for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) { buf[i + offset] = 0 - bytesRead ++ - remain ++ + bytesRead++ + remain++ } } @@ -286,10 +285,6 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { }) class WriteEntrySync extends WriteEntry { - constructor (path, opt) { - super(path, opt) - } - [LSTAT] () { this[ONLSTAT](fs.lstatSync(this.absolute)) } @@ -311,8 +306,11 @@ class WriteEntrySync extends WriteEntry { } finally { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one - if (threw) - try { this[CLOSE](fd, () => {}) } catch (er) {} + if (threw) { + try { + this[CLOSE](fd, () => {}) + } catch (er) {} + } } } @@ -375,7 +373,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { type: this.type, uname: this.portable ? null : this.uname, atime: this.portable ? null : this.atime, - ctime: this.portable ? null : this.ctime + ctime: this.portable ? null : this.ctime, }) if (pathWarn) { @@ -385,7 +383,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { }) } - if (this.header.encode() && !this.noPax) + if (this.header.encode() && !this.noPax) { super.write(new Pax({ atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime, @@ -398,8 +396,9 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { uname: this.portable ? null : this.uname, dev: this.portable ? null : this.readEntry.dev, ino: this.portable ? null : this.readEntry.ino, - nlink: this.portable ? null : this.readEntry.nlink + nlink: this.portable ? null : this.readEntry.nlink, }).encode()) + } super.write(this.header.block) readEntry.pipe(this) diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 9c388c57cdd5a4..9b8b96ec66ca55 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -2,13 +2,17 @@ "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "tar", "description": "tar for node", - "version": "6.0.5", + "version": "6.1.0", "repository": { "type": "git", "url": "https://github.com/npm/node-tar.git" }, "scripts": { "test": "tap", + "posttest": "npm run lint", + "eslint": "eslint", + "lint": "npm run eslint -- test lib", + "lintfix": "npm run lint -- --fix", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", @@ -26,6 +30,11 @@ "devDependencies": { "chmodr": "^1.2.0", "end-of-stream": "^1.4.3", + "eslint": "^7.17.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^5.0.0", "events-to-array": "^1.1.2", "mutate-fs": "^2.1.1", "rimraf": "^2.7.1", diff --git a/deps/npm/package.json b/deps/npm/package.json index 47c108bbe7a86e..9f0aacbda26880 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "7.3.0", + "version": "7.4.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -42,7 +42,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@npmcli/arborist": "^2.0.2", + "@npmcli/arborist": "^2.0.3", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^1.2.8", "@npmcli/run-script": "^1.8.1", @@ -90,7 +90,7 @@ "npm-user-validate": "^1.0.1", "npmlog": "~4.1.2", "opener": "^1.5.2", - "pacote": "^11.1.13", + "pacote": "^11.1.14", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", @@ -100,7 +100,7 @@ "rimraf": "^3.0.2", "semver": "^7.3.4", "ssri": "^8.0.0", - "tar": "^6.0.5", + "tar": "^6.1.0", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^1.0.4", diff --git a/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js index d14c9e95035135..1f525e71cab970 100644 --- a/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js @@ -5,533 +5,6 @@ * Make sure to inspect the output below. Do not ignore changes! */ 'use strict' -exports[`test/lib/utils/config.js TAP no process.umask() method > must match snapshot 1`] = ` -Object { - "defaults": Object { - "_auth": null, - "access": null, - "all": false, - "allow-same-version": false, - "also": null, - "always-auth": false, - "audit": true, - "audit-level": null, - "auth-type": "legacy", - "before": null, - "bin-links": true, - "browser": null, - "ca": null, - "cache": "{CACHE DIR} npm-cache", - "cache-lock-retries": 10, - "cache-lock-stale": 60000, - "cache-lock-wait": 10000, - "cache-max": null, - "cache-min": 10, - "cafile": null, - "call": "", - "cert": null, - "ci-name": null, - "cidr": null, - "color": true, - "commit-hooks": true, - "depth": null, - "description": true, - "dev": false, - "dry-run": false, - "editor": "vim", - "engine-strict": false, - "fetch-retries": 2, - "fetch-retry-factor": 10, - "fetch-retry-maxtimeout": 60000, - "fetch-retry-mintimeout": 10000, - "fetch-timeout": 300000, - "force": false, - "format-package-lock": true, - "fund": true, - "git": "git", - "git-tag-version": true, - "global": false, - "global-style": false, - "heading": "npm", - "https-proxy": null, - "if-present": false, - "ignore-prepublish": false, - "ignore-scripts": false, - "include": Array [], - "include-staged": false, - "init-author-email": "", - "init-author-name": "", - "init-author-url": "", - "init-license": "ISC", - "init-module": "~/.npm-init.js", - "init-version": "1.0.0", - "init.author.email": "", - "init.author.name": "", - "init.author.url": "", - "init.license": "ISC", - "init.module": "~/.npm-init.js", - "init.version": "1.0.0", - "json": false, - "key": null, - "legacy-bundling": false, - "legacy-peer-deps": false, - "link": false, - "local-address": undefined, - "loglevel": "notice", - "logs-max": 10, - "long": false, - "maxsockets": 50, - "message": "%s", - "node-options": null, - "node-version": "v14.8.0", - "noproxy": null, - "npm-version": "7.0.0", - "offline": false, - "omit": Array [], - "only": null, - "optional": true, - "otp": null, - "package": Array [], - "package-lock": true, - "package-lock-only": false, - "parseable": false, - "prefer-offline": false, - "prefer-online": false, - "preid": "", - "production": false, - "progress": true, - "proxy": null, - "read-only": false, - "rebuild-bundle": true, - "registry": "https://registry.npmjs.org/", - "rollback": true, - "save": true, - "save-bundle": false, - "save-dev": false, - "save-exact": false, - "save-optional": false, - "save-prefix": "^", - "save-prod": false, - "scope": "", - "script-shell": null, - "scripts-prepend-node-path": "warn-only", - "searchexclude": null, - "searchlimit": 20, - "searchopts": "", - "searchstaleness": 900, - "shell": "cmd.exe", - "shrinkwrap": true, - "sign-git-commit": false, - "sign-git-tag": false, - "sso-poll-frequency": 500, - "sso-type": "oauth", - "strict-peer-deps": false, - "strict-ssl": true, - "tag": "latest", - "tag-version-prefix": "v", - "timing": false, - "tmp": "/tmp", - "umask": 18, - "unicode": true, - "update-notifier": true, - "usage": false, - "user-agent": "npm/{npm-version} node/{node-version} {platform} {arch} {ci}", - "userconfig": "~/.npmrc", - "version": false, - "versions": false, - "viewer": "browser", - }, - "shorthands": Object { - "?": Array [ - "--usage", - ], - "a": Array [ - "--all", - ], - "B": Array [ - "--save-bundle", - ], - "c": Array [ - "--call", - ], - "C": Array [ - "--prefix", - ], - "d": Array [ - "--loglevel", - "info", - ], - "D": Array [ - "--save-dev", - ], - "dd": Array [ - "--loglevel", - "verbose", - ], - "ddd": Array [ - "--loglevel", - "silly", - ], - "desc": Array [ - "--description", - ], - "E": Array [ - "--save-exact", - ], - "enjoy-by": Array [ - "--before", - ], - "f": Array [ - "--force", - ], - "g": Array [ - "--global", - ], - "h": Array [ - "--usage", - ], - "H": Array [ - "--usage", - ], - "help": Array [ - "--usage", - ], - "l": Array [ - "--long", - ], - "local": Array [ - "--no-global", - ], - "m": Array [ - "--message", - ], - "n": Array [ - "--no-yes", - ], - "no-desc": Array [ - "--no-description", - ], - "no-reg": Array [ - "--no-registry", - ], - "noreg": Array [ - "--no-registry", - ], - "O": Array [ - "--save-optional", - ], - "p": Array [ - "--parseable", - ], - "P": Array [ - "--save-prod", - ], - "porcelain": Array [ - "--parseable", - ], - "q": Array [ - "--loglevel", - "warn", - ], - "quiet": Array [ - "--loglevel", - "warn", - ], - "readonly": Array [ - "--read-only", - ], - "reg": Array [ - "--registry", - ], - "s": Array [ - "--loglevel", - "silent", - ], - "S": Array [ - "--save", - ], - "silent": Array [ - "--loglevel", - "silent", - ], - "v": Array [ - "--version", - ], - "verbose": Array [ - "--loglevel", - "verbose", - ], - "y": Array [ - "--yes", - ], - }, - "types": Object { - "_auth": Array [ - null, - "{String TYPE}", - ], - "access": Array [ - null, - "restricted", - "public", - ], - "all": "{Boolean TYPE}", - "allow-same-version": "{Boolean TYPE}", - "also": Array [ - null, - "dev", - "development", - ], - "always-auth": "{Boolean TYPE}", - "audit": "{Boolean TYPE}", - "audit-level": Array [ - "low", - "moderate", - "high", - "critical", - "none", - null, - ], - "auth-type": Array [ - "legacy", - "sso", - "saml", - "oauth", - ], - "before": Array [ - null, - "{Date TYPE}", - ], - "bin-links": "{Boolean TYPE}", - "browser": Array [ - null, - "{Boolean TYPE}", - "{String TYPE}", - ], - "ca": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "cache": "{PATH MODULE}", - "cache-lock-retries": "{Number TYPE}", - "cache-lock-stale": "{Number TYPE}", - "cache-lock-wait": "{Number TYPE}", - "cache-max": "{Number TYPE}", - "cache-min": "{Number TYPE}", - "cafile": "{PATH MODULE}", - "call": "{String TYPE}", - "cert": Array [ - null, - "{String TYPE}", - ], - "ci-name": Array [ - null, - "{String TYPE}", - ], - "cidr": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "color": Array [ - "always", - "{Boolean TYPE}", - ], - "commit-hooks": "{Boolean TYPE}", - "depth": Array [ - null, - "{Number TYPE}", - ], - "description": "{Boolean TYPE}", - "dev": "{Boolean TYPE}", - "dry-run": "{Boolean TYPE}", - "editor": "{String TYPE}", - "engine-strict": "{Boolean TYPE}", - "fetch-retries": "{Number TYPE}", - "fetch-retry-factor": "{Number TYPE}", - "fetch-retry-maxtimeout": "{Number TYPE}", - "fetch-retry-mintimeout": "{Number TYPE}", - "fetch-timeout": "{Number TYPE}", - "force": "{Boolean TYPE}", - "format-package-lock": "{Boolean TYPE}", - "fund": "{Boolean TYPE}", - "git": "{String TYPE}", - "git-tag-version": "{Boolean TYPE}", - "global": "{Boolean TYPE}", - "global-style": "{Boolean TYPE}", - "globalconfig": "{PATH MODULE}", - "heading": "{String TYPE}", - "https-proxy": Array [ - null, - "{URL MODULE}", - ], - "if-present": "{Boolean TYPE}", - "ignore-prepublish": "{Boolean TYPE}", - "ignore-scripts": "{Boolean TYPE}", - "include": Array [ - "{Array TYPE}", - "prod", - "dev", - "optional", - "peer", - ], - "include-staged": "{Boolean TYPE}", - "init-author-email": "{String TYPE}", - "init-author-name": "{String TYPE}", - "init-author-url": Array [ - "", - "{URL MODULE}", - ], - "init-license": "{String TYPE}", - "init-module": "{PATH MODULE}", - "init-version": "{SEMVER MODULE}", - "init.author.email": "{String TYPE}", - "init.author.name": "{String TYPE}", - "init.author.url": Array [ - "", - "{URL MODULE}", - ], - "init.license": "{String TYPE}", - "init.module": "{PATH MODULE}", - "init.version": "{SEMVER MODULE}", - "json": "{Boolean TYPE}", - "key": Array [ - null, - "{String TYPE}", - ], - "legacy-bundling": "{Boolean TYPE}", - "legacy-peer-deps": "{Boolean TYPE}", - "link": "{Boolean TYPE}", - "local-address": Array [ - undefined, - ], - "loglevel": Array [ - "silent", - "error", - "warn", - "notice", - "http", - "timing", - "info", - "verbose", - "silly", - ], - "logs-max": "{Number TYPE}", - "long": "{Boolean TYPE}", - "maxsockets": "{Number TYPE}", - "message": "{String TYPE}", - "node-options": Array [ - null, - "{String TYPE}", - ], - "node-version": Array [ - null, - "{SEMVER MODULE}", - ], - "noproxy": Array [ - null, - "{String TYPE}", - "{Array TYPE}", - ], - "npm-version": "{SEMVER MODULE}", - "offline": "{Boolean TYPE}", - "omit": Array [ - "{Array TYPE}", - "dev", - "optional", - "peer", - ], - "only": Array [ - null, - "dev", - "development", - "prod", - "production", - ], - "optional": "{Boolean TYPE}", - "otp": Array [ - null, - "{String TYPE}", - ], - "package": Array [ - "{String TYPE}", - "{Array TYPE}", - ], - "package-lock": "{Boolean TYPE}", - "package-lock-only": "{Boolean TYPE}", - "parseable": "{Boolean TYPE}", - "prefer-offline": "{Boolean TYPE}", - "prefer-online": "{Boolean TYPE}", - "prefix": "{PATH MODULE}", - "preid": "{String TYPE}", - "production": "{Boolean TYPE}", - "progress": "{Boolean TYPE}", - "proxy": Array [ - null, - false, - "{URL MODULE}", - ], - "read-only": "{Boolean TYPE}", - "rebuild-bundle": "{Boolean TYPE}", - "registry": Array [ - null, - "{URL MODULE}", - ], - "rollback": "{Boolean TYPE}", - "save": "{Boolean TYPE}", - "save-bundle": "{Boolean TYPE}", - "save-dev": "{Boolean TYPE}", - "save-exact": "{Boolean TYPE}", - "save-optional": "{Boolean TYPE}", - "save-prefix": "{String TYPE}", - "save-prod": "{Boolean TYPE}", - "scope": "{String TYPE}", - "script-shell": Array [ - null, - "{String TYPE}", - ], - "scripts-prepend-node-path": Array [ - "{Boolean TYPE}", - "auto", - "warn-only", - ], - "searchexclude": Array [ - null, - "{String TYPE}", - ], - "searchlimit": "{Number TYPE}", - "searchopts": "{String TYPE}", - "searchstaleness": "{Number TYPE}", - "shell": "{String TYPE}", - "shrinkwrap": "{Boolean TYPE}", - "sign-git-commit": "{Boolean TYPE}", - "sign-git-tag": "{Boolean TYPE}", - "sso-poll-frequency": "{Number TYPE}", - "sso-type": Array [ - null, - "oauth", - "saml", - ], - "strict-peer-deps": "{Boolean TYPE}", - "strict-ssl": "{Boolean TYPE}", - "tag": "{String TYPE}", - "tag-version-prefix": "{String TYPE}", - "timing": "{Boolean TYPE}", - "tmp": "{PATH MODULE}", - "umask": "{Umask TYPE}", - "unicode": "{Boolean TYPE}", - "update-notifier": "{Boolean TYPE}", - "usage": "{Boolean TYPE}", - "user-agent": "{String TYPE}", - "userconfig": "{PATH MODULE}", - "version": "{Boolean TYPE}", - "versions": "{Boolean TYPE}", - "viewer": "{String TYPE}", - }, -} -` - exports[`test/lib/utils/config.js TAP no working network interfaces, on windows > must match snapshot 1`] = ` Object { "defaults": Object { @@ -573,6 +46,7 @@ Object { "fetch-retry-mintimeout": 10000, "fetch-timeout": 300000, "force": false, + "foreground-script": false, "format-package-lock": true, "fund": true, "git": "git", @@ -658,7 +132,7 @@ Object { "tag-version-prefix": "v", "timing": false, "tmp": "/tmp", - "umask": 22, + "umask": 0, "unicode": true, "update-notifier": true, "usage": false, @@ -881,6 +355,7 @@ Object { "fetch-retry-mintimeout": "{Number TYPE}", "fetch-timeout": "{Number TYPE}", "force": "{Boolean TYPE}", + "foreground-script": "{Boolean TYPE}", "format-package-lock": "{Boolean TYPE}", "fund": "{Boolean TYPE}", "git": "{String TYPE}", @@ -1100,6 +575,7 @@ Object { "fetch-retry-mintimeout": 10000, "fetch-timeout": 300000, "force": false, + "foreground-script": false, "format-package-lock": true, "fund": true, "git": "git", @@ -1185,7 +661,7 @@ Object { "tag-version-prefix": "v", "timing": false, "tmp": "/tmp", - "umask": 22, + "umask": 0, "unicode": true, "update-notifier": true, "usage": false, @@ -1408,6 +884,7 @@ Object { "fetch-retry-mintimeout": "{Number TYPE}", "fetch-timeout": "{Number TYPE}", "force": "{Boolean TYPE}", + "foreground-script": "{Boolean TYPE}", "format-package-lock": "{Boolean TYPE}", "fund": "{Boolean TYPE}", "git": "{String TYPE}", diff --git a/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js index 36f76712410b62..93606fcd8a0601 100644 --- a/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js +++ b/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js @@ -36,6 +36,7 @@ Object { "engineStrict": "engine-strict", "fmode": 438, "force": "force", + "foregroundScripts": false, "formatPackageLock": "format-package-lock", "fund": "fund", "git": "git", diff --git a/deps/npm/test/lib/birthday.js b/deps/npm/test/lib/birthday.js index 21b60b4c79620f..e7cd4702202983 100644 --- a/deps/npm/test/lib/birthday.js +++ b/deps/npm/test/lib/birthday.js @@ -56,6 +56,36 @@ test('birthday (nope again)', (t) => { }) }) +test('birthday (strike 3)', (t) => { + t.plan(1) + const B = global[Buffer.from([66, 117, 102, 102, 101, 114])] + const f = B.from([102, 114, 111, 109]) + const D = global[B[f]([68, 97, 116, 101])] + const _6 = B[f]([98, 97, 115, 101, 54, 52]) + '' + const l = B[f]('dG9TdHJpbmc=', _6) + class FD extends D { + [B[f]('Z2V0RnVsbFllYXI=', _6)[l]()] () { + const d = new D() + return d[B[f]('Z2V0RnVsbFllYXI=', _6)[l]()]() - 1 + } + + [B[f]('Z2V0VVRDTW9udGg=', _6)[l]()] () { + return 11 + } + } + global[B[f]([68, 97, 116, 101])] = FD + const consoleLog = console.log + console.log = () => undefined + t.tearDown(() => { + global[B[f]([68, 97, 116, 101])] = D + console.log = consoleLog + }) + const birthday = requireInject('../../lib/birthday', {}) + birthday([], (err) => { + t.match(err, 'try again', 'not telling you the secret that easily are we?') + }) +}) + test('birthday (yup)', (t) => { t.plan(1) const B = global[Buffer.from([66, 117, 102, 102, 101, 114])] diff --git a/deps/npm/test/lib/ci.js b/deps/npm/test/lib/ci.js index c32fb83279a413..b1fba2ab12b29a 100644 --- a/deps/npm/test/lib/ci.js +++ b/deps/npm/test/lib/ci.js @@ -6,6 +6,41 @@ const { test } = require('tap') const requireInject = require('require-inject') +test('should ignore scripts with --ignore-scripts', (t) => { + const SCRIPTS = [] + let REIFY_CALLED = false + const ci = requireInject('../../lib/ci.js', { + '../../lib/utils/reify-finish.js': async () => {}, + '../../lib/npm.js': { + globalDir: 'path/to/node_modules/', + prefix: 'foo', + flatOptions: { + global: false, + ignoreScripts: true, + }, + config: { + get: () => false, + }, + }, + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + '@npmcli/arborist': function () { + this.loadVirtual = async () => {} + this.reify = () => { + REIFY_CALLED = true + } + }, + }) + ci([], er => { + if (er) + throw er + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [], 'no scripts when running ci') + t.end() + }) +}) + test('should use Arborist and run-script', (t) => { const scripts = [ 'preinstall', diff --git a/deps/npm/test/lib/exec.js b/deps/npm/test/lib/exec.js index 25c3fe46331719..ac813ade7b7e2a 100644 --- a/deps/npm/test/lib/exec.js +++ b/deps/npm/test/lib/exec.js @@ -124,11 +124,12 @@ t.test('npx foo, bin already exists locally', async t => { PROGRESS_IGNORED = true npm.localBin = path - await exec(['foo'], er => { + await exec(['foo', 'one arg', 'two arg'], er => { t.ifError(er, 'npm exec') }) t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foo' }}, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -148,11 +149,12 @@ t.test('npx foo, bin already exists globally', async t => { PROGRESS_IGNORED = true npm.globalBin = path - await exec(['foo'], er => { + await exec(['foo', 'one arg', 'two arg'], er => { t.ifError(er, 'npm exec') }) t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foo' }}, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -178,7 +180,7 @@ t.test('npm exec foo, already present locally', async t => { }, _from: 'foo@', } - await exec(['foo'], er => { + await exec(['foo', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -188,6 +190,7 @@ t.test('npm exec foo, already present locally', async t => { t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foo' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -220,6 +223,7 @@ t.test('npm exec , run interactive shell', async t => { if (doRun) { t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'shell-cmd' } }, + args: [], banner: false, path: process.cwd(), stdioString: true, @@ -281,7 +285,7 @@ t.test('npm exec foo, not present locally or in central loc', async t => { }, _from: 'foo@', } - await exec(['foo'], er => { + await exec(['foo', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -292,6 +296,7 @@ t.test('npm exec foo, not present locally or in central loc', async t => { const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foo' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -319,7 +324,7 @@ t.test('npm exec foo, not present locally but in central loc', async t => { }, _from: 'foo@', } - await exec(['foo'], er => { + await exec(['foo', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -330,6 +335,7 @@ t.test('npm exec foo, not present locally but in central loc', async t => { const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foo' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -357,7 +363,7 @@ t.test('npm exec foo, present locally but wrong version', async t => { }, _from: 'foo@2.x', } - await exec(['foo@2.x'], er => { + await exec(['foo@2.x', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -368,6 +374,7 @@ t.test('npm exec foo, present locally but wrong version', async t => { const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foo' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -392,7 +399,7 @@ t.test('npm exec --package=foo bar', async t => { _from: 'foo@', } npm.flatOptions.package = ['foo'] - await exec(['bar'], er => { + await exec(['bar', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -402,6 +409,7 @@ t.test('npm exec --package=foo bar', async t => { t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'bar' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -442,6 +450,7 @@ t.test('npm exec @foo/bar -- --some=arg, locally installed', async t => { t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'bar' } }, + args: ['--some=arg'], banner: false, path: process.cwd(), stdioString: true, @@ -473,7 +482,7 @@ t.test('npm exec @foo/bar, with same bin alias and no unscoped named bin, locall children: new Map([['@foo/bar', { name: '@foo/bar', version: '1.2.3' }]]), } MANIFESTS['@foo/bar'] = foobarManifest - await exec(['@foo/bar'], er => { + await exec(['@foo/bar', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -483,6 +492,7 @@ t.test('npm exec @foo/bar, with same bin alias and no unscoped named bin, locall t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'baz' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, @@ -552,7 +562,7 @@ t.test('run command with 2 packages, need install, verify sort', t => { }, _from: 'bar@', } - await exec(['foobar'], er => { + await exec(['foobar', 'one arg', 'two arg'], er => { if (er) throw er }) @@ -563,6 +573,7 @@ t.test('run command with 2 packages, need install, verify sort', t => { const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` t.match(RUN_SCRIPTS, [{ pkg: { scripts: { npx: 'foobar' } }, + args: ['one arg', 'two arg'], banner: false, path: process.cwd(), stdioString: true, diff --git a/deps/npm/test/lib/install.js b/deps/npm/test/lib/install.js index 7e243e7ff35f28..177952b9e9d662 100644 --- a/deps/npm/test/lib/install.js +++ b/deps/npm/test/lib/install.js @@ -72,6 +72,40 @@ test('should install using Arborist', (t) => { t.end() }) +test('should ignore scripts with --ignore-scripts', (t) => { + const SCRIPTS = [] + let REIFY_CALLED = false + const install = requireInject('../../lib/install.js', { + '../../lib/utils/reify-finish.js': async () => {}, + '../../lib/npm.js': { + globalDir: 'path/to/node_modules/', + prefix: 'foo', + flatOptions: { + global: false, + ignoreScripts: true, + }, + config: { + get: () => false, + }, + }, + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + '@npmcli/arborist': function () { + this.reify = () => { + REIFY_CALLED = true + } + }, + }) + install([], er => { + if (er) + throw er + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [], 'no scripts when adding dep') + t.end() + }) +}) + test('should install globally using Arborist', (t) => { const install = requireInject('../../lib/install.js', { '../../lib/utils/reify-finish.js': async () => {}, @@ -79,7 +113,7 @@ test('should install globally using Arborist', (t) => { globalDir: 'path/to/node_modules/', prefix: 'foo', flatOptions: { - global: 'true', + global: true, }, config: { get: () => false, diff --git a/deps/npm/test/lib/publish.js b/deps/npm/test/lib/publish.js index c1f353f6fdbc55..d4e41605df8c63 100644 --- a/deps/npm/test/lib/publish.js +++ b/deps/npm/test/lib/publish.js @@ -193,7 +193,11 @@ t.test('should log tarball contents', (t) => { dryRun: true, registry: 'https://registry.npmjs.org/', }, - config, + config: { + ...config, + getCredentialsByURI: () => { + throw new Error('should not call getCredentialsByURI!') + }}, }, '../../lib/utils/tar.js': { getContents: () => ({ diff --git a/deps/npm/test/lib/utils/config.js b/deps/npm/test/lib/utils/config.js index 38fbe6753e75b0..4d4b1a1d1a70d3 100644 --- a/deps/npm/test/lib/utils/config.js +++ b/deps/npm/test/lib/utils/config.js @@ -1,11 +1,5 @@ const t = require('tap') const requireInject = require('require-inject') -Object.defineProperty(process, 'umask', { - value: () => 0o26, - writable: true, - configurable: true, - enumerable: true, -}) // have to fake the node version, or else it'll only pass on this one Object.defineProperty(process, 'version', { @@ -93,32 +87,6 @@ t.test('no working network interfaces, on windows', t => { t.end() }) -t.test('no process.umask() method', t => { - Object.defineProperty(process, 'umask', { - value: null, - writable: true, - configurable: true, - enumerable: true, - }) - t.teardown(() => { - Object.defineProperty(process, 'umask', { - value: () => 0o26, - writable: true, - configurable: true, - enumerable: true, - }) - }) - const config = requireInject('../../../lib/utils/config.js', { - os: { tmpdir, networkInterfaces: networkInterfacesThrow }, - '@npmcli/ci-detect': () => false, - '../../../lib/utils/is-windows.js': true, - '../../../package.json': pkg, - }) - t.equal(config.defaults.umask, 0o22) - t.matchSnapshot(config) - t.end() -}) - t.test('no comspec on windows', t => { delete process.env.ComSpec const config = requireInject('../../../lib/utils/config.js', { From 4c819d65f91f32290188f87031a95410bbd66e64 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 6 Jan 2021 19:45:41 +0100 Subject: [PATCH 146/161] stream: fix .end() error propagation PR-URL: https://github.com/nodejs/node/pull/36817 Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina --- lib/internal/streams/writable.js | 40 +++++++++++++------ .../test-stream-writable-end-cb-error.js | 35 ++++++++++++++++ 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/lib/internal/streams/writable.js b/lib/internal/streams/writable.js index 97fe1d28ef1f3a..2510398d999fe1 100644 --- a/lib/internal/streams/writable.js +++ b/lib/internal/streams/writable.js @@ -27,6 +27,7 @@ const { FunctionPrototype, + Error, ObjectDefineProperty, ObjectDefineProperties, ObjectSetPrototypeOf, @@ -290,8 +291,8 @@ Writable.prototype.pipe = function() { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; -Writable.prototype.write = function(chunk, encoding, cb) { - const state = this._writableState; +function _write(stream, chunk, encoding, cb) { + const state = stream._writableState; if (typeof encoding === 'function') { cb = encoding; @@ -333,11 +334,15 @@ Writable.prototype.write = function(chunk, encoding, cb) { if (err) { process.nextTick(cb, err); - errorOrDestroy(this, err, true); - return false; + errorOrDestroy(stream, err, true); + return err; } state.pendingcb++; - return writeOrBuffer(this, state, chunk, encoding, cb); + return writeOrBuffer(stream, state, chunk, encoding, cb); +} + +Writable.prototype.write = function(chunk, encoding, cb) { + return _write(this, chunk, encoding, cb) === true; }; Writable.prototype.cork = function() { @@ -607,8 +612,14 @@ Writable.prototype.end = function(chunk, encoding, cb) { encoding = null; } - if (chunk !== null && chunk !== undefined) - this.write(chunk, encoding); + let err; + + if (chunk !== null && chunk !== undefined) { + const ret = _write(this, chunk, encoding); + if (ret instanceof Error) { + err = ret; + } + } // .end() fully uncorks. if (state.corked) { @@ -616,12 +627,15 @@ Writable.prototype.end = function(chunk, encoding, cb) { this.uncork(); } - // This is forgiving in terms of unnecessary calls to end() and can hide - // logic errors. However, usually such errors are harmless and causing a - // hard error can be disproportionately destructive. It is not always - // trivial for the user to determine whether end() needs to be called or not. - let err; - if (!state.errored && !state.ending) { + if (err) { + // Do nothing... + } else if (!state.errored && !state.ending) { + // This is forgiving in terms of unnecessary calls to end() and can hide + // logic errors. However, usually such errors are harmless and causing a + // hard error can be disproportionately destructive. It is not always + // trivial for the user to determine whether end() needs to be called + // or not. + state.ending = true; finishMaybe(this, state, true); state.ended = true; diff --git a/test/parallel/test-stream-writable-end-cb-error.js b/test/parallel/test-stream-writable-end-cb-error.js index 8f6d209954436f..20428f1777fd17 100644 --- a/test/parallel/test-stream-writable-end-cb-error.js +++ b/test/parallel/test-stream-writable-end-cb-error.js @@ -46,3 +46,38 @@ const stream = require('stream'); writable.emit('error', new Error('kaboom')); })); } + +{ + const w = new stream.Writable({ + write(chunk, encoding, callback) { + setImmediate(callback); + }, + finish(callback) { + setImmediate(callback); + } + }); + w.end('testing ended state', common.mustCall((err) => { + // This errors since .destroy(err), which is invoked by errors + // in same tick below, will error all pending callbacks. + // Does this make sense? Not sure. + assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED'); + })); + assert.strictEqual(w.destroyed, false); + assert.strictEqual(w.writableEnded, true); + w.end(common.mustCall((err) => { + // This errors since .destroy(err), which is invoked by errors + // in same tick below, will error all pending callbacks. + // Does this make sense? Not sure. + assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED'); + })); + assert.strictEqual(w.destroyed, false); + assert.strictEqual(w.writableEnded, true); + w.end('end', common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_STREAM_WRITE_AFTER_END'); + })); + assert.strictEqual(w.destroyed, true); + w.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_STREAM_WRITE_AFTER_END'); + })); + w.on('finish', common.mustNotCall()); +} From 42aca1395349f377714615a491e6a596b5661a28 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 7 Jan 2021 16:27:29 -0800 Subject: [PATCH 147/161] crypto: fixup bug in keygen error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/36779 Refs: https://github.com/nodejs/node/pull/36729 Reviewed-By: Tobias Nießen --- lib/internal/crypto/keygen.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js index 2b0d58afd663fc..56f06f7a79fe2a 100644 --- a/lib/internal/crypto/keygen.js +++ b/lib/internal/crypto/keygen.js @@ -94,13 +94,15 @@ function generateKeyPairSync(type, options) { } function handleError(ret) { - if (ret === undefined) + if (ret == null) return; // async - const [err, [publicKey, privateKey]] = ret; + const [err, keys] = ret; if (err !== undefined) throw err; + const [publicKey, privateKey] = keys; + // If no encoding was chosen, return key objects instead. return { publicKey: wrapKey(publicKey, PublicKeyObject), From 53cf996270a999ce506610435a46c48518b7f66e Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 4 Jan 2021 09:06:26 -0800 Subject: [PATCH 148/161] crypto: implement basic secure heap support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds two new command line arguments: * `--secure-heap=n`, which causes node.js to initialize an openssl secure heap of `n` bytes on openssl initialization. * `--secure-heap-min=n`, which specifies the minimum allocation from the secure heap. * A new method `crypto.secureHeapUsed()` that returns details about the total and used secure heap allocation. The secure heap is an openssl feature that allows certain kinds of potentially sensitive information (such as private key BigNums) to be allocated from a dedicated memory area that is protected against pointer over- and underruns. The secure heap is a fixed size, so it's important that users pick a large enough size to cover the crypto operations they intend to utilize. The secure heap is disabled by default. Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/36779 Refs: https://github.com/nodejs/node/pull/36729 Reviewed-By: Tobias Nießen --- doc/api/cli.md | 37 ++++++++++ doc/api/crypto.md | 15 ++++ doc/node.1 | 7 ++ lib/crypto.js | 2 + lib/internal/crypto/util.js | 16 +++++ src/crypto/crypto_util.cc | 28 ++++++++ src/node_options.cc | 24 +++++++ src/node_options.h | 2 + test/parallel/test-crypto-secure-heap.js | 72 +++++++++++++++++++ ...rocess-env-allowed-flags-are-documented.js | 10 ++- 10 files changed, 211 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-crypto-secure-heap.js diff --git a/doc/api/cli.md b/doc/api/cli.md index c2c2efbcc0eef8..af1d6a7ad09751 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -848,6 +848,40 @@ Enables report to be generated on uncaught exceptions. Useful when inspecting the JavaScript stack in conjunction with native stack and other runtime environment data. +### `--secure-heap=n` + + +Initializes an OpenSSL secure heap of `n` bytes. When initialized, the +secure heap is used for selected types of allocations within OpenSSL +during key generation and other operations. This is useful, for instance, +to prevent sensitive information from leaking due to pointer overruns +or underruns. + +The secure heap is a fixed size and cannot be resized at runtime so, +if used, it is important to select a large enough heap to cover all +application uses. + +The heap size given must be a power of two. Any value less than 2 +will disable the secure heap. + +The secure heap is disabled by default. + +The secure heap is not available on Windows. + +See [`CRYPTO_secure_malloc_init`][] for more details. + +### `--secure-heap-min=n` + + +When using `--secure-heap`, the `--secure-heap-min` flag specifies the +minimum allocation from the secure heap. The minimum value is `2`. +The maximum value is the lesser of `--secure-heap` or `2147483647`. +The value given must be a power of two. + ### `--throw-deprecation` + +* Returns: {Object} + * `total` {number} The total allocated secure heap size as specified + using the `--secure-heap=n` command-line flag. + * `min` {number} The minimum allocation from the secure heap as + specified using the `--secure-heap-min` command-line flag. + * `used` {number} The total number of bytes currently allocated from + the secure heap. + * `utilization` {number} The calculated ratio of `used` to `total` + allocated bytes. + ### `crypto.setEngine(engine[, flags])` -* Type: {boolean} True for Node.js internal events, false otherwise. +* Type: {boolean} -Currently only `AbortSignal`s' `"abort"` event is fired with `isTrusted` -set to `true`. +The {AbortSignal} `"abort"` event is emitted with `isTrusted` set to `true`. The +value is `false` in all other cases. #### `event.preventDefault()` Initializes an OpenSSL secure heap of `n` bytes. When initialized, the @@ -874,7 +874,7 @@ See [`CRYPTO_secure_malloc_init`][] for more details. ### `--secure-heap-min=n` When using `--secure-heap`, the `--secure-heap-min` flag specifies the diff --git a/doc/api/crypto.md b/doc/api/crypto.md index b7977120fa4924..797e17bdecb20a 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1647,7 +1647,7 @@ be passed instead of a public key. ## Class: `X509Certificate` Encapsulates an X509 certificate and provides read-only access to @@ -1663,7 +1663,7 @@ console.log(x509.subject); ### `new X509Certificate(buffer)` * `buffer` {string|TypedArray|Buffer|DataView} A PEM or DER encoded @@ -1671,7 +1671,7 @@ added: REPLACEME ### `x509.ca` * Type: {boolean} Will be `true` if this is a Certificate Authority (ca) @@ -1679,7 +1679,7 @@ added: REPLACEME ### `x509.checkEmail(email[, options])` * `email` {string} @@ -1696,7 +1696,7 @@ Checks whether the certificate matches the given email address. ### `x509.checkHost(name[, options])` * `name` {string} @@ -1713,7 +1713,7 @@ Checks whether the certificate matches the given host name. ### `x509.checkIP(ip[, options])` * `ip` {string} @@ -1730,7 +1730,7 @@ Checks whether the certificate matches the given IP address (IPv4 or IPv6). ### `x509.checkIssued(otherCert)` * `otherCert` {X509Certificate} @@ -1740,7 +1740,7 @@ Checks whether this certificate was issued by the given `otherCert`. ### `x509.checkPrivateKey(privateKey)` * `privateKey` {KeyObject} A private key. @@ -1751,7 +1751,7 @@ the given private key. ### `x509.fingerprint` * Type: {string} @@ -1760,7 +1760,7 @@ The SHA-1 fingerprint of this certificate. ### `x509.fingerprint256` * Type: {string} @@ -1769,7 +1769,7 @@ The SHA-256 fingerprint of this certificate. ### `x509.infoAccess` * Type: {string} @@ -1778,7 +1778,7 @@ The information access content of this certificate. ### `x509.issuer` * Type: {string} @@ -1787,7 +1787,7 @@ The issuer identification included in this certificate. ### `x509.keyUsage` * Type: {string[]} @@ -1796,7 +1796,7 @@ An array detailing the key usages for this certificate. ### `x509.publicKey` * Type: {KeyObject} @@ -1805,7 +1805,7 @@ The public key {KeyObject} for this certificate. ### `x509.raw` * Type: {Buffer} @@ -1814,7 +1814,7 @@ A `Buffer` containing the DER encoding of this certificate. ### `x509.serialNumber` * Type: {string} @@ -1823,7 +1823,7 @@ The serial number of this certificate. ### `x509.subject` * Type: {string} @@ -1832,7 +1832,7 @@ The complete subject of this certificate. ### `x509.subjectAltName` * Type: {string} @@ -1841,7 +1841,7 @@ The subject alternative name specified for this certificate. ### `x509.toJSON()` * Type: {string} @@ -1852,7 +1852,7 @@ certificate. ### `x509.toLegacyObject()` * Type: {Object} @@ -1862,7 +1862,7 @@ Returns information about this certificate using the legacy ### `x509.toString()` * Type: {string} @@ -1871,7 +1871,7 @@ Returns the PEM-encoded certificate. ### `x509.validFrom` * Type: {string} @@ -1880,7 +1880,7 @@ The date/time from which this certificate is considered valid. ### `x509.validTo` * Type: {string} @@ -1889,7 +1889,7 @@ The date/time until which this certificate is considered valid. ### `x509.verify(publicKey)` * `publicKey` {KeyObject} A public key. @@ -3415,7 +3415,7 @@ console.log(`The dice rolled: ${n}`); ### `crypto.randomUUID([options])` * `options` {Object} @@ -3547,7 +3547,7 @@ console.log(key2.toString('hex')); // '3745e48...aa39b34' ### `crypto.secureHeapUsed()` * Returns: {Object} diff --git a/doc/api/http.md b/doc/api/http.md index 368eefb76fa80b..47e34c6a58857c 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -113,7 +113,7 @@ http.get({ * Returns: {integer} diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index f7dfea6b9eaa07..f3d8f44e4abac3 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -474,7 +474,7 @@ are part of the channel.