docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,107 @@
export declare enum charCodes {
backSpace = 8,
lineFeed = 10,
tab = 9,
carriageReturn = 13,
shiftOut = 14,
space = 32,
exclamationMark = 33,
quotationMark = 34,
numberSign = 35,
dollarSign = 36,
percentSign = 37,
ampersand = 38,
apostrophe = 39,
leftParenthesis = 40,
rightParenthesis = 41,
asterisk = 42,
plusSign = 43,
comma = 44,
dash = 45,
dot = 46,
slash = 47,
digit0 = 48,
digit1 = 49,
digit2 = 50,
digit3 = 51,
digit4 = 52,
digit5 = 53,
digit6 = 54,
digit7 = 55,
digit8 = 56,
digit9 = 57,
colon = 58,
semicolon = 59,
lessThan = 60,
equalsTo = 61,
greaterThan = 62,
questionMark = 63,
atSign = 64,
uppercaseA = 65,
uppercaseB = 66,
uppercaseC = 67,
uppercaseD = 68,
uppercaseE = 69,
uppercaseF = 70,
uppercaseG = 71,
uppercaseH = 72,
uppercaseI = 73,
uppercaseJ = 74,
uppercaseK = 75,
uppercaseL = 76,
uppercaseM = 77,
uppercaseN = 78,
uppercaseO = 79,
uppercaseP = 80,
uppercaseQ = 81,
uppercaseR = 82,
uppercaseS = 83,
uppercaseT = 84,
uppercaseU = 85,
uppercaseV = 86,
uppercaseW = 87,
uppercaseX = 88,
uppercaseY = 89,
uppercaseZ = 90,
leftSquareBracket = 91,
backslash = 92,
rightSquareBracket = 93,
caret = 94,
underscore = 95,
graveAccent = 96,
lowercaseA = 97,
lowercaseB = 98,
lowercaseC = 99,
lowercaseD = 100,
lowercaseE = 101,
lowercaseF = 102,
lowercaseG = 103,
lowercaseH = 104,
lowercaseI = 105,
lowercaseJ = 106,
lowercaseK = 107,
lowercaseL = 108,
lowercaseM = 109,
lowercaseN = 110,
lowercaseO = 111,
lowercaseP = 112,
lowercaseQ = 113,
lowercaseR = 114,
lowercaseS = 115,
lowercaseT = 116,
lowercaseU = 117,
lowercaseV = 118,
lowercaseW = 119,
lowercaseX = 120,
lowercaseY = 121,
lowercaseZ = 122,
leftCurlyBrace = 123,
verticalBar = 124,
rightCurlyBrace = 125,
tilde = 126,
nonBreakingSpace = 160,
oghamSpaceMark = 5760,
lineSeparator = 8232,
paragraphSeparator = 8233
}
export declare function isDigit(code: number): boolean;
@@ -0,0 +1,113 @@
'use strict';
var inspect = require('object-inspect');
var $TypeError = require('es-errors/type');
/*
* This function traverses the list returning the node corresponding to the given key.
*
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
* By doing so, all the recently used nodes can be accessed relatively quickly.
*/
/** @type {import('./list.d.ts').listGetNode} */
// eslint-disable-next-line consistent-return
var listGetNode = function (list, key, isDelete) {
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
var prev = list;
/** @type {(typeof list)['next']} */
var curr;
// eslint-disable-next-line eqeqeq
for (; (curr = prev.next) != null; prev = curr) {
if (curr.key === key) {
prev.next = curr.next;
if (!isDelete) {
// eslint-disable-next-line no-extra-parens
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
list.next = curr; // eslint-disable-line no-param-reassign
}
return curr;
}
}
};
/** @type {import('./list.d.ts').listGet} */
var listGet = function (objects, key) {
if (!objects) {
return void undefined;
}
var node = listGetNode(objects, key);
return node && node.value;
};
/** @type {import('./list.d.ts').listSet} */
var listSet = function (objects, key, value) {
var node = listGetNode(objects, key);
if (node) {
node.value = value;
} else {
// Prepend the new node to the beginning of the list
objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
key: key,
next: objects.next,
value: value
});
}
};
/** @type {import('./list.d.ts').listHas} */
var listHas = function (objects, key) {
if (!objects) {
return false;
}
return !!listGetNode(objects, key);
};
/** @type {import('./list.d.ts').listDelete} */
// eslint-disable-next-line consistent-return
var listDelete = function (objects, key) {
if (objects) {
return listGetNode(objects, key, true);
}
};
/** @type {import('.')} */
module.exports = function getSideChannelList() {
/** @typedef {ReturnType<typeof getSideChannelList>} Channel */
/** @typedef {Parameters<Channel['get']>[0]} K */
/** @typedef {Parameters<Channel['set']>[1]} V */
/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
/** @type {Channel} */
var channel = {
assert: function (key) {
if (!channel.has(key)) {
throw new $TypeError('Side channel does not contain ' + inspect(key));
}
},
'delete': function (key) {
var root = $o && $o.next;
var deletedNode = listDelete($o, key);
if (deletedNode && root && root === deletedNode) {
$o = void undefined;
}
return !!deletedNode;
},
get: function (key) {
return listGet($o, key);
},
has: function (key) {
return listHas($o, key);
},
set: function (key, value) {
if (!$o) {
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
$o = {
next: void undefined
};
}
// eslint-disable-next-line no-extra-parens
listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
}
};
// @ts-expect-error TODO: figure out why this is erroring
return channel;
};
@@ -0,0 +1,55 @@
'use strict';
/**
* Calculate data maxRate
* @param {Number} [samplesCount= 10]
* @param {Number} [min= 1000]
* @returns {Function}
*/
function speedometer(samplesCount, min) {
samplesCount = samplesCount || 10;
const bytes = new Array(samplesCount);
const timestamps = new Array(samplesCount);
let head = 0;
let tail = 0;
let firstSampleTS;
min = min !== undefined ? min : 1000;
return function push(chunkLength) {
const now = Date.now();
const startedAt = timestamps[tail];
if (!firstSampleTS) {
firstSampleTS = now;
}
bytes[head] = chunkLength;
timestamps[head] = now;
let i = tail;
let bytesCount = 0;
while (i !== head) {
bytesCount += bytes[i++];
i = i % samplesCount;
}
head = (head + 1) % samplesCount;
if (head === tail) {
tail = (tail + 1) % samplesCount;
}
if (now - firstSampleTS < min) {
return;
}
const passed = startedAt && now - startedAt;
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
};
}
export default speedometer;
@@ -0,0 +1,92 @@
'use strict';
// Copyright 2013 Timothy J Fontaine <tjfontaine@gmail.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:
//
// 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
/*
Read any stream all the way to the end and trigger a single cb
const http = require('http');
const rte = require('readtoend');
http.get('http://nodejs.org', function(response) {
rte.readToEnd(response, function(err, body) {
console.log(body);
});
});
*/
let stream = require('stream');
const util = require('util');
if (!stream.Transform) {
stream = require('readable-stream');
}
function ReadToEnd(opts) {
if (!(this instanceof ReadToEnd)) {
return new ReadToEnd(opts);
}
stream.Transform.call(this, opts);
this._rte_encoding = opts.encoding || 'utf8';
this._buff = '';
}
module.exports = ReadToEnd;
util.inherits(ReadToEnd, stream.Transform);
ReadToEnd.prototype._transform = function(chunk, encoding, done) {
this._buff += chunk.toString(this._rte_encoding);
this.push(chunk);
done();
};
ReadToEnd.prototype._flush = function(done) {
this.emit('complete', undefined, this._buff);
done();
};
ReadToEnd.readToEnd = function(stream, options, cb) {
if (!cb) {
cb = options;
options = {};
}
const dest = new ReadToEnd(options);
stream.pipe(dest);
stream.on('error', function(err) {
stream.unpipe(dest);
cb(err);
});
dest.on('complete', cb);
dest.resume();
return dest;
};
@@ -0,0 +1,212 @@
/**
* @author Nicholas C. Zakas
* See LICENSE file in root directory for full license.
*/
"use strict"
const path = require("path")
const { READ, ReferenceTracker, getStringIfConstant } = require("eslint-utils")
/**
* Get the first char of the specified template element.
* @param {TemplateLiteral} node The `TemplateLiteral` node to get.
* @param {number} i The number of template elements to get first char.
* @param {Set<Node>} sepNodes The nodes of `path.sep`.
* @param {import("escope").Scope} globalScope The global scope object.
* @param {string[]} outNextChars The array to collect chars.
* @returns {void}
*/
function collectFirstCharsOfTemplateElement(
node,
i,
sepNodes,
globalScope,
outNextChars
) {
const element = node.quasis[i].value.cooked
if (element == null) {
return
}
if (element !== "") {
outNextChars.push(element[0])
return
}
if (node.expressions.length > i) {
collectFirstChars(
node.expressions[i],
sepNodes,
globalScope,
outNextChars
)
}
}
/**
* Get the first char of a given node.
* @param {TemplateLiteral} node The `TemplateLiteral` node to get.
* @param {Set<Node>} sepNodes The nodes of `path.sep`.
* @param {import("escope").Scope} globalScope The global scope object.
* @param {string[]} outNextChars The array to collect chars.
* @returns {void}
*/
function collectFirstChars(node, sepNodes, globalScope, outNextChars) {
switch (node.type) {
case "AssignmentExpression":
collectFirstChars(node.right, sepNodes, globalScope, outNextChars)
break
case "BinaryExpression":
collectFirstChars(node.left, sepNodes, globalScope, outNextChars)
break
case "ConditionalExpression":
collectFirstChars(
node.consequent,
sepNodes,
globalScope,
outNextChars
)
collectFirstChars(
node.alternate,
sepNodes,
globalScope,
outNextChars
)
break
case "LogicalExpression":
collectFirstChars(node.left, sepNodes, globalScope, outNextChars)
collectFirstChars(node.right, sepNodes, globalScope, outNextChars)
break
case "SequenceExpression":
collectFirstChars(
node.expressions[node.expressions.length - 1],
sepNodes,
globalScope,
outNextChars
)
break
case "TemplateLiteral":
collectFirstCharsOfTemplateElement(
node,
0,
sepNodes,
globalScope,
outNextChars
)
break
case "Identifier":
case "MemberExpression":
if (sepNodes.has(node)) {
outNextChars.push(path.sep)
break
}
// fallthrough
default: {
const str = getStringIfConstant(node, globalScope)
if (str) {
outNextChars.push(str[0])
}
}
}
}
/**
* Check if a char is a path separator or not.
* @param {string} c The char to check.
* @returns {boolean} `true` if the char is a path separator.
*/
function isPathSeparator(c) {
return c === "/" || c === path.sep
}
/**
* Check if the given Identifier node is followed by string concatenation with a
* path separator.
* @param {Identifier} node The `__dirname` or `__filename` node to check.
* @param {Set<Node>} sepNodes The nodes of `path.sep`.
* @param {import("escope").Scope} globalScope The global scope object.
* @returns {boolean} `true` if the given Identifier node is followed by string
* concatenation with a path separator.
*/
function isConcat(node, sepNodes, globalScope) {
const parent = node.parent
const nextChars = []
if (
parent.type === "BinaryExpression" &&
parent.operator === "+" &&
parent.left === node
) {
collectFirstChars(
parent.right,
sepNodes,
globalScope,
/* out */ nextChars
)
} else if (parent.type === "TemplateLiteral") {
collectFirstCharsOfTemplateElement(
parent,
parent.expressions.indexOf(node) + 1,
sepNodes,
globalScope,
/* out */ nextChars
)
}
return nextChars.some(isPathSeparator)
}
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"disallow string concatenation with `__dirname` and `__filename`",
category: "Possible Errors",
recommended: false,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-path-concat.md",
},
fixable: null,
schema: [],
messages: {
usePathFunctions:
"Use path.join() or path.resolve() instead of string concatenation.",
},
},
create(context) {
return {
"Program:exit"() {
const globalScope = context.getScope()
const tracker = new ReferenceTracker(globalScope)
const sepNodes = new Set()
// Collect `paht.sep` references
for (const { node } of tracker.iterateCjsReferences({
path: { sep: { [READ]: true } },
})) {
sepNodes.add(node)
}
for (const { node } of tracker.iterateEsmReferences({
path: { sep: { [READ]: true } },
})) {
sepNodes.add(node)
}
// Verify `__dirname` and `__filename`
for (const { node } of tracker.iterateGlobalReferences({
__dirname: { [READ]: true },
__filename: { [READ]: true },
})) {
if (isConcat(node, sepNodes, globalScope)) {
context.report({
node: node.parent,
messageId: "usePathFunctions",
})
}
}
},
}
},
}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
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.
@@ -0,0 +1,763 @@
/* eslint-disable complexity,max-statements */
/**
* file.js: Transport for outputting to a local log file.
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*/
'use strict';
const fs = require('fs');
const path = require('path');
const asyncSeries = require('async/series');
const zlib = require('zlib');
const { MESSAGE } = require('triple-beam');
const { Stream, PassThrough } = require('readable-stream');
const TransportStream = require('winston-transport');
const debug = require('@dabh/diagnostics')('winston:file');
const os = require('os');
const tailFile = require('../tail-file');
/**
* Transport for outputting to a local log file.
* @type {File}
* @extends {TransportStream}
*/
module.exports = class File extends TransportStream {
/**
* Constructor function for the File transport object responsible for
* persisting log messages and metadata to one or more files.
* @param {Object} options - Options for this instance.
*/
constructor(options = {}) {
super(options);
// Expose the name of this Transport on the prototype.
this.name = options.name || 'file';
// Helper function which throws an `Error` in the event that any of the
// rest of the arguments is present in `options`.
function throwIf(target, ...args) {
args.slice(1).forEach(name => {
if (options[name]) {
throw new Error(`Cannot set ${name} and ${target} together`);
}
});
}
// Setup the base stream that always gets piped to to handle buffering.
this._stream = new PassThrough();
this._stream.setMaxListeners(30);
// Bind this context for listener methods.
this._onError = this._onError.bind(this);
if (options.filename || options.dirname) {
throwIf('filename or dirname', 'stream');
this._basename = this.filename = options.filename
? path.basename(options.filename)
: 'winston.log';
this.dirname = options.dirname || path.dirname(options.filename);
this.options = options.options || { flags: 'a' };
} else if (options.stream) {
// eslint-disable-next-line no-console
console.warn('options.stream will be removed in winston@4. Use winston.transports.Stream');
throwIf('stream', 'filename', 'maxsize');
this._dest = this._stream.pipe(this._setupStream(options.stream));
this.dirname = path.dirname(this._dest.path);
// We need to listen for drain events when write() returns false. This
// can make node mad at times.
} else {
throw new Error('Cannot log to file without filename or stream.');
}
this.maxsize = options.maxsize || null;
this.rotationFormat = options.rotationFormat || false;
this.zippedArchive = options.zippedArchive || false;
this.maxFiles = options.maxFiles || null;
this.eol = (typeof options.eol === 'string') ? options.eol : os.EOL;
this.tailable = options.tailable || false;
this.lazy = options.lazy || false;
// Internal state variables representing the number of files this instance
// has created and the current size (in bytes) of the current logfile.
this._size = 0;
this._pendingSize = 0;
this._created = 0;
this._drain = false;
this._opening = false;
this._ending = false;
this._fileExist = false;
if (this.dirname) this._createLogDirIfNotExist(this.dirname);
if (!this.lazy) this.open();
}
finishIfEnding() {
if (this._ending) {
if (this._opening) {
this.once('open', () => {
this._stream.once('finish', () => this.emit('finish'));
setImmediate(() => this._stream.end());
});
} else {
this._stream.once('finish', () => this.emit('finish'));
setImmediate(() => this._stream.end());
}
}
}
/**
* Core logging method exposed to Winston. Metadata is optional.
* @param {Object} info - TODO: add param description.
* @param {Function} callback - TODO: add param description.
* @returns {undefined}
*/
log(info, callback = () => { }) {
// Remark: (jcrugzz) What is necessary about this callback(null, true) now
// when thinking about 3.x? Should silent be handled in the base
// TransportStream _write method?
if (this.silent) {
callback();
return true;
}
// Output stream buffer is full and has asked us to wait for the drain event
if (this._drain) {
this._stream.once('drain', () => {
this._drain = false;
this.log(info, callback);
});
return;
}
if (this._rotate) {
this._stream.once('rotate', () => {
this._rotate = false;
this.log(info, callback);
});
return;
}
if (this.lazy) {
if (!this._fileExist) {
if (!this._opening) {
this.open();
}
this.once('open', () => {
this._fileExist = true;
this.log(info, callback);
return;
});
return;
}
if (this._needsNewFile(this._pendingSize)) {
this._dest.once('close', () => {
if (!this._opening) {
this.open();
}
this.once('open', () => {
this.log(info, callback);
return;
});
return;
});
return;
}
}
// Grab the raw string and append the expected EOL.
const output = `${info[MESSAGE]}${this.eol}`;
const bytes = Buffer.byteLength(output);
// After we have written to the PassThrough check to see if we need
// to rotate to the next file.
//
// Remark: This gets called too early and does not depict when data
// has been actually flushed to disk.
function logged() {
this._size += bytes;
this._pendingSize -= bytes;
debug('logged %s %s', this._size, output);
this.emit('logged', info);
// Do not attempt to rotate files while rotating
if (this._rotate) {
return;
}
// Do not attempt to rotate files while opening
if (this._opening) {
return;
}
// Check to see if we need to end the stream and create a new one.
if (!this._needsNewFile()) {
return;
}
if (this.lazy) {
this._endStream(() => {this.emit('fileclosed');});
return;
}
// End the current stream, ensure it flushes and create a new one.
// This could potentially be optimized to not run a stat call but its
// the safest way since we are supporting `maxFiles`.
this._rotate = true;
this._endStream(() => this._rotateFile());
}
// Keep track of the pending bytes being written while files are opening
// in order to properly rotate the PassThrough this._stream when the file
// eventually does open.
this._pendingSize += bytes;
if (this._opening
&& !this.rotatedWhileOpening
&& this._needsNewFile(this._size + this._pendingSize)) {
this.rotatedWhileOpening = true;
}
const written = this._stream.write(output, logged.bind(this));
if (!written) {
this._drain = true;
this._stream.once('drain', () => {
this._drain = false;
callback();
});
} else {
callback(); // eslint-disable-line callback-return
}
debug('written', written, this._drain);
this.finishIfEnding();
return written;
}
/**
* Query the transport. Options object is optional.
* @param {Object} options - Loggly-like query options for this instance.
* @param {function} callback - Continuation to respond to when complete.
* TODO: Refactor me.
*/
query(options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = normalizeQuery(options);
const file = path.join(this.dirname, this.filename);
let buff = '';
let results = [];
let row = 0;
const stream = fs.createReadStream(file, {
encoding: 'utf8'
});
stream.on('error', err => {
if (stream.readable) {
stream.destroy();
}
if (!callback) {
return;
}
return err.code !== 'ENOENT' ? callback(err) : callback(null, results);
});
stream.on('data', data => {
data = (buff + data).split(/\n+/);
const l = data.length - 1;
let i = 0;
for (; i < l; i++) {
if (!options.start || row >= options.start) {
add(data[i]);
}
row++;
}
buff = data[l];
});
stream.on('close', () => {
if (buff) {
add(buff, true);
}
if (options.order === 'desc') {
results = results.reverse();
}
// eslint-disable-next-line callback-return
if (callback) callback(null, results);
});
function add(buff, attempt) {
try {
const log = JSON.parse(buff);
if (check(log)) {
push(log);
}
} catch (e) {
if (!attempt) {
stream.emit('error', e);
}
}
}
function push(log) {
if (
options.rows &&
results.length >= options.rows &&
options.order !== 'desc'
) {
if (stream.readable) {
stream.destroy();
}
return;
}
if (options.fields) {
log = options.fields.reduce((obj, key) => {
obj[key] = log[key];
return obj;
}, {});
}
if (options.order === 'desc') {
if (results.length >= options.rows) {
results.shift();
}
}
results.push(log);
}
function check(log) {
if (!log) {
return;
}
if (typeof log !== 'object') {
return;
}
const time = new Date(log.timestamp);
if (
(options.from && time < options.from) ||
(options.until && time > options.until) ||
(options.level && options.level !== log.level)
) {
return;
}
return true;
}
function normalizeQuery(options) {
options = options || {};
// limit
options.rows = options.rows || options.limit || 10;
// starting row offset
options.start = options.start || 0;
// now
options.until = options.until || new Date();
if (typeof options.until !== 'object') {
options.until = new Date(options.until);
}
// now - 24
options.from = options.from || (options.until - (24 * 60 * 60 * 1000));
if (typeof options.from !== 'object') {
options.from = new Date(options.from);
}
// 'asc' or 'desc'
options.order = options.order || 'desc';
return options;
}
}
/**
* Returns a log stream for this transport. Options object is optional.
* @param {Object} options - Stream options for this instance.
* @returns {Stream} - TODO: add return description.
* TODO: Refactor me.
*/
stream(options = {}) {
const file = path.join(this.dirname, this.filename);
const stream = new Stream();
const tail = {
file,
start: options.start
};
stream.destroy = tailFile(tail, (err, line) => {
if (err) {
return stream.emit('error', err);
}
try {
stream.emit('data', line);
line = JSON.parse(line);
stream.emit('log', line);
} catch (e) {
stream.emit('error', e);
}
});
return stream;
}
/**
* Checks to see the filesize of.
* @returns {undefined}
*/
open() {
// If we do not have a filename then we were passed a stream and
// don't need to keep track of size.
if (!this.filename) return;
if (this._opening) return;
this._opening = true;
// Stat the target file to get the size and create the stream.
this.stat((err, size) => {
if (err) {
return this.emit('error', err);
}
debug('stat done: %s { size: %s }', this.filename, size);
this._size = size;
this._dest = this._createStream(this._stream);
this._opening = false;
this.once('open', () => {
if (!this._stream.emit('rotate')) {
this._rotate = false;
}
});
});
}
/**
* Stat the file and assess information in order to create the proper stream.
* @param {function} callback - TODO: add param description.
* @returns {undefined}
*/
stat(callback) {
const target = this._getFile();
const fullpath = path.join(this.dirname, target);
fs.stat(fullpath, (err, stat) => {
if (err && err.code === 'ENOENT') {
debug('ENOENT ok', fullpath);
// Update internally tracked filename with the new target name.
this.filename = target;
return callback(null, 0);
}
if (err) {
debug(`err ${err.code} ${fullpath}`);
return callback(err);
}
if (!stat || this._needsNewFile(stat.size)) {
// If `stats.size` is greater than the `maxsize` for this
// instance then try again.
return this._incFile(() => this.stat(callback));
}
// Once we have figured out what the filename is, set it
// and return the size.
this.filename = target;
callback(null, stat.size);
});
}
/**
* Closes the stream associated with this instance.
* @param {function} cb - TODO: add param description.
* @returns {undefined}
*/
close(cb) {
if (!this._stream) {
return;
}
this._stream.end(() => {
if (cb) {
cb(); // eslint-disable-line callback-return
}
this.emit('flush');
this.emit('closed');
});
}
/**
* TODO: add method description.
* @param {number} size - TODO: add param description.
* @returns {undefined}
*/
_needsNewFile(size) {
size = size || this._size;
return this.maxsize && size >= this.maxsize;
}
/**
* TODO: add method description.
* @param {Error} err - TODO: add param description.
* @returns {undefined}
*/
_onError(err) {
this.emit('error', err);
}
/**
* TODO: add method description.
* @param {Stream} stream - TODO: add param description.
* @returns {mixed} - TODO: add return description.
*/
_setupStream(stream) {
stream.on('error', this._onError);
return stream;
}
/**
* TODO: add method description.
* @param {Stream} stream - TODO: add param description.
* @returns {mixed} - TODO: add return description.
*/
_cleanupStream(stream) {
stream.removeListener('error', this._onError);
stream.destroy();
return stream;
}
/**
* TODO: add method description.
*/
_rotateFile() {
this._incFile(() => this.open());
}
/**
* Unpipe from the stream that has been marked as full and end it so it
* flushes to disk.
*
* @param {function} callback - Callback for when the current file has closed.
* @private
*/
_endStream(callback = () => { }) {
if (this._dest) {
this._stream.unpipe(this._dest);
this._dest.end(() => {
this._cleanupStream(this._dest);
callback();
});
} else {
callback(); // eslint-disable-line callback-return
}
}
/**
* Returns the WritableStream for the active file on this instance. If we
* should gzip the file then a zlib stream is returned.
*
* @param {ReadableStream} source –PassThrough to pipe to the file when open.
* @returns {WritableStream} Stream that writes to disk for the active file.
*/
_createStream(source) {
const fullpath = path.join(this.dirname, this.filename);
debug('create stream start', fullpath, this.options);
const dest = fs.createWriteStream(fullpath, this.options)
// TODO: What should we do with errors here?
.on('error', err => debug(err))
.on('close', () => debug('close', dest.path, dest.bytesWritten))
.on('open', () => {
debug('file open ok', fullpath);
this.emit('open', fullpath);
source.pipe(dest);
// If rotation occured during the open operation then we immediately
// start writing to a new PassThrough, begin opening the next file
// and cleanup the previous source and dest once the source has drained.
if (this.rotatedWhileOpening) {
this._stream = new PassThrough();
this._stream.setMaxListeners(30);
this._rotateFile();
this.rotatedWhileOpening = false;
this._cleanupStream(dest);
source.end();
}
});
debug('create stream ok', fullpath);
return dest;
}
/**
* TODO: add method description.
* @param {function} callback - TODO: add param description.
* @returns {undefined}
*/
_incFile(callback) {
debug('_incFile', this.filename);
const ext = path.extname(this._basename);
const basename = path.basename(this._basename, ext);
const tasks = [];
if (this.zippedArchive) {
tasks.push(
function (cb) {
const num = this._created > 0 && !this.tailable ? this._created : '';
this._compressFile(
path.join(this.dirname, `${basename}${num}${ext}`),
path.join(this.dirname, `${basename}${num}${ext}.gz`),
cb
);
}.bind(this)
);
}
tasks.push(
function (cb) {
if (!this.tailable) {
this._created += 1;
this._checkMaxFilesIncrementing(ext, basename, cb);
} else {
this._checkMaxFilesTailable(ext, basename, cb);
}
}.bind(this)
);
asyncSeries(tasks, callback);
}
/**
* Gets the next filename to use for this instance in the case that log
* filesizes are being capped.
* @returns {string} - TODO: add return description.
* @private
*/
_getFile() {
const ext = path.extname(this._basename);
const basename = path.basename(this._basename, ext);
const isRotation = this.rotationFormat
? this.rotationFormat()
: this._created;
// Caveat emptor (indexzero): rotationFormat() was broken by design When
// combined with max files because the set of files to unlink is never
// stored.
return !this.tailable && this._created
? `${basename}${isRotation}${ext}`
: `${basename}${ext}`;
}
/**
* Increment the number of files created or checked by this instance.
* @param {mixed} ext - TODO: add param description.
* @param {mixed} basename - TODO: add param description.
* @param {mixed} callback - TODO: add param description.
* @returns {undefined}
* @private
*/
_checkMaxFilesIncrementing(ext, basename, callback) {
// Check for maxFiles option and delete file.
if (!this.maxFiles || this._created < this.maxFiles) {
return setImmediate(callback);
}
const oldest = this._created - this.maxFiles;
const isOldest = oldest !== 0 ? oldest : '';
const isZipped = this.zippedArchive ? '.gz' : '';
const filePath = `${basename}${isOldest}${ext}${isZipped}`;
const target = path.join(this.dirname, filePath);
fs.unlink(target, callback);
}
/**
* Roll files forward based on integer, up to maxFiles. e.g. if base if
* file.log and it becomes oversized, roll to file1.log, and allow file.log
* to be re-used. If file is oversized again, roll file1.log to file2.log,
* roll file.log to file1.log, and so on.
* @param {mixed} ext - TODO: add param description.
* @param {mixed} basename - TODO: add param description.
* @param {mixed} callback - TODO: add param description.
* @returns {undefined}
* @private
*/
_checkMaxFilesTailable(ext, basename, callback) {
const tasks = [];
if (!this.maxFiles) {
return;
}
// const isZipped = this.zippedArchive ? '.gz' : '';
const isZipped = this.zippedArchive ? '.gz' : '';
for (let x = this.maxFiles - 1; x > 1; x--) {
tasks.push(function (i, cb) {
let fileName = `${basename}${(i - 1)}${ext}${isZipped}`;
const tmppath = path.join(this.dirname, fileName);
fs.exists(tmppath, exists => {
if (!exists) {
return cb(null);
}
fileName = `${basename}${i}${ext}${isZipped}`;
fs.rename(tmppath, path.join(this.dirname, fileName), cb);
});
}.bind(this, x));
}
asyncSeries(tasks, () => {
fs.rename(
path.join(this.dirname, `${basename}${ext}${isZipped}`),
path.join(this.dirname, `${basename}1${ext}${isZipped}`),
callback
);
});
}
/**
* Compresses src to dest with gzip and unlinks src
* @param {string} src - path to source file.
* @param {string} dest - path to zipped destination file.
* @param {Function} callback - callback called after file has been compressed.
* @returns {undefined}
* @private
*/
_compressFile(src, dest, callback) {
fs.access(src, fs.F_OK, (err) => {
if (err) {
return callback();
}
var gzip = zlib.createGzip();
var inp = fs.createReadStream(src);
var out = fs.createWriteStream(dest);
out.on('finish', () => {
fs.unlink(src, callback);
});
inp.pipe(gzip).pipe(out);
});
}
_createLogDirIfNotExist(dirPath) {
/* eslint-disable no-sync */
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}
/* eslint-enable no-sync */
}
};
@@ -0,0 +1 @@
module.exports={C:{"52":0.0204,"78":0.0102,"96":0.0459,"112":0.0816,"115":0.2703,"123":0.0051,"125":0.0051,"127":0.0051,"128":0.0612,"134":0.0153,"135":0.0051,"136":0.0102,"137":0.0051,"138":0.0051,"139":0.0102,"140":0.0306,"141":0.0102,"142":0.0306,"143":0.918,"144":0.7803,"145":0.0051,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 121 122 124 126 129 130 131 132 133 146 147 3.5 3.6"},D:{"39":0.0051,"40":0.0051,"41":0.0051,"42":0.0051,"43":0.0051,"44":0.0051,"45":0.0051,"46":0.0051,"47":0.0051,"48":0.0051,"49":0.0102,"50":0.0051,"51":0.0051,"52":0.0051,"53":0.0051,"54":0.0051,"55":0.0051,"56":0.0051,"57":0.0051,"58":0.0051,"59":0.0051,"60":0.0051,"70":0.0102,"74":0.0357,"76":0.0102,"77":0.0051,"79":0.0153,"87":0.0051,"88":0.0051,"90":0.0051,"100":0.1632,"102":0.0459,"103":0.0102,"104":0.0153,"105":0.0408,"106":0.0051,"108":0.0051,"109":0.6936,"110":0.0051,"111":0.0051,"112":0.1479,"113":0.051,"114":0.0204,"115":0.0051,"116":0.0204,"118":0.0102,"119":0.0153,"120":0.1071,"121":0.0153,"122":0.0357,"123":0.0102,"124":0.0204,"125":1.6932,"126":0.0255,"127":0.0051,"128":0.0561,"129":0.0459,"130":0.0663,"131":0.0918,"132":0.0357,"133":0.0561,"134":0.0408,"135":0.051,"136":0.0765,"137":0.0816,"138":0.1734,"139":0.4029,"140":10.4958,"141":24.225,"142":0.1224,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 66 67 68 69 71 72 73 75 78 80 81 83 84 85 86 89 91 92 93 94 95 96 97 98 99 101 107 117 143 144 145"},F:{"85":0.0051,"91":0.0153,"92":0.0306,"95":0.0306,"120":0.1224,"121":0.1428,"122":1.3413,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"15":0.0051,"18":0.0051,"92":0.0051,"109":0.0102,"112":0.0408,"114":0.0051,"121":0.0051,"122":0.0051,"126":0.0051,"127":0.0051,"129":0.0051,"131":0.0051,"133":0.0051,"134":0.0102,"135":0.0051,"136":0.0102,"137":0.0051,"138":0.0153,"139":0.0153,"140":0.3978,"141":1.8666,"142":0.0051,_:"12 13 14 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 113 115 116 117 118 119 120 123 124 125 128 130 132"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 17.0 26.2","13.1":0.0051,"14.1":0.0102,"15.6":0.0306,"16.2":0.0051,"16.3":0.0051,"16.4":0.0051,"16.5":0.0051,"16.6":0.0306,"17.1":0.0255,"17.2":0.0051,"17.3":0.0051,"17.4":0.0102,"17.5":0.0153,"17.6":0.0459,"18.0":0.0051,"18.1":0.0102,"18.2":0.0051,"18.3":0.0204,"18.4":0.0102,"18.5-18.6":0.051,"26.0":0.2346,"26.1":0.0102},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00107,"5.0-5.1":0,"6.0-6.1":0.00427,"7.0-7.1":0.00321,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00962,"10.0-10.2":0.00107,"10.3":0.01817,"11.0-11.2":0.26931,"11.3-11.4":0.00641,"12.0-12.1":0.00214,"12.2-12.5":0.05237,"13.0-13.1":0,"13.2":0.00534,"13.3":0.00214,"13.4-13.7":0.00855,"14.0-14.4":0.01817,"14.5-14.8":0.01924,"15.0-15.1":0.01817,"15.2-15.3":0.01389,"15.4":0.01603,"15.5":0.01817,"15.6-15.8":0.23725,"16.0":0.03206,"16.1":0.05985,"16.2":0.03099,"16.3":0.05557,"16.4":0.01389,"16.5":0.02458,"16.6-16.7":0.3174,"17.0":0.02244,"17.1":0.0342,"17.2":0.02458,"17.3":0.03634,"17.4":0.06412,"17.5":0.11008,"17.6-17.7":0.27786,"18.0":0.06305,"18.1":0.13038,"18.2":0.07053,"18.3":0.22656,"18.4":0.11649,"18.5-18.6":5.93978,"26.0":0.73419,"26.1":0.02672},P:{"4":0.03049,"20":0.01016,"21":0.01016,"22":0.02033,"23":0.03049,"24":0.03049,"25":0.03049,"26":0.05081,"27":0.0813,"28":2.48993,"29":0.17277,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0","7.2-7.4":0.03049,"18.0":0.02033,"19.0":0.01016},I:{"0":0.02936,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.3479,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.0068,"11":0.0136,_:"6 7 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.3283},Q:{_:"14.9"},O:{"0":0.0294},H:{"0":0},L:{"0":37.3474}};
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./range')} */
module.exports = RangeError;
@@ -0,0 +1 @@
!function(_,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],t):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_be=t(_.dayjs)}(this,(function(_){"use strict";function t(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var e=t(_),n="студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),s="студзень_лютый_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_"),o="студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж.".split("_"),i="студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),r=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function d(_,t,e){var n,s;return"m"===e?t?"хвіліна":"хвіліну":"h"===e?t?"гадзіна":"гадзіну":_+" "+(n=+_,s={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[e].split("_"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}var a=function(_,t){return r.test(t)?n[_.month()]:s[_.month()]};a.s=s,a.f=n;var m=function(_,t){return r.test(t)?o[_.month()]:i[_.month()]};m.s=i,m.f=o;var u={name:"be",weekdays:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),weekdaysShort:"няд_пнд_аўт_сер_чцв_пят_суб".split("_"),weekdaysMin:"нд_пн_аў_ср_чц_пт_сб".split("_"),months:a,monthsShort:m,weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:d,mm:d,h:d,hh:d,d:"дзень",dd:d,M:"месяц",MM:d,y:"год",yy:d},ordinal:function(_){return _},meridiem:function(_){return _<4?"ночы":_<12?"раніцы":_<17?"дня":"вечара"}};return e.default.locale(u,null,!0),u}));
@@ -0,0 +1,29 @@
var eq = require('./eq');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
* of source objects to the destination object for all destination properties
* that resolve to `undefined`.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function customDefaultsAssignIn(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
module.exports = customDefaultsAssignIn;
@@ -0,0 +1 @@
{"version":3,"file":"LazyPlanServiceNode.d.ts","sourceRoot":"","sources":["../../../../src/planning/models/LazyPlanServiceNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,2BAA2B,EAAE,MAElC,CAAC;AAEF,8BAAsB,mBAAoB,YAAW,eAAe;IAC3D,CAAC,2BAA2B,CAAC;IACpC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IACzD,SAAS,CAAC,YAAY,EAAE,eAAe,GAAG,SAAS,CAAC;gBAGlD,WAAW,EAAE,eAAe,GAAG,SAAS,EACxC,iBAAiB,EAAE,iBAAiB;IAOtC,IAAW,QAAQ,IAAI,eAAe,GAAG,eAAe,EAAE,GAAG,SAAS,CAErE;IAED,IAAW,aAAa,IAAI,OAAO,CAElC;IAED,IAAW,iBAAiB,IAAI,iBAAiB,CAEhD;IAED,IAAW,QAAQ,CACjB,QAAQ,EAAE,eAAe,GAAG,eAAe,EAAE,GAAG,SAAS,EAG1D;IAED,IAAW,aAAa,CAAC,aAAa,EAAE,OAAO,EAE9C;WAEa,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB;IASvD,UAAU,IAAI,IAAI;IAIlB,UAAU,IAAI,OAAO;IAI5B,SAAS,CAAC,QAAQ,IAAI,eAAe;IAQrC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,IAAI,eAAe;CAC5D"}
@@ -0,0 +1,4 @@
export default interface Disposable {
dispose(): Promise<void> | void;
}
export declare function isDisposable(value: any): value is Disposable;
@@ -0,0 +1,53 @@
import type { Lib, SourceType, TSESTree } from '@typescript-eslint/types';
import type { ReferencerOptions } from './referencer';
import { ScopeManager } from './ScopeManager';
export interface AnalyzeOptions {
/**
* Known visitor keys.
*/
childVisitorKeys?: ReferencerOptions['childVisitorKeys'];
/**
* Whether the whole script is executed under node.js environment.
* When enabled, the scope manager adds a function scope immediately following the global scope.
* Defaults to `false`.
*/
globalReturn?: boolean;
/**
* Implied strict mode.
* Defaults to `false`.
*/
impliedStrict?: boolean;
/**
* The identifier that's used for JSX Element creation (after transpilation).
* This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement").
* Defaults to `"React"`.
*/
jsxPragma?: string | null;
/**
* The identifier that's used for JSX fragment elements (after transpilation).
* If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment).
* This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment").
* Defaults to `null`.
*/
jsxFragmentName?: string | null;
/**
* The lib used by the project.
* This automatically defines a type variable for any types provided by the configured TS libs.
* Defaults to ['esnext'].
*
* https://www.typescriptlang.org/tsconfig#lib
*/
lib?: Lib[];
/**
* The source type of the script.
*/
sourceType?: SourceType;
/**
* @deprecated This option never did what it was intended for and will be removed in a future major release.
*/
emitDecoratorMetadata?: boolean;
}
/**
* Takes an AST and returns the analyzed scopes.
*/
export declare function analyze(tree: TSESTree.Node, providedOptions?: AnalyzeOptions): ScopeManager;
@@ -0,0 +1,2 @@
export declare const htmlDecodeTree: Uint16Array;
//# sourceMappingURL=decode-data-html.d.ts.map
@@ -0,0 +1,44 @@
import isArray from './isArray.js';
/**
* Casts `value` as an array if it's not one.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Lang
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast array.
* @example
*
* _.castArray(1);
* // => [1]
*
* _.castArray({ 'a': 1 });
* // => [{ 'a': 1 }]
*
* _.castArray('abc');
* // => ['abc']
*
* _.castArray(null);
* // => [null]
*
* _.castArray(undefined);
* // => [undefined]
*
* _.castArray();
* // => []
*
* var array = [1, 2, 3];
* console.log(_.castArray(array) === array);
* // => true
*/
function castArray() {
if (!arguments.length) {
return [];
}
var value = arguments[0];
return isArray(value) ? value : [value];
}
export default castArray;
@@ -0,0 +1,33 @@
# fs.realpath
A backwards-compatible fs.realpath for Node v6 and above
In Node v6, the JavaScript implementation of fs.realpath was replaced
with a faster (but less resilient) native implementation. That raises
new and platform-specific errors and cannot handle long or excessively
symlink-looping paths.
This module handles those cases by detecting the new errors and
falling back to the JavaScript implementation. On versions of Node
prior to v6, it has no effect.
## USAGE
```js
var rp = require('fs.realpath')
// async version
rp.realpath(someLongAndLoopingPath, function (er, real) {
// the ELOOP was handled, but it was a bit slower
})
// sync version
var real = rp.realpathSync(someLongAndLoopingPath)
// monkeypatch at your own risk!
// This replaces the fs.realpath/fs.realpathSync builtins
rp.monkeypatch()
// un-do the monkeypatching
rp.unmonkeypatch()
```
@@ -0,0 +1,35 @@
/**
* assert that condition is true or throw error (with message)
*/
export function assert(condition, msg) {
if (!condition) {
throw new Error(msg);
}
}
/**
* assert that value cannot exist = type `never`. throw runtime error if it does.
*/
export function assertNever(value, msg) {
throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected object: ' + value);
}
const FLOAT32_MAX = 3.4028234663852886e+38, FLOAT32_MIN = -3.4028234663852886e+38, UINT32_MAX = 0xFFFFFFFF, INT32_MAX = 0X7FFFFFFF, INT32_MIN = -0X80000000;
export function assertInt32(arg) {
if (typeof arg !== "number")
throw new Error('invalid int 32: ' + typeof arg);
if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN)
throw new Error('invalid int 32: ' + arg);
}
export function assertUInt32(arg) {
if (typeof arg !== "number")
throw new Error('invalid uint 32: ' + typeof arg);
if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0)
throw new Error('invalid uint 32: ' + arg);
}
export function assertFloat32(arg) {
if (typeof arg !== "number")
throw new Error('invalid float 32: ' + typeof arg);
if (!Number.isFinite(arg))
return;
if (arg > FLOAT32_MAX || arg < FLOAT32_MIN)
throw new Error('invalid float 32: ' + arg);
}
@@ -0,0 +1 @@
{"version":3,"file":"resolveInstanceBindingNodeFromConstructorParams.js","sourceRoot":"","sources":["../../../../src/resolution/actions/resolveInstanceBindingNodeFromConstructorParams.ts"],"names":[],"mappings":";;AAyCA,0GA4CC;AArFD,gDAAgD;AAMhD,iEAA8D;AAE9D,SAAS,8BAA8B,CACrC,QAAqE,EACrE,OAAoC,EACpC,wBAA8C;IAE9C,IAAI,wBAAwB,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,MAAM,GAAyB,QAAQ,CAAC;IAE5C,KAAK,MAAM,UAAU,IAAI,wBAAwB,EAAE,CAAC;QAClD,IAAI,IAAA,kBAAS,EAAa,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,GAAG,MAAM,CAAC,IAAI,CAClB,CAAC,gBAA4B,EAAwB,EAAE,CACrD,IAAA,2CAAoB,EAClB,gBAAiE,EACjE,OAAO,EACP,UAAU,CACX,CACJ,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,IAAA,2CAAoB,EAC3B,MAAqE,EACrE,OAAO,EACP,UAAU,CACX,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,+CAA+C,CAI7D,qBAIyB;IAMzB,OAAO,CACL,iBAA4B,EAC5B,MAAwB,EACxB,IAAmC,EACb,EAAE;QACxB,MAAM,QAAQ,GACuB,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,CACtE,GAAG,iBAAiB,CAC0C,CAAC;QAEjE,MAAM,0BAA0B,GAC9B,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAEhD,IAAI,IAAA,kBAAS,EAAC,0BAA0B,CAAC,EAAE,CAAC;YAC1C,OAAO,0BAA0B,CAAC,IAAI,CACpC,GAAyB,EAAE,CACzB,8BAA8B,CAC5B,QAAQ,EACR,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,wBAAwB,CACtD,CACJ,CAAC;QACJ,CAAC;QAED,OAAO,8BAA8B,CACnC,QAAQ,EACR,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,wBAAwB,CACtD,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=buildArrayMetadataWithElement.spec.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["emphasis.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,+BANW,QAAQ,KACR,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA0ClB;;;;8BAxDmC,OAAO;6BAAP,OAAO;2BADb,wBAAwB;0BAAxB,wBAAwB;AA2DtD;;;;;GAKG;AACH,iCALW,QAAQ,MACR,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"}
@@ -0,0 +1,40 @@
import { GetPacketStatusDepends } from '../../action/packet/GetPacketStatus';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
file_id: import("@sinclair/typebox").TString;
current_parent_directory: import("@sinclair/typebox").TString;
new_name: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TObject<{
ok: import("@sinclair/typebox").TBoolean;
}>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class RenameGroupFile extends GetPacketStatusDepends<PayloadType, ReturnType> {
actionName: "rename_group_file";
actionSummary: string;
actionTags: string[];
payloadExample: {
group_id: string;
file_id: string;
current_parent_directory: string;
new_name: string;
};
returnExample: {
ok: boolean;
};
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
file_id: import("@sinclair/typebox").TString;
current_parent_directory: import("@sinclair/typebox").TString;
new_name: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
ok: import("@sinclair/typebox").TBoolean;
}>;
_handle(payload: PayloadType): Promise<{
ok: boolean;
}>;
}
export {};
@@ -0,0 +1,101 @@
declare namespace envPaths {
export interface Options {
/**
__Don't use this option unless you really have to!__
Suffix appended to the project name to avoid name conflicts with native apps. Pass an empty string to disable it.
@default 'nodejs'
*/
readonly suffix?: string;
}
export interface Paths {
/**
Directory for data files.
Example locations (with the default `nodejs` suffix):
- macOS: `~/Library/Application Support/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`)
- Linux: `~/.local/share/MyApp-nodejs` (or `$XDG_DATA_HOME/MyApp-nodejs`)
*/
readonly data: string;
/**
Directory for data files.
Example locations (with the default `nodejs` suffix):
- macOS: `~/Library/Preferences/MyApp-nodejs`
- Windows: `%APPDATA%\MyApp-nodejs\Config` (for example, `C:\Users\USERNAME\AppData\Roaming\MyApp-nodejs\Config`)
- Linux: `~/.config/MyApp-nodejs` (or `$XDG_CONFIG_HOME/MyApp-nodejs`)
*/
readonly config: string;
/**
Directory for non-essential data files.
Example locations (with the default `nodejs` suffix):
- macOS: `~/Library/Caches/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Cache` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Cache`)
- Linux: `~/.cache/MyApp-nodejs` (or `$XDG_CACHE_HOME/MyApp-nodejs`)
*/
readonly cache: string;
/**
Directory for log files.
Example locations (with the default `nodejs` suffix):
- macOS: `~/Library/Logs/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Log` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Log`)
- Linux: `~/.local/state/MyApp-nodejs` (or `$XDG_STATE_HOME/MyApp-nodejs`)
*/
readonly log: string;
/**
Directory for temporary files.
Example locations (with the default `nodejs` suffix):
- macOS: `/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn/T/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\Temp\MyApp-nodejs` (for example, `C:\Users\USERNAME\AppData\Local\Temp\MyApp-nodejs`)
- Linux: `/tmp/USERNAME/MyApp-nodejs`
*/
readonly temp: string;
}
}
declare const envPaths: {
/**
Get paths for storing things like data, config, cache, etc.
Note: It only generates the path strings. It doesn't create the directories for you. You could use [`make-dir`](https://github.com/sindresorhus/make-dir) to create the directories.
@param name - Name of your project. Used to generate the paths.
@returns The paths to use for your project on current OS.
@example
```
import envPaths = require('env-paths');
const paths = envPaths('MyApp');
paths.data;
//=> '/home/sindresorhus/.local/share/MyApp-nodejs'
paths.config
//=> '/home/sindresorhus/.config/MyApp-nodejs'
```
*/
(name: string, options?: envPaths.Options): envPaths.Paths;
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function envPaths(name: string, options?: envPaths.Options): envPaths.Paths;
// export = envPaths;
default: typeof envPaths;
};
export = envPaths;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/define-data-property
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,8 @@
var $edc7c66594a0ae8a$exports = {};
$edc7c66594a0ae8a$exports = {
"longPressMessage": `Premere a lungo o premere Alt + Freccia gi\xf9 per aprire il menu`
};
export {$edc7c66594a0ae8a$exports as default};
//# sourceMappingURL=it-IT.module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ConstantValueBinding.d.ts","sourceRoot":"","sources":["../../../../src/binding/models/ConstantValueBinding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,oBAAoB,CAAC,UAAU,CAC9C,SAAQ,aAAa,CACnB,OAAO,iBAAiB,CAAC,aAAa,EACtC,OAAO,kBAAkB,CAAC,SAAS,EACnC,UAAU,CACX;IACD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;CACtC"}
@@ -0,0 +1,120 @@
{
"name": "unified",
"version": "11.0.5",
"description": "parse, inspect, transform, and serialize content through syntax trees",
"license": "MIT",
"keywords": [
"ast",
"compile",
"content",
"cst",
"parse",
"process",
"rehype",
"remark",
"retext",
"serialize",
"stringify",
"syntax",
"transform",
"tree",
"unified"
],
"homepage": "https://unifiedjs.com",
"repository": "unifiedjs/unified",
"bugs": "https://github.com/unifiedjs/unified/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"Junyoung Choi <fluke8259@gmail.com>",
"Hernan Rajchert <hrajchert@gmail.com>",
"Christian Murphy <christian.murphy.42@gmail.com>",
"Vse Mozhet Byt <vsemozhetbyt@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>"
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/unist": "^3.0.0",
"bail": "^2.0.0",
"devlop": "^1.0.0",
"extend": "^3.0.0",
"is-plain-obj": "^4.0.0",
"trough": "^2.0.0",
"vfile": "^6.0.0"
},
"devDependencies": {
"@types/extend": "^3.0.0",
"@types/hast": "^3.0.0",
"@types/mdast": "^4.0.0",
"@types/node": "^20.0.0",
"c8": "^10.0.0",
"prettier": "^3.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"tsd": "^0.31.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.58.0"
},
"scripts": {
"build": "tsc --build --clean && tsc --build && node script/fix-types.js && type-coverage && tsd",
"format": "remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix",
"prepack": "npm run build && npm run format",
"test": "npm run build && npm run format && npm run test-coverage",
"test-api": "node --conditions development test/index.js",
"test-coverage": "c8 --100 --check-coverage --reporter lcov npm run test-api"
},
"prettier": {
"bracketSpacing": false,
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm",
[
"remark-lint-no-html",
false
]
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"ignoreCatch": true,
"strict": true
},
"xo": {
"overrides": [
{
"files": [
"**/*.ts"
],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/naming-convention": "off",
"import/no-duplicates": "off"
}
}
],
"prettier": true,
"rules": {
"unicorn/no-this-assignment": "off"
}
}
}
@@ -0,0 +1,18 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-flat-configs.js" script.
*/
"use strict"
module.exports = {
plugins: {
get "es-x"() {
return require("../../index.js")
},
},
rules: {
...require("./no-new-in-es2023-intl-api").rules,
...require("./no-new-in-es2022-intl-api").rules,
...require("./no-new-in-es2021-intl-api").rules,
},
}
@@ -0,0 +1,33 @@
'use strict'
const fs = require('@npmcli/fs')
const fixOwner = require('./fix-owner')
const path = require('path')
module.exports.mkdir = mktmpdir
async function mktmpdir (cache, opts = {}) {
const { tmpPrefix } = opts
const tmpDir = path.join(cache, 'tmp')
await fs.mkdir(tmpDir, { recursive: true, owner: 'inherit' })
// do not use path.join(), it drops the trailing / if tmpPrefix is unset
const target = `${tmpDir}${path.sep}${tmpPrefix || ''}`
return fs.mkdtemp(target, { owner: 'inherit' })
}
module.exports.withTmp = withTmp
function withTmp (cache, opts, cb) {
if (!cb) {
cb = opts
opts = {}
}
return fs.withTempDir(path.join(cache, 'tmp'), cb, opts)
}
module.exports.fix = fixtmpdir
function fixtmpdir (cache) {
return fixOwner(cache, path.join(cache, 'tmp'))
}
@@ -0,0 +1,52 @@
import type { HelperManager } from "../HelperManager";
import type { Options } from "../index";
import type NameManager from "../NameManager";
import type TokenProcessor from "../TokenProcessor";
import type ReactHotLoaderTransformer from "./ReactHotLoaderTransformer";
import Transformer from "./Transformer";
/**
* Class for editing import statements when we are keeping the code as ESM. We still need to remove
* type-only imports in TypeScript and Flow.
*/
export default class ESMImportTransformer extends Transformer {
readonly tokens: TokenProcessor;
readonly nameManager: NameManager;
readonly helperManager: HelperManager;
readonly reactHotLoaderTransformer: ReactHotLoaderTransformer | null;
readonly isTypeScriptTransformEnabled: boolean;
readonly isFlowTransformEnabled: boolean;
readonly keepUnusedImports: boolean;
private nonTypeIdentifiers;
private declarationInfo;
private injectCreateRequireForImportRequire;
constructor(tokens: TokenProcessor, nameManager: NameManager, helperManager: HelperManager, reactHotLoaderTransformer: ReactHotLoaderTransformer | null, isTypeScriptTransformEnabled: boolean, isFlowTransformEnabled: boolean, keepUnusedImports: boolean, options: Options);
process(): boolean;
private processImportEquals;
private processImport;
/**
* Remove type bindings from this import, leaving the rest of the import intact.
*
* Return true if this import was ONLY types, and thus is eligible for removal. This will bail out
* of the replacement operation, so we can return early here.
*/
private removeImportTypeBindings;
private shouldAutomaticallyElideImportedName;
private processExportDefault;
/**
* Handle a statement with one of these forms:
* export {a, type b};
* export {c, type d} from 'foo';
*
* In both cases, any explicit type exports should be removed. In the first
* case, we also need to handle implicit export elision for names declared as
* types. In the second case, we must NOT do implicit named export elision,
* but we must remove the runtime import if all exports are type exports.
*/
private processNamedExports;
/**
* ESM elides all imports with the rule that we only elide if we see that it's
* a type and never see it as a value. This is in contrast to CJS, which
* elides imports that are completely unknown.
*/
private shouldElideExportedName;
}
@@ -0,0 +1,24 @@
var OverloadYield = require("./OverloadYield.js");
function _asyncGeneratorDelegate(t) {
var e = {},
n = !1;
function pump(e, r) {
return n = !0, r = new Promise(function (n) {
n(t[e](r));
}), {
done: !1,
value: new OverloadYield(r, 1)
};
}
return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () {
return this;
}, e.next = function (t) {
return n ? (n = !1, t) : pump("next", t);
}, "function" == typeof t["throw"] && (e["throw"] = function (t) {
if (n) throw n = !1, t;
return pump("throw", t);
}), "function" == typeof t["return"] && (e["return"] = function (t) {
return n ? (n = !1, t) : pump("return", t);
}), e;
}
module.exports = _asyncGeneratorDelegate, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,397 @@
declare var ajv: {
(options?: ajv.Options): ajv.Ajv;
new(options?: ajv.Options): ajv.Ajv;
ValidationError: typeof AjvErrors.ValidationError;
MissingRefError: typeof AjvErrors.MissingRefError;
$dataMetaSchema: object;
}
declare namespace AjvErrors {
class ValidationError extends Error {
constructor(errors: Array<ajv.ErrorObject>);
message: string;
errors: Array<ajv.ErrorObject>;
ajv: true;
validation: true;
}
class MissingRefError extends Error {
constructor(baseId: string, ref: string, message?: string);
static message: (baseId: string, ref: string) => string;
message: string;
missingRef: string;
missingSchema: string;
}
}
declare namespace ajv {
type ValidationError = AjvErrors.ValidationError;
type MissingRefError = AjvErrors.MissingRefError;
interface Ajv {
/**
* Validate data using schema
* Schema will be compiled and cached (using serialized JSON as key, [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize by default).
* @param {string|object|Boolean} schemaKeyRef key, ref or schema object
* @param {Any} data to be validated
* @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
*/
validate(schemaKeyRef: object | string | boolean, data: any): boolean | PromiseLike<any>;
/**
* Create validating function for passed schema.
* @param {object|Boolean} schema schema object
* @return {Function} validating function
*/
compile(schema: object | boolean): ValidateFunction;
/**
* Creates validating function for passed schema with asynchronous loading of missing schemas.
* `loadSchema` option should be a function that accepts schema uri and node-style callback.
* @this Ajv
* @param {object|Boolean} schema schema object
* @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped
* @param {Function} callback optional node-style callback, it is always called with 2 parameters: error (or null) and validating function.
* @return {PromiseLike<ValidateFunction>} validating function
*/
compileAsync(schema: object | boolean, meta?: Boolean, callback?: (err: Error, validate: ValidateFunction) => any): PromiseLike<ValidateFunction>;
/**
* Adds schema to the instance.
* @param {object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
* @param {string} 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`.
* @return {Ajv} this for method chaining
*/
addSchema(schema: Array<object> | object, key?: string): Ajv;
/**
* Add schema that will be used to validate other schemas
* options in META_IGNORE_OPTIONS are alway set to false
* @param {object} schema schema object
* @param {string} key optional schema key
* @return {Ajv} this for method chaining
*/
addMetaSchema(schema: object, key?: string): Ajv;
/**
* Validate schema
* @param {object|Boolean} schema schema to validate
* @return {Boolean} true if schema is valid
*/
validateSchema(schema: object | boolean): boolean;
/**
* Get compiled schema from the instance by `key` or `ref`.
* @param {string} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
* @return {Function} schema validating function (with property `schema`). Returns undefined if keyRef can't be resolved to an existing schema.
*/
getSchema(keyRef: string): ValidateFunction | undefined;
/**
* 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.
* @param {string|object|RegExp|Boolean} schemaKeyRef key, ref, pattern to match key/ref or schema object
* @return {Ajv} this for method chaining
*/
removeSchema(schemaKeyRef?: object | string | RegExp | boolean): Ajv;
/**
* Add custom format
* @param {string} name format name
* @param {string|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
* @return {Ajv} this for method chaining
*/
addFormat(name: string, format: FormatValidator | FormatDefinition): Ajv;
/**
* Define custom keyword
* @this Ajv
* @param {string} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords.
* @param {object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
* @return {Ajv} this for method chaining
*/
addKeyword(keyword: string, definition: KeywordDefinition): Ajv;
/**
* Get keyword definition
* @this Ajv
* @param {string} keyword pre-defined or custom keyword.
* @return {object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
*/
getKeyword(keyword: string): object | boolean;
/**
* Remove keyword
* @this Ajv
* @param {string} keyword pre-defined or custom keyword.
* @return {Ajv} this for method chaining
*/
removeKeyword(keyword: string): Ajv;
/**
* Validate keyword
* @this Ajv
* @param {object} definition keyword definition object
* @param {boolean} throwError true to throw exception if definition is invalid
* @return {boolean} validation result
*/
validateKeyword(definition: KeywordDefinition, throwError: boolean): boolean;
/**
* Convert array of error message objects to string
* @param {Array<object>} errors optional array of validation errors, if not passed errors from the instance are used.
* @param {object} options optional options with properties `separator` and `dataVar`.
* @return {string} human readable string with all errors descriptions
*/
errorsText(errors?: Array<ErrorObject> | null, options?: ErrorsTextOptions): string;
errors?: Array<ErrorObject> | null;
_opts: Options;
}
interface CustomLogger {
log(...args: any[]): any;
warn(...args: any[]): any;
error(...args: any[]): any;
}
interface ValidateFunction {
(
data: any,
dataPath?: string,
parentData?: object | Array<any>,
parentDataProperty?: string | number,
rootData?: object | Array<any>
): boolean | PromiseLike<any>;
schema?: object | boolean;
errors?: null | Array<ErrorObject>;
refs?: object;
refVal?: Array<any>;
root?: ValidateFunction | object;
$async?: true;
source?: object;
}
interface Options {
$data?: boolean;
allErrors?: boolean;
verbose?: boolean;
jsonPointers?: boolean;
uniqueItems?: boolean;
unicode?: boolean;
format?: false | string;
formats?: object;
keywords?: object;
unknownFormats?: true | string[] | 'ignore';
schemas?: Array<object> | object;
schemaId?: '$id' | 'id' | 'auto';
missingRefs?: true | 'ignore' | 'fail';
extendRefs?: true | 'ignore' | 'fail';
loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike<object | boolean>;
removeAdditional?: boolean | 'all' | 'failing';
useDefaults?: boolean | 'empty' | 'shared';
coerceTypes?: boolean | 'array';
strictDefaults?: boolean | 'log';
strictKeywords?: boolean | 'log';
strictNumbers?: boolean;
async?: boolean | string;
transpile?: string | ((code: string) => string);
meta?: boolean | object;
validateSchema?: boolean | 'log';
addUsedSchema?: boolean;
inlineRefs?: boolean | number;
passContext?: boolean;
loopRequired?: number;
ownProperties?: boolean;
multipleOfPrecision?: boolean | number;
errorDataPath?: string,
messages?: boolean;
sourceCode?: boolean;
processCode?: (code: string, schema: object) => string;
cache?: object;
logger?: CustomLogger | false;
nullable?: boolean;
serialize?: ((schema: object | boolean) => any) | false;
}
type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike<any>);
type NumberFormatValidator = ((data: number) => boolean | PromiseLike<any>);
interface NumberFormatDefinition {
type: "number",
validate: NumberFormatValidator;
compare?: (data1: number, data2: number) => number;
async?: boolean;
}
interface StringFormatDefinition {
type?: "string",
validate: FormatValidator;
compare?: (data1: string, data2: string) => number;
async?: boolean;
}
type FormatDefinition = NumberFormatDefinition | StringFormatDefinition;
interface KeywordDefinition {
type?: string | Array<string>;
async?: boolean;
$data?: boolean;
errors?: boolean | string;
metaSchema?: object;
// schema: false makes validate not to expect schema (ValidateFunction)
schema?: boolean;
statements?: boolean;
dependencies?: Array<string>;
modifying?: boolean;
valid?: boolean;
// one and only one of the following properties should be present
validate?: SchemaValidateFunction | ValidateFunction;
compile?: (schema: any, parentSchema: object, it: CompilationContext) => ValidateFunction;
macro?: (schema: any, parentSchema: object, it: CompilationContext) => object | boolean;
inline?: (it: CompilationContext, keyword: string, schema: any, parentSchema: object) => string;
}
interface CompilationContext {
level: number;
dataLevel: number;
dataPathArr: string[];
schema: any;
schemaPath: string;
baseId: string;
async: boolean;
opts: Options;
formats: {
[index: string]: FormatDefinition | undefined;
};
keywords: {
[index: string]: KeywordDefinition | undefined;
};
compositeRule: boolean;
validate: (schema: object) => boolean;
util: {
copy(obj: any, target?: any): any;
toHash(source: string[]): { [index: string]: true | undefined };
equal(obj: any, target: any): boolean;
getProperty(str: string): string;
schemaHasRules(schema: object, rules: any): string;
escapeQuotes(str: string): string;
toQuotedString(str: string): string;
getData(jsonPointer: string, dataLevel: number, paths: string[]): string;
escapeJsonPointer(str: string): string;
unescapeJsonPointer(str: string): string;
escapeFragment(str: string): string;
unescapeFragment(str: string): string;
};
self: Ajv;
}
interface SchemaValidateFunction {
(
schema: any,
data: any,
parentSchema?: object,
dataPath?: string,
parentData?: object | Array<any>,
parentDataProperty?: string | number,
rootData?: object | Array<any>
): boolean | PromiseLike<any>;
errors?: Array<ErrorObject>;
}
interface ErrorsTextOptions {
separator?: string;
dataVar?: string;
}
interface ErrorObject {
keyword: string;
dataPath: string;
schemaPath: string;
params: ErrorParameters;
// Added to validation errors of propertyNames keyword schema
propertyName?: string;
// Excluded if messages set to false.
message?: string;
// These are added with the `verbose` option.
schema?: any;
parentSchema?: object;
data?: any;
}
type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams |
DependenciesParams | FormatParams | ComparisonParams |
MultipleOfParams | PatternParams | RequiredParams |
TypeParams | UniqueItemsParams | CustomParams |
PatternRequiredParams | PropertyNamesParams |
IfParams | SwitchParams | NoParams | EnumParams;
interface RefParams {
ref: string;
}
interface LimitParams {
limit: number;
}
interface AdditionalPropertiesParams {
additionalProperty: string;
}
interface DependenciesParams {
property: string;
missingProperty: string;
depsCount: number;
deps: string;
}
interface FormatParams {
format: string
}
interface ComparisonParams {
comparison: string;
limit: number | string;
exclusive: boolean;
}
interface MultipleOfParams {
multipleOf: number;
}
interface PatternParams {
pattern: string;
}
interface RequiredParams {
missingProperty: string;
}
interface TypeParams {
type: string;
}
interface UniqueItemsParams {
i: number;
j: number;
}
interface CustomParams {
keyword: string;
}
interface PatternRequiredParams {
missingPattern: string;
}
interface PropertyNamesParams {
propertyName: string;
}
interface IfParams {
failingKeyword: string;
}
interface SwitchParams {
caseIndex: number;
}
interface NoParams { }
interface EnumParams {
allowedValues: Array<any>;
}
}
export = ajv;
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=isBindingConstraintsWithNoNameNorTags.spec.d.ts.map
@@ -0,0 +1,218 @@
# mdast-util-to-string
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
[mdast][] utility to get the text content of a node.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`toString(value[, options])`](#tostringvalue-options)
* [`Options`](#options)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package is a tiny utility that gets the textual content of a node.
## When should I use this?
This utility is useful when you have a node, say a heading, and want to get the
text inside it.
This package does not serialize markdown, that’s what
[`mdast-util-to-markdown`][mdast-util-to-markdown] does.
Similar packages, [`hast-util-to-string`][hast-util-to-string] and
[`hast-util-to-text`][hast-util-to-text], do the same but on [hast][].
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install mdast-util-to-string
```
In Deno with [`esm.sh`][esmsh]:
```js
import {toString} from 'https://esm.sh/mdast-util-to-string@4'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {toString} from 'https://esm.sh/mdast-util-to-string@4?bundle'
</script>
```
## Use
```js
import {fromMarkdown} from 'mdast-util-from-markdown'
import {toString} from 'mdast-util-to-string'
const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.')
console.log(toString(tree)) // => 'Some emphasis, importance, and code.'
```
## API
This package exports the identifier [`toString`][api-to-string].
There is no default export.
### `toString(value[, options])`
Get the text content of a node or list of nodes.
Prefers the node’s plain-text fields, otherwise serializes its children,
and if the given value is an array, serialize the nodes in it.
###### Parameters
* `value` (`unknown`)
— thing to serialize, typically [`Node`][node]
* `options` ([`Options`][api-options], optional)
— configuration
###### Returns
Serialized `value` (`string`).
### `Options`
Configuration (TypeScript type).
###### Fields
* `includeImageAlt` (`boolean`, default: `true`)
— whether to use `alt` for `image`s
* `includeHtml` (`boolean`, default: `true`)
— whether to use `value` of HTML
## Types
This package is fully typed with [TypeScript][].
It exports the additional type [`Options`][api-options].
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `mdast-util-to-string@^4`,
compatible with Node.js 16.
## Security
Use of `mdast-util-to-string` does not involve **[hast][]**, user content, or
change the tree, so there are no openings for [cross-site scripting (XSS)][xss]
attacks.
## Related
* [`hast-util-to-string`](https://github.com/wooorm/rehype-minify/tree/main/packages/hast-util-to-string)
— get text content in hast
* [`hast-util-to-text`](https://github.com/syntax-tree/hast-util-to-text)
— get text content in hast according to the `innerText` algorithm
## Contribute
See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/syntax-tree/mdast-util-to-string/workflows/main/badge.svg
[build]: https://github.com/syntax-tree/mdast-util-to-string/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-string.svg
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-string
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-string.svg
[downloads]: https://www.npmjs.com/package/mdast-util-to-string
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-to-string
[size]: https://bundlejs.com/?q=mdast-util-to-string
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/syntax-tree/unist/discussions
[npm]: https://docs.npmjs.com/cli/install
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[typescript]: https://www.typescriptlang.org
[license]: license
[author]: https://wooorm.com
[health]: https://github.com/syntax-tree/.github
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
[mdast]: https://github.com/syntax-tree/mdast
[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown
[hast]: https://github.com/syntax-tree/hast
[hast-util-to-string]: https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-to-string
[hast-util-to-text]: https://github.com/syntax-tree/hast-util-to-text
[node]: https://github.com/syntax-tree/mdast#nodes
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
[api-to-string]: #tostringvalue-options
[api-options]: #options
@@ -0,0 +1,10 @@
import type { COSEALG } from '../../cose.js';
import type { Uint8Array_ } from '../../../types/index.js';
/**
* Generate a digest of the provided data.
*
* @param data The data to generate a digest of
* @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm
*/
export declare function digest(data: Uint8Array_, algorithm: COSEALG): Promise<Uint8Array_>;
//# sourceMappingURL=digest.d.ts.map
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/grid/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.module.js.map"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","132":"K D E wC"},B:{"1":"0 1 2 3 4 5 M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","260":"C L"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","4":"xC TC 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","4":"J"},E:{"1":"ZB K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","4":"J 2C ZC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","260":"F B C FD GD HD ID NC uC JD OC"},G:{"2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D","16":"A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"2":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"2":"1D 2D"}},B:2,C:"CSS3 Cursors (original values)",D:true};
@@ -0,0 +1,5 @@
export * from './extends-check.mjs';
export * from './extends-from-mapped-key.mjs';
export * from './extends-from-mapped-result.mjs';
export * from './extends-undefined.mjs';
export * from './extends.mjs';
@@ -0,0 +1,100 @@
const maxDistance = 3;
function editDistance(a, b) {
// https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance
// Calculating optimal string alignment distance, no substring is edited more than once.
// (Simple implementation.)
// Quick early exit, return worst case.
if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);
// distance between prefix substrings of a and b
const d = [];
// pure deletions turn a into empty string
for (let i = 0; i <= a.length; i++) {
d[i] = [i];
}
// pure insertions turn empty string into b
for (let j = 0; j <= b.length; j++) {
d[0][j] = j;
}
// fill matrix
for (let j = 1; j <= b.length; j++) {
for (let i = 1; i <= a.length; i++) {
let cost = 1;
if (a[i - 1] === b[j - 1]) {
cost = 0;
} else {
cost = 1;
}
d[i][j] = Math.min(
d[i - 1][j] + 1, // deletion
d[i][j - 1] + 1, // insertion
d[i - 1][j - 1] + cost // substitution
);
// transposition
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
}
}
}
return d[a.length][b.length];
}
/**
* Find close matches, restricted to same number of edits.
*
* @param {string} word
* @param {string[]} candidates
* @returns {string}
*/
function suggestSimilar(word, candidates) {
if (!candidates || candidates.length === 0) return '';
// remove possible duplicates
candidates = Array.from(new Set(candidates));
const searchingOptions = word.startsWith('--');
if (searchingOptions) {
word = word.slice(2);
candidates = candidates.map(candidate => candidate.slice(2));
}
let similar = [];
let bestDistance = maxDistance;
const minSimilarity = 0.4;
candidates.forEach((candidate) => {
if (candidate.length <= 1) return; // no one character guesses
const distance = editDistance(word, candidate);
const length = Math.max(word.length, candidate.length);
const similarity = (length - distance) / length;
if (similarity > minSimilarity) {
if (distance < bestDistance) {
// better edit distance, throw away previous worse matches
bestDistance = distance;
similar = [candidate];
} else if (distance === bestDistance) {
similar.push(candidate);
}
}
});
similar.sort((a, b) => a.localeCompare(b));
if (searchingOptions) {
similar = similar.map(candidate => `--${candidate}`);
}
if (similar.length > 1) {
return `\n(Did you mean one of ${similar.join(', ')}?)`;
}
if (similar.length === 1) {
return `\n(Did you mean ${similar[0]}?)`;
}
return '';
}
exports.suggestSimilar = suggestSimilar;
@@ -0,0 +1,20 @@
var colorspace = require('@so-ric/colorspace');
var kuler = require('kuler');
/**
* Prefix the messages with a colored namespace.
*
* @param {Array} args The messages array that is getting written.
* @param {Object} options Options for diagnostics.
* @returns {Array} Altered messages array.
* @public
*/
module.exports = function ansiModifier(args, options) {
var namespace = options.namespace;
var ansi = options.colors !== false
? kuler(namespace +':', colorspace(namespace))
: namespace +':';
args[0] = ansi +' '+ args[0];
return args;
};
@@ -0,0 +1 @@
{"version":3,"file":"injectFromHierarchy.js","sourceRoot":"","sources":["../../../../src/metadata/decorators/injectFromHierarchy.ts"],"names":[],"mappings":";;AAMA,kDAoBC;AAzBD,kEAA2D;AAG3D,6CAA0C;AAE1C,SAAgB,mBAAmB,CACjC,OAAoC;IAEpC,sEAAsE;IACtE,OAAO,CAAC,MAAgB,EAAQ,EAAE;QAChC,MAAM,KAAK,GAAc,EAAE,CAAC;QAE5B,IAAI,OAAO,GAAwB,IAAA,6BAAW,EAAC,MAAiB,CAAC,CAAC;QAClE,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;YACnD,MAAM,QAAQ,GAAY,OAAO,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,OAAO,GAAG,IAAA,6BAAW,EAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QAED,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAA,uBAAU,EAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
import type { Active, UniqueIdentifier } from '@dnd-kit/core';
import type { Transition } from '@dnd-kit/utilities';
export declare type SortableTransition = Pick<Transition, 'easing' | 'duration'>;
export declare type AnimateLayoutChanges = (args: {
active: Active | null;
containerId: UniqueIdentifier;
isDragging: boolean;
isSorting: boolean;
id: UniqueIdentifier;
index: number;
items: UniqueIdentifier[];
previousItems: UniqueIdentifier[];
previousContainerId: UniqueIdentifier;
newIndex: number;
transition: SortableTransition | null;
wasDragging: boolean;
}) => boolean;
export interface NewIndexGetterArguments {
id: UniqueIdentifier;
items: UniqueIdentifier[];
activeIndex: number;
overIndex: number;
}
export declare type NewIndexGetter = (args: NewIndexGetterArguments) => number;
@@ -0,0 +1,6 @@
"use strict";
function _class_call_check(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
exports._ = _class_call_check;
@@ -0,0 +1,9 @@
import * as Types from './types';
export declare class Module<Properties extends Types.IModuleProperties = Types.IModuleProperties> {
private readonly properties;
constructor(properties: Properties);
/** Parses using one of the parsers defined on this instance */
Parse<Key extends keyof Properties>(key: Key, content: string, context: unknown): [] | [Types.StaticParser<Properties[Key]>, string];
/** Parses using one of the parsers defined on this instance */
Parse<Key extends keyof Properties>(key: Key, content: string): [] | [Types.StaticParser<Properties[Key]>, string];
}
@@ -0,0 +1,57 @@
# es-shim-unscopables <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Helper package to shim a method into `Array.prototype[Symbol.unscopables]`
## Example
```js
const assert = require('assert');
const shimUnscopables = require('es-shim-unscopables');
let copyWithin;
let concat;
with ([]) {
assert.equal(concat, Array.prototype.concat);
assert.notEqual(copyWithin, Array.prototype.copyWithin);
}
shimUnscopables('concat');
with ([]) {
assert.notEqual(concat, Array.prototype.concat);
assert.notEqual(copyWithin, Array.prototype.copyWithin);
}
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
## Security
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
[package-url]: https://npmjs.org/package/es-shim-unscopables
[npm-version-svg]: https://versionbadg.es/ljharb/es-shim-unscopables.svg
[deps-svg]: https://david-dm.org/ljharb/es-shim-unscopables.svg
[deps-url]: https://david-dm.org/ljharb/es-shim-unscopables
[dev-deps-svg]: https://david-dm.org/ljharb/es-shim-unscopables/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-shim-unscopables#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es-shim-unscopables.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es-shim-unscopables.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-shim-unscopables.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es-shim-unscopables
[codecov-image]: https://codecov.io/gh/ljharb/es-shim-unscopables/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/es-shim-unscopables/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-shim-unscopables
[actions-url]: https://github.com/ljharb/es-shim-unscopables/actions
@@ -0,0 +1,16 @@
import cloneArrayBuffer from './_cloneArrayBuffer.js';
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
export default cloneTypedArray;
@@ -0,0 +1,187 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {AriaLabelingProps, AsyncLoadable, DOMProps, Key, LinkDOMProps, LoadingState, MultipleSelection, Sortable, SpectrumSelectionProps, StyleProps} from '@react-types/shared';
import {GridCollection, GridNode} from '@react-types/grid';
import {JSX, ReactElement, ReactNode} from 'react';
/** Widths that result in a constant pixel value for the same Table width. */
export type ColumnStaticSize = number | `${number}` | `${number}%`; // match regex: /^(\d+)(?=%$)/
/**
* Widths that change size in relation to the remaining space and in ratio to other dynamic columns.
* All numbers must be integers and greater than 0.
* FR units take up remaining, if any, space in the table.
*/
export type ColumnDynamicSize = `${number}fr`; // match regex: /^(\d+)(?=fr$)/
/** All possible sizes a column can be assigned. */
export type ColumnSize = ColumnStaticSize | ColumnDynamicSize;
export interface TableProps<T> extends MultipleSelection, Sortable {
/** The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows. */
children: [ReactElement<TableHeaderProps<T>>, ReactElement<TableBodyProps<T>>],
/** A list of row keys to disable. */
disabledKeys?: Iterable<Key>,
/**
* Whether pressing the escape key should clear selection in the table or not.
*
* Most experiences should not modify this option as it eliminates a keyboard user's ability to
* easily clear selection. Only use if the escape key is being handled externally or should not
* trigger selection clearing contextually.
* @default 'clearSelection'
*/
escapeKeyBehavior?: 'clearSelection' | 'none',
/** Whether selection should occur on press up instead of press down. */
shouldSelectOnPressUp?: boolean
}
/**
* @deprecated - use SpectrumTableProps from '@adobe/react-spectrum' instead.
*/
export interface SpectrumTableProps<T> extends TableProps<T>, SpectrumSelectionProps, DOMProps, AriaLabelingProps, StyleProps {
/**
* Sets the amount of vertical padding within each cell.
* @default 'regular'
*/
density?: 'compact' | 'regular' | 'spacious',
/**
* Sets the overflow behavior for the cell contents.
* @default 'truncate'
*/
overflowMode?: 'wrap' | 'truncate',
/** Whether the TableView should be displayed with a quiet style. */
isQuiet?: boolean,
/** Sets what the TableView should render when there is no content to display. */
renderEmptyState?: () => JSX.Element,
/** Handler that is called when a user performs an action on a row. */
onAction?: (key: Key) => void,
/**
* Handler that is called when a user starts a column resize.
*/
onResizeStart?: (widths: Map<Key, ColumnSize>) => void,
/**
* Handler that is called when a user performs a column resize.
* Can be used with the width property on columns to put the column widths into
* a controlled state.
*/
onResize?: (widths: Map<Key, ColumnSize>) => void,
/**
* Handler that is called after a user performs a column resize.
* Can be used to store the widths of columns for another future session.
*/
onResizeEnd?: (widths: Map<Key, ColumnSize>) => void
}
export interface TableHeaderProps<T> {
/** A list of table columns. */
columns?: T[],
/** A list of `Column(s)` or a function. If the latter, a list of columns must be provided using the `columns` prop. */
children: ColumnElement<T> | ColumnElement<T>[] | ColumnRenderer<T>
}
type ColumnElement<T> = ReactElement<ColumnProps<T>>;
type ColumnRenderer<T> = (item: T) => ColumnElement<T>;
export interface ColumnProps<T> {
/** Rendered contents of the column if `children` contains child columns. */
title?: ReactNode,
/** Static child columns or content to render as the column header. */
children: ReactNode | ColumnElement<T> | ColumnElement<T>[],
/** A list of child columns used when dynamically rendering nested child columns. */
childColumns?: T[],
/** The width of the column. */
width?: ColumnSize | null,
/** The minimum width of the column. */
minWidth?: ColumnStaticSize | null,
/** The maximum width of the column. */
maxWidth?: ColumnStaticSize | null,
/** The default width of the column. */
defaultWidth?: ColumnSize | null,
/** Whether the column allows resizing. */
allowsResizing?: boolean,
/** Whether the column allows sorting. */
allowsSorting?: boolean,
/** Whether a column is a [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) and should be announced by assistive technology during row navigation. */
isRowHeader?: boolean,
/** A string representation of the column's contents, used for accessibility announcements. */
textValue?: string
}
// TODO: how to support these in CollectionBuilder...
export interface SpectrumColumnProps<T> extends ColumnProps<T> {
/**
* The alignment of the column's contents relative to its allotted width.
* @default 'start'
*/
align?: 'start' | 'center' | 'end',
// /** Whether the column should stick to the viewport when scrolling. */
// isSticky?: boolean, // shouldStick?? Not implemented yet?
/** Whether the column should render a divider between it and the next column. */
showDivider?: boolean,
/**
* Whether the column should hide its header text. A tooltip with the column's header text
* will be displayed when the column header is focused instead. Note that this prop is specifically for columns
* that contain ActionButtons in place of text content.
*/
hideHeader?: boolean
}
export type RowElement<T> = ReactElement<RowProps<T>>;
export interface TableBodyProps<T> extends Omit<AsyncLoadable, 'isLoading'> {
/** The contents of the table body. Supports static items or a function for dynamic rendering. */
children: RowElement<T> | RowElement<T>[] | ((item: T) => RowElement<T>),
/** A list of row objects in the table body used when dynamically rendering rows. */
items?: Iterable<T>,
/** The current loading state of the table. */
loadingState?: LoadingState
}
export interface RowProps<T> extends LinkDOMProps {
/**
* A list of child item objects used when dynamically rendering row children. Requires the feature flag to be
* enabled along with UNSTABLE_allowsExpandableRows, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.
* @version alpha
* @private
*/
UNSTABLE_childItems?: Iterable<T>,
// TODO: update when async loading is supported for expandable rows
// /** Whether this row has children, even if not loaded yet. */
// hasChildItems?: boolean,
/** Rendered contents of the row or row child items. */
children: CellElement | CellElement[] | CellRenderer,
/** A string representation of the row's contents, used for features like typeahead. */
textValue?: string // ???
}
export interface CellProps {
/** The contents of the cell. */
children: ReactNode,
/** A string representation of the cell's contents, used for features like typeahead. */
textValue?: string,
/** Indicates how many columns the data cell spans. */
colSpan?: number
}
export type CellElement = ReactElement<CellProps>;
export type CellRenderer = (columnKey: Key) => CellElement;
export interface TableCollection<T> extends GridCollection<T> {
// TODO perhaps elaborate on this? maybe not clear enough, essentially returns the table header rows (e.g. in a tiered headers table, will return the nodes containing the top tier column, next tier, etc)
/** A list of header row nodes in the table. */
headerRows: GridNode<T>[],
/** A list of column nodes in the table. */
columns: GridNode<T>[],
/** A set of column keys that serve as the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader). */
rowHeaderColumnKeys: Set<Key>,
/** The node that makes up the header of the table. */
head?: GridNode<T>,
/** The node that makes up the body of the table. */
body: GridNode<T>
}
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var DetailsRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'details'
}
}],
type: 'structure'
};
var _default = DetailsRole;
exports.default = _default;
@@ -0,0 +1,209 @@
/**
* @fileoverview Prevents usage of Function.prototype.bind and arrow functions
* in React component props.
* @author Daniel Lo Nigro <dan.cx>
* @author Jacky Ho
*/
'use strict';
const propName = require('jsx-ast-utils/propName');
const docsUrl = require('../util/docsUrl');
const astUtil = require('../util/ast');
const jsxUtil = require('../util/jsx');
const report = require('../util/report');
const getAncestors = require('../util/eslint').getAncestors;
// -----------------------------------------------------------------------------
// Rule Definition
// -----------------------------------------------------------------------------
const messages = {
bindCall: 'JSX props should not use .bind()',
arrowFunc: 'JSX props should not use arrow functions',
bindExpression: 'JSX props should not use ::',
func: 'JSX props should not use functions',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow `.bind()` or arrow functions in JSX props',
category: 'Best Practices',
recommended: false,
url: docsUrl('jsx-no-bind'),
},
messages,
schema: [{
type: 'object',
properties: {
allowArrowFunctions: {
default: false,
type: 'boolean',
},
allowBind: {
default: false,
type: 'boolean',
},
allowFunctions: {
default: false,
type: 'boolean',
},
ignoreRefs: {
default: false,
type: 'boolean',
},
ignoreDOMComponents: {
default: false,
type: 'boolean',
},
},
additionalProperties: false,
}],
},
create(context) {
const configuration = context.options[0] || {};
// Keep track of all the variable names pointing to a bind call,
// bind expression or an arrow function in different block statements
const blockVariableNameSets = {};
/**
* @param {string | number} blockStart
*/
function setBlockVariableNameSet(blockStart) {
blockVariableNameSets[blockStart] = {
arrowFunc: new Set(),
bindCall: new Set(),
bindExpression: new Set(),
func: new Set(),
};
}
function getNodeViolationType(node) {
if (
!configuration.allowBind
&& astUtil.isCallExpression(node)
&& node.callee.type === 'MemberExpression'
&& node.callee.property.type === 'Identifier'
&& node.callee.property.name === 'bind'
) {
return 'bindCall';
}
if (node.type === 'ConditionalExpression') {
return getNodeViolationType(node.test)
|| getNodeViolationType(node.consequent)
|| getNodeViolationType(node.alternate);
}
if (!configuration.allowArrowFunctions && node.type === 'ArrowFunctionExpression') {
return 'arrowFunc';
}
if (
!configuration.allowFunctions
&& (node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration')
) {
return 'func';
}
if (!configuration.allowBind && node.type === 'BindExpression') {
return 'bindExpression';
}
return null;
}
/**
* @param {string | number} violationType
* @param {unknown} variableName
* @param {string | number} blockStart
*/
function addVariableNameToSet(violationType, variableName, blockStart) {
blockVariableNameSets[blockStart][violationType].add(variableName);
}
function getBlockStatementAncestors(node) {
return getAncestors(context, node).filter(
(ancestor) => ancestor.type === 'BlockStatement'
).reverse();
}
function reportVariableViolation(node, name, blockStart) {
const blockSets = blockVariableNameSets[blockStart];
const violationTypes = Object.keys(blockSets);
return violationTypes.find((type) => {
if (blockSets[type].has(name)) {
report(context, messages[type], type, {
node,
});
return true;
}
return false;
});
}
function findVariableViolation(node, name) {
getBlockStatementAncestors(node).find(
(block) => reportVariableViolation(node, name, block.range[0])
);
}
return {
BlockStatement(node) {
setBlockVariableNameSet(node.range[0]);
},
FunctionDeclaration(node) {
const blockAncestors = getBlockStatementAncestors(node);
const variableViolationType = getNodeViolationType(node);
if (blockAncestors.length > 0 && variableViolationType) {
addVariableNameToSet(variableViolationType, node.id.name, blockAncestors[0].range[0]);
}
},
VariableDeclarator(node) {
if (!node.init) {
return;
}
const blockAncestors = getBlockStatementAncestors(node);
const variableViolationType = getNodeViolationType(node.init);
if (
blockAncestors.length > 0
&& variableViolationType
&& 'kind' in node.parent
&& node.parent.kind === 'const' // only support const right now
) {
addVariableNameToSet(variableViolationType, 'name' in node.id ? node.id.name : undefined, blockAncestors[0].range[0]);
}
},
JSXAttribute(node) {
const isRef = configuration.ignoreRefs && propName(node) === 'ref';
if (isRef || !node.value || !node.value.expression) {
return;
}
const isDOMComponent = jsxUtil.isDOMComponent(node.parent);
if (configuration.ignoreDOMComponents && isDOMComponent) {
return;
}
const valueNode = node.value.expression;
const valueNodeType = valueNode.type;
const nodeViolationType = getNodeViolationType(valueNode);
if (valueNodeType === 'Identifier') {
findVariableViolation(node, valueNode.name);
} else if (nodeViolationType) {
report(context, messages[nodeViolationType], nodeViolationType, {
node,
});
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"names":["_inherit","require","inheritInnerComments","child","parent","inherit"],"sources":["../../src/comments/inheritInnerComments.ts"],"sourcesContent":["import inherit from \"../utils/inherit.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function inheritInnerComments(\n child: t.Node,\n parent: t.Node,\n): void {\n inherit(\"innerComments\", child, parent);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGe,SAASC,oBAAoBA,CAC1CC,KAAa,EACbC,MAAc,EACR;EACN,IAAAC,gBAAO,EAAC,eAAe,EAAEF,KAAK,EAAEC,MAAM,CAAC;AACzC","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"buildUnmanagedMetadataFromMaybeClassElementMetadata.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/buildUnmanagedMetadataFromMaybeClassElementMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAKhF,eAAO,MAAM,mDAAmD,EAAE,MAAM,CACtE,QAAQ,EAAE,yBAAyB,GAAG,SAAS,KAC5C,oBAIF,CAAC"}
@@ -0,0 +1,14 @@
import React from 'react';
import type { DataType, PhotoProviderBase } from './types';
export interface PhotoProviderProps extends PhotoProviderBase {
children: React.ReactNode;
onIndexChange?: (index: number, state: PhotoProviderState) => void;
onVisibleChange?: (visible: boolean, index: number, state: PhotoProviderState) => void;
}
type PhotoProviderState = {
images: DataType[];
visible: boolean;
index: number;
};
export default function PhotoProvider({ children, onIndexChange, onVisibleChange, ...restProps }: PhotoProviderProps): React.JSX.Element;
export {};
@@ -0,0 +1,8 @@
import { _ as _class_apply_descriptor_destructure } from "./_class_apply_descriptor_destructure.js";
import { _ as _class_extract_field_descriptor } from "./_class_extract_field_descriptor.js";
function _class_private_field_destructure(receiver, privateMap) {
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
return _class_apply_descriptor_destructure(receiver, descriptor);
}
export { _class_private_field_destructure as _ };
@@ -0,0 +1,328 @@
export type VisitTraversalStep = $eslintcore.VisitTraversalStep;
export type CallTraversalStep = $eslintcore.CallTraversalStep;
export type TraversalStep = $eslintcore.TraversalStep;
export type SourceLocation = $eslintcore.SourceLocation;
export type SourceLocationWithOffset = $eslintcore.SourceLocationWithOffset;
export type SourceRange = $eslintcore.SourceRange;
export type IDirective = $eslintcore.Directive;
export type DirectiveType = $eslintcore.DirectiveType;
export type SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions;
/**
* <Options>
*/
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
export type RuleConfig = $eslintcore.RuleConfig;
export type RulesConfig = $eslintcore.RulesConfig;
export type StringConfig = $typests.StringConfig;
export type BooleanConfig = $typests.BooleanConfig;
/**
* A class to represent a step in the traversal process where a
* method is called.
* @implements {CallTraversalStep}
*/
export class CallMethodStep implements CallTraversalStep {
/**
* Creates a new instance.
* @param {Object} options The options for the step.
* @param {string} options.target The target of the step.
* @param {Array<any>} options.args The arguments of the step.
*/
constructor({ target, args }: {
target: string;
args: Array<any>;
});
/**
* The type of the step.
* @type {"call"}
* @readonly
*/
readonly type: "call";
/**
* The kind of the step. Represents the same data as the `type` property
* but it's a number for performance.
* @type {2}
* @readonly
*/
readonly kind: 2;
/**
* The name of the method to call.
* @type {string}
*/
target: string;
/**
* The arguments to pass to the method.
* @type {Array<any>}
*/
args: Array<any>;
}
/**
* Object to parse ESLint configuration comments.
*/
export class ConfigCommentParser {
/**
* Parses a list of "name:string_value" or/and "name" options divided by comma or
* whitespace. Used for "global" comments.
* @param {string} string The string to parse.
* @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
*/
parseStringConfig(string: string): StringConfig;
/**
* Parses a JSON-like config.
* @param {string} string The string to parse.
* @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
*/
parseJSONLikeConfig(string: string): ({
ok: true;
config: RulesConfig;
} | {
ok: false;
error: {
message: string;
};
});
/**
* Parses a config of values separated by comma.
* @param {string} string The string to parse.
* @returns {BooleanConfig} Result map of values and true values
*/
parseListConfig(string: string): BooleanConfig;
/**
* Parses a directive comment into directive text and value.
* @param {string} string The string with the directive to be parsed.
* @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
*/
parseDirective(string: string): DirectiveComment | undefined;
#private;
}
/**
* A class to represent a directive comment.
* @implements {IDirective}
*/
export class Directive implements IDirective {
/**
* Creates a new instance.
* @param {Object} options The options for the directive.
* @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
* @param {unknown} options.node The node representing the directive.
* @param {string} options.value The value of the directive.
* @param {string} options.justification The justification for the directive.
*/
constructor({ type, node, value, justification }: {
type: "disable" | "enable" | "disable-next-line" | "disable-line";
node: unknown;
value: string;
justification: string;
});
/**
* The type of directive.
* @type {DirectiveType}
* @readonly
*/
readonly type: DirectiveType;
/**
* The node representing the directive.
* @type {unknown}
* @readonly
*/
readonly node: unknown;
/**
* Everything after the "eslint-disable" portion of the directive,
* but before the "--" that indicates the justification.
* @type {string}
* @readonly
*/
readonly value: string;
/**
* The justification for the directive.
* @type {string}
* @readonly
*/
readonly justification: string;
}
/**
* Source Code Base Object
* @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
* @implements {TextSourceCode<Options>}
*/
export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
RootNode: object;
SyntaxElementWithLoc: object;
} = $eslintcore.SourceCodeBaseTypeOptions & {
RootNode: object;
SyntaxElementWithLoc: object;
}> implements TextSourceCode<Options> {
/**
* Creates a new instance.
* @param {Object} options The options for the instance.
* @param {string} options.text The source code text.
* @param {Options['RootNode']} options.ast The root AST node.
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
*/
constructor({ text, ast, lineEndingPattern }: {
text: string;
ast: Options["RootNode"];
lineEndingPattern?: RegExp;
});
/**
* The AST of the source code.
* @type {Options['RootNode']}
*/
ast: Options["RootNode"];
/**
* The text of the source code.
* @type {string}
*/
text: string;
/**
* Returns the loc information for the given node or token.
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
* @returns {SourceLocation} The loc information for the node or token.
* @throws {Error} If the node or token does not have loc information.
*/
getLoc(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceLocation;
/**
* Converts a source text index into a `{ line: number, column: number }` pair.
* @param {number} index The index of a character in a file.
* @throws {TypeError|RangeError} If non-numeric index or index out of range.
* @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
* @public
*/
public getLocFromIndex(index: number): {
line: number;
column: number;
};
/**
* Converts a `{ line: number, column: number }` pair into a source text index.
* @param {Object} loc A line/column location.
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
* @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
* @throws {TypeError|RangeError} If `loc` is not an object with a numeric
* `line` and `column`, if the `line` is less than or equal to zero or
* the `line` or `column` is out of the expected range.
* @returns {number} The index of the line/column location in a file.
* @public
*/
public getIndexFromLoc(loc: {
line: number;
column: number;
}): number;
/**
* Returns the range information for the given node or token.
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
* @returns {SourceRange} The range information for the node or token.
* @throws {Error} If the node or token does not have range information.
*/
getRange(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceRange;
/**
* Returns the parent of the given node.
* @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
* @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
* @throws {Error} If the method is not implemented in the subclass.
*/
getParent(node: Options["SyntaxElementWithLoc"]): Options["SyntaxElementWithLoc"] | undefined;
/**
* Gets all the ancestors of a given node
* @param {Options['SyntaxElementWithLoc']} node The node
* @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
* from the root node at index 0 and going inwards to the parent node.
* @throws {TypeError} When `node` is missing.
*/
getAncestors(node: Options["SyntaxElementWithLoc"]): Array<Options["SyntaxElementWithLoc"]>;
/**
* Gets the source code for the given node.
* @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
* @param {number} [beforeCount] The number of characters before the node to retrieve.
* @param {number} [afterCount] The number of characters after the node to retrieve.
* @returns {string} The text representing the AST node.
* @public
*/
public getText(node?: Options["SyntaxElementWithLoc"], beforeCount?: number, afterCount?: number): string;
/**
* Gets the entire source text split into an array of lines.
* @returns {Array<string>} The source text as an array of lines.
* @public
*/
public get lines(): Array<string>;
/**
* Traverse the source code and return the steps that were taken.
* @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
*/
traverse(): Iterable<TraversalStep>;
#private;
}
/**
* A class to represent a step in the traversal process where a node is visited.
* @implements {VisitTraversalStep}
*/
export class VisitNodeStep implements VisitTraversalStep {
/**
* Creates a new instance.
* @param {Object} options The options for the step.
* @param {object} options.target The target of the step.
* @param {1|2} options.phase The phase of the step.
* @param {Array<any>} options.args The arguments of the step.
*/
constructor({ target, phase, args }: {
target: object;
phase: 1 | 2;
args: Array<any>;
});
/**
* The type of the step.
* @type {"visit"}
* @readonly
*/
readonly type: "visit";
/**
* The kind of the step. Represents the same data as the `type` property
* but it's a number for performance.
* @type {1}
* @readonly
*/
readonly kind: 1;
/**
* The target of the step.
* @type {object}
*/
target: object;
/**
* The phase of the step.
* @type {1|2}
*/
phase: 1 | 2;
/**
* The arguments of the step.
* @type {Array<any>}
*/
args: Array<any>;
}
import type * as $eslintcore from "@eslint/core";
import type * as $typests from "./types.cts";
/**
* Represents a directive comment.
*/
declare class DirectiveComment {
/**
* Creates a new directive comment.
* @param {string} label The label of the directive.
* @param {string} value The value of the directive.
* @param {string} justification The justification of the directive.
*/
constructor(label: string, value: string, justification: string);
/**
* The label of the directive, such as "eslint", "eslint-disable", etc.
* @type {string}
*/
label: string;
/**
* The value of the directive (the string after the label).
* @type {string}
*/
value: string;
/**
* The justification of the directive (the string after the --).
* @type {string}
*/
justification: string;
}
export {};
@@ -0,0 +1,33 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = extractValueFromUpdateExpression;
/**
* Extractor function for an UpdateExpression type value node.
* An update expression is an expression with an update operator.
* For example, foo++ will evaluate to foo + 1.
*
* @param - value - AST Value object with type `UpdateExpression`
* @returns - The extracted value converted to correct type.
*/
function extractValueFromUpdateExpression(value) {
// eslint-disable-next-line global-require
var getValue = require('.').default;
var operator = value.operator,
argument = value.argument,
prefix = value.prefix;
var val = getValue(argument);
switch (operator) {
case '++':
return prefix ? ++val : val++; // eslint-disable-line no-plusplus
case '--':
return prefix ? --val : val--; // eslint-disable-line no-plusplus
default:
return undefined;
}
}
@@ -0,0 +1 @@
{"name":"strip-ansi","version":"7.1.2","requiresBuild":false,"files":{"license":{"checkedAt":1794532105428,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1794532105428,"integrity":"sha512-1nlfLdsc5N0L7sic7bVk5BIYMZLLqXtMorqnukQ2OCR83NhxguRoBkfU8wuQxBw2GlQrB9PHfu7DB8RonXawUg==","mode":420,"size":468},"package.json":{"checkedAt":1794532105429,"integrity":"sha512-GlO7h8jiXVzw0rx48YvtN9ml+3YMNdPsRvKKVIGc2vK7FPCGvl46fkAvJknwSU7xI6dyyAPx3pdOQpuVPAm5mg==","mode":420,"size":963},"readme.md":{"checkedAt":1794532105429,"integrity":"sha512-H6ELM1OBTBIkJgQFeWec6Whz1D2pk2PqCGd+ae1HC5+LoYCUdBRY5EGt0CCQ7fDSxkvAAY/ForMmpnCp+w5x2w==","mode":420,"size":1223},"index.d.ts":{"checkedAt":1794532105429,"integrity":"sha512-xcXpsuAuqQTuqcDNVOb+hWmhMay8cEn63kev8etVYlCjjZPkdJ+VDF/AgkJPQre1QRrRrizRevTT+ZCylP0rNw==","mode":420,"size":349}}}
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PKCS8ShroudedKeyBag = void 0;
const tslib_1 = require("tslib");
const asn1_pkcs8_1 = require("@peculiar/asn1-pkcs8");
const asn1_schema_1 = require("@peculiar/asn1-schema");
let PKCS8ShroudedKeyBag = class PKCS8ShroudedKeyBag extends asn1_pkcs8_1.EncryptedPrivateKeyInfo {
};
exports.PKCS8ShroudedKeyBag = PKCS8ShroudedKeyBag;
exports.PKCS8ShroudedKeyBag = PKCS8ShroudedKeyBag = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], PKCS8ShroudedKeyBag);
@@ -0,0 +1,31 @@
# jsx-a11y/role-has-required-aria-props
💼 This rule is enabled in the following configs: ☑️ `recommended`, 🔒 `strict`.
<!-- end auto-generated rule header -->
Elements with ARIA roles must have all required attributes for that role.
## Rule details
This rule takes no arguments.
### Succeed
```jsx
<!-- Good: the checkbox role requires the aria-checked state -->
<span role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0"></span>
```
### Fail
```jsx
<!-- Bad: the checkbox role requires the aria-checked state -->
<span role="checkbox" aria-labelledby="foo" tabindex="0"></span>
```
## Accessibility guidelines
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
### Resources
- [ARIA Spec, Roles](https://www.w3.org/TR/wai-aria/#roles)
- [Chrome Audit Rules, AX_ARIA_03](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_03)
@@ -0,0 +1,263 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-unnecessary-boolean-literal-compare',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow unnecessary equality comparisons against boolean literals',
recommended: 'strict',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
comparingNullableToFalse: 'This expression unnecessarily compares a nullable boolean value to false instead of using the ?? operator to provide a default.',
comparingNullableToTrueDirect: 'This expression unnecessarily compares a nullable boolean value to true instead of using it directly.',
comparingNullableToTrueNegated: 'This expression unnecessarily compares a nullable boolean value to true instead of negating it.',
direct: 'This expression unnecessarily compares a boolean value to a boolean instead of using it directly.',
negated: 'This expression unnecessarily compares a boolean value to a boolean instead of negating it.',
noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowComparingNullableBooleansToFalse: {
type: 'boolean',
description: 'Whether to allow comparisons between nullable boolean variables and `false`.',
},
allowComparingNullableBooleansToTrue: {
type: 'boolean',
description: 'Whether to allow comparisons between nullable boolean variables and `true`.',
},
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: {
type: 'boolean',
description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.',
},
},
},
],
},
defaultOptions: [
{
allowComparingNullableBooleansToFalse: true,
allowComparingNullableBooleansToTrue: true,
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
},
],
create(context, [options]) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
const compilerOptions = services.program.getCompilerOptions();
const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks');
if (!isStrictNullChecks &&
options.allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) {
context.report({
loc: {
start: { column: 0, line: 0 },
end: { column: 0, line: 0 },
},
messageId: 'noStrictNullCheck',
});
}
function getBooleanComparison(node) {
const comparison = deconstructComparison(node);
if (!comparison) {
return undefined;
}
const { constraintType, isTypeParameter } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(comparison.expression));
if (isTypeParameter && constraintType == null) {
return undefined;
}
if (isBooleanType(constraintType)) {
return {
...comparison,
expressionIsNullableBoolean: false,
};
}
if (isNullableBoolean(constraintType)) {
return {
...comparison,
expressionIsNullableBoolean: true,
};
}
return undefined;
}
function isBooleanType(expressionType) {
return tsutils.isTypeFlagSet(expressionType, ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral);
}
/**
* checks if the expressionType is a union that
* 1) contains at least one nullish type (null or undefined)
* 2) contains at least once boolean type (true or false or boolean)
* 3) does not contain any types besides nullish and boolean types
*/
function isNullableBoolean(expressionType) {
if (!expressionType.isUnion()) {
return false;
}
const { types } = expressionType;
const nonNullishTypes = types.filter(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Undefined | ts.TypeFlags.Null));
const hasNonNullishType = nonNullishTypes.length > 0;
if (!hasNonNullishType) {
return false;
}
const hasNullableType = nonNullishTypes.length < types.length;
if (!hasNullableType) {
return false;
}
const allNonNullishTypesAreBoolean = nonNullishTypes.every(isBooleanType);
if (!allNonNullishTypesAreBoolean) {
return false;
}
return true;
}
function deconstructComparison(node) {
const comparisonType = getEqualsKind(node.operator);
if (!comparisonType) {
return undefined;
}
for (const [against, expression] of [
[node.right, node.left],
[node.left, node.right],
]) {
if (against.type !== utils_1.AST_NODE_TYPES.Literal ||
typeof against.value !== 'boolean') {
continue;
}
const { value: literalBooleanInComparison } = against;
const negated = !comparisonType.isPositive;
return {
expression,
literalBooleanInComparison,
negated,
};
}
return undefined;
}
function nodeIsUnaryNegation(node) {
return (node.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
node.prefix &&
node.operator === '!');
}
return {
BinaryExpression(node) {
const comparison = getBooleanComparison(node);
if (comparison == null) {
return;
}
if (comparison.expressionIsNullableBoolean) {
if (comparison.literalBooleanInComparison &&
options.allowComparingNullableBooleansToTrue) {
return;
}
if (!comparison.literalBooleanInComparison &&
options.allowComparingNullableBooleansToFalse) {
return;
}
}
context.report({
node,
messageId: comparison.expressionIsNullableBoolean
? comparison.literalBooleanInComparison
? comparison.negated
? 'comparingNullableToTrueNegated'
: 'comparingNullableToTrueDirect'
: 'comparingNullableToFalse'
: comparison.negated
? 'negated'
: 'direct',
*fix(fixer) {
// 1. isUnaryNegation - parent negation
// 2. literalBooleanInComparison - is compared to literal boolean
// 3. negated - is expression negated
const isUnaryNegation = nodeIsUnaryNegation(node.parent);
const shouldNegate = comparison.negated !== comparison.literalBooleanInComparison;
const mutatedNode = isUnaryNegation ? node.parent : node;
yield fixer.replaceText(mutatedNode, context.sourceCode.getText(comparison.expression));
// if `isUnaryNegation === literalBooleanInComparison === !negated` is true - negate the expression
if (shouldNegate === isUnaryNegation) {
yield fixer.insertTextBefore(mutatedNode, '!');
// if the expression `exp` is not a strong precedence node, wrap it in parentheses
if (!(0, util_1.isStrongPrecedenceNode)(comparison.expression)) {
yield fixer.insertTextBefore(mutatedNode, '(');
yield fixer.insertTextAfter(mutatedNode, ')');
}
}
// if the expression `exp` is nullable, and we're not comparing to `true`, insert `?? true`
if (comparison.expressionIsNullableBoolean &&
!comparison.literalBooleanInComparison) {
// provide the default `true`
yield fixer.insertTextBefore(mutatedNode, '(');
yield fixer.insertTextAfter(mutatedNode, ' ?? true)');
}
},
});
},
};
},
});
function getEqualsKind(operator) {
switch (operator) {
case '!=':
return {
isPositive: false,
isStrict: false,
};
case '!==':
return {
isPositive: false,
isStrict: true,
};
case '==':
return {
isPositive: true,
isStrict: false,
};
case '===':
return {
isPositive: true,
isStrict: true,
};
default:
return undefined;
}
}
@@ -0,0 +1,44 @@
import { isSpace } from '../util.js';
const zeroWidth = {
line: 0,
start: 0,
delimiter: 0,
postDelimiter: 0,
tag: 0,
postTag: 0,
name: 0,
postName: 0,
type: 0,
postType: 0,
description: 0,
end: 0,
lineEnd: 0,
};
const headers = { lineEnd: 'CR' };
const fields = Object.keys(zeroWidth);
const repr = (x) => (isSpace(x) ? `{${x.length}}` : x);
const frame = (line) => '|' + line.join('|') + '|';
const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k]));
export default function inspect({ source }) {
var _a, _b;
if (source.length === 0)
return '';
const width = Object.assign({}, zeroWidth);
for (const f of fields)
width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length;
for (const { number, tokens } of source) {
width.line = Math.max(width.line, number.toString().length);
for (const k in tokens)
width[k] = Math.max(width[k], repr(tokens[k]).length);
}
const lines = [[], []];
for (const f of fields)
lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f]));
for (const f of fields)
lines[1].push('-'.padEnd(width[f], '-'));
for (const { number, tokens } of source) {
const line = number.toString().padStart(width.line);
lines.push([line, ...align(width, tokens)]);
}
return lines.map(frame).join('\n');
}
@@ -0,0 +1,67 @@
"use strict"
const { READ } = require("@eslint-community/eslint-utils")
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const common_objects = {
Network: {
dataReceived: { [READ]: { supported: ["22.17.0"] } },
dataSent: { [READ]: { supported: ["22.18.0"] } },
loadingFailed: { [READ]: { experimental: ["22.7.0", "20.18.0"] } },
loadingFinished: { [READ]: { experimental: ["22.6.0", "20.18.0"] } },
requestWillBeSent: { [READ]: { experimental: ["22.6.0", "20.18.0"] } },
responseReceived: { [READ]: { experimental: ["22.6.0", "20.18.0"] } },
},
NetworkResources: {
put: { [READ]: { experimental: ["22.19.0"] } },
},
console: { [READ]: { supported: ["8.0.0"] } },
close: { [READ]: { supported: ["9.0.0"] } },
open: { [READ]: { supported: ["8.0.0"] } },
url: { [READ]: { supported: ["8.0.0"] } },
waitForDebugger: { [READ]: { supported: ["12.7.0"] } },
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const promises_api = {
Session: { [READ]: { supported: ["19.0.0"] } },
...common_objects,
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const callback_api = {
Session: { [READ]: { supported: ["8.0.0"] } },
...common_objects,
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
module.exports = {
inspector: {
[READ]: {
experimental: ["8.0.0"],
supported: ["14.0.0"],
},
...callback_api,
},
"node:inspector": {
[READ]: { supported: ["14.13.1", "12.20.0"] },
...callback_api,
},
"inspector/promises": {
[READ]: { experimental: ["19.0.0"] },
...promises_api,
},
"node:inspector/promises": {
[READ]: { experimental: ["19.0.0"] },
...promises_api,
},
}
@@ -0,0 +1,86 @@
{
"name": "@types/fabric",
"version": "5.3.10",
"description": "TypeScript definitions for fabric",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fabric",
"license": "MIT",
"contributors": [
{
"name": "Oliver Klemencic",
"githubUsername": "oklemencic",
"url": "https://github.com/oklemencic"
},
{
"name": "Joseph Livecchi",
"githubUsername": "joewashear007",
"url": "https://github.com/joewashear007"
},
{
"name": "Michael Randolph",
"githubUsername": "mrand01",
"url": "https://github.com/mrand01"
},
{
"name": "Tiger Oakes",
"githubUsername": "NotWoods",
"url": "https://github.com/NotWoods"
},
{
"name": "Brian Martinson",
"githubUsername": "bmartinson",
"url": "https://github.com/bmartinson"
},
{
"name": "Rogerio Teixeira",
"githubUsername": "RogerioTeixeira",
"url": "https://github.com/RogerioTeixeira"
},
{
"name": "Bradley Hill",
"githubUsername": "BradleyHill",
"url": "https://github.com/BradleyHill"
},
{
"name": "Bryan Krol",
"githubUsername": "bmkrol823",
"url": "https://github.com/bmkrol823"
},
{
"name": "Glenn Gartner",
"githubUsername": "glenngartner",
"url": "https://github.com/glenngartner"
},
{
"name": "Codertx",
"githubUsername": "codertx",
"url": "https://github.com/codertx"
},
{
"name": "Mike Moore",
"githubUsername": "mike667",
"url": "https://github.com/mike667"
},
{
"name": "Natalie Marleny",
"githubUsername": "nataliemarleny",
"url": "https://github.com/nataliemarleny"
},
{
"name": "Muhammad Rahmahalim",
"githubUsername": "oxwazz",
"url": "https://github.com/oxwazz"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/fabric"
},
"scripts": {},
"dependencies": {},
"peerDependencies": {},
"typesPublisherContentHash": "7ea6f78d6fe117a75ed0aecf4fb40f76d1c54de5f6f29b34babfa5d9eed6bf8f",
"typeScriptVersion": "5.0"
}
@@ -0,0 +1,3 @@
'use strict';
module.exports = Number.MAX_VALUE || 1.7976931348623157e+308;
@@ -0,0 +1,42 @@
var constant = require('./constant'),
createInverter = require('./_createInverter'),
identity = require('./identity');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key;
}, constant(identity));
module.exports = invert;
@@ -0,0 +1,53 @@
util-deprecate
==============
### The Node.js `util.deprecate()` function with browser support
In Node.js, this module simply re-exports the `util.deprecate()` function.
In the web browser (i.e. via browserify), a browser-specific implementation
of the `util.deprecate()` function is used.
## API
A `deprecate()` function is the only thing exposed by this module.
``` javascript
// setup:
exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
// users see:
foo();
// foo() is deprecated, use bar() instead
foo();
foo();
```
## License
(The MIT License)
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
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.
@@ -0,0 +1,40 @@
import EventEmitter from 'node:events';
import { IStatusHelperSubscription } from '../../napcat-common/src/status-interface';
export interface SystemStatus {
cpu: {
model: string;
speed: string;
usage: {
system: string;
qq: string;
};
core: number;
};
memory: {
total: string;
usage: {
system: string;
qq: string;
};
};
arch: string;
}
export declare class StatusHelper {
private psCpuUsage;
private psCurrentTime;
private cpuTimes;
private replaceNaN;
private sysCpuInfo;
private sysMemoryUsage;
private qqUsage;
systemStatus(): SystemStatus;
}
declare class StatusHelperSubscription extends EventEmitter implements IStatusHelperSubscription {
private statusHelper;
private interval;
constructor(time?: number);
private startInterval;
private stopInterval;
}
export declare const statusHelperSubscription: StatusHelperSubscription;
export {};
@@ -0,0 +1,67 @@
# parent-module [![Build Status](https://travis-ci.org/sindresorhus/parent-module.svg?branch=master)](https://travis-ci.org/sindresorhus/parent-module)
> Get the path of the parent module
Node.js exposes `module.parent`, but it only gives you the first cached parent, which is not necessarily the actual parent.
## Install
```
$ npm install parent-module
```
## Usage
```js
// bar.js
const parentModule = require('parent-module');
module.exports = () => {
console.log(parentModule());
//=> '/Users/sindresorhus/dev/unicorn/foo.js'
};
```
```js
// foo.js
const bar = require('./bar');
bar();
```
## API
### parentModule([filepath])
By default, it will return the path of the immediate parent.
#### filepath
Type: `string`<br>
Default: [`__filename`](https://nodejs.org/api/globals.html#globals_filename)
Filepath of the module of which to get the parent path.
Useful if you want it to work [multiple module levels down](https://github.com/sindresorhus/parent-module/tree/master/fixtures/filepath).
## Tip
Combine it with [`read-pkg-up`](https://github.com/sindresorhus/read-pkg-up) to read the package.json of the parent module.
```js
const path = require('path');
const readPkgUp = require('read-pkg-up');
const parentModule = require('parent-module');
console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg);
//=> {name: 'chalk', version: '1.0.0', …}
```
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -0,0 +1 @@
module.exports={A:{D:{"1":"0 1 2 3 4 5 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B"},L:{"1":"I"},B:{"1":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB 0C 1C","33":"6 7 8 9 K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB"},M:{"1":"MC"},A:{"2":"K D E F A B wC"},F:{"1":"0 1 2 3 4 5 pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB FD GD HD ID NC uC JD OC"},K:{"1":"H","2":"A B C NC uC OC"},E:{"1":"L M G OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD","2":"J ZB K D 2C ZC 3C 4C 5C ED","33":"E F A B C 6C aC NC"},G:{"1":"WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"ZC KD vC LD MD ND","33":"E OD PD QD RD SD TD UD VD"},P:{"1":"6 7 8 9 AB BB CB DB EB FB qD rD sD aC tD uD vD wD xD QC RC SC yD","2":"J oD pD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"}},B:6,C:"text-decoration-line property",D:undefined};
@@ -0,0 +1,59 @@
import type { ProjectServiceOptions } from '@typescript-eslint/types';
import type * as ts from 'typescript/lib/tsserverlibrary';
/**
* Shortcut type to refer to TypeScript's server ProjectService.
*/
export type TypeScriptProjectService = ts.server.ProjectService;
/**
* A created Project Service instance, as well as metadata on its creation.
*/
export interface ProjectServiceAndMetadata {
/**
* Files allowed to be loaded from the default project, if any were specified.
*/
allowDefaultProject: string[] | undefined;
/**
* The performance.now() timestamp of the last reload of the project service.
*/
lastReloadTimestamp: number;
/**
* The maximum number of files that can be matched by the default project.
*/
maximumDefaultProjectFileMatchCount: number;
/**
* The created TypeScript Project Service instance.
*/
service: TypeScriptProjectService;
}
/**
* Settings to create a new Project Service instance with {@link createProjectService}.
*/
export interface CreateProjectServiceSettings {
/**
* Granular options to configure the project service.
*/
options?: ProjectServiceOptions;
/**
* How aggressively (and slowly) to parse JSDoc comments.
*/
jsDocParsingMode?: ts.JSDocParsingMode;
/**
* Root directory for the tsconfig.json file, if not the current directory.
*/
tsconfigRootDir?: string;
}
/**
* Creates a new Project Service instance, as well as metadata on its creation.
* @param settings Settings to create a new Project Service instance.
* @returns A new Project Service instance, as well as metadata on its creation.
* @example
* ```ts
* import { createProjectService } from '@typescript-eslint/project-service';
*
* const { service } = createProjectService();
*
* service.openClientFile('index.ts');
* ```
*/
export declare function createProjectService({ jsDocParsingMode, options: optionsRaw, tsconfigRootDir, }?: CreateProjectServiceSettings): ProjectServiceAndMetadata;
export { type ProjectServiceOptions } from '@typescript-eslint/types';
@@ -0,0 +1,22 @@
export type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object)
export function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
export function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
export function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
export interface StringifyOptions {
bigint?: boolean,
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
deterministic?: boolean | ((a: string, b: string) => number),
maximumBreadth?: number,
maximumDepth?: number,
strict?: boolean,
}
export namespace stringify {
export function configure(options: StringifyOptions): typeof stringify
}
export function configure(options: StringifyOptions): typeof stringify
export default stringify
@@ -0,0 +1 @@
{"version":3,"file":"assertMetadataFromTypescriptIfManaged.spec.d.ts","sourceRoot":"","sources":["../../../../src/metadata/calculations/assertMetadataFromTypescriptIfManaged.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,223 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const DescriptionFileUtils = require("./DescriptionFileUtils");
const forEachBail = require("./forEachBail");
const { processImportsField } = require("./util/entrypoints");
const { parseIdentifier } = require("./util/identifier");
const {
deprecatedInvalidSegmentRegEx,
invalidSegmentRegEx,
} = require("./util/path");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").JsonObject} JsonObject */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */
/** @typedef {import("./util/entrypoints").ImportsField} ImportsField */
const dotCode = ".".charCodeAt(0);
module.exports = class ImportsFieldPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {Set<string>} conditionNames condition names
* @param {string | string[]} fieldNamePath name path
* @param {string | ResolveStepHook} targetFile target file
* @param {string | ResolveStepHook} targetPackage target package
*/
constructor(
source,
conditionNames,
fieldNamePath,
targetFile,
targetPackage,
) {
this.source = source;
this.targetFile = targetFile;
this.targetPackage = targetPackage;
this.conditionNames = conditionNames;
this.fieldName = fieldNamePath;
/** @type {WeakMap<JsonObject, FieldProcessor>} */
this.fieldProcessorCache = new WeakMap();
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const targetFile = resolver.ensureHook(this.targetFile);
const targetPackage = resolver.ensureHook(this.targetPackage);
resolver
.getHook(this.source)
.tapAsync("ImportsFieldPlugin", (request, resolveContext, callback) => {
// When there is no description file, abort
if (!request.descriptionFilePath || request.request === undefined) {
return callback();
}
const remainingRequest =
request.request + request.query + request.fragment;
const importsField =
/** @type {ImportsField|null|undefined} */
(
DescriptionFileUtils.getField(
/** @type {JsonObject} */ (request.descriptionFileData),
this.fieldName,
)
);
if (!importsField) return callback();
if (request.directory) {
return callback(
new Error(
`Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)`,
),
);
}
/** @type {string[]} */
let paths;
/** @type {string | null} */
let usedField;
try {
// We attach the cache to the description file instead of the importsField value
// because we use a WeakMap and the importsField could be a string too.
// Description file is always an object when exports field can be accessed.
let fieldProcessor = this.fieldProcessorCache.get(
/** @type {JsonObject} */ (request.descriptionFileData),
);
if (fieldProcessor === undefined) {
fieldProcessor = processImportsField(importsField);
this.fieldProcessorCache.set(
/** @type {JsonObject} */ (request.descriptionFileData),
fieldProcessor,
);
}
[paths, usedField] = fieldProcessor(
remainingRequest,
this.conditionNames,
);
} catch (/** @type {unknown} */ err) {
if (resolveContext.log) {
resolveContext.log(
`Imports field in ${request.descriptionFilePath} can't be processed: ${err}`,
);
}
return callback(/** @type {Error} */ (err));
}
if (paths.length === 0) {
return callback(
new Error(
`Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})`,
),
);
}
forEachBail(
paths,
/**
* @param {string} path path
* @param {(err?: null|Error, result?: null|ResolveRequest) => void} callback callback
* @param {number} i index
* @returns {void}
*/
(path, callback, i) => {
const parsedIdentifier = parseIdentifier(path);
if (!parsedIdentifier) return callback();
const [path_, query, fragment] = parsedIdentifier;
switch (path_.charCodeAt(0)) {
// should be relative
case dotCode: {
if (
invalidSegmentRegEx.exec(path_.slice(2)) !== null &&
deprecatedInvalidSegmentRegEx.test(path_.slice(2)) !== null
) {
if (paths.length === i) {
return callback(
new Error(
`Invalid "imports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`,
),
);
}
return callback();
}
/** @type {ResolveRequest} */
const obj = {
...request,
request: undefined,
path: resolver.join(
/** @type {string} */ (request.descriptionFileRoot),
path_,
),
relativePath: path_,
query,
fragment,
};
resolver.doResolve(
targetFile,
obj,
`using imports field: ${path}`,
resolveContext,
(err, result) => {
if (err) return callback(err);
// Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400
if (result === undefined) return callback(null, null);
callback(null, result);
},
);
break;
}
// package resolving
default: {
/** @type {ResolveRequest} */
const obj = {
...request,
request: path_,
relativePath: path_,
fullySpecified: true,
query,
fragment,
};
resolver.doResolve(
targetPackage,
obj,
`using imports field: ${path}`,
resolveContext,
(err, result) => {
if (err) return callback(err);
// Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400
if (result === undefined) return callback(null, null);
callback(null, result);
},
);
}
}
},
/**
* @param {(null|Error)=} err error
* @param {(null|ResolveRequest)=} result result
* @returns {void}
*/
(err, result) => callback(err, result || null),
);
});
}
};
@@ -0,0 +1,73 @@
# Pirates [![Coverage][codecov-badge]][codecov-link]
### Properly hijack require
This library allows to add custom require hooks, which do not interfere with other require hooks.
This library only works with commonJS.
[codecov-badge]: https://img.shields.io/codecov/c/github/danez/pirates/master.svg?style=flat "codecov"
[codecov-link]: https://codecov.io/gh/danez/pirates "codecov"
## Why?
Two reasons:
1. Babel and istanbul were breaking each other.
2. Everyone seemed to re-invent the wheel on this, and everyone wanted a solution that was DRY, simple, easy to use,
and made everything Just Work™, while allowing multiple require hooks, in a fashion similar to calling `super`.
For some context, see [the Babel issue thread][] which started this all, then [the nyc issue thread][], where
discussion was moved (as we began to discuss just using the code nyc had developed), and finally to [#1][issue-1]
where discussion was finally moved.
[the Babel issue thread]: https://github.com/babel/babel/pull/3062 "Babel Issue Thread"
[the nyc issue thread]: https://github.com/bcoe/nyc/issues/70 "NYC Issue Thread"
[issue-1]: https://github.com/danez/pirates/issues/1 "Issue #1"
## Installation
npm install --save pirates
## Usage
Using pirates is really easy:
```javascript
// my-module/register.js
const addHook = require('pirates').addHook;
// Or if you use ES modules
// import { addHook } from 'pirates';
function matcher(filename) {
// Here, you can inspect the filename to determine if it should be hooked or
// not. Just return a truthy/falsey. Files in node_modules are automatically ignored,
// unless otherwise specified in options (see below).
// TODO: Implement your logic here
return true;
}
const revert = addHook(
(code, filename) => code.replace('@@foo', 'console.log(\'foo\');'),
{ exts: ['.js'], matcher }
);
// And later, if you want to un-hook require, you can just do:
revert();
```
## API
### pirates.addHook(hook, [opts={ [matcher: true], [exts: ['.js']], [ignoreNodeModules: true] }]);
Add a require hook. `hook` must be a function that takes `(code, filename)`, and returns the modified code. `opts` is
an optional options object. Available options are: `matcher`, which is a function that accepts a filename, and
returns a truthy value if the file should be hooked (defaults to a function that always returns true), falsey if
otherwise; `exts`, which is an array of extensions to hook, they should begin with `.` (defaults to `['.js']`);
`ignoreNodeModules`, if true, any file in a `node_modules` folder wont be hooked (the matcher also wont be called),
if false, then the matcher will be called for any files in `node_modules` (defaults to true).
## Projects that use Pirates
See the [wiki page](https://github.com/danez/pirates/wiki/Projects-using-Pirates). If you add Pirates to your project,
(And you should! It works best if everyone uses it. Then we can have a happy world full of happy require hooks!), please
add yourself to the wiki.
@@ -0,0 +1,6 @@
import { Binding, CacheBindingInvalidationKind } from '@inversifyjs/core';
export interface CacheBindingInvalidation {
binding: Binding<unknown>;
kind: CacheBindingInvalidationKind;
}
//# sourceMappingURL=CacheBindingInvalidation.d.ts.map
@@ -0,0 +1 @@
{"39":"0.20","40":"0.21","41":"0.21","42":"0.25","43":"0.27","44":"0.30","45":"0.31","47":"0.36","49":"0.37","50":"1.1","51":"1.2","52":"1.3","53":"1.4","54":"1.4","56":"1.6","58":"1.7","59":"1.8","61":"2.0","66":"3.0","69":"4.0","72":"5.0","73":"5.0","76":"6.0","78":"7.0","79":"8.0","80":"8.0","82":"9.0","83":"9.0","84":"10.0","85":"10.0","86":"11.0","87":"11.0","89":"12.0","90":"13.0","91":"13.0","92":"14.0","93":"14.0","94":"15.0","95":"16.0","96":"16.0","98":"17.0","99":"18.0","100":"18.0","102":"19.0","103":"20.0","104":"20.0","105":"21.0","106":"21.0","107":"22.0","108":"22.0","110":"23.0","111":"24.0","112":"24.0","114":"25.0","116":"26.0","118":"27.0","119":"28.0","120":"28.0","121":"29.0","122":"29.0","123":"30.0","124":"30.0","125":"31.0","126":"31.0","127":"32.0","128":"32.0","129":"33.0","130":"33.0","131":"34.0","132":"34.0","133":"35.0","134":"35.0","135":"36.0","136":"36.0","137":"37.0","138":"37.0","139":"38.0","140":"38.0","141":"39.0","142":"39.0","143":"40.0","144":"40.0"}
@@ -0,0 +1,111 @@
'use strict';
var test = require('tape');
var isTypedArray = require('../');
var isCallable = require('is-callable');
var hasToStringTag = require('has-tostringtag/shams')();
var generators = require('make-generator-function')();
var arrowFn = require('make-arrow-function')();
var forEach = require('for-each');
var inspect = require('object-inspect');
var typedArrayNames = [
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array'
];
test('not arrays', function (t) {
t.test('non-number/string primitives', function (st) {
// @ts-expect-error Expected 1 arguments, but got 0.ts(2554)
st.notOk(isTypedArray(), 'undefined is not typed array');
st.notOk(isTypedArray(null), 'null is not typed array');
st.notOk(isTypedArray(false), 'false is not typed array');
st.notOk(isTypedArray(true), 'true is not typed array');
st.end();
});
t.notOk(isTypedArray({}), 'object is not typed array');
t.notOk(isTypedArray(/a/g), 'regex literal is not typed array');
t.notOk(isTypedArray(new RegExp('a', 'g')), 'regex object is not typed array');
t.notOk(isTypedArray(new Date()), 'new Date() is not typed array');
t.test('numbers', function (st) {
st.notOk(isTypedArray(42), 'number is not typed array');
st.notOk(isTypedArray(Object(42)), 'number object is not typed array');
st.notOk(isTypedArray(NaN), 'NaN is not typed array');
st.notOk(isTypedArray(Infinity), 'Infinity is not typed array');
st.end();
});
t.test('strings', function (st) {
st.notOk(isTypedArray('foo'), 'string primitive is not typed array');
st.notOk(isTypedArray(Object('foo')), 'string object is not typed array');
st.end();
});
t.end();
});
test('Functions', function (t) {
t.notOk(isTypedArray(function () {}), 'function is not typed array');
t.end();
});
test('Generators', { skip: generators.length === 0 }, function (t) {
forEach(generators, function (genFn) {
t.notOk(isTypedArray(genFn), 'generator function ' + inspect(genFn) + ' is not typed array');
});
t.end();
});
test('Arrow functions', { skip: !arrowFn }, function (t) {
t.notOk(isTypedArray(arrowFn), 'arrow function is not typed array');
t.end();
});
test('@@toStringTag', { skip: !hasToStringTag }, function (t) {
forEach(typedArrayNames, function (typedArray) {
// @ts-expect-error
if (typeof global[typedArray] === 'function') {
// @ts-expect-error
var fakeTypedArray = [];
// @ts-expect-error
fakeTypedArray[Symbol.toStringTag] = typedArray;
// @ts-expect-error
t.notOk(isTypedArray(fakeTypedArray), 'faked ' + typedArray + ' is not typed array');
} else {
t.comment('# SKIP ' + typedArray + ' is not supported');
}
});
t.end();
});
test('non-Typed Arrays', function (t) {
t.notOk(isTypedArray([]), '[] is not typed array');
t.end();
});
/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor | BigUint64ArrayConstructor} TypedArrayConstructor */
test('Typed Arrays', function (t) {
forEach(typedArrayNames, function (typedArray) {
// @ts-expect-error
/** @type {TypedArrayConstructor} */ var TypedArray = global[typedArray];
if (isCallable(TypedArray)) {
var arr = new TypedArray(10);
t.ok(isTypedArray(arr), 'new ' + typedArray + '(10) is typed array');
} else {
t.comment('# SKIP ' + typedArray + ' is not supported');
}
});
t.end();
});
@@ -0,0 +1,67 @@
/*
Fraction.js v5.0.0 10/1/2024
https://raw.org/article/rational-numbers-in-javascript/
Copyright (c) 2024, Robert Eisele (https://raw.org/)
Licensed under the MIT license.
*/
const Fraction = require('fraction.js');
// NOTE: This is a nice example, but a stable version of this is served with Polynomial.js:
// https://github.com/rawify/Polynomial.js
function integrate(poly) {
poly = poly.replace(/\s+/g, "");
var regex = /(\([+-]?[0-9/]+\)|[+-]?[0-9/]+)x(?:\^(\([+-]?[0-9/]+\)|[+-]?[0-9]+))?/g;
var arr;
var res = {};
while (null !== (arr = regex.exec(poly))) {
var a = (arr[1] || "1").replace("(", "").replace(")", "").split("/");
var b = (arr[2] || "1").replace("(", "").replace(")", "").split("/");
var exp = new Fraction(b).add(1);
var key = "" + exp;
if (res[key] !== undefined) {
res[key] = { x: new Fraction(a).div(exp).add(res[key].x), e: exp };
} else {
res[key] = { x: new Fraction(a).div(exp), e: exp };
}
}
var str = "";
var c = 0;
for (var i in res) {
if (res[i].x.s !== -1n && c > 0) {
str += "+";
} else if (res[i].x.s === -1n) {
str += "-";
}
if (res[i].x.n !== res[i].x.d) {
if (res[i].x.d !== 1n) {
str += res[i].x.n + "/" + res[i].x.d;
} else {
str += res[i].x.n;
}
}
str += "x";
if (res[i].e.n !== res[i].e.d) {
str += "^";
if (res[i].e.d !== 1n) {
str += "(" + res[i].e.n + "/" + res[i].e.d + ")";
} else {
str += res[i].e.n;
}
}
c++;
}
return str;
}
var poly = "-2/3x^3-2x^2+3x+8x^3-1/3x^(4/8)";
console.log("f(x): " + poly);
console.log("F(x): " + integrate(poly));
@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return parseObjectStyles;
}
});
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
const _postcssnested = /*#__PURE__*/ _interop_require_default(require("postcss-nested"));
const _postcssjs = /*#__PURE__*/ _interop_require_default(require("postcss-js"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function parseObjectStyles(styles) {
if (!Array.isArray(styles)) {
return parseObjectStyles([
styles
]);
}
return styles.flatMap((style)=>{
return (0, _postcss.default)([
(0, _postcssnested.default)({
bubble: [
"screen"
]
})
]).process(style, {
parser: _postcssjs.default
}).root.nodes;
});
}
@@ -0,0 +1,437 @@
import {
colorVariants
} from "./chunk-GQT3YUX3.mjs";
import {
tv
} from "./chunk-UWE6H66T.mjs";
import {
collapseAdjacentVariantBorders,
dataFocusVisibleClasses
} from "./chunk-GH5E4FQB.mjs";
// src/components/button.ts
var button = tv({
base: [
"z-0",
"group",
"relative",
"inline-flex",
"items-center",
"justify-center",
"box-border",
"appearance-none",
"outline-none",
"select-none",
"whitespace-nowrap",
"min-w-max",
"font-normal",
"subpixel-antialiased",
"overflow-hidden",
"tap-highlight-transparent",
"data-[pressed=true]:scale-[0.97]",
...dataFocusVisibleClasses
],
variants: {
variant: {
solid: "",
bordered: "border-medium bg-transparent",
light: "bg-transparent",
flat: "",
faded: "border-medium",
shadow: "",
ghost: "border-medium bg-transparent"
},
size: {
sm: "px-3 min-w-16 h-8 text-tiny gap-2 rounded-small",
md: "px-4 min-w-20 h-10 text-small gap-2 rounded-medium",
lg: "px-6 min-w-24 h-12 text-medium gap-3 rounded-large"
},
color: {
default: "",
primary: "",
secondary: "",
success: "",
warning: "",
danger: ""
},
radius: {
none: "rounded-none",
sm: "rounded-small",
md: "rounded-medium",
lg: "rounded-large",
full: "rounded-full"
},
fullWidth: {
true: "w-full"
},
isDisabled: {
true: "opacity-disabled pointer-events-none"
},
isInGroup: {
true: "[&:not(:first-child):not(:last-child)]:rounded-none"
},
isIconOnly: {
true: "px-0 !gap-0",
false: "[&>svg]:max-w-[theme(spacing.8)]"
},
disableAnimation: {
true: "!transition-none data-[pressed=true]:scale-100",
false: "transition-transform-colors-opacity motion-reduce:transition-none"
}
},
defaultVariants: {
size: "md",
variant: "solid",
color: "default",
fullWidth: false,
isDisabled: false,
isInGroup: false
},
compoundVariants: [
{
variant: "solid",
color: "default",
class: colorVariants.solid.default
},
{
variant: "solid",
color: "primary",
class: colorVariants.solid.primary
},
{
variant: "solid",
color: "secondary",
class: colorVariants.solid.secondary
},
{
variant: "solid",
color: "success",
class: colorVariants.solid.success
},
{
variant: "solid",
color: "warning",
class: colorVariants.solid.warning
},
{
variant: "solid",
color: "danger",
class: colorVariants.solid.danger
},
{
variant: "shadow",
color: "default",
class: colorVariants.shadow.default
},
{
variant: "shadow",
color: "primary",
class: colorVariants.shadow.primary
},
{
variant: "shadow",
color: "secondary",
class: colorVariants.shadow.secondary
},
{
variant: "shadow",
color: "success",
class: colorVariants.shadow.success
},
{
variant: "shadow",
color: "warning",
class: colorVariants.shadow.warning
},
{
variant: "shadow",
color: "danger",
class: colorVariants.shadow.danger
},
{
variant: "bordered",
color: "default",
class: colorVariants.bordered.default
},
{
variant: "bordered",
color: "primary",
class: colorVariants.bordered.primary
},
{
variant: "bordered",
color: "secondary",
class: colorVariants.bordered.secondary
},
{
variant: "bordered",
color: "success",
class: colorVariants.bordered.success
},
{
variant: "bordered",
color: "warning",
class: colorVariants.bordered.warning
},
{
variant: "bordered",
color: "danger",
class: colorVariants.bordered.danger
},
{
variant: "flat",
color: "default",
class: colorVariants.flat.default
},
{
variant: "flat",
color: "primary",
class: colorVariants.flat.primary
},
{
variant: "flat",
color: "secondary",
class: colorVariants.flat.secondary
},
{
variant: "flat",
color: "success",
class: colorVariants.flat.success
},
{
variant: "flat",
color: "warning",
class: colorVariants.flat.warning
},
{
variant: "flat",
color: "danger",
class: colorVariants.flat.danger
},
{
variant: "faded",
color: "default",
class: colorVariants.faded.default
},
{
variant: "faded",
color: "primary",
class: colorVariants.faded.primary
},
{
variant: "faded",
color: "secondary",
class: colorVariants.faded.secondary
},
{
variant: "faded",
color: "success",
class: colorVariants.faded.success
},
{
variant: "faded",
color: "warning",
class: colorVariants.faded.warning
},
{
variant: "faded",
color: "danger",
class: colorVariants.faded.danger
},
{
variant: "light",
color: "default",
class: [colorVariants.light.default, "data-[hover=true]:bg-default/40"]
},
{
variant: "light",
color: "primary",
class: [colorVariants.light.primary, "data-[hover=true]:bg-primary/20"]
},
{
variant: "light",
color: "secondary",
class: [colorVariants.light.secondary, "data-[hover=true]:bg-secondary/20"]
},
{
variant: "light",
color: "success",
class: [colorVariants.light.success, "data-[hover=true]:bg-success/20"]
},
{
variant: "light",
color: "warning",
class: [colorVariants.light.warning, "data-[hover=true]:bg-warning/20"]
},
{
variant: "light",
color: "danger",
class: [colorVariants.light.danger, "data-[hover=true]:bg-danger/20"]
},
{
variant: "ghost",
color: "default",
class: [colorVariants.ghost.default, "data-[hover=true]:!bg-default"]
},
{
variant: "ghost",
color: "primary",
class: [
colorVariants.ghost.primary,
"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground"
]
},
{
variant: "ghost",
color: "secondary",
class: [
colorVariants.ghost.secondary,
"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground"
]
},
{
variant: "ghost",
color: "success",
class: [
colorVariants.ghost.success,
"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground"
]
},
{
variant: "ghost",
color: "warning",
class: [
colorVariants.ghost.warning,
"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground"
]
},
{
variant: "ghost",
color: "danger",
class: [
colorVariants.ghost.danger,
"data-[hover=true]:!bg-danger data-[hover=true]:!text-danger-foreground"
]
},
{
isInGroup: true,
class: "rounded-none first:rounded-s-medium last:rounded-e-medium"
},
{
isInGroup: true,
size: "sm",
class: "rounded-none first:rounded-s-small last:rounded-e-small"
},
{
isInGroup: true,
size: "md",
class: "rounded-none first:rounded-s-medium last:rounded-e-medium"
},
{
isInGroup: true,
size: "lg",
class: "rounded-none first:rounded-s-large last:rounded-e-large"
},
{
isInGroup: true,
isRounded: true,
class: "rounded-none first:rounded-s-full last:rounded-e-full"
},
{
isInGroup: true,
radius: "none",
class: "rounded-none first:rounded-s-none last:rounded-e-none"
},
{
isInGroup: true,
radius: "sm",
class: "rounded-none first:rounded-s-small last:rounded-e-small"
},
{
isInGroup: true,
radius: "md",
class: "rounded-none first:rounded-s-medium last:rounded-e-medium"
},
{
isInGroup: true,
radius: "lg",
class: "rounded-none first:rounded-s-large last:rounded-e-large"
},
{
isInGroup: true,
radius: "full",
class: "rounded-none first:rounded-s-full last:rounded-e-full"
},
{
isInGroup: true,
variant: ["ghost", "bordered"],
color: "default",
className: collapseAdjacentVariantBorders.default
},
{
isInGroup: true,
variant: ["ghost", "bordered"],
color: "primary",
className: collapseAdjacentVariantBorders.primary
},
{
isInGroup: true,
variant: ["ghost", "bordered"],
color: "secondary",
className: collapseAdjacentVariantBorders.secondary
},
{
isInGroup: true,
variant: ["ghost", "bordered"],
color: "success",
className: collapseAdjacentVariantBorders.success
},
{
isInGroup: true,
variant: ["ghost", "bordered"],
color: "warning",
className: collapseAdjacentVariantBorders.warning
},
{
isInGroup: true,
variant: ["ghost", "bordered"],
color: "danger",
className: collapseAdjacentVariantBorders.danger
},
{
isIconOnly: true,
size: "sm",
class: "min-w-8 w-8 h-8"
},
{
isIconOnly: true,
size: "md",
class: "min-w-10 w-10 h-10"
},
{
isIconOnly: true,
size: "lg",
class: "min-w-12 w-12 h-12"
},
{
variant: ["solid", "faded", "flat", "bordered", "shadow"],
class: "data-[hover=true]:opacity-hover"
}
]
});
var buttonGroup = tv({
base: "inline-flex items-center justify-center h-auto",
variants: {
fullWidth: {
true: "w-full"
}
},
defaultVariants: {
fullWidth: false
}
});
export {
button,
buttonGroup
};
@@ -0,0 +1,72 @@
"use strict";
var Buffer = require("safer-buffer").Buffer;
// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
// correspond to encoded bytes (if 128 - then lower half is ASCII).
exports._sbcs = SBCSCodec;
function SBCSCodec(codecOptions, iconv) {
if (!codecOptions)
throw new Error("SBCS codec is called without the data.")
// Prepare char buffer for decoding.
if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
if (codecOptions.chars.length === 128) {
var asciiString = "";
for (var i = 0; i < 128; i++)
asciiString += String.fromCharCode(i);
codecOptions.chars = asciiString + codecOptions.chars;
}
this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
// Encoding buffer.
var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
for (var i = 0; i < codecOptions.chars.length; i++)
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
this.encodeBuf = encodeBuf;
}
SBCSCodec.prototype.encoder = SBCSEncoder;
SBCSCodec.prototype.decoder = SBCSDecoder;
function SBCSEncoder(options, codec) {
this.encodeBuf = codec.encodeBuf;
}
SBCSEncoder.prototype.write = function(str) {
var buf = Buffer.alloc(str.length);
for (var i = 0; i < str.length; i++)
buf[i] = this.encodeBuf[str.charCodeAt(i)];
return buf;
}
SBCSEncoder.prototype.end = function() {
}
function SBCSDecoder(options, codec) {
this.decodeBuf = codec.decodeBuf;
}
SBCSDecoder.prototype.write = function(buf) {
// Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
var decodeBuf = this.decodeBuf;
var newBuf = Buffer.alloc(buf.length*2);
var idx1 = 0, idx2 = 0;
for (var i = 0; i < buf.length; i++) {
idx1 = buf[i]*2; idx2 = i*2;
newBuf[idx2] = decodeBuf[idx1];
newBuf[idx2+1] = decodeBuf[idx1+1];
}
return newBuf.toString('ucs2');
}
SBCSDecoder.prototype.end = function() {
}
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","_index","isClassDeclaration","isExportDefaultSpecifier","isExportNamespaceSpecifier","isImportDefaultSpecifier","isImportNamespaceSpecifier","isStatement","ImportSpecifier","node","importKind","word","space","print","imported","local","name","ImportDefaultSpecifier","ExportDefaultSpecifier","exported","ExportSpecifier","exportKind","ExportNamespaceSpecifier","token","warningShown","_printAttributes","hasPreviousBrace","_node$extra","importAttributesKeyword","format","attributes","assertions","extra","deprecatedAssertSyntax","deprecatedWithLegacySyntax","console","warn","useAssertKeyword","printList","occurrenceCount","undefined","shouldPrintTrailingComma","ExportAllDeclaration","_node$attributes","_node$assertions","length","source","semicolon","maybePrintDecoratorsBeforeExport","printer","declaration","_shouldPrintDecoratorsBeforeExport","printJoin","decorators","ExportNamedDeclaration","declar","specifiers","slice","hasSpecial","first","shift","hasBrace","_node$attributes2","_node$assertions2","ExportDefaultDeclaration","noIndentInnerCommentsHere","tokenContext","TokenContext","exportDefault","ImportDeclaration","_node$attributes3","_node$assertions3","isTypeKind","module","phase","hasSpecifiers","ImportAttribute","key","value","ImportNamespaceSpecifier","ImportExpression","options","rightParens"],"sources":["../../src/generators/modules.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isClassDeclaration,\n isExportDefaultSpecifier,\n isExportNamespaceSpecifier,\n isImportDefaultSpecifier,\n isImportNamespaceSpecifier,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function ImportSpecifier(this: Printer, node: t.ImportSpecifier) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local);\n }\n}\n\nexport function ImportDefaultSpecifier(\n this: Printer,\n node: t.ImportDefaultSpecifier,\n) {\n this.print(node.local);\n}\n\nexport function ExportDefaultSpecifier(\n this: Printer,\n node: t.ExportDefaultSpecifier,\n) {\n this.print(node.exported);\n}\n\nexport function ExportSpecifier(this: Printer, node: t.ExportSpecifier) {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n this.print(node.local);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported);\n }\n}\n\nexport function ExportNamespaceSpecifier(\n this: Printer,\n node: t.ExportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported);\n}\n\nlet warningShown = false;\n\nexport function _printAttributes(\n this: Printer,\n node: Extract<t.Node, { attributes?: t.ImportAttribute[] | null }>,\n hasPreviousBrace: boolean,\n) {\n const { importAttributesKeyword } = this.format;\n const { attributes, assertions } = node;\n\n if (\n !process.env.BABEL_8_BREAKING &&\n attributes &&\n !importAttributesKeyword &&\n node.extra &&\n (node.extra.deprecatedAssertSyntax ||\n node.extra.deprecatedWithLegacySyntax) &&\n // In the production build only show the warning once.\n // We want to show it per-usage locally for tests.\n (!process.env.IS_PUBLISH || !warningShown)\n ) {\n warningShown = true;\n console.warn(`\\\nYou are using import attributes, without specifying the desired output syntax.\nPlease specify the \"importAttributesKeyword\" generator option, whose value can be one of:\n - \"with\" : \\`import { a } from \"b\" with { type: \"json\" };\\`\n - \"assert\" : \\`import { a } from \"b\" assert { type: \"json\" };\\`\n - \"with-legacy\" : \\`import { a } from \"b\" with type: \"json\";\\`\n`);\n }\n\n const useAssertKeyword =\n importAttributesKeyword === \"assert\" ||\n (!importAttributesKeyword && assertions);\n\n this.word(useAssertKeyword ? \"assert\" : \"with\");\n this.space();\n\n if (\n !process.env.BABEL_8_BREAKING &&\n !useAssertKeyword &&\n (importAttributesKeyword === \"with-legacy\" ||\n (!importAttributesKeyword && node.extra?.deprecatedWithLegacySyntax))\n ) {\n // with-legacy\n this.printList(attributes || assertions);\n return;\n }\n\n const occurrenceCount = hasPreviousBrace ? 1 : 0;\n\n this.token(\"{\", undefined, occurrenceCount);\n this.space();\n thisLine truncated
@@ -0,0 +1 @@
{"name":"unist-util-visit-parents","version":"6.0.2","requiresBuild":false,"files":{"license":{"checkedAt":1794532112684,"integrity":"sha512-cQvy4TvDNGTww5W7wo7SHRjv/0G8g3u/v8V2BhwwrAM+M5M2Z7W8hy+cQrU+e4exnULY2LrZ0EQqBk6Fj/Sdrw==","mode":420,"size":1099},"lib/color.js":{"checkedAt":1794532113889,"integrity":"sha512-YO2PvDCl8+P1wwMT1jQEsGOPIRh21YsB24mbv1hzFFJ7hu0zzpSkkygm12vQyzcfP7LESUP3Ah8Xd88efCw6Cg==","mode":420,"size":90},"lib/color.node.js":{"checkedAt":1794532113889,"integrity":"sha512-OmxucNOQNXYeGwggus6Kce8nyEKArOFfU/RJePVoplIZ0N8kpeoltOZlLSPojqP8qWcgKkwzj88DoUq3wES+8A==","mode":420,"size":120},"index.js":{"checkedAt":1794532113889,"integrity":"sha512-G8kXnstMue997AwXhFsjyy8/FRk7mx1ny3hRhloO2Qyjfs5U/Zph52/+qOdLDIw70rWNUg40kjeZz2tD7clZ4A==","mode":420,"size":108},"lib/index.js":{"checkedAt":1794532113889,"integrity":"sha512-bmjx9FQQq0M9wc71weXWHtwU2dJaV6svqYBxJbC5ML4ajQkOp/SFjlKDEArU+RPAWIwF9Gzen1HGkPO5qw+EJQ==","mode":420,"size":11752},"package.json":{"checkedAt":1794532113889,"integrity":"sha512-NYp6/utgBP5xHTA64OUwAs7urCQ7JLCIfXKIaJfR+cB1UoveWwpNhAn8O/aes3LiymsOdTH5Nozfiy5KAroIYg==","mode":420,"size":2627},"lib/color.d.ts.map":{"checkedAt":1794532113890,"integrity":"sha512-+QghqAZJP3C6ibQks4MlwbCgq84yXAfnMJXBIdT835HySXVkXd0uWW2DmiW3JZtkP1aIhBslXZ0j5lw/q37mlw==","mode":420,"size":140},"lib/color.node.d.ts.map":{"checkedAt":1794532113890,"integrity":"sha512-Hmb/TDuNAJ6W1YThJYXRJ0Plg+A3WO6YQkevYRenqAcf7Zr/GXuM8M4mj6wz5elJacgjVFCrx0UAnQVPpgXtoA==","mode":420,"size":150},"lib/index.d.ts.map":{"checkedAt":1794532113890,"integrity":"sha512-NLCN1g+0YqWieMyVz9JXXiujkWyL8McENV+vyf2mcS4+1G5LdYzZHP4ibUWzWkj4zLa1n8EWe92E6zRE+IOwIQ==","mode":420,"size":3154},"readme.md":{"checkedAt":1794532113890,"integrity":"sha512-KKEp8KtGpuwz8tXjoSEtHEt3kikRNLDFTB8LxmOXpQh+++Ks9hf41DeIhnok9rpMhf4PeH/pGzIwFlx0RfU4Kg==","mode":420,"size":10283},"lib/color.d.ts":{"checkedAt":1794532113890,"integrity":"sha512-bKGsXBxQWe62x553n4baQx7+uKHD/AKrrj7SkDPyukD7j3ze3ntVYRqTLZInQAYLLAa1yf/BBZbGU8B+44O9wA==","mode":420,"size":127},"lib/color.node.d.ts":{"checkedAt":1794532113890,"integrity":"sha512-Yd9Y1pwadbZ/98/qJ9HkbMKie1nuuJzbpE9+Z4SEZ3xgJw7m+XM7gVKidso8Jslra8Qj6sF/QXJU0EKCdOd57w==","mode":420,"size":132},"index.d.ts":{"checkedAt":1794532113890,"integrity":"sha512-wdUT4p8pMb9uFS8rE0ydatbrW6qqpy5DpD0W2QQG7XZWuqmwN94FBqGFNKKEy+zoFDZLkFDsSi+kNryOOzFMGg==","mode":420,"size":349},"lib/index.d.ts":{"checkedAt":1794532113891,"integrity":"sha512-WpznrAg17Ra/URTlvSJfQsje/914p8F46I6zkHXr5HXsZIcGcLrLnxReuBW2Z066hEDQQOzGIT24puRGxlbynQ==","mode":420,"size":8956}}}
@@ -0,0 +1,12 @@
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module exports.
*/
module.exports = require('./db.json')
@@ -0,0 +1,256 @@
# agentkeepalive
[![NPM version][npm-image]][npm-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![Node.js CI](https://github.com/node-modules/agentkeepalive/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/agentkeepalive/actions/workflows/nodejs.yml)
[![npm download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/agentkeepalive.svg?style=flat
[npm-url]: https://npmjs.org/package/agentkeepalive
[snyk-image]: https://snyk.io/test/npm/agentkeepalive/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/agentkeepalive
[download-image]: https://img.shields.io/npm/dm/agentkeepalive.svg?style=flat-square
[download-url]: https://npmjs.org/package/agentkeepalive
The enhancement features `keep alive` `http.Agent`. Support `http` and `https`.
## What's different from original `http.Agent`?
- `keepAlive=true` by default
- Disable Nagle's algorithm: `socket.setNoDelay(true)`
- Add free socket timeout: avoid long time inactivity socket leak in the free-sockets queue.
- Add active socket timeout: avoid long time inactivity socket leak in the active-sockets queue.
- TTL for active socket.
## Node.js version required
Support Node.js >= `8.0.0`
## Install
```bash
$ npm install agentkeepalive --save
```
## new Agent([options])
* `options` {Object} Set of configurable options to set on the agent.
Can have the following fields:
* `keepAlive` {Boolean} Keep sockets around in a pool to be used by
other requests in the future. Default = `true`.
* `keepAliveMsecs` {Number} When using the keepAlive option, specifies the initial delay
for TCP Keep-Alive packets. Ignored when the keepAlive option is false or undefined. Defaults to 1000.
Default = `1000`. Only relevant if `keepAlive` is set to `true`.
* `freeSocketTimeout`: {Number} Sets the free socket to timeout
after `freeSocketTimeout` milliseconds of inactivity on the free socket.
The default [server-side timeout](https://nodejs.org/api/http.html#serverkeepalivetimeout) is 5000 milliseconds, to [avoid ECONNRESET exceptions](https://medium.com/ssense-tech/reduce-networking-errors-in-nodejs-23b4eb9f2d83), we set the default value to `4000` milliseconds.
Only relevant if `keepAlive` is set to `true`.
* `timeout`: {Number} Sets the working socket to timeout
after `timeout` milliseconds of inactivity on the working socket.
Default is `freeSocketTimeout * 2` so long as that value is greater than or equal to 8 seconds, otherwise the default is 8 seconds.
* `maxSockets` {Number} Maximum number of sockets to allow per
host. Default = `Infinity`.
* `maxFreeSockets` {Number} Maximum number of sockets (per host) to leave open
in a free state. Only relevant if `keepAlive` is set to `true`.
Default = `256`.
* `socketActiveTTL` {Number} Sets the socket active time to live, even if it's in use.
If not set, the behaviour keeps the same (the socket will be released only when free)
Default = `null`.
## Usage
```js
const http = require('http');
const HttpAgent = require('agentkeepalive').HttpAgent;
const keepaliveAgent = new HttpAgent({
maxSockets: 100,
maxFreeSockets: 10,
timeout: 60000, // active socket keepalive for 60 seconds
freeSocketTimeout: 30000, // free socket keepalive for 30 seconds
});
const options = {
host: 'cnodejs.org',
port: 80,
path: '/',
method: 'GET',
agent: keepaliveAgent,
};
const req = http.request(options, res => {
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
req.on('error', e => {
console.log('problem with request: ' + e.message);
});
req.end();
setTimeout(() => {
if (keepaliveAgent.statusChanged) {
console.log('[%s] agent status changed: %j', Date(), keepaliveAgent.getCurrentStatus());
}
}, 2000);
```
### `getter agent.statusChanged`
counters have change or not after last checkpoint.
### `agent.getCurrentStatus()`
`agent.getCurrentStatus()` will return a object to show the status of this agent:
```js
{
createSocketCount: 10,
closeSocketCount: 5,
timeoutSocketCount: 0,
requestCount: 5,
freeSockets: { 'localhost:57479:': 3 },
sockets: { 'localhost:57479:': 5 },
requests: {}
}
```
### Support `https`
```js
const https = require('https');
const HttpsAgent = require('agentkeepalive').HttpsAgent;
const keepaliveAgent = new HttpsAgent();
// https://www.google.com/search?q=nodejs&sugexp=chrome,mod=12&sourceid=chrome&ie=UTF-8
const options = {
host: 'www.google.com',
port: 443,
path: '/search?q=nodejs&sugexp=chrome,mod=12&sourceid=chrome&ie=UTF-8',
method: 'GET',
agent: keepaliveAgent,
};
const req = https.request(options, res => {
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', chunk => {
console.log('BODY: ' + chunk);
});
});
req.on('error', e => {
console.log('problem with request: ' + e.message);
});
req.end();
setTimeout(() => {
console.log('agent status: %j', keepaliveAgent.getCurrentStatus());
}, 2000);
```
### Support `req.reusedSocket`
This agent implements the `req.reusedSocket` to determine whether a request is send through a reused socket.
When server closes connection at unfortunate time ([keep-alive race](https://code-examples.net/en/q/28a8069)), the http client will throw a `ECONNRESET` error. Under this circumstance, `req.reusedSocket` is useful when we want to retry the request automatically.
```js
const http = require('http');
const HttpAgent = require('agentkeepalive').HttpAgent;
const agent = new HttpAgent();
const req = http
.get('http://localhost:3000', { agent }, (res) => {
// ...
})
.on('error', (err) => {
if (req.reusedSocket && err.code === 'ECONNRESET') {
// retry the request or anything else...
}
})
```
This behavior is consistent with Node.js core. But through `agentkeepalive`, you can use this feature in older Node.js version.
## [Benchmark](https://github.com/node-modules/agentkeepalive/tree/master/benchmark)
run the benchmark:
```bash
cd benchmark
sh start.sh
```
Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz
node@v0.8.9
50 maxSockets, 60 concurrent, 1000 requests per concurrent, 5ms delay
Keep alive agent (30 seconds):
```js
Transactions: 60000 hits
Availability: 100.00 %
Elapsed time: 29.70 secs
Data transferred: 14.88 MB
Response time: 0.03 secs
Transaction rate: 2020.20 trans/sec
Throughput: 0.50 MB/sec
Concurrency: 59.84
Successful transactions: 60000
Failed transactions: 0
Longest transaction: 0.15
Shortest transaction: 0.01
```
Normal agent:
```js
Transactions: 60000 hits
Availability: 100.00 %
Elapsed time: 46.53 secs
Data transferred: 14.88 MB
Response time: 0.05 secs
Transaction rate: 1289.49 trans/sec
Throughput: 0.32 MB/sec
Concurrency: 59.81
Successful transactions: 60000
Failed transactions: 0
Longest transaction: 0.45
Shortest transaction: 0.00
```
Socket created:
```bash
[proxy.js:120000] keepalive, 50 created, 60000 requestFinished, 1200 req/socket, 0 requests, 0 sockets, 0 unusedSockets, 50 timeout
{" <10ms":662," <15ms":17825," <20ms":20552," <30ms":17646," <40ms":2315," <50ms":567," <100ms":377," <150ms":56," <200ms":0," >=200ms+":0}
----------------------------------------------------------------
[proxy.js:120000] normal , 53866 created, 84260 requestFinished, 1.56 req/socket, 0 requests, 0 sockets
{" <10ms":75," <15ms":1112," <20ms":10947," <30ms":32130," <40ms":8228," <50ms":3002," <100ms":4274," <150ms":181," <200ms":18," >=200ms+":33}
```
## License
[MIT](LICENSE)
<!-- GITCONTRIBUTOR_START -->
## Contributors
|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|[<img src="https://avatars.githubusercontent.com/u/5557458?v=4" width="100px;"/><br/><sub><b>AndrewLeedham</b></sub>](https://github.com/AndrewLeedham)<br/>|[<img src="https://avatars.githubusercontent.com/u/5243774?v=4" width="100px;"/><br/><sub><b>ngot</b></sub>](https://github.com/ngot)<br/>|[<img src="https://avatars.githubusercontent.com/u/25919630?v=4" width="100px;"/><br/><sub><b>wrynearson</b></sub>](https://github.com/wrynearson)<br/>|[<img src="https://avatars.githubusercontent.com/u/26738844?v=4" width="100px;"/><br/><sub><b>aaronArinder</b></sub>](https://github.com/aaronArinder)<br/>|
| :---: | :---: | :---: | :---: | :---: | :---: |
|[<img src="https://avatars.githubusercontent.com/u/10976983?v=4" width="100px;"/><br/><sub><b>alexpenev-s</b></sub>](https://github.com/alexpenev-s)<br/>|[<img src="https://avatars.githubusercontent.com/u/959726?v=4" width="100px;"/><br/><sub><b>blemoine</b></sub>](https://github.com/blemoine)<br/>|[<img src="https://avatars.githubusercontent.com/u/398027?v=4" width="100px;"/><br/><sub><b>bdehamer</b></sub>](https://github.com/bdehamer)<br/>|[<img src="https://avatars.githubusercontent.com/u/4985201?v=4" width="100px;"/><br/><sub><b>DylanPiercey</b></sub>](https://github.com/DylanPiercey)<br/>|[<img src="https://avatars.githubusercontent.com/u/3770250?v=4" width="100px;"/><br/><sub><b>cixel</b></sub>](https://github.com/cixel)<br/>|[<img src="https://avatars.githubusercontent.com/u/2883231?v=4" width="100px;"/><br/><sub><b>HerringtonDarkholme</b></sub>](https://github.com/HerringtonDarkholme)<br/>|
|[<img src="https://avatars.githubusercontent.com/u/1433247?v=4" width="100px;"/><br/><sub><b>denghongcai</b></sub>](https://github.com/denghongcai)<br/>|[<img src="https://avatars.githubusercontent.com/u/1847934?v=4" width="100px;"/><br/><sub><b>kibertoad</b></sub>](https://github.com/kibertoad)<br/>|[<img src="https://avatars.githubusercontent.com/u/5236150?v=4" width="100px;"/><br/><sub><b>pangorgo</b></sub>](https://github.com/pangorgo)<br/>|[<img src="https://avatars.githubusercontent.com/u/588898?v=4" width="100px;"/><br/><sub><b>mattiash</b></sub>](https://github.com/mattiash)<br/>|[<img src="https://avatars.githubusercontent.com/u/182440?v=4" width="100px;"/><br/><sub><b>nabeelbukhari</b></sub>](https://github.com/nabeelbukhari)<br/>|[<img src="https://avatars.githubusercontent.com/u/1411117?v=4" width="100px;"/><br/><sub><b>pmalouin</b></sub>](https://github.com/pmalouin)<br/>|
[<img src="https://avatars.githubusercontent.com/u/1404810?v=4" width="100px;"/><br/><sub><b>SimenB</b></sub>](https://github.com/SimenB)<br/>|[<img src="https://avatars.githubusercontent.com/u/2630384?v=4" width="100px;"/><br/><sub><b>vinaybedre</b></sub>](https://github.com/vinaybedre)<br/>|[<img src="https://avatars.githubusercontent.com/u/10933333?v=4" width="100px;"/><br/><sub><b>starkwang</b></sub>](https://github.com/starkwang)<br/>|[<img src="https://avatars.githubusercontent.com/u/6897780?v=4" width="100px;"/><br/><sub><b>killagu</b></sub>](https://github.com/killagu)<br/>|[<img src="https://avatars.githubusercontent.com/u/15345331?v=4" width="100px;"/><br/><sub><b>tony-gutierrez</b></sub>](https://github.com/tony-gutierrez)<br/>|[<img src="https://avatars.githubusercontent.com/u/5856440?v=4" width="100px;"/><br/><sub><b>whxaxes</b></sub>](https://github.com/whxaxes)<br/>
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sat Aug 05 2023 02:36:31 GMT+0800`.
<!-- GITCONTRIBUTOR_END -->
@@ -0,0 +1,69 @@
# decamelize-keys [![Build Status](https://travis-ci.org/dsblv/decamelize-keys.svg?branch=master)](https://travis-ci.org/dsblv/decamelize-keys)
> Convert object keys from camelCase to lowercase with a custom separator using [`decamelize`](https://github.com/sindresorhus/decamelize)
*This project was forked from [`camelcase-keys`](https://github.com/sindresorhus/camelcase-keys) and converted to do the opposite*
## Install
```sh
$ npm install --save decamelize-keys
```
## Usage
```js
const decamelizeKeys = require('decamelize-keys');
decamelizeKeys({fooBar: true}, '-');
//=> {'foo-bar': true}
```
## API
### decamelizeKeys(input, [separator], [options])
### input
Type: `object`
*Required*
Object to decamelize.
### separator
Type: `string`
Default: `_`
A string to insert between words.
### options
Type: `object`
#### separator
Type: `string`
Default: `_`
Alternative way to specify [separator](#separator).
#### exclude
Type: `array`
Default: `[]`
Exclude keys from being decamelized.
## Related
See [`camelcase-keys`](https://github.com/sindresorhus/camelcase-keys) for the inverse.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com), [Dmirty Sobolev](https://github.com/dsblv)
@@ -0,0 +1,11 @@
import { LazyServiceIdentifier, ServiceIdentifier } from '@inversifyjs/common';
import { MetadataName } from './MetadataName';
import { MetadataTag } from './MetadataTag';
export interface BaseResolvedValueElementMetadata<TKind> {
kind: TKind;
name: MetadataName | undefined;
optional: boolean;
tags: Map<MetadataTag, unknown>;
value: ServiceIdentifier | LazyServiceIdentifier;
}
//# sourceMappingURL=BaseResolvedValueElementMetadata.d.ts.map
@@ -0,0 +1,14 @@
import { isBezierDefinition } from 'motion-utils';
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
import { supportedWaapiEasing } from './supported.mjs';
function isWaapiSupportedEasing(easing) {
return Boolean((typeof easing === "function" && supportsLinearEasing()) ||
!easing ||
(typeof easing === "string" &&
(easing in supportedWaapiEasing || supportsLinearEasing())) ||
isBezierDefinition(easing) ||
(Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
}
export { isWaapiSupportedEasing };
@@ -0,0 +1,43 @@
import { createDraftSafeSelector, createSelector } from '@reduxjs/toolkit'
import { produce } from 'immer'
type State = { value: number }
const selectSelf = (state: State) => state
test('handles normal values correctly', () => {
const unsafeSelector = createSelector(selectSelf, (x) => x.value)
const draftSafeSelector = createDraftSafeSelector(selectSelf, (x) => x.value)
let state = { value: 1 }
expect(unsafeSelector(state)).toBe(1)
expect(draftSafeSelector(state)).toBe(1)
expect(draftSafeSelector).toHaveProperty('resultFunc')
expect(draftSafeSelector).toHaveProperty('memoizedResultFunc')
expect(draftSafeSelector).toHaveProperty('lastResult')
expect(draftSafeSelector).toHaveProperty('dependencies')
expect(draftSafeSelector).toHaveProperty('recomputations')
expect(draftSafeSelector).toHaveProperty('resetRecomputations')
expect(draftSafeSelector).toHaveProperty('clearCache')
state = { value: 2 }
expect(unsafeSelector(state)).toBe(2)
expect(draftSafeSelector(state)).toBe(2)
})
test('handles drafts correctly', () => {
const unsafeSelector = createSelector(selectSelf, (state) => state.value)
const draftSafeSelector = createDraftSafeSelector(
selectSelf,
(state) => state.value,
)
produce({ value: 1 }, (state) => {
expect(unsafeSelector(state)).toBe(1)
expect(draftSafeSelector(state)).toBe(1)
state.value = 2
expect(unsafeSelector(state)).toBe(1)
expect(draftSafeSelector(state)).toBe(2)
})
})
@@ -0,0 +1 @@
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/types/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjE,MAAM,MAAM,cAAc,CACxB,gBAAgB,SAAS,eAAe,GAAG,eAAe,IACxD,gBAAgB,GAAG,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;AAEhE,MAAM,MAAM,sBAAsB,CAChC,gBAAgB,SAAS,eAAe,GAAG,eAAe,IACxD;IACF,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE,MAAM,MAAM,QAAQ,CAAC,WAAW,EAAE,WAAW,IAAI,CAC/C,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,WAAW,KACpB,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9C,MAAM,MAAM,eAAe,CACzB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,UAAU,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,IAClE,OAAO,CAAC;IACV,QAAQ,EAAE,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5C,GAAG,EAAE,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,GAAG,EAAE,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAClC,QAAQ,EACJ,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,GAChE,MAAM,CACJ,MAAM,EACN,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,CACjE,CAAC;IACN,KAAK,EAAE,cAAc,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAChD,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;CAC3D,CAAC,GACA,CACI;IACE,OAAO,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GACD;IACE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB,GACD;IACE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CACJ,CAAC;AAEJ,MAAM,MAAM,oBAAoB,GAAG,OAAO,sBAAsB,CAAC;AAEjE,MAAM,MAAM,OAAO,GACf,oBAAoB,CAAC,KAAK,CAAC,GAC3B,oBAAoB,CAAC,WAAW,CAAC,CAAC;AAEtC,MAAM,MAAM,OAAO,GACf,oBAAoB,CAAC,KAAK,CAAC,GAC3B,oBAAoB,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,451 @@
/// <reference types="node" />
import { EventEmitter } from "events";
import {
Agent,
ClientRequest,
ClientRequestArgs,
IncomingMessage,
OutgoingHttpHeaders,
Server as HTTPServer,
} from "http";
import { Server as HTTPSServer } from "https";
import { createConnection } from "net";
import { Duplex, DuplexOptions } from "stream";
import { SecureContextOptions } from "tls";
import { URL } from "url";
import { ZlibOptions } from "zlib";
// can not get all overload of BufferConstructor['from'], need to copy all it's first arguments here
// https://github.com/microsoft/TypeScript/issues/32164
type BufferLike =
| string
| Buffer
| DataView
| number
| ArrayBufferView
| Uint8Array
| ArrayBuffer
| SharedArrayBuffer
| Blob
| readonly any[]
| readonly number[]
| { valueOf(): ArrayBuffer }
| { valueOf(): SharedArrayBuffer }
| { valueOf(): Uint8Array }
| { valueOf(): readonly number[] }
| { valueOf(): string }
| { [Symbol.toPrimitive](hint: string): string };
// WebSocket socket.
declare class WebSocket extends EventEmitter {
/** The connection is not yet open. */
static readonly CONNECTING: 0;
/** The connection is open and ready to communicate. */
static readonly OPEN: 1;
/** The connection is in the process of closing. */
static readonly CLOSING: 2;
/** The connection is closed. */
static readonly CLOSED: 3;
binaryType: "nodebuffer" | "arraybuffer" | "fragments";
readonly bufferedAmount: number;
readonly extensions: string;
/** Indicates whether the websocket is paused */
readonly isPaused: boolean;
readonly protocol: string;
/** The current state of the connection */
readonly readyState:
| typeof WebSocket.CONNECTING
| typeof WebSocket.OPEN
| typeof WebSocket.CLOSING
| typeof WebSocket.CLOSED;
readonly url: string;
/** The connection is not yet open. */
readonly CONNECTING: 0;
/** The connection is open and ready to communicate. */
readonly OPEN: 1;
/** The connection is in the process of closing. */
readonly CLOSING: 2;
/** The connection is closed. */
readonly CLOSED: 3;
onopen: ((event: WebSocket.Event) => void) | null;
onerror: ((event: WebSocket.ErrorEvent) => void) | null;
onclose: ((event: WebSocket.CloseEvent) => void) | null;
onmessage: ((event: WebSocket.MessageEvent) => void) | null;
constructor(address: null);
constructor(address: string | URL, options?: WebSocket.ClientOptions | ClientRequestArgs);
constructor(
address: string | URL,
protocols?: string | string[],
options?: WebSocket.ClientOptions | ClientRequestArgs,
);
close(code?: number, data?: string | Buffer): void;
ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
// https://github.com/websockets/ws/issues/2076#issuecomment-1250354722
send(data: BufferLike, cb?: (err?: Error) => void): void;
send(
data: BufferLike,
options: {
mask?: boolean | undefined;
binary?: boolean | undefined;
compress?: boolean | undefined;
fin?: boolean | undefined;
},
cb?: (err?: Error) => void,
): void;
terminate(): void;
/**
* Pause the websocket causing it to stop emitting events. Some events can still be
* emitted after this is called, until all buffered data is consumed. This method
* is a noop if the ready state is `CONNECTING` or `CLOSED`.
*/
pause(): void;
/**
* Make a paused socket resume emitting events. This method is a noop if the ready
* state is `CONNECTING` or `CLOSED`.
*/
resume(): void;
// HTML5 WebSocket events
addEventListener<K extends keyof WebSocket.WebSocketEventMap>(
type: K,
listener:
| ((event: WebSocket.WebSocketEventMap[K]) => void)
| { handleEvent(event: WebSocket.WebSocketEventMap[K]): void },
options?: WebSocket.EventListenerOptions,
): void;
removeEventListener<K extends keyof WebSocket.WebSocketEventMap>(
type: K,
listener:
| ((event: WebSocket.WebSocketEventMap[K]) => void)
| { handleEvent(event: WebSocket.WebSocketEventMap[K]): void },
): void;
// Events
on(event: "close", listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
on(event: "error", listener: (this: WebSocket, error: Error) => void): this;
on(event: "upgrade", listener: (this: WebSocket, request: IncomingMessage) => void): this;
on(event: "message", listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
on(event: "open", listener: (this: WebSocket) => void): this;
on(event: "ping" | "pong", listener: (this: WebSocket, data: Buffer) => void): this;
on(event: "redirect", listener: (this: WebSocket, url: string, request: ClientRequest) => void): this;
on(
event: "unexpected-response",
listener: (this: WebSocket, request: ClientRequest, response: IncomingMessage) => void,
): this;
on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
once(event: "close", listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
once(event: "error", listener: (this: WebSocket, error: Error) => void): this;
once(event: "upgrade", listener: (this: WebSocket, request: IncomingMessage) => void): this;
once(event: "message", listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
once(event: "open", listener: (this: WebSocket) => void): this;
once(event: "ping" | "pong", listener: (this: WebSocket, data: Buffer) => void): this;
once(event: "redirect", listener: (this: WebSocket, url: string, request: ClientRequest) => void): this;
once(
event: "unexpected-response",
listener: (this: WebSocket, request: ClientRequest, response: IncomingMessage) => void,
): this;
once(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
off(event: "close", listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
off(event: "error", listener: (this: WebSocket, error: Error) => void): this;
off(event: "upgrade", listener: (this: WebSocket, request: IncomingMessage) => void): this;
off(event: "message", listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
off(event: "open", listener: (this: WebSocket) => void): this;
off(event: "ping" | "pong", listener: (this: WebSocket, data: Buffer) => void): this;
off(event: "redirect", listener: (this: WebSocket, url: string, request: ClientRequest) => void): this;
off(
event: "unexpected-response",
listener: (this: WebSocket, request: ClientRequest, response: IncomingMessage) => void,
): this;
off(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
addListener(event: "close", listener: (code: number, reason: Buffer) => void): this;
addListener(event: "error", listener: (error: Error) => void): this;
addListener(event: "upgrade", listener: (request: IncomingMessage) => void): this;
addListener(event: "message", listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
addListener(event: "open", listener: () => void): this;
addListener(event: "ping" | "pong", listener: (data: Buffer) => void): this;
addListener(event: "redirect", listener: (url: string, request: ClientRequest) => void): this;
addListener(
event: "unexpected-response",
listener: (request: ClientRequest, response: IncomingMessage) => void,
): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: "close", listener: (code: number, reason: Buffer) => void): this;
removeListener(event: "error", listener: (error: Error) => void): this;
removeListener(event: "upgrade", listener: (request: IncomingMessage) => void): this;
removeListener(event: "message", listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
removeListener(event: "open", listener: () => void): this;
removeListener(event: "ping" | "pong", listener: (data: Buffer) => void): this;
removeListener(event: "redirect", listener: (url: string, request: ClientRequest) => void): this;
removeListener(
event: "unexpected-response",
listener: (request: ClientRequest, response: IncomingMessage) => void,
): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
declare namespace WebSocket {
/**
* Data represents the raw message payload received over the WebSocket.
*/
type RawData = Buffer | ArrayBuffer | Buffer[];
/**
* Data represents the message payload received over the WebSocket.
*/
type Data = string | Buffer | ArrayBuffer | Buffer[];
/**
* CertMeta represents the accepted types for certificate & key data.
*/
type CertMeta = string | string[] | Buffer | Buffer[];
/**
* VerifyClientCallbackSync is a synchronous callback used to inspect the
* incoming message. The return value (boolean) of the function determines
* whether or not to accept the handshake.
*/
type VerifyClientCallbackSync<Request extends IncomingMessage = IncomingMessage> = (info: {
origin: string;
secure: boolean;
req: Request;
}) => boolean;
/**
* VerifyClientCallbackAsync is an asynchronous callback used to inspect the
* incoming message. The return value (boolean) of the function determines
* whether or not to accept the handshake.
*/
type VerifyClientCallbackAsync<Request extends IncomingMessage = IncomingMessage> = (
info: { origin: string; secure: boolean; req: Request },
callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void,
) => void;
/**
* FinishRequestCallback is a callback for last minute customization of the
* headers. If finishRequest is set, then it has the responsibility to call
* request.end() once it is done setting request headers.
*/
type FinishRequestCallback = (request: ClientRequest, websocket: WebSocket) => void;
interface ClientOptions extends SecureContextOptions {
protocol?: string | undefined;
followRedirects?: boolean | undefined;
generateMask?(mask: Buffer): void;
handshakeTimeout?: number | undefined;
maxRedirects?: number | undefined;
perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
localAddress?: string | undefined;
protocolVersion?: number | undefined;
headers?: { [key: string]: string } | undefined;
origin?: string | undefined;
agent?: Agent | undefined;
host?: string | undefined;
family?: number | undefined;
checkServerIdentity?(servername: string, cert: CertMeta): boolean;
rejectUnauthorized?: boolean | undefined;
allowSynchronousEvents?: boolean | undefined;
autoPong?: boolean | undefined;
maxPayload?: number | undefined;
skipUTF8Validation?: boolean | undefined;
createConnection?: typeof createConnection | undefined;
finishRequest?: FinishRequestCallback | undefined;
}
interface PerMessageDeflateOptions {
serverNoContextTakeover?: boolean | undefined;
clientNoContextTakeover?: boolean | undefined;
serverMaxWindowBits?: number | undefined;
clientMaxWindowBits?: number | undefined;
zlibDeflateOptions?:
| {
flush?: number | undefined;
finishFlush?: number | undefined;
chunkSize?: number | undefined;
windowBits?: number | undefined;
level?: number | undefined;
memLevel?: number | undefined;
strategy?: number | undefined;
dictionary?: Buffer | Buffer[] | DataView | undefined;
info?: boolean | undefined;
}
| undefined;
zlibInflateOptions?: ZlibOptions | undefined;
threshold?: number | undefined;
concurrencyLimit?: number | undefined;
}
interface Event {
type: string;
target: WebSocket;
}
interface ErrorEvent {
error: any;
message: string;
type: string;
target: WebSocket;
}
interface CloseEvent {
wasClean: boolean;
code: number;
reason: string;
type: string;
target: WebSocket;
}
interface MessageEvent {
data: Data;
type: string;
target: WebSocket;
}
interface WebSocketEventMap {
open: Event;
error: ErrorEvent;
close: CloseEvent;
message: MessageEvent;
}
interface EventListenerOptions {
once?: boolean | undefined;
}
interface ServerOptions<
U extends typeof WebSocket = typeof WebSocket,
V extends typeof IncomingMessage = typeof IncomingMessage,
> {
host?: string | undefined;
port?: number | undefined;
backlog?: number | undefined;
server?: HTTPServer<V> | HTTPSServer<V> | undefined;
verifyClient?:
| VerifyClientCallbackAsync<InstanceType<V>>
| VerifyClientCallbackSync<InstanceType<V>>
| undefined;
handleProtocols?: (protocols: Set<string>, request: InstanceType<V>) => string | false;
path?: string | undefined;
noServer?: boolean | undefined;
allowSynchronousEvents?: boolean | undefined;
autoPong?: boolean | undefined;
clientTracking?: boolean | undefined;
perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
maxPayload?: number | undefined;
skipUTF8Validation?: boolean | undefined;
WebSocket?: U | undefined;
}
interface AddressInfo {
address: string;
family: string;
port: number;
}
}
export import AddressInfo = WebSocket.AddressInfo;
export import CertMeta = WebSocket.CertMeta;
export import ClientOptions = WebSocket.ClientOptions;
export import CloseEvent = WebSocket.CloseEvent;
export import Data = WebSocket.Data;
export import ErrorEvent = WebSocket.ErrorEvent;
export import Event = WebSocket.Event;
export import EventListenerOptions = WebSocket.EventListenerOptions;
export import FinishRequestCallback = WebSocket.FinishRequestCallback;
export import MessageEvent = WebSocket.MessageEvent;
export import PerMessageDeflateOptions = WebSocket.PerMessageDeflateOptions;
export import RawData = WebSocket.RawData;
export import ServerOptions = WebSocket.ServerOptions;
export import VerifyClientCallbackAsync = WebSocket.VerifyClientCallbackAsync;
export import VerifyClientCallbackSync = WebSocket.VerifyClientCallbackSync;
// WebSocket Server
declare class Server<
T extends typeof WebSocket = typeof WebSocket,
U extends typeof IncomingMessage = typeof IncomingMessage,
> extends EventEmitter {
options: WebSocket.ServerOptions<T, U>;
path: string;
clients: Set<InstanceType<T>>;
constructor(options?: WebSocket.ServerOptions<T, U>, callback?: () => void);
address(): WebSocket.AddressInfo | string | null;
close(cb?: (err?: Error) => void): void;
handleUpgrade(
request: InstanceType<U>,
socket: Duplex,
upgradeHead: Buffer,
callback: (client: InstanceType<T>, request: InstanceType<U>) => void,
): void;
shouldHandle(request: InstanceType<U>): boolean | Promise<boolean>;
// Events
on(event: "connection", cb: (this: Server<T>, websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
on(event: "error", cb: (this: Server<T>, error: Error) => void): this;
on(event: "headers", cb: (this: Server<T>, headers: string[], request: InstanceType<U>) => void): this;
on(event: "close" | "listening", cb: (this: Server<T>) => void): this;
on(
event: "wsClientError",
cb: (this: Server<T>, error: Error, socket: Duplex, request: InstanceType<U>) => void,
): this;
on(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
once(
event: "connection",
cb: (this: Server<T>, websocket: InstanceType<T>, request: InstanceType<U>) => void,
): this;
once(event: "error", cb: (this: Server<T>, error: Error) => void): this;
once(event: "headers", cb: (this: Server<T>, headers: string[], request: InstanceType<U>) => void): this;
once(event: "close" | "listening", cb: (this: Server<T>) => void): this;
once(
event: "wsClientError",
cb: (this: Server<T>, error: Error, socket: Duplex, request: InstanceType<U>) => void,
): this;
once(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
off(event: "connection", cb: (this: Server<T>, websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
off(event: "error", cb: (this: Server<T>, error: Error) => void): this;
off(event: "headers", cb: (this: Server<T>, headers: string[], request: InstanceType<U>) => void): this;
off(event: "close" | "listening", cb: (this: Server<T>) => void): this;
off(
event: "wsClientError",
cb: (this: Server<T>, error: Error, socket: Duplex, request: InstanceType<U>) => void,
): this;
off(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
addListener(event: "connection", cb: (websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
addListener(event: "error", cb: (error: Error) => void): this;
addListener(event: "headers", cb: (headers: string[], request: InstanceType<U>) => void): this;
addListener(event: "close" | "listening", cb: () => void): this;
addListener(event: "wsClientError", cb: (error: Error, socket: Duplex, request: InstanceType<U>) => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener(event: "connection", cb: (websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
removeListener(event: "error", cb: (error: Error) => void): this;
removeListener(event: "headers", cb: (headers: string[], request: InstanceType<U>) => void): this;
removeListener(event: "close" | "listening", cb: () => void): this;
removeListener(event: "wsClientError", cb: (error: Error, socket: Duplex, request: InstanceType<U>) => void): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
export { type Server };
export const WebSocketServer: typeof Server;
export interface WebSocketServer extends Server {} // eslint-disable-line @typescript-eslint/no-empty-interface
// WebSocket stream
export function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
export default WebSocket;
export { WebSocket };
@@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/react-dom`
# Summary
This package contains type definitions for react-dom (https://react.dev/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
### Additional Details
* Last updated: Wed, 12 Nov 2025 04:37:38 GMT
* Dependencies: none
* Peer dependencies: [@types/react](https://npmjs.com/package/@types/react)
# Credits
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon).
@@ -0,0 +1,65 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/check.tsx
var check_exports = {};
__export(check_exports, {
CheckIcon: () => CheckIcon
});
module.exports = __toCommonJS(check_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var CheckIcon = ({ filled = false, ...props }) => filled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
viewBox: "0 0 24 24",
width: "1em",
...props,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"path",
{
d: "M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z",
fill: "currentColor"
}
)
}
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"svg",
{
"aria-hidden": "true",
fill: "none",
focusable: "false",
height: "1em",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2,
viewBox: "0 0 24 24",
width: "1em",
...props,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "20 6 9 17 4 12" })
}
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CheckIcon
});
@@ -0,0 +1,25 @@
'use strict';
var colors = require('@colors/colors/safe');
var format = require('./format');
var _require = require('triple-beam'),
MESSAGE = _require.MESSAGE;
/*
* function uncolorize (info)
* Returns a new instance of the uncolorize Format that strips colors
* from `info` objects. This was previously exposed as { stripColors: true }
* to transports in `winston < 3.0.0`.
*/
module.exports = format(function (info, opts) {
if (opts.level !== false) {
info.level = colors.strip(info.level);
}
if (opts.message !== false) {
info.message = colors.strip(String(info.message));
}
if (opts.raw !== false && info[MESSAGE]) {
info[MESSAGE] = colors.strip(String(info[MESSAGE]));
}
return info;
});
@@ -0,0 +1,52 @@
import { mixNumber } from 'motion-dom';
const SCALE_PRECISION = 0.0001;
const SCALE_MIN = 1 - SCALE_PRECISION;
const SCALE_MAX = 1 + SCALE_PRECISION;
const TRANSLATE_PRECISION = 0.01;
const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;
const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;
function calcLength(axis) {
return axis.max - axis.min;
}
function isNear(value, target, maxDistance) {
return Math.abs(value - target) <= maxDistance;
}
function calcAxisDelta(delta, source, target, origin = 0.5) {
delta.origin = origin;
delta.originPoint = mixNumber(source.min, source.max, delta.origin);
delta.scale = calcLength(target) / calcLength(source);
delta.translate =
mixNumber(target.min, target.max, delta.origin) - delta.originPoint;
if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||
isNaN(delta.scale)) {
delta.scale = 1.0;
}
if ((delta.translate >= TRANSLATE_MIN &&
delta.translate <= TRANSLATE_MAX) ||
isNaN(delta.translate)) {
delta.translate = 0.0;
}
}
function calcBoxDelta(delta, source, target, origin) {
calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);
calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);
}
function calcRelativeAxis(target, relative, parent) {
target.min = parent.min + relative.min;
target.max = target.min + calcLength(relative);
}
function calcRelativeBox(target, relative, parent) {
calcRelativeAxis(target.x, relative.x, parent.x);
calcRelativeAxis(target.y, relative.y, parent.y);
}
function calcRelativeAxisPosition(target, layout, parent) {
target.min = layout.min - parent.min;
target.max = target.min + calcLength(layout);
}
function calcRelativePosition(target, layout, parent) {
calcRelativeAxisPosition(target.x, layout.x, parent.x);
calcRelativeAxisPosition(target.y, layout.y, parent.y);
}
export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };
@@ -0,0 +1 @@
{"name":"universalify","version":"2.0.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532099038,"integrity":"sha512-pbs/at7xx/YXvA/EeNUBu6IUrMMh+EerE1URm1WGO2+l8ctpSZuv/dwamKLHiKjL7PI653/zdK5KBvd/iU6u7Q==","mode":420,"size":1100},"index.js":{"checkedAt":1794532099039,"integrity":"sha512-gL+FgbfnwGoXGLOjbR5HzQRTGFFSVus2keizlYwtVCkGRqyxyCmffkgL5R8e5/BxehoBMQPg44IJ1dJ0IlmCjw==","mode":420,"size":706},"package.json":{"checkedAt":1794532099039,"integrity":"sha512-Vu/40xstMfdYFsHBxPFMUcfGQr12XdQYLCcPkQSzy7KUkX9GZcrAcOBW9Tp98U1zgzOBCR7X5YSBwb97mCXSRg==","mode":420,"size":857},"README.md":{"checkedAt":1794532099039,"integrity":"sha512-KtSVQwvcq/Z7aENkHydf5/0BVD5g+Ki9LZZQ+n6Ru4AGhXUNvOgKt2sL9q2PNx6Gmmj96dgD97tm/HwqmPygvw==","mode":420,"size":2012}}}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more