docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var currentNonce;
exports.setNonce = function (nonce) {
currentNonce = nonce;
};
exports.getNonce = function () {
if (currentNonce) {
return currentNonce;
}
if (typeof __webpack_nonce__ !== 'undefined') {
return __webpack_nonce__;
}
return undefined;
};
@@ -0,0 +1,53 @@
import * as ts from 'typescript';
/**
* @example
* ```ts
* class DerivedClass extends Promise<number> {}
* DerivedClass.reject
* // ^ PromiseLike
* ```
*/
export declare function isPromiseLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* const value = Promise
* value.reject
* // ^ PromiseConstructorLike
* ```
*/
export declare function isPromiseConstructorLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* class Foo extends Error {}
* new Foo()
* // ^ ErrorLike
* ```
*/
export declare function isErrorLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* type T = Readonly<Error>
* // ^ ReadonlyErrorLike
* ```
*/
export declare function isReadonlyErrorLike(program: ts.Program, type: ts.Type): boolean;
/**
* @example
* ```ts
* type T = Readonly<{ foo: 'bar' }>
* // ^ ReadonlyTypeLike
* ```
*/
export declare function isReadonlyTypeLike(program: ts.Program, type: ts.Type, predicate?: (subType: {
aliasSymbol: ts.Symbol;
aliasTypeArguments: readonly ts.Type[];
} & ts.Type) => boolean): boolean;
export declare function isBuiltinTypeAliasLike(program: ts.Program, type: ts.Type, predicate: (subType: {
aliasSymbol: ts.Symbol;
aliasTypeArguments: readonly ts.Type[];
} & ts.Type) => boolean): boolean;
export declare function isBuiltinSymbolLike(program: ts.Program, type: ts.Type, symbolName: string | string[]): boolean;
export declare function isBuiltinSymbolLikeRecurser(program: ts.Program, type: ts.Type, predicate: (subType: ts.Type) => boolean | null): boolean;
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Divide = createLucideIcon("Divide", [
["circle", { cx: "12", cy: "6", r: "1", key: "1bh7o1" }],
["line", { x1: "5", x2: "19", y1: "12", y2: "12", key: "13b5wn" }],
["circle", { cx: "12", cy: "18", r: "1", key: "lqb9t5" }]
]);
export { Divide as default };
//# sourceMappingURL=divide.js.map
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FileCheck2 = createLucideIcon("FileCheck2", [
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "1pf5j1" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "m3 15 2 2 4-4", key: "1lhrkk" }]
]);
export { FileCheck2 as default };
//# sourceMappingURL=file-check-2.js.map
@@ -0,0 +1,275 @@
"use strict";
const compile = require("./compile.js");
const normalizeUnit = require("./normalizeUnit-Cn0hUyBC.js");
const units = require("./units.js");
const BASIC_ISO_REGEX = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
const EXTENDED_ISO_REGEX = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
const ISO_TIMES_REGEX = [
/(\d\d):(\d\d):(\d\d)\.(\d+)/,
// 'HH:mm:ss.SSSS'
/(\d\d):(\d\d):(\d\d),(\d+)/,
// 'HH:mm:ss,SSSS'
/(\d\d):(\d\d):(\d\d)/,
// 'HH:mm:ss'
/(\d\d):(\d\d)/,
// 'HH:mm'
/(\d\d)(\d\d)(\d\d)\.(\d+)/,
// 'HHmmss.SSSS'
/(\d\d)(\d\d)(\d\d),(\d+)/,
// 'HHmmss,SSSS'
/(\d\d)(\d\d)(\d\d)/,
// 'HHmmss'
/(\d\d)(\d\d)/,
// 'HHmm'
/(\d\d)/
// 'HH'
];
const TZ_REGEX = /(Z)|([+-]\d\d)(?::?(\d\d))?/;
const ISO_DATES_REGEX = [
/(\d{4})-(\d\d)-(\d\d)/,
// 'YYYY-MM-DD'
/(\d{4})-(\d\d)/,
// 'YYYY-MM'
/(\d{4})(\d\d)(\d\d)/,
// 'YYYYMMDD'
/(\d{4})(\d\d)/,
// 'YYYYMM'
/(\d{4})/
// 'YYYY'
];
function autoExtract(input) {
const dateRet = new Array(8);
let matches;
const match = EXTENDED_ISO_REGEX.exec(input) || BASIC_ISO_REGEX.exec(input);
if (match) {
const datesLen = ISO_DATES_REGEX.length;
for (let i = 0; i < datesLen; i++) {
if (matches = ISO_DATES_REGEX[i].exec(match[1])) {
for (let j = 0; j < 3; j++) {
const matched = matches[j + 1];
dateRet[j] = matched ? +matched : 1;
}
if (dateRet[1]) {
dateRet[1] -= 1;
}
break;
}
}
matches = null;
if (match[3]) {
for (let i = 0, timesLen = ISO_TIMES_REGEX.length; i < timesLen; i++) {
if (matches = ISO_TIMES_REGEX[i].exec(match[3])) {
if (matches[4]) {
matches[4] = matches[4].padEnd(3, "00");
}
for (let j = 1, len = matches.length; j < len; j++) {
dateRet[j + 2] = +matches[j];
}
break;
}
}
}
matches = null;
if (match[4]) {
matches = TZ_REGEX.exec(match[4]);
if (matches) {
dateRet[7] = matches[1] ? NaN : +matches[2] * 60 + (matches[3] ? +matches[3] : 0);
}
}
return dateRet;
}
return input;
}
function createDate(y, m, d, h, minute, s, ms) {
let date;
if (y < 100 && y >= 0) {
date = new Date(y + 400, m, d, h, minute, s, ms);
if (isFinite(date.getFullYear())) {
date.setFullYear(y);
}
} else {
date = new Date(y, m, d, h, minute, s, ms);
}
return date;
}
function createUTCDate(y, m, d, h, minute, s, ms) {
let date;
if (y < 100 && y >= 0) {
y += 400;
date = new Date(Date.UTC(y, m, d, h, minute, s, ms));
if (isFinite(date.getUTCFullYear())) {
date.setUTCFullYear(y);
}
} else {
date = new Date(Date.UTC(y, m, d, h, minute, s, ms));
}
return date;
}
function createFromArray(input) {
const utcOffset = input[7];
const currentDate = /* @__PURE__ */ new Date();
const isUTC = Number.isNaN(utcOffset);
const flag = isUTC ? "UTC" : "";
const currentStuffing = [
currentDate[`get${flag}FullYear`](),
currentDate[`get${flag}Month`](),
currentDate[`get${flag}Date`]()
];
let i = 0;
const array = new Array(7);
for (; i < 3 && input[i] == null; ++i) {
array[i] = currentStuffing[i];
}
for (; i < 7; i++) {
array[i] = input[i] == null ? 0 : input[i];
}
let day = array[2];
if (day === 0) {
day = 1;
}
let minute = array[4];
if (!isUTC && typeof utcOffset === "number") {
minute -= utcOffset + currentDate.getTimezoneOffset();
}
return (isUTC ? createUTCDate : createDate)(
array[0],
array[1],
day,
array[3],
minute,
array[5],
array[6]
);
}
function toInteger(val) {
return parseInt(val, 10);
}
function toMonth(val) {
return parseInt(val, 10) - 1;
}
function toMilliseconds(val) {
return parseInt(val.padEnd(3, "0"), 10);
}
function parseTimezone(val) {
if (val === "Z") {
return NaN;
}
const matches = TZ_REGEX.exec(val);
return +matches[2] * 60 + (matches[3] ? +matches[3] : 0);
}
function extractWithFormat(input, format) {
const { pattern, tokens } = compile(format);
const match = new RegExp(pattern).exec(input);
if (!match) {
return "";
}
const parts = [];
tokens.forEach((token, i) => {
const value = match[i + 1];
switch (token) {
case "YYYY":
parts[0] = toInteger(value);
break;
// case 'YY':
// parts[0] = toInteger(value);
// break;
case "MM":
parts[1] = toMonth(value);
break;
case "DD":
parts[2] = toInteger(value);
break;
case "HH":
parts[3] = toInteger(value);
break;
case "mm":
parts[4] = toInteger(value);
break;
case "ss":
parts[5] = toInteger(value);
break;
case "SSS":
parts[6] = toMilliseconds(value);
break;
case "Z":
parts[7] = parseTimezone(value);
break;
}
});
return parts;
}
const { DATE, DAY, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, YEAR, UTC_OFFSET } = units;
const ASP_NET_JSON_REGEX = /^\/?Date\((-?\d+)/i;
function ensureType(value, checked) {
return checked;
}
function parseObject(obj) {
const array = [];
Object.entries(obj).forEach(([unit, value]) => {
unit = normalizeUnit.normalizeUnit(unit);
switch (unit) {
case YEAR:
array[0] = value;
break;
case MONTH:
array[1] = value;
break;
case DATE:
case DAY:
array[2] = value;
break;
case HOUR:
array[3] = value;
break;
case MINUTE:
array[4] = value;
break;
case SECOND:
array[5] = value;
break;
case MILLISECOND:
array[6] = value;
break;
case UTC_OFFSET:
array[7] = value;
break;
}
});
if (array.length === 0) {
return /* @__PURE__ */ new Date();
}
return createFromArray(array);
}
function parseString(input, format) {
const extracted = typeof format === "string" && format ? extractWithFormat(input, format) : autoExtract(input);
if (Array.isArray(extracted)) {
return createFromArray(extracted);
}
const matched = ASP_NET_JSON_REGEX.exec(input);
return new Date(matched !== null ? +matched[1] : Date.parse(extracted));
}
function parse(input, format) {
let ret;
const whatType = typeof input;
if (ensureType(input, whatType === "string")) {
ret = parseString(input, format);
} else if (Array.isArray(input)) {
ret = createFromArray(input);
} else if (input instanceof Date) {
ret = new Date(input);
} else if (ensureType(input, whatType === "object" && input !== null)) {
if (input.isValid && input.isValid()) {
ret = /* @__PURE__ */ new Date(+input);
} else {
ret = parseObject(input);
}
} else if (ensureType(input, whatType === "number")) {
ret = new Date(input);
} else if (ensureType(input, whatType === "undefined")) {
ret = format ? /* @__PURE__ */ new Date(NaN) : /* @__PURE__ */ new Date();
} else {
ret = new Date(Date.parse(input));
}
return ret;
}
module.exports = parse;
@@ -0,0 +1,135 @@
/**
* @fileoverview Rule to enforce a single linebreak style.
* @author Erik Mueller
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* @import { SourceRange } from "@eslint/core";
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "linebreak-style",
url: "https://eslint.style/rules/linebreak-style",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent linebreak style",
recommended: false,
url: "https://eslint.org/docs/latest/rules/linebreak-style",
},
fixable: "whitespace",
schema: [
{
enum: ["unix", "windows"],
},
],
messages: {
expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.",
expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Builds a fix function that replaces text at the specified range in the source text.
* @param {SourceRange} range The range to replace
* @param {string} text The text to insert.
* @returns {Function} Fixer function
* @private
*/
function createFix(range, text) {
return function (fixer) {
return fixer.replaceTextRange(range, text);
};
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program: function checkForLinebreakStyle(node) {
const linebreakStyle = context.options[0] || "unix",
expectedLF = linebreakStyle === "unix",
expectedLFChars = expectedLF ? "\n" : "\r\n",
source = sourceCode.getText(),
pattern = astUtils.createGlobalLinebreakMatcher();
let match;
let i = 0;
while ((match = pattern.exec(source)) !== null) {
i++;
if (match[0] === expectedLFChars) {
continue;
}
const index = match.index;
const range = [index, index + match[0].length];
context.report({
node,
loc: {
start: {
line: i,
column: sourceCode.lines[i - 1].length,
},
end: {
line: i + 1,
column: 0,
},
},
messageId: expectedLF ? "expectedLF" : "expectedCRLF",
fix: createFix(range, expectedLFChars),
});
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"quote.js","sources":["../../../src/icons/quote.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Quote\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgM2EyIDIgMCAwIDAtMiAydjZhMiAyIDAgMCAwIDIgMiAxIDEgMCAwIDEgMSAxdjFhMiAyIDAgMCAxLTIgMiAxIDEgMCAwIDAtMSAxdjJhMSAxIDAgMCAwIDEgMSA2IDYgMCAwIDAgNi02VjVhMiAyIDAgMCAwLTItMnoiIC8+CiAgPHBhdGggZD0iTTUgM2EyIDIgMCAwIDAtMiAydjZhMiAyIDAgMCAwIDIgMiAxIDEgMCAwIDEgMSAxdjFhMiAyIDAgMCAxLTIgMiAxIDEgMCAwIDAtMSAxdjJhMSAxIDAgMCAwIDEgMSA2IDYgMCAwIDAgNi02VjVhMiAyIDAgMCAwLTItMnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/quote\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Quote = createLucideIcon('Quote', [\n [\n 'path',\n {\n d: 'M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z',\n key: 'rib7q0',\n },\n ],\n [\n 'path',\n {\n d: 'M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z',\n key: '1ymkrd',\n },\n ],\n]);\n\nexport default Quote;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
{"version":3,"file":"namespace.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,447 @@
/**
* @fileoverview Source code for spaced-comments rule
* @author Gyandeep Singh
* @deprecated in ESLint v8.53.0
*/
"use strict";
const escapeRegExp = require("escape-string-regexp");
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Escapes the control characters of a given string.
* @param {string} s A string to escape.
* @returns {string} An escaped string.
*/
function escape(s) {
return `(?:${escapeRegExp(s)})`;
}
/**
* Escapes the control characters of a given string.
* And adds a repeat flag.
* @param {string} s A string to escape.
* @returns {string} An escaped string.
*/
function escapeAndRepeat(s) {
return `${escape(s)}+`;
}
/**
* Parses `markers` option.
* If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments.
* @param {string[]} [markers] A marker list.
* @returns {string[]} A marker list.
*/
function parseMarkersOption(markers) {
// `*` is a marker for JSDoc comments.
if (!markers.includes("*")) {
return markers.concat("*");
}
return markers;
}
/**
* Creates string pattern for exceptions.
* Generated pattern:
*
* 1. A space or an exception pattern sequence.
* @param {string[]} exceptions An exception pattern list.
* @returns {string} A regular expression string for exceptions.
*/
function createExceptionsPattern(exceptions) {
let pattern = "";
/*
* A space or an exception pattern sequence.
* [] ==> "\s"
* ["-"] ==> "(?:\s|\-+$)"
* ["-", "="] ==> "(?:\s|(?:\-+|=+)$)"
* ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24)
*/
if (exceptions.length === 0) {
// a space.
pattern += "\\s";
} else {
// a space or...
pattern += "(?:\\s|";
if (exceptions.length === 1) {
// a sequence of the exception pattern.
pattern += escapeAndRepeat(exceptions[0]);
} else {
// a sequence of one of the exception patterns.
pattern += "(?:";
pattern += exceptions.map(escapeAndRepeat).join("|");
pattern += ")";
}
pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`;
}
return pattern;
}
/**
* Creates RegExp object for `always` mode.
* Generated pattern for beginning of comment:
*
* 1. First, a marker or nothing.
* 2. Next, a space or an exception pattern sequence.
* @param {string[]} markers A marker list.
* @param {string[]} exceptions An exception pattern list.
* @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode.
*/
function createAlwaysStylePattern(markers, exceptions) {
let pattern = "^";
/*
* A marker or nothing.
* ["*"] ==> "\*?"
* ["*", "!"] ==> "(?:\*|!)?"
* ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F
*/
if (markers.length === 1) {
// the marker.
pattern += escape(markers[0]);
} else {
// one of markers.
pattern += "(?:";
pattern += markers.map(escape).join("|");
pattern += ")";
}
pattern += "?"; // or nothing.
pattern += createExceptionsPattern(exceptions);
return new RegExp(pattern, "u");
}
/**
* Creates RegExp object for `never` mode.
* Generated pattern for beginning of comment:
*
* 1. First, a marker or nothing (captured).
* 2. Next, a space or a tab.
* @param {string[]} markers A marker list.
* @returns {RegExp} A RegExp object for `never` mode.
*/
function createNeverStylePattern(markers) {
const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`;
return new RegExp(pattern, "u");
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "spaced-comment",
url: "https://eslint.style/rules/spaced-comment",
},
},
],
},
type: "suggestion",
docs: {
description:
"Enforce consistent spacing after the `//` or `/*` in a comment",
recommended: false,
url: "https://eslint.org/docs/latest/rules/spaced-comment",
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
},
markers: {
type: "array",
items: {
type: "string",
},
},
line: {
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
},
markers: {
type: "array",
items: {
type: "string",
},
},
},
additionalProperties: false,
},
block: {
type: "object",
properties: {
exceptions: {
type: "array",
items: {
type: "string",
},
},
markers: {
type: "array",
items: {
type: "string",
},
},
balanced: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
},
additionalProperties: false,
},
],
messages: {
unexpectedSpaceAfterMarker:
"Unexpected space or tab after marker ({{refChar}}) in comment.",
expectedExceptionAfter:
"Expected exception block, space or tab after '{{refChar}}' in comment.",
unexpectedSpaceBefore:
"Unexpected space or tab before '*/' in comment.",
unexpectedSpaceAfter:
"Unexpected space or tab after '{{refChar}}' in comment.",
expectedSpaceBefore:
"Expected space or tab before '*/' in comment.",
expectedSpaceAfter:
"Expected space or tab after '{{refChar}}' in comment.",
},
},
create(context) {
const sourceCode = context.sourceCode;
// Unless the first option is never, require a space
const requireSpace = context.options[0] !== "never";
/*
* Parse the second options.
* If markers don't include `"*"`, it's added automatically for JSDoc
* comments.
*/
const config = context.options[1] || {};
const balanced = config.block && config.block.balanced;
const styleRules = ["block", "line"].reduce((rule, type) => {
const markers = parseMarkersOption(
(config[type] && config[type].markers) || config.markers || [],
);
const exceptions =
(config[type] && config[type].exceptions) ||
config.exceptions ||
[];
const endNeverPattern = "[ \t]+$";
// Create RegExp object for valid patterns.
rule[type] = {
beginRegex: requireSpace
? createAlwaysStylePattern(markers, exceptions)
: createNeverStylePattern(markers),
endRegex:
balanced && requireSpace
? new RegExp(
`${createExceptionsPattern(exceptions)}$`,
"u",
)
: new RegExp(endNeverPattern, "u"),
hasExceptions: exceptions.length > 0,
captureMarker: new RegExp(
`^(${markers.map(escape).join("|")})`,
"u",
),
markers: new Set(markers),
};
return rule;
}, {});
/**
* Reports a beginning spacing error with an appropriate message.
* @param {ASTNode} node A comment node to check.
* @param {string} messageId An error message to report.
* @param {Array} match An array of match results for markers.
* @param {string} refChar Character used for reference in the error message.
* @returns {void}
*/
function reportBegin(node, messageId, match, refChar) {
const type = node.type.toLowerCase(),
commentIdentifier = type === "block" ? "/*" : "//";
context.report({
node,
fix(fixer) {
const start = node.range[0];
let end = start + 2;
if (requireSpace) {
if (match) {
end += match[0].length;
}
return fixer.insertTextAfterRange([start, end], " ");
}
end += match[0].length;
return fixer.replaceTextRange(
[start, end],
commentIdentifier + (match[1] ? match[1] : ""),
);
},
messageId,
data: { refChar },
});
}
/**
* Reports an ending spacing error with an appropriate message.
* @param {ASTNode} node A comment node to check.
* @param {string} messageId An error message to report.
* @param {string} match An array of the matched whitespace characters.
* @returns {void}
*/
function reportEnd(node, messageId, match) {
context.report({
node,
fix(fixer) {
if (requireSpace) {
return fixer.insertTextAfterRange(
[node.range[0], node.range[1] - 2],
" ",
);
}
const end = node.range[1] - 2,
start = end - match[0].length;
return fixer.replaceTextRange([start, end], "");
},
messageId,
});
}
/**
* Reports a given comment if it's invalid.
* @param {ASTNode} node a comment node to check.
* @returns {void}
*/
function checkCommentForSpace(node) {
const type = node.type.toLowerCase(),
rule = styleRules[type],
commentIdentifier = type === "block" ? "/*" : "//";
// Ignores empty comments and comments that consist only of a marker.
if (node.value.length === 0 || rule.markers.has(node.value)) {
return;
}
const beginMatch = rule.beginRegex.exec(node.value);
const endMatch = rule.endRegex.exec(node.value);
// Checks.
if (requireSpace) {
if (!beginMatch) {
const hasMarker = rule.captureMarker.exec(node.value);
const marker = hasMarker
? commentIdentifier + hasMarker[0]
: commentIdentifier;
if (rule.hasExceptions) {
reportBegin(
node,
"expectedExceptionAfter",
hasMarker,
marker,
);
} else {
reportBegin(
node,
"expectedSpaceAfter",
hasMarker,
marker,
);
}
}
if (balanced && type === "block" && !endMatch) {
reportEnd(node, "expectedSpaceBefore");
}
} else {
if (beginMatch) {
if (!beginMatch[1]) {
reportBegin(
node,
"unexpectedSpaceAfter",
beginMatch,
commentIdentifier,
);
} else {
reportBegin(
node,
"unexpectedSpaceAfterMarker",
beginMatch,
beginMatch[1],
);
}
}
if (balanced && type === "block" && endMatch) {
reportEnd(node, "unexpectedSpaceBefore", endMatch);
}
}
}
return {
Program() {
const comments = sourceCode.getAllComments();
comments
.filter(token => token.type !== "Shebang")
.forEach(checkCommentForSpace);
},
};
},
};
@@ -0,0 +1,315 @@
/**
* @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before
* @author Benoît Zugmeyer
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "operator-linebreak",
url: "https://eslint.style/rules/operator-linebreak",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent linebreak style for operators",
recommended: false,
url: "https://eslint.org/docs/latest/rules/operator-linebreak",
},
schema: [
{
enum: ["after", "before", "none", null],
},
{
type: "object",
properties: {
overrides: {
type: "object",
additionalProperties: {
enum: ["after", "before", "none", "ignore"],
},
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
operatorAtBeginning:
"'{{operator}}' should be placed at the beginning of the line.",
operatorAtEnd:
"'{{operator}}' should be placed at the end of the line.",
badLinebreak: "Bad line breaking before and after '{{operator}}'.",
noLinebreak:
"There should be no line break before or after '{{operator}}'.",
},
},
create(context) {
const usedDefaultGlobal = !context.options[0];
const globalStyle = context.options[0] || "after";
const options = context.options[1] || {};
const styleOverrides = options.overrides
? Object.assign({}, options.overrides)
: {};
if (usedDefaultGlobal && !styleOverrides["?"]) {
styleOverrides["?"] = "before";
}
if (usedDefaultGlobal && !styleOverrides[":"]) {
styleOverrides[":"] = "before";
}
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Gets a fixer function to fix rule issues
* @param {Token} operatorToken The operator token of an expression
* @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none'
* @returns {Function} A fixer function
*/
function getFixer(operatorToken, desiredStyle) {
return fixer => {
const tokenBefore = sourceCode.getTokenBefore(operatorToken);
const tokenAfter = sourceCode.getTokenAfter(operatorToken);
const textBefore = sourceCode.text.slice(
tokenBefore.range[1],
operatorToken.range[0],
);
const textAfter = sourceCode.text.slice(
operatorToken.range[1],
tokenAfter.range[0],
);
const hasLinebreakBefore = !astUtils.isTokenOnSameLine(
tokenBefore,
operatorToken,
);
const hasLinebreakAfter = !astUtils.isTokenOnSameLine(
operatorToken,
tokenAfter,
);
let newTextBefore, newTextAfter;
if (
hasLinebreakBefore !== hasLinebreakAfter &&
desiredStyle !== "none"
) {
// If there is a comment before and after the operator, don't do a fix.
if (
sourceCode.getTokenBefore(operatorToken, {
includeComments: true,
}) !== tokenBefore &&
sourceCode.getTokenAfter(operatorToken, {
includeComments: true,
}) !== tokenAfter
) {
return null;
}
/*
* If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator.
* foo &&
* bar
* would get fixed to
* foo
* && bar
*/
newTextBefore = textAfter;
newTextAfter = textBefore;
} else {
const LINEBREAK_REGEX =
astUtils.createGlobalLinebreakMatcher();
// Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings.
newTextBefore =
desiredStyle === "before" || textBefore.trim()
? textBefore
: textBefore.replace(LINEBREAK_REGEX, "");
newTextAfter =
desiredStyle === "after" || textAfter.trim()
? textAfter
: textAfter.replace(LINEBREAK_REGEX, "");
// If there was no change (due to interfering comments), don't output a fix.
if (
newTextBefore === textBefore &&
newTextAfter === textAfter
) {
return null;
}
}
if (
newTextAfter === "" &&
tokenAfter.type === "Punctuator" &&
"+-".includes(operatorToken.value) &&
tokenAfter.value === operatorToken.value
) {
// To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-.
newTextAfter += " ";
}
return fixer.replaceTextRange(
[tokenBefore.range[1], tokenAfter.range[0]],
newTextBefore + operatorToken.value + newTextAfter,
);
};
}
/**
* Checks the operator placement
* @param {ASTNode} node The node to check
* @param {ASTNode} rightSide The node that comes after the operator in `node`
* @param {string} operator The operator
* @private
* @returns {void}
*/
function validateNode(node, rightSide, operator) {
/*
* Find the operator token by searching from the right side, because between the left side and the operator
* there could be additional tokens from type annotations. Search specifically for the token which
* value equals the operator, in order to skip possible opening parentheses before the right side node.
*/
const operatorToken = sourceCode.getTokenBefore(
rightSide,
token => token.value === operator,
);
const leftToken = sourceCode.getTokenBefore(operatorToken);
const rightToken = sourceCode.getTokenAfter(operatorToken);
const operatorStyleOverride = styleOverrides[operator];
const style = operatorStyleOverride || globalStyle;
const fix = getFixer(operatorToken, style);
// if single line
if (
astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
// do nothing.
} else if (
operatorStyleOverride !== "ignore" &&
!astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
!astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
// lone operator
context.report({
node,
loc: operatorToken.loc,
messageId: "badLinebreak",
data: {
operator,
},
fix,
});
} else if (
style === "before" &&
astUtils.isTokenOnSameLine(leftToken, operatorToken)
) {
context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtBeginning",
data: {
operator,
},
fix,
});
} else if (
style === "after" &&
astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtEnd",
data: {
operator,
},
fix,
});
} else if (style === "none") {
context.report({
node,
loc: operatorToken.loc,
messageId: "noLinebreak",
data: {
operator,
},
fix,
});
}
}
/**
* Validates a binary expression using `validateNode`
* @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
* @returns {void}
*/
function validateBinaryExpression(node) {
validateNode(node, node.right, node.operator);
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
BinaryExpression: validateBinaryExpression,
LogicalExpression: validateBinaryExpression,
AssignmentExpression: validateBinaryExpression,
VariableDeclarator(node) {
if (node.init) {
validateNode(node, node.init, "=");
}
},
PropertyDefinition(node) {
if (node.value) {
validateNode(node, node.value, "=");
}
},
ConditionalExpression(node) {
validateNode(node, node.consequent, "?");
validateNode(node, node.alternate, ":");
},
};
},
};
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
@@ -0,0 +1,20 @@
"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 __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./eslint-utils"), exports);
__exportStar(require("./helpers"), exports);
__exportStar(require("./misc"), exports);
__exportStar(require("./predicates"), exports);
@@ -0,0 +1,179 @@
{
"cardinalNumbers-en": [
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
"fifteen",
"sixteen",
"seventeen",
"eighteen",
"nineteen",
"twenty"
],
"ordinalNumbers-en": [
"first",
"second",
"third",
"fourth",
"fifth",
"sixth",
"seventh",
"eighth",
"ninth",
"tenth",
"eleventh",
"twelfth",
"thirteenth",
"fourteenth",
"fifteenth",
"sixteenth",
"seventeenth",
"eighteenth",
"nineteenth",
"twentieth"
],
"daysOfWeek-en": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday"
],
"months-en": [
"january",
"february",
"march",
"april",
"may",
"june",
"july",
"august",
"september",
"october",
"november",
"december"
],
"seasons-en": [
"spring",
"summer",
"autumn",
"winter"
],
"timePeriods-en": [
"morning",
"afternoon",
"evening",
"night",
"midnight",
"noon"
],
"rainbowColors-en": [
"red",
"orange",
"yellow",
"green",
"blue",
"indigo",
"violet"
],
"directions-en": [
"north",
"south",
"east",
"west"
],
"intermediateDirections-en": [
"northeast",
"northwest",
"southeast",
"southwest"
],
"sizeProgression-en": [
"tiny",
"small",
"medium",
"large",
"huge",
"giant"
],
"militaryAlphabet-en": [
"alpha",
"bravo",
"charlie",
"delta",
"echo",
"foxtrot",
"golf",
"hotel",
"india",
"juliet",
"kilo",
"lima",
"mike",
"november",
"oscar",
"papa",
"quebec",
"romeo",
"sierra",
"tango",
"uniform",
"victor",
"whiskey",
"xray",
"yankee",
"zulu"
],
"planets-en": [
"mercury",
"venus",
"earth",
"mars",
"jupiter",
"saturn",
"uranus",
"neptune",
"pluto"
],
"zodiacSigns-en": [
"aries",
"taurus",
"gemini",
"cancer",
"leo",
"virgo",
"libra",
"scorpio",
"sagittarius",
"capricorn",
"aquarius",
"pisces"
],
"chineseZodiac-en": [
"rat",
"ox",
"tiger",
"rabbit",
"dragon",
"snake",
"horse",
"goat",
"monkey",
"rooster",
"dog",
"pig"
]
}
@@ -0,0 +1,561 @@
# mlly
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Codecov][codecov-src]][codecov-href]
> Missing [ECMAScript module](https://nodejs.org/api/esm.html) utils for Node.js
While ESM Modules are evolving in Node.js ecosystem, there are still
many required features that are still experimental or missing or needed to support ESM. This package tries to fill in the gap.
## Usage
Install npm package:
```sh
# using yarn
yarn add mlly
# using npm
npm install mlly
```
**Note:** Node.js 14+ is recommended.
Import utils:
```js
// ESM
import {} from "mlly";
// CommonJS
const {} = require("mlly");
```
## Resolving ESM modules
Several utilities to make ESM resolution easier:
- Respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
- Exposed from Node.js implementation
- Windows paths normalized
- Supporting custom `extensions` and `/index` resolution
- Supporting custom `conditions`
- Support resolving from multiple paths or urls
### `resolve` / `resolveSync`
Resolve a module by respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
(using [wooorm/import-meta-resolve](https://github.com/wooorm/import-meta-resolve)).
Additionally supports resolving without extension and `/index` similar to CommonJS.
```js
import { resolve, resolveSync } from "mlly";
// file:///home/user/project/module.mjs
console.log(await resolve("./module.mjs", { url: import.meta.url }));
```
**Resolve options:**
- `url`: URL or string to resolve from (default is `pwd()`)
- `conditions`: Array of conditions used for resolution algorithm (default is `['node', 'import']`)
- `extensions`: Array of additional extensions to check if import failed (default is `['.mjs', '.cjs', '.js', '.json']`)
### `resolvePath` / `resolvePathSync`
Similar to `resolve` but returns a path instead of URL using `fileURLToPath`.
```js
import { resolvePath, resolveSync } from "mlly";
// /home/user/project/module.mjs
console.log(await resolvePath("./module.mjs", { url: import.meta.url }));
```
### `createResolve`
Create a `resolve` function with defaults.
```js
import { createResolve } from "mlly";
const _resolve = createResolve({ url: import.meta.url });
// file:///home/user/project/module.mjs
console.log(await _resolve("./module.mjs"));
```
**Example:** Ponyfill [import.meta.resolve](https://nodejs.org/api/esm.html#esm_import_meta_resolve_specifier_parent):
```js
import { createResolve } from "mlly";
import.meta.resolve = createResolve({ url: import.meta.url });
```
### `resolveImports`
Resolve all static and dynamic imports with relative paths to full resolved path.
```js
import { resolveImports } from "mlly";
// import foo from 'file:///home/user/project/bar.mjs'
console.log(
await resolveImports(`import foo from './bar.mjs'`, { url: import.meta.url }),
);
```
## Syntax Analyzes
### `isValidNodeImport`
Using various syntax detection and heuristics, this method can determine if import is a valid import or not to be imported using dynamic `import()` before hitting an error!
When result is `false`, we usually need a to create a CommonJS require context or add specific rules to the bundler to transform dependency.
```js
import { isValidNodeImport } from "mlly";
// If returns true, we are safe to use `import('some-lib')`
await isValidNodeImport("some-lib", {});
```
**Algorithm:**
- Check import protocol - If is `data:` return `true` (✅ valid) - If is not `node:`, `file:` or `data:`, return `false` (
❌ invalid)
- Resolve full path of import using Node.js [Resolution algorithm](https://nodejs.org/api/esm.html#resolution-algorithm)
- Check full path extension
- If is `.mjs`, `.cjs`, `.node` or `.wasm`, return `true` (✅ valid)
- If is not `.js`, return `false` (❌ invalid)
- If is matching known mixed syntax (`.esm.js`, `.es.js`, etc) return `false` (
❌ invalid)
- Read closest `package.json` file to resolve path
- If `type: 'module'` field is set, return `true` (✅ valid)
- Read source code of resolved path
- Try to detect CommonJS syntax usage
- If yes, return `true` (✅ valid)
- Try to detect ESM syntax usage
- if yes, return `false` (
❌ invalid)
**Notes:**
- There might be still edge cases algorithm cannot cover. It is designed with best-efforts.
- This method also allows using dynamic import of CommonJS libraries considering
Node.js has [Interoperability with CommonJS](https://nodejs.org/api/esm.html#interoperability-with-commonjs).
### `hasESMSyntax`
Detect if code, has usage of ESM syntax (Static `import`, ESM `export` and `import.meta` usage)
```js
import { hasESMSyntax } from "mlly";
hasESMSyntax("export default foo = 123"); // true
```
### `hasCJSSyntax`
Detect if code, has usage of CommonJS syntax (`exports`, `module.exports`, `require` and `global` usage)
```js
import { hasCJSSyntax } from "mlly";
hasCJSSyntax("export default foo = 123"); // false
```
### `detectSyntax`
Tests code against both CJS and ESM.
`isMixed` indicates if both are detected! This is a common case with legacy packages exporting semi-compatible ESM syntax meant to be used by bundlers.
```js
import { detectSyntax } from "mlly";
// { hasESM: true, hasCJS: true, isMixed: true }
detectSyntax('export default require("lodash")');
```
## CommonJS Context
### `createCommonJS`
This utility creates a compatible CommonJS context that is missing in ECMAScript modules.
```js
import { createCommonJS } from "mlly";
const { __dirname, __filename, require } = createCommonJS(import.meta.url);
```
Note: `require` and `require.resolve` implementation are lazy functions. [`createRequire`](https://nodejs.org/api/module.html#module_module_createrequire_filename) will be called on first usage.
## Import/Export Analyzes
Tools to quickly analyze ESM syntax and extract static `import`/`export`
- Super fast Regex based implementation
- Handle most edge cases
- Find all static ESM imports
- Find all dynamic ESM imports
- Parse static import statement
- Find all named, declared and default exports
### `findStaticImports`
Find all static ESM imports.
Example:
```js
import { findStaticImports } from "mlly";
console.log(
findStaticImports(`
// Empty line
import foo, { bar /* foo */ } from 'baz'
`),
);
```
Outputs:
```js
[
{
type: "static",
imports: "foo, { bar /* foo */ } ",
specifier: "baz",
code: "import foo, { bar /* foo */ } from 'baz'",
start: 15,
end: 55,
},
];
```
### `parseStaticImport`
Parse a dynamic ESM import statement previously matched by `findStaticImports`.
Example:
```js
import { findStaticImports, parseStaticImport } from "mlly";
const [match0] = findStaticImports(`import baz, { x, y as z } from 'baz'`);
console.log(parseStaticImport(match0));
```
Outputs:
```js
{
type: 'static',
imports: 'baz, { x, y as z } ',
specifier: 'baz',
code: "import baz, { x, y as z } from 'baz'",
start: 0,
end: 36,
defaultImport: 'baz',
namespacedImport: undefined,
namedImports: { x: 'x', y: 'z' }
}
```
### `findDynamicImports`
Find all dynamic ESM imports.
Example:
```js
import { findDynamicImports } from "mlly";
console.log(
findDynamicImports(`
const foo = await import('bar')
`),
);
```
### `findExports`
```js
import { findExports } from "mlly";
console.log(
findExports(`
export const foo = 'bar'
export { bar, baz }
export default something
`),
);
```
Outputs:
```js
[
{
type: "declaration",
declaration: "const",
name: "foo",
code: "export const foo",
start: 1,
end: 17,
},
{
type: "named",
exports: " bar, baz ",
code: "export { bar, baz }",
start: 26,
end: 45,
names: ["bar", "baz"],
},
{ type: "default", code: "export default ", start: 46, end: 61 },
];
```
### `findExportNames`
Same as `findExports` but returns array of export names.
```js
import { findExportNames } from "mlly";
// [ "foo", "bar", "baz", "default" ]
console.log(
findExportNames(`
export const foo = 'bar'
export { bar, baz }
export default something
`),
);
```
## `resolveModuleExportNames`
Resolves module and reads its contents to extract possible export names using static analyzes.
```js
import { resolveModuleExportNames } from "mlly";
// ["basename", "dirname", ... ]
console.log(await resolveModuleExportNames("mlly"));
```
## Evaluating Modules
Set of utilities to evaluate ESM modules using `data:` imports
- Automatic import rewrite to resolved path using static analyzes
- Allow bypass ESM Cache
- Stack-trace support
- `.json` loader
### `evalModule`
Transform and evaluates module code using dynamic imports.
```js
import { evalModule } from "mlly";
await evalModule(`console.log("Hello World!")`);
await evalModule(
`
import { reverse } from './utils.mjs'
console.log(reverse('!emosewa si sj'))
`,
{ url: import.meta.url },
);
```
**Options:**
- all `resolve` options
- `url`: File URL
### `loadModule`
Dynamically loads a module by evaluating source code.
```js
import { loadModule } from "mlly";
await loadModule("./hello.mjs", { url: import.meta.url });
```
Options are same as `evalModule`.
### `transformModule`
- Resolves all relative imports will be resolved
- All usages of `import.meta.url` will be replaced with `url` or `from` option
```js
import { transformModule } from "mlly";
console.log(transformModule(`console.log(import.meta.url)`), {
url: "test.mjs",
});
```
Options are same as `evalModule`.
## Other Utils
### `fileURLToPath`
Similar to [url.fileURLToPath](https://nodejs.org/api/url.html#url_url_fileurltopath_url) but also converts windows backslash `\` to unix slash `/` and handles if input is already a path.
```js
import { fileURLToPath } from "mlly";
// /foo/bar.js
console.log(fileURLToPath("file:///foo/bar.js"));
// C:/path
console.log(fileURLToPath("file:///C:/path/"));
```
### `pathToFileURL`
Similar to [url.pathToFileURL](https://nodejs.org/api/url.html#urlpathtofileurlpath) but also handles `URL` input and returns a **string** with `file://` protocol.
```js
import { pathToFileURL } from "mlly";
// /foo/bar.js
console.log(pathToFileURL("foo/bar.js"));
// C:/path
console.log(pathToFileURL("C:\\path"));
```
### `normalizeid`
Ensures id has either of `node:`, `data:`, `http:`, `https:` or `file:` protocols.
```js
import { normalizeid } from "mlly";
// file:///foo/bar.js
console.log(normalizeid("/foo/bar.js"));
```
### `loadURL`
Read source contents of a URL. (currently only file protocol supported)
```js
import { resolve, loadURL } from "mlly";
const url = await resolve("./index.mjs", { url: import.meta.url });
console.log(await loadURL(url));
```
### `toDataURL`
Convert code to [`data:`](https://nodejs.org/api/esm.html#esm_data_imports) URL using base64 encoding.
```js
import { toDataURL } from "mlly";
console.log(
toDataURL(`
// This is an example
console.log('Hello world')
`),
);
```
### `interopDefault`
Return the default export of a module at the top-level, alongside any other named exports.
```js
// Assuming the shape { default: { foo: 'bar' }, baz: 'qux' }
import myModule from "my-module";
// Returns { foo: 'bar', baz: 'qux' }
console.log(interopDefault(myModule));
```
**Options:**
- `preferNamespace`: In case that `default` value exists but is not extendable (when is string for example), return input as-is (default is `false`, meaning `default`'s value is prefered even if cannot be extended)
### `sanitizeURIComponent`
Replace reserved characters from a segment of URI to make it compatible with [rfc2396](https://datatracker.ietf.org/doc/html/rfc2396).
```js
import { sanitizeURIComponent } from "mlly";
// foo_bar
console.log(sanitizeURIComponent(`foo:bar`));
```
### `sanitizeFilePath`
Sanitize each path of a file name or path with `sanitizeURIComponent` for URI compatibility.
```js
import { sanitizeFilePath } from "mlly";
// C:/te_st/_...slug_.jsx'
console.log(sanitizeFilePath("C:\\te#st\\[...slug].jsx"));
```
### `parseNodeModulePath`
Parses an absolute file path in `node_modules` to three segments:
- `dir`: Path to main directory of package
- `name`: Package name
- `subpath`: The optional package subpath
It returns an empty object (with partial keys) if parsing fails.
```js
import { parseNodeModulePath } from "mlly";
// dir: "/src/a/node_modules/"
// name: "lib"
// subpath: "./dist/index.mjs"
const { dir, name, subpath } = parseNodeModulePath(
"/src/a/node_modules/lib/dist/index.mjs",
);
```
### `lookupNodeModuleSubpath`
Parses an absolute file path in `node_modules` and tries to reverse lookup (or guess) the original package exports subpath for it.
```js
import { lookupNodeModuleSubpath } from "mlly";
// subpath: "./utils"
const subpath = lookupNodeModuleSubpath(
"/src/a/node_modules/lib/dist/utils.mjs",
);
```
## License
[MIT](./LICENSE) - Made with 💛
<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/mlly?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/mlly
[npm-downloads-src]: https://img.shields.io/npm/dm/mlly?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/mlly
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/mlly/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/mlly
@@ -0,0 +1 @@
{"version":3,"file":"list-collapse.js","sources":["../../../src/icons/list-collapse.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ListCollapse\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyAxMCAyLjUtMi41TDMgNSIgLz4KICA8cGF0aCBkPSJtMyAxOSAyLjUtMi41TDMgMTQiIC8+CiAgPHBhdGggZD0iTTEwIDZoMTEiIC8+CiAgPHBhdGggZD0iTTEwIDEyaDExIiAvPgogIDxwYXRoIGQ9Ik0xMCAxOGgxMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/list-collapse\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ListCollapse = createLucideIcon('ListCollapse', [\n ['path', { d: 'm3 10 2.5-2.5L3 5', key: 'i6eama' }],\n ['path', { d: 'm3 19 2.5-2.5L3 14', key: 'w2gmor' }],\n ['path', { d: 'M10 6h11', key: 'c7qv1k' }],\n ['path', { d: 'M10 12h11', key: '6m4ad9' }],\n ['path', { d: 'M10 18h11', key: '11hvi2' }],\n]);\n\nexport default ListCollapse;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"grid-3-x-3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,120 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "tegn", verb: "havde" },
file: { unit: "bytes", verb: "havde" },
array: { unit: "elementer", verb: "indeholdt" },
set: { unit: "elementer", verb: "indeholdt" },
map: { unit: "elementer", verb: "indeholdt" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "input",
email: "e-mailadresse",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO dato- og klokkeslæt",
date: "ISO-dato",
time: "ISO-klokkeslæt",
duration: "ISO-varighed",
ipv4: "IPv4-adresse",
ipv6: "IPv6-adresse",
mac: "MAC-adresse",
cidrv4: "IPv4-spektrum",
cidrv6: "IPv6-spektrum",
base64: "base64-kodet streng",
base64url: "base64url-kodet streng",
json_string: "JSON-streng",
e164: "E.164-nummer",
credit_card: "kreditkortnummer",
currency_code: "valutakode",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary = {
nan: "NaN",
string: "streng",
number: "tal",
boolean: "boolean",
array: "liste",
object: "objekt",
set: "sæt",
file: "fil",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Ugyldigt input: forventede instanceof ${issue.expected}, fik ${received}`;
}
return `Ugyldigt input: forventede ${expected}, fik ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Ugyldig værdi: forventede ${util.stringifyPrimitive(issue.values[0])}`;
return `Ugyldigt valg: forventede en af følgende ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing)
return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing) {
return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `For lille: forventede ${origin} havde ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Ugyldig streng: skal starte med "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Ugyldig streng: skal ende med "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Ugyldig streng: skal indeholde "${_issue.includes}"`;
if (_issue.format === "regex")
return `Ugyldig streng: skal matche mønsteret ${_issue.pattern}`;
return `Ugyldig ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ugyldigt tal: skal være deleligt med ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Ukendte nøgler" : "Ukendt nøgle"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ugyldig nøgle i ${issue.origin}`;
case "invalid_union":
return "Ugyldigt input: matcher ingen af de tilladte typer";
case "invalid_element":
return `Ugyldig værdi i ${issue.origin}`;
default:
return `Ugyldigt input`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,13 @@
'use strict'
let Node = require('./node')
class Comment extends Node {
constructor(defaults) {
super(defaults)
this.type = 'comment'
}
}
module.exports = Comment
Comment.default = Comment
@@ -0,0 +1,16 @@
import { IBackOffOptions } from "../options";
import { fullJitter } from "./full/full.jitter";
import { noJitter } from "./no/no.jitter";
export type Jitter = (delay: number) => number;
export function JitterFactory(options: IBackOffOptions): Jitter {
switch (options.jitter) {
case "full":
return fullJitter;
case "none":
default:
return noJitter;
}
}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './square-arrow-out-down-right.js';
//# sourceMappingURL=arrow-down-right-from-square.js.map
@@ -0,0 +1,144 @@
/*
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function () {
'use strict';
function isExpression(node) {
if (node == null) { return false; }
switch (node.type) {
case 'ArrayExpression':
case 'AssignmentExpression':
case 'BinaryExpression':
case 'CallExpression':
case 'ConditionalExpression':
case 'FunctionExpression':
case 'Identifier':
case 'Literal':
case 'LogicalExpression':
case 'MemberExpression':
case 'NewExpression':
case 'ObjectExpression':
case 'SequenceExpression':
case 'ThisExpression':
case 'UnaryExpression':
case 'UpdateExpression':
return true;
}
return false;
}
function isIterationStatement(node) {
if (node == null) { return false; }
switch (node.type) {
case 'DoWhileStatement':
case 'ForInStatement':
case 'ForStatement':
case 'WhileStatement':
return true;
}
return false;
}
function isStatement(node) {
if (node == null) { return false; }
switch (node.type) {
case 'BlockStatement':
case 'BreakStatement':
case 'ContinueStatement':
case 'DebuggerStatement':
case 'DoWhileStatement':
case 'EmptyStatement':
case 'ExpressionStatement':
case 'ForInStatement':
case 'ForStatement':
case 'IfStatement':
case 'LabeledStatement':
case 'ReturnStatement':
case 'SwitchStatement':
case 'ThrowStatement':
case 'TryStatement':
case 'VariableDeclaration':
case 'WhileStatement':
case 'WithStatement':
return true;
}
return false;
}
function isSourceElement(node) {
return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
}
function trailingStatement(node) {
switch (node.type) {
case 'IfStatement':
if (node.alternate != null) {
return node.alternate;
}
return node.consequent;
case 'LabeledStatement':
case 'ForStatement':
case 'ForInStatement':
case 'WhileStatement':
case 'WithStatement':
return node.body;
}
return null;
}
function isProblematicIfStatement(node) {
var current;
if (node.type !== 'IfStatement') {
return false;
}
if (node.alternate == null) {
return false;
}
current = node.consequent;
do {
if (current.type === 'IfStatement') {
if (current.alternate == null) {
return true;
}
}
current = trailingStatement(current);
} while (current);
return false;
}
module.exports = {
isExpression: isExpression,
isStatement: isStatement,
isIterationStatement: isIterationStatement,
isSourceElement: isSourceElement,
isProblematicIfStatement: isProblematicIfStatement,
trailingStatement: trailingStatement
};
}());
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1,11 @@
import type { TSESTree, ParserServicesWithTypeInformation } from '@typescript-eslint/utils';
import type * as ts from 'typescript';
/**
* Given a member of a class which extends another class or implements an interface,
* yields the corresponding member type for each of the base class/interfaces.
*/
export declare function getBaseTypesOfClassMember(services: ParserServicesWithTypeInformation, memberNode: TSESTree.MethodDefinition | TSESTree.PropertyDefinition): Generator<{
baseType: ts.Type;
baseMemberType: ts.Type;
heritageToken: ts.SyntaxKind.ExtendsKeyword | ts.SyntaxKind.ImplementsKeyword;
}>;
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './circle-x.js';
//# sourceMappingURL=x-circle.js.map
@@ -0,0 +1,25 @@
import { createTailwindMerge } from './create-tailwind-merge'
import { getDefaultConfig } from './default-config'
import { mergeConfigs } from './merge-configs'
import { AnyConfig, ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds } from './types'
type CreateConfigSubsequent = (config: AnyConfig) => AnyConfig
export const extendTailwindMerge = <
AdditionalClassGroupIds extends string = never,
AdditionalThemeGroupIds extends string = never,
>(
configExtension:
| ConfigExtension<
DefaultClassGroupIds | AdditionalClassGroupIds,
DefaultThemeGroupIds | AdditionalThemeGroupIds
>
| CreateConfigSubsequent,
...createConfig: CreateConfigSubsequent[]
) =>
typeof configExtension === 'function'
? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig)
: createTailwindMerge(
() => mergeConfigs(getDefaultConfig(), configExtension),
...createConfig,
)
@@ -0,0 +1,57 @@
"use client";
import { useLayoutEffect } from "./utils.js";
import { useRouter } from "./useRouter.js";
import * as React$1 from "react";
//#region src/useNavigate.tsx
/**
* Imperative navigation hook.
*
* Returns a stable `navigate(options)` function to change the current location
* programmatically. Prefer the `Link` component for user-initiated navigation,
* and use this hook from effects, callbacks, or handlers where imperative
* navigation is required.
*
* Options:
* - `from`: Optional route base used to resolve relative `to` paths.
*
* @returns A function that accepts `NavigateOptions`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook
*/
function useNavigate(_defaultOpts) {
const router = useRouter();
return React$1.useCallback((options) => {
return router.navigate({
...options,
from: options.from ?? _defaultOpts?.from
});
}, [_defaultOpts?.from, router]);
}
/**
* Component that triggers a navigation when rendered. Navigation executes
* in an effect after mount/update.
*
* Props are the same as `NavigateOptions` used by `navigate()`.
*
* @returns null
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent
*/
function Navigate(props) {
const router = useRouter();
const navigate = useNavigate();
const previousPropsRef = React$1.useRef(null);
useLayoutEffect(() => {
if (previousPropsRef.current !== props) {
navigate(props);
previousPropsRef.current = props;
}
}, [
router,
props,
navigate
]);
return null;
}
//#endregion
export { Navigate, useNavigate };
//# sourceMappingURL=useNavigate.js.map
@@ -0,0 +1,72 @@
import { SEPERATOR_CHARS } from '../../data/const'
import { MatcherBaseClass, MatchOptions, SeparatorMatch } from '../../types'
type SeparatorMatchOptions = Pick<MatchOptions, 'password'>
const separatorRegex = new RegExp(`[${SEPERATOR_CHARS.join('')}]`)
/*
*-------------------------------------------------------------------------------
* separators (any semi-repeated special character) -----------------------------
*-------------------------------------------------------------------------------
*/
class MatchSeparator extends MatcherBaseClass {
static getMostUsedSeparatorChar(password: string): string | undefined {
const mostUsedSeperators = [
...password
.split('')
.filter((c) => separatorRegex.test(c))
.reduce((memo, c) => {
const m = memo.get(c)
if (m) {
memo.set(c, parseInt(m, 10) + 1)
} else {
memo.set(c, 1)
}
return memo
}, new Map())
.entries(),
].sort(([_a, a], [_b, b]) => b - a)
if (!mostUsedSeperators.length) return undefined
const match = mostUsedSeperators[0]
// If the special character is only used once, don't treat it like a separator
if (match[1] < 2) return undefined
return match[0]
}
static getSeparatorRegex(separator: string): RegExp {
return new RegExp(`([^${separator}\n])(${separator})(?!${separator})`, 'g')
// negative lookbehind can be added again in a few years when it is more supported by the browsers (currently 2023)
// https://github.com/zxcvbn-ts/zxcvbn/issues/202
// return new RegExp(`(?<!${separator})(${separator})(?!${separator})`, 'g')
}
match({ password }: SeparatorMatchOptions) {
const result: SeparatorMatch[] = []
if (password.length === 0) return result
const mostUsedSpecial = MatchSeparator.getMostUsedSeparatorChar(password)
if (mostUsedSpecial === undefined) return result
const isSeparator = MatchSeparator.getSeparatorRegex(mostUsedSpecial)
for (const match of password.matchAll(isSeparator)) {
if (match.index === undefined) continue
// add one to the index because we changed the regex from negative lookbehind to something simple.
// this simple approach uses the first character before the separater too but we only need the index of the separater
// https://github.com/zxcvbn-ts/zxcvbn/issues/202
const i = match.index + 1
result.push({
pattern: 'separator',
token: mostUsedSpecial,
i,
j: i,
})
}
return result
}
}
export default MatchSeparator
@@ -0,0 +1,27 @@
import { MiddlewareHandler } from "../../types.js";
//#region src/middleware/powered-by/index.d.ts
type PoweredByOptions = {
/**
* The value for X-Powered-By header.
* @default Hono
*/
serverName?: string;
};
/**
* Powered By Middleware for Hono.
*
* @param options - The options for the Powered By Middleware.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* import { poweredBy } from 'hono/powered-by'
*
* const app = new Hono()
*
* app.use(poweredBy()) // With options: poweredBy({ serverName: "My Server" })
* ```
*/
export declare const poweredBy: (options?: PoweredByOptions) => MiddlewareHandler;
//#endregion
export {};
@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('max-params');
exports.default = (0, util_1.createRule)({
name: 'max-params',
meta: {
type: 'suggestion',
// defaultOptions, -- base rule does not use defaultOptions
docs: {
description: 'Enforce a maximum number of parameters in function definitions',
extendsBaseRule: true,
},
messages: baseRule.meta.messages,
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
countVoidThis: {
type: 'boolean',
description: 'Whether to count a `this` declaration when the type is `void`.',
},
max: {
type: 'integer',
description: 'A maximum number of parameters in function definitions.',
minimum: 0,
},
maximum: {
type: 'integer',
description: '(deprecated) A maximum number of parameters in function definitions.',
minimum: 0,
},
},
},
],
},
defaultOptions: [{ countVoidThis: false, max: 3 }],
create(context, [{ countVoidThis }]) {
const baseRules = baseRule.create(context);
if (countVoidThis === true) {
return baseRules;
}
const removeVoidThisParam = (node) => {
if (node.params.length === 0 ||
node.params[0].type !== utils_1.AST_NODE_TYPES.Identifier ||
node.params[0].name !== 'this' ||
node.params[0].typeAnnotation?.typeAnnotation.type !==
utils_1.AST_NODE_TYPES.TSVoidKeyword) {
return node;
}
return {
...node,
params: node.params.slice(1),
};
};
const wrapListener = (listener) => {
return (node) => {
listener(removeVoidThisParam(node));
};
};
return {
ArrowFunctionExpression: wrapListener(baseRules.ArrowFunctionExpression),
FunctionDeclaration: wrapListener(baseRules.FunctionDeclaration),
FunctionExpression: wrapListener(baseRules.FunctionExpression),
TSDeclareFunction: wrapListener(baseRules.FunctionDeclaration),
TSFunctionType: wrapListener(baseRules.FunctionDeclaration),
};
},
});
@@ -0,0 +1,5 @@
declare const lineSplitRE: RegExp;
declare function positionToOffset(source: string, lineNumber: number, columnNumber: number): number;
declare function offsetToLineNumber(source: string, offset: number): number;
export { lineSplitRE, offsetToLineNumber, positionToOffset };
@@ -0,0 +1,21 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed 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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/////////////////////////////
/// WorkerGlobalScope APIs
/////////////////////////////
// These are only available in a Web Worker
declare function importScripts(...urls: string[]): void;
@@ -0,0 +1 @@
module.exports={A:{D:{"1":"_5F","2":"_8H"},L:{"1":"I"},B:{"1":"_K","2":"_I"},C:{"1":"_LF","2":"_PK","33":"_oD _ZG"},M:{"1":"YC"},A:{"2":"_E"},F:{"1":"_OI","2":"_RK"},K:{"1":"H","2":"_D"},E:{"1":"_0I _ZN _OE","2":"_u XD","33":"_3E _FR"},G:{"1":"_AB","2":"_1","33":"_SD _JD"},P:{"1":"_U","2":"J"},I:{"1":"I","2":"_G"}},B:6,C:"plaintext from unicode-bidi",D:undefined};
@@ -0,0 +1 @@
{"version":3,"file":"mediaType.js","sourceRoot":"","sources":["../../../src/shared/mediaType.ts"],"names":[],"mappings":";;;;;AAyBA,4CAiBC;AAQD,8CAMC;AAxDD,gEAAuC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,gBAAgB,CAAC,MAAiC;IAC9D,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,CAAC;QACD,OAAO,sBAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrE,kEAAkE;QAClE,oEAAoE;QACpE,kEAAkE;QAClE,uBAAuB;QACvB,IAAI,OAAO,KAAK,EAAE,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/D,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,MAAiC;IAC/D,uEAAuE;IACvE,IAAI,MAAM,KAAK,kBAAkB,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,CAAC,KAAK,kBAAkB,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,84 @@
const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
const _32n = /* @__PURE__ */ BigInt(32);
// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high
// }` to match little-endian word order rather than the property names.
function fromBig(n, le = false) {
if (le)
return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
}
// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array
// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.
function split(lst, le = false) {
const len = lst.length;
let Ah = new Uint32Array(len);
let Al = new Uint32Array(len);
for (let i = 0; i < len; i++) {
const { h, l } = fromBig(lst[i], le);
[Ah[i], Al[i]] = [h, l];
}
return [Ah, Al];
}
// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS
// bitwise results back to uint32 first, and little-endian callers must swap.
const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.
const shrSH = (h, _l, s) => h >>> s;
// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.
const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.
const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));
// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.
const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.
const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));
// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.
const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));
// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.
const rotr32H = (_h, l) => l;
// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.
const rotr32L = (h, _l) => h;
// High 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.
const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));
// Low 32-bit half of a 64-bit left rotate, valid for `s` in `1..31`.
const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));
// High 32-bit half of a 64-bit left rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.
const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));
// Low 32-bit half of a 64-bit left rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.
const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));
// Add two split 64-bit words and return the split `{ h, l }` sum.
// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out
// of the low sum and instead use division.
function add(Ah, Al, Bh, Bl) {
const l = (Al >>> 0) + (Bl >>> 0);
return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };
}
// Addition with more than 2 elements
// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.
const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.
const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;
// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.
const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.
const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;
// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.
const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.
const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;
// prettier-ignore
export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };
// Canonical grouped namespace for callers that prefer one object.
// Named exports stay for direct imports.
// prettier-ignore
const u64 = {
fromBig, split, toBig,
shrSH, shrSL,
rotrSH, rotrSL, rotrBH, rotrBL,
rotr32H, rotr32L,
rotlSH, rotlSL, rotlBH, rotlBL,
add, add3L, add3H, add4L, add4H, add5H, add5L,
};
// Default export mirrors named `u64` for compatibility with object-style imports.
export default u64;
//# sourceMappingURL=_u64.js.map
@@ -0,0 +1,250 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
'use strict';
/*::
import type {
ESNode,
Token,
MostTokens,
BlockComment,
LineComment,
AFunction,
PropertyDefinition,
PropertyDefinitionWithNonComputedName,
MethodDefinition,
MethodDefinitionConstructor,
MethodDefinitionWithNonComputedName,
MemberExpression,
MemberExpressionWithNonComputedName,
ObjectPropertyWithShorthandStaticName,
ObjectPropertyWithNonShorthandStaticName,
DestructuringObjectPropertyWithShorthandStaticName,
DestructuringObjectPropertyWithNonShorthandStaticName,
ClassMember,
ClassDeclaration,
ClassExpression,
Literal,
BigIntLiteral,
BooleanLiteral,
NullLiteral,
NumericLiteral,
RegExpLiteral,
StringLiteral,
Identifier,
EnumDefaultedMember,
Expression,
Statement,
} from './types';
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
isClass: true,
isPropertyDefinitionWithNonComputedName: true,
isClassMember: true,
isClassMemberWithNonComputedName: true,
isComment: true,
isFunction: true,
isMethodDefinitionWithNonComputedName: true,
isMemberExpressionWithNonComputedProperty: true,
isOptionalMemberExpressionWithNonComputedProperty: true,
isObjectPropertyWithShorthand: true,
isObjectPropertyWithNonComputedName: true,
isBigIntLiteral: true,
isBooleanLiteral: true,
isNullLiteral: true,
isNumericLiteral: true,
isRegExpLiteral: true,
isStringLiteral: true,
isExpression: true,
isStatement: true
};
exports.isBigIntLiteral = isBigIntLiteral;
exports.isBooleanLiteral = isBooleanLiteral;
exports.isClass = isClass;
exports.isClassMember = isClassMember;
exports.isClassMemberWithNonComputedName = isClassMemberWithNonComputedName;
exports.isComment = isComment;
exports.isExpression = isExpression;
exports.isFunction = isFunction;
exports.isMemberExpressionWithNonComputedProperty = isMemberExpressionWithNonComputedProperty;
exports.isMethodDefinitionWithNonComputedName = isMethodDefinitionWithNonComputedName;
exports.isNullLiteral = isNullLiteral;
exports.isNumericLiteral = isNumericLiteral;
exports.isObjectPropertyWithNonComputedName = isObjectPropertyWithNonComputedName;
exports.isObjectPropertyWithShorthand = isObjectPropertyWithShorthand;
exports.isOptionalMemberExpressionWithNonComputedProperty = isOptionalMemberExpressionWithNonComputedProperty;
exports.isPropertyDefinitionWithNonComputedName = isPropertyDefinitionWithNonComputedName;
exports.isRegExpLiteral = isRegExpLiteral;
exports.isStatement = isStatement;
exports.isStringLiteral = isStringLiteral;
var _predicates = require("./generated/predicates");
Object.keys(_predicates).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _predicates[key]) return;
exports[key] = _predicates[key];
});
function isClass(node
/*: ESNode */
)
/*: implies node is (ClassDeclaration | ClassExpression) */
{
return node.type === 'ClassDeclaration' || node.type === 'ClassExpression';
}
function isPropertyDefinitionWithNonComputedName(node
/*: ESNode */
)
/*: implies node is PropertyDefinitionWithNonComputedName */
{
return node.type === 'PropertyDefinition' && node.computed === false;
}
function isClassMember(node
/*: ESNode */
)
/*: implies node is ClassMember */
{
return node.type === 'PropertyDefinition' || node.type === 'MethodDefinition';
}
function isClassMemberWithNonComputedName(node
/*: ESNode */
)
/*: implies node is (PropertyDefinitionWithNonComputedName | MethodDefinitionConstructor | MethodDefinitionWithNonComputedName) */
{
return (node.type === 'PropertyDefinition' || node.type === 'MethodDefinition') && node.computed === false;
}
function isComment(node
/*: ESNode | Token */
)
/*: implies node is (MostTokens | BlockComment | LineComment) */
{
return node.type === 'Block' || node.type === 'Line';
}
function isFunction(node
/*: ESNode */
)
/*: implies node is AFunction */
{
return node.type === 'ArrowFunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression';
}
function isMethodDefinitionWithNonComputedName(node
/*: ESNode */
)
/*: implies node is (MethodDefinitionConstructor | MethodDefinitionWithNonComputedName) */
{
return node.type === 'MethodDefinition' && node.computed === false;
}
function isMemberExpressionWithNonComputedProperty(node
/*: ESNode */
)
/*: implies node is MemberExpressionWithNonComputedName */
{
return node.type === 'MemberExpression' && node.computed === false;
}
function isOptionalMemberExpressionWithNonComputedProperty(node
/*: ESNode */
)
/*: implies node is MemberExpressionWithNonComputedName */
{
return node.type === 'MemberExpression' && node.computed === false;
}
function isObjectPropertyWithShorthand(node
/*: ESNode */
)
/*: implies node is (ObjectPropertyWithShorthandStaticName | DestructuringObjectPropertyWithShorthandStaticName) */
{
return node.type === 'Property' && node.shorthand === true;
}
function isObjectPropertyWithNonComputedName(node
/*: ESNode */
)
/*: implies node is (ObjectPropertyWithNonShorthandStaticName | ObjectPropertyWithShorthandStaticName | DestructuringObjectPropertyWithNonShorthandStaticName | DestructuringObjectPropertyWithShorthandStaticName) */
{
return node.type === 'Property' && node.computed === false;
}
function isBigIntLiteral(node
/*: ESNode */
)
/*: implies node is BigIntLiteral */
{
return node.type === 'Literal' && node.literalType === 'bigint';
}
function isBooleanLiteral(node
/*: ESNode */
)
/*: implies node is BooleanLiteral */
{
return node.type === 'Literal' && node.literalType === 'boolean';
}
function isNullLiteral(node
/*: ESNode */
)
/*: implies node is NullLiteral */
{
return node.type === 'Literal' && node.literalType === 'null';
}
function isNumericLiteral(node
/*: ESNode */
)
/*: implies node is NumericLiteral */
{
return node.type === 'Literal' && node.literalType === 'numeric';
}
function isRegExpLiteral(node
/*: ESNode */
)
/*: implies node is RegExpLiteral */
{
return node.type === 'Literal' && node.literalType === 'regexp';
}
function isStringLiteral(node
/*: ESNode */
)
/*: implies node is StringLiteral */
{
return node.type === 'Literal' && node.literalType === 'string';
}
function isExpression(node
/*: ESNode */
)
/*: implies node is Expression */
{
return node.type === 'ThisExpression' || node.type === 'ArrayExpression' || node.type === 'ObjectExpression' || // $FlowFixMe[incompatible-type]
node.type === 'ObjectExpression' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression' || node.type === 'YieldExpression' || node.type === 'Literal' || node.type === 'UnaryExpression' || node.type === 'UpdateExpression' || node.type === 'BinaryExpression' || node.type === 'AssignmentExpression' || node.type === 'LogicalExpression' || node.type === 'MemberExpression' || node.type === 'ConditionalExpression' || node.type === 'CallExpression' || node.type === 'NewExpression' || node.type === 'SequenceExpression' || node.type === 'TemplateLiteral' || node.type === 'TaggedTemplateExpression' || node.type === 'ClassExpression' || node.type === 'MetaProperty' || node.type === 'Identifier' || node.type === 'AwaitExpression' || node.type === 'ImportExpression' || node.type === 'ChainExpression' || node.type === 'TypeCastExpression' || node.type === 'AsExpression' || node.type === 'AsConstExpression' || node.type === 'JSXFragment' || node.type === 'JSXElement';
}
function isStatement(node
/*: ESNode */
)
/*: implies node is Statement */
{
return node.type === 'BlockStatement' || node.type === 'BreakStatement' || node.type === 'ClassDeclaration' || node.type === 'ContinueStatement' || node.type === 'DebuggerStatement' || node.type === 'DeclareClass' || node.type === 'DeclareVariable' || node.type === 'DeclareFunction' || node.type === 'DeclareInterface' || node.type === 'DeclareModule' || node.type === 'DeclareOpaqueType' || node.type === 'DeclareTypeAlias' || node.type === 'DoWhileStatement' || node.type === 'EmptyStatement' || node.type === 'EnumDeclaration' || node.type === 'ExpressionStatement' || node.type === 'ForInStatement' || node.type === 'ForOfStatement' || node.type === 'ForStatement' || node.type === 'FunctionDeclaration' || node.type === 'IfStatement' || node.type === 'InterfaceDeclaration' || node.type === 'LabeledStatement' || node.type === 'OpaqueType' || node.type === 'ReturnStatement' || node.type === 'SwitchStatement' || node.type === 'ThrowStatement' || node.type === 'TryStatement' || node.type === 'TypeAlias' || node.type === 'VariableDeclaration' || node.type === 'WhileStatement' || node.type === 'WithStatement';
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_LC","2":"_IB"},B:{"2":"_J"},C:{"1":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"1":"_T","16":"_a"},G:{"2":"_M"},H:{"16":"1D"},I:{"2":"_P"},J:{"16":"_B"},K:{"2":"H","16":"_D"},L:{"16":"I"},M:{"16":"YC"},N:{"16":"_A"},O:{"16":"bC"},P:{"16":"_F"},Q:{"2":"JE"},R:{"16":"KE"},S:{"1":"_C"}},B:1,C:"Alternate stylesheet",D:false};
@@ -0,0 +1,66 @@
"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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.string = string;
exports.number = number;
exports.boolean = boolean;
exports.bigint = bigint;
exports.date = date;
const core = __importStar(require("../core/index.cjs"));
const schemas = __importStar(require("./schemas.cjs"));
function string(params) {
return core._coercedString(schemas.ZodString, params);
}
function number(params) {
return core._coercedNumber(schemas.ZodNumber, params);
}
function boolean(params) {
return core._coercedBoolean(schemas.ZodBoolean, params);
}
function bigint(params) {
return core._coercedBigint(schemas.ZodBigInt, params);
}
function date(params) {
return core._coercedDate(schemas.ZodDate, params);
}
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1,30 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed 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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface RegExpConstructor {
/**
* Escapes any RegExp syntax characters in the input string, returning a
* new string that can be safely interpolated into a RegExp as a literal
* string to match.
* @example
* ```ts
* const regExp = new RegExp(RegExp.escape("foo.bar"));
* regExp.test("foo.bar"); // true
* regExp.test("foo!bar"); // false
* ```
*/
escape(string: string): string;
}
@@ -0,0 +1,3 @@
import * as ts from 'typescript';
export declare function isSourceFile(code: unknown): code is ts.SourceFile;
export declare function getCodeText(code: string | ts.SourceFile): string;
@@ -0,0 +1,15 @@
import { warnOnce } from 'motion-utils';
import { useScroll } from '../use-scroll.mjs';
/**
* @deprecated useViewportScroll is deprecated. Convert to useScroll()
*/
function useViewportScroll() {
if (process.env.NODE_ENV !== "production") {
warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll().");
}
return useScroll();
}
export { useViewportScroll };
//# sourceMappingURL=use-viewport-scroll.mjs.map
@@ -0,0 +1,80 @@
import { parseAccept } from "../../utils/accept.js";
import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from "../../utils/compress.js";
//#region src/middleware/compress/index.ts
const ENCODING_TYPES = ["gzip", "deflate"];
const cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/i;
const selectEncoding = (header, candidates) => {
if (header === void 0) return;
const accepts = parseAccept(header);
const wildcardQ = accepts.find((a) => a.type === "*")?.q;
let best;
for (const enc of candidates) {
const explicit = accepts.find((a) => a.type.toLowerCase() === enc);
const q = explicit ? explicit.q : wildcardQ ?? 0;
if (q === 1) return enc;
else if (q > 0 && (!best || q > best.q)) best = {
encoding: enc,
q
};
}
return best?.encoding;
};
const varyAcceptEncodingRegExp = /(?:^|,)\s*accept-encoding\s*(?:,|$)/i;
/**
* Compress Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/compress}
*
* @param {CompressionOptions} [options] - The options for the compress middleware.
* @param {'gzip' | 'deflate'} [options.encoding] - The compression scheme to allow for response compression. Either 'gzip' or 'deflate'. If not defined, both are allowed and will be used based on the Accept-Encoding header. 'gzip' is prioritized if this option is not provided and the client provides both in the Accept-Encoding header.
* @param {number} [options.threshold=1024] - The minimum size in bytes to compress. Defaults to 1024 bytes.
* @param {RegExp | Function} [options.contentTypeFilter=COMPRESSIBLE_CONTENT_TYPE_REGEX] - A RegExp or function to determine if the response Content-Type should be compressed.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use(compress())
*
* // Compress only JSON responses
* app.use(compress({ contentTypeFilter: /^application\/json/ }))
*
* // Compress based on custom Content-Type logic
* app.use(compress({ contentTypeFilter: (type) => COMPRESSIBLE_CONTENT_TYPE_REGEX.test(type) || type === "application/x-myformat" }))
* ```
*/
const compress = (options) => {
const threshold = options?.threshold ?? 1024;
const candidates = options?.encoding ? [options.encoding] : ENCODING_TYPES;
const contentTypeFilter = options?.contentTypeFilter ?? COMPRESSIBLE_CONTENT_TYPE_REGEX;
const shouldCompress = typeof contentTypeFilter === "function" ? (res) => {
const type = res.headers.get("Content-Type");
return type && contentTypeFilter(type);
} : (res) => {
const type = res.headers.get("Content-Type");
return type && contentTypeFilter.test(type);
};
return async function compress(ctx, next) {
await next();
const contentLength = ctx.res.headers.get("Content-Length");
if (ctx.res.status === 206 || ctx.res.headers.has("Content-Encoding") || ctx.res.headers.has("Transfer-Encoding") || ctx.req.method === "HEAD" || contentLength && Number(contentLength) < threshold || !shouldCompress(ctx.res) || !shouldTransform(ctx.res)) return;
const current = ctx.res.headers.get("Vary");
if (current !== "*" && !(current && varyAcceptEncodingRegExp.test(current))) ctx.header("Vary", current ? `${current}, Accept-Encoding` : "Accept-Encoding");
const accepted = ctx.req.header("Accept-Encoding");
const encoding = selectEncoding(accepted, candidates);
if (!encoding || !ctx.res.body) return;
const stream = new CompressionStream(encoding);
ctx.res = new Response(ctx.res.body.pipeThrough(stream), ctx.res);
ctx.res.headers.delete("Content-Length");
ctx.res.headers.set("Content-Encoding", encoding);
const etag = ctx.res.headers.get("ETag");
if (etag && !etag.startsWith("W/")) ctx.res.headers.set("ETag", `W/${etag}`);
};
};
const shouldTransform = (res) => {
const cacheControl = res.headers.get("Cache-Control");
return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl);
};
//#endregion
export { COMPRESSIBLE_CONTENT_TYPE_REGEX, compress };
@@ -0,0 +1 @@
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/contains.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './circle-chevron-left.js';
//# sourceMappingURL=chevron-left-circle.js.map
@@ -0,0 +1,12 @@
import * as React from 'react';
type Direction = 'ltr' | 'rtl';
interface DirectionProviderProps {
children?: React.ReactNode;
dir: Direction;
}
declare const DirectionProvider: React.FC<DirectionProviderProps>;
declare function useDirection(localDir?: Direction): Direction;
declare const Provider: React.FC<DirectionProviderProps>;
export { DirectionProvider, Provider, useDirection };
@@ -0,0 +1 @@
{"version":3,"file":"ajv-provider.js","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,WAAW,MAAM,aAAa,CAAC;AAGtC,SAAS,wBAAwB;IAC7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC;QAChB,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,WAAoD,CAAC;IACxE,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhB,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,sBAAsB;IAG/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,GAAS;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAClD,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAI,MAAsB;QAClC,yDAAyD;QACzD,MAAM,YAAY,GACd,KAAK,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpC,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YAElC,IAAI,KAAK,EAAE,CAAC;gBACR,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;iBAC1D,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,139 @@
"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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "字元", verb: "擁有" },
file: { unit: "位元組", verb: "擁有" },
array: { unit: "項目", verb: "擁有" },
set: { unit: "項目", verb: "擁有" },
map: { unit: "項目", verb: "擁有" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "輸入",
email: "郵件地址",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO 日期時間",
date: "ISO 日期",
time: "ISO 時間",
duration: "ISO 期間",
ipv4: "IPv4 位址",
ipv6: "IPv6 位址",
mac: "MAC 位址",
cidrv4: "IPv4 範圍",
cidrv6: "IPv6 範圍",
base64: "base64 編碼字串",
base64url: "base64url 編碼字串",
json_string: "JSON 字串",
e164: "E.164 數值",
credit_card: "信用卡號",
currency_code: "貨幣代碼",
iban: "IBAN",
jwt: "JWT",
template_literal: "輸入",
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `無效的輸入值:預期為 instanceof ${issue.expected},但收到 ${received}`;
}
return `無效的輸入值:預期為 ${expected},但收到 ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `無效的輸入值:預期為 ${util.stringifyPrimitive(issue.values[0])}`;
return `無效的選項:預期為以下其中之一 ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()} ${sizing.unit ?? "個元素"}`;
return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `無效的字串:必須以 "${_issue.prefix}" 開頭`;
}
if (_issue.format === "ends_with")
return `無效的字串:必須以 "${_issue.suffix}" 結尾`;
if (_issue.format === "includes")
return `無效的字串:必須包含 "${_issue.includes}"`;
if (_issue.format === "regex")
return `無效的字串:必須符合格式 ${_issue.pattern}`;
return `無效的 ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `無效的數字:必須為 ${issue.divisor} 的倍數`;
case "unrecognized_keys":
return `無法識別的鍵值${issue.keys.length > 1 ? "們" : ""}:${util.joinValues(issue.keys, "、")}`;
case "invalid_key":
return `${issue.origin} 中有無效的鍵值`;
case "invalid_union":
return "無效的輸入值";
case "invalid_element":
return `${issue.origin} 中有無效的值`;
default:
return `無效的輸入值`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,12 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{# def.numberKeyword }}
{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) {
{{ var $errorKeyword = $keyword; }}
{{# def.error:'_limitItems' }}
} {{? $breakOnError }} else { {{?}}
@@ -0,0 +1,514 @@
flf2a$ 5 5 14 1 3 0 129 0
BABYFACE Leet by cat, v0.8 2019
gopher:╱╱baud.baby
$$@
$$@
$$@
$$@
$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲___╱____╱ @@
_______@
╱╱ ╱@
╱╱ ╲@
╱ ╱@
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ --╱ @
╲________╱ @@
______ @
_╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ _╱ @
╲________╱ @@
_______ @
╱╱ ╲@
╱╱ __╱@
╱ _╱ @
╲_______╱ @@
_______ @
╱╱ ╲@
╱╱ __╱@
╱ ╱ ╱ @
╲________╱ @@
_______ @
╱ ╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╲@
_╱ ╱ @
╱ ╱ @
╲╲_______╱ @@
______ @
╱ ╲@
╱ ╱@
_╱ ╱╱ @
╲______╱╱ @@
____ ___ @
╱ ╱ ╲@
╱ ╱@
╱╱ _╱ @
╲╲___╱___╱ @@
______ @
╱╱ ╲@
╱╱ ╱@
╱ ╱ @
╲________╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲__╱__╱__╱ @@
_______ @
╱╱ ╱ ╲@
╱╱ ╱@
╱ ╱ @
╲__╱_____╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱╱ __╱ @
╲╲_____╱ @@
_______ @
╱ ╲╲@
╱ ╱╱@
╲__ ╱ @
╲_____╱ @@
_______ @
╱╱ ╲@
╱╱ ╱@
╱ _╱ @
╲____╱___╱ @@
________ @
╱ ╲@
╱ _╱@
╱- ╱ @
╲_______╱╱ @@
________ @
╱ ╲@
╱ _╱@
╱ ╱ @
╲_____╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱╱ @
╲_______╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲ ╱ @
╲╲_____╱ @@
________ @
╱ ╱ ╱ ╲@
╱ ╱@
╱╱ ╱ @
╲╲_______╱ @@
________ @
╱ ╱ ╲@
╱_ _╱@
╱ ╱ @
╲___╱___╱╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲__ ╱╱ @
╲____╱╱ @@
_______ @
╱ ╲╲@
╱- ╱@
╱ _╱ @
╲________╱ @@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲___╱____╱ @@
________@
╱ ╱@
╱ ╲@
╱ ╱@
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ --╱ @
╲________╱ @@
_______ @
_╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ _╱ @
╲________╱ @@
________ @
╱ ╲@
╱ __╱@
╱ _╱ @
╲_______╱ @@
________ @
╱ ╲@
╱ __╱@
╱ ╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╲@
_╱ ╱ @
╱ ╱ @
╲________╱ @@
______ @
╱ ╲@
╱ ╱@
_╱ ╱ @
╲_______╱ @@
____ ___ @
╱ ╱ ╲@
╱ ╱@
╱ _╱ @
╲____╱___╱ @@
_______ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲__╱__╱__╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲__╱_____╱ @@
________ @
╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ ╱@
╱ __╱ @
╲______╱ @@
________ @
╱ ╲@
╱ ╱@
╲__ ╱ @
╲_____╱ @@
________ @
╱ ╲@
╱ ╱@
╱ _╱ @
╲____╱___╱ @@
________ @
╱ ╲@
╱ _╱@
╱- ╱ @
╲________╱ @@
________ @
╱ ╲@
╱ _╱@
╱ ╱ @
╲______╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲ ╱ @
╲______╱ @@
________ @
╱ ╱ ╱ ╲@
╱ ╱@
╱ ╱ @
╲________╱ @@
________ @
╱ ╱ ╲@
╱_ _╱@
╱ ╱ @
╲___╱____╱ @@
________ @
╱ ╱ ╲@
╱ ╱@
╲__ ╱ @
╲_____╱ @@
________ @
╱ ╲@
╱- ╱@
╱ _╱ @
╲________╱ @@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@@ -0,0 +1 @@
module.exports={C:{"38":0.00507,"43":0.00507,"44":0.01522,"45":0.00507,"52":0.01522,"78":0.01522,"100":0.00507,"101":0.00507,"115":0.15726,"120":0.01522,"121":0.03044,"122":0.00507,"123":0.01015,"124":0.00507,"125":0.00507,"127":0.00507,"128":0.00507,"135":0.00507,"136":0.00507,"138":0.00507,"139":0.00507,"140":0.0761,"143":0.00507,"144":0.00507,"145":0.00507,"146":0.00507,"147":0.01015,"148":0.00507,"149":0.00507,"150":0.01522,"151":0.01015,"152":0.04058,"153":0.08624,"154":0.28916,"155":1.02475,"156":0.90299,"157":0.03551,_:"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 39 40 41 42 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 96 97 98 99 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 126 129 130 131 132 133 134 137 141 142 158 159 160 3.5 3.6"},D:{"39":0.01522,"40":0.01522,"41":0.01522,"42":0.01522,"43":0.01522,"44":0.01522,"45":0.01522,"46":0.01522,"47":0.02029,"48":0.06088,"49":0.03551,"50":0.01522,"51":0.01522,"52":0.01522,"53":0.02029,"54":0.01522,"55":0.01522,"56":0.02029,"57":0.01522,"58":0.02029,"59":0.02029,"60":0.01522,"70":0.02537,"76":0.00507,"80":0.00507,"87":0.01015,"91":0.00507,"93":0.01522,"97":0.00507,"103":0.13697,"104":0.04566,"105":0.04566,"106":0.04566,"107":0.04566,"108":0.04566,"109":0.42613,"110":0.04566,"111":0.05073,"112":0.04566,"114":0.02029,"116":0.21307,"117":0.04566,"118":0.06595,"119":0.03551,"120":0.08624,"121":0.01015,"122":0.03044,"123":0.01015,"124":0.0558,"125":0.01015,"126":0.0761,"127":0.01015,"128":0.08624,"129":0.00507,"130":0.01522,"131":0.12683,"132":0.01015,"133":0.12175,"134":0.04058,"135":0.04058,"136":0.0558,"137":0.06595,"138":0.20799,"139":0.05073,"140":0.06088,"141":0.06088,"142":2.60245,"143":0.04566,"144":0.25365,"145":0.05073,"146":0.08624,"147":0.13697,"148":0.31453,"149":0.35511,"150":0.83705,"151":2.17632,"152":8.86253,"153":6.84855,"154":1.48639,"155":0.02029,_:"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 74 75 77 78 79 81 83 84 85 86 88 89 90 92 94 95 96 98 99 100 101 102 113 115 156 157"},F:{"89":0.00507,"95":0.01522,"100":0.00507,"101":0.01015,"105":0.00507,"106":0.00507,"107":0.00507,"124":0.00507,"133":0.00507,"134":0.12175,"135":0.46164,_:"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 85 86 87 88 90 91 92 93 94 96 97 98 99 102 103 104 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"102":0.00507,"109":0.04566,"114":0.00507,"119":0.01522,"120":0.01522,"122":0.00507,"128":0.00507,"129":0.00507,"131":0.00507,"132":0.00507,"133":0.00507,"134":0.00507,"135":0.00507,"137":0.00507,"138":0.00507,"139":0.00507,"140":0.00507,"141":0.00507,"142":0.00507,"143":0.01015,"144":0.00507,"145":0.01015,"146":0.01015,"147":0.01015,"148":0.02029,"149":0.03044,"150":0.10146,"151":0.35004,"152":2.89668,"153":3.46486,"154":0.90299,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 123 124 125 126 127 130 136"},E:{"9":0.00507,"14":0.01015,"27":0.29423,_:"4 5 6 7 8 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 15.1 15.2-15.3 27.1 TP","10.1":0.00507,"11.1":0.00507,"12.1":0.00507,"13.1":0.03551,"14.1":0.03551,"15.4":0.01015,"15.5":0.01522,"15.6":0.22829,"16.0":0.00507,"16.1":0.02537,"16.2":0.01015,"16.3":0.03551,"16.4":0.01522,"16.5":0.02029,"16.6":0.33482,"17.0":0.01015,"17.1":0.39062,"17.2":0.02029,"17.3":0.02537,"17.4":0.03551,"17.5":0.0558,"17.6":0.35004,"18.0":0.01522,"18.1":0.05073,"18.2":0.02029,"18.3":0.08117,"18.4":0.03044,"18.5-18.7":0.07102,"26.0":0.03044,"26.1":0.03551,"26.2":0.1319,"26.3":0.19785,"26.4":0.13697,"26.5":0.66456,"26.6":4.99691,"27.2":0.01015},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00273,"5.0-5.1":0.00273,"6.0-6.1":0,"7.0-7.1":0.00547,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.02735,"11.0-11.2":0.00273,"11.3-11.4":0.00547,"12.0-12.1":0,"12.2-12.5":0.0711,"13.0-13.1":0,"13.2":0.01367,"13.3":0,"13.4-13.7":0.00273,"14.0-14.4":0.01094,"14.5-14.8":0.01641,"15.0-15.1":0.01641,"15.2-15.3":0.01094,"15.4":0.01367,"15.5":0.01641,"15.6-15.8":0.35549,"16.0":0.02735,"16.1":0.04922,"16.2":0.02735,"16.3":0.06016,"16.4":0.01367,"16.5":0.02188,"16.6-16.7":0.49495,"17.0":0.01914,"17.1":0.02735,"17.2":0.02735,"17.3":0.04102,"17.4":0.05743,"17.5":0.11212,"17.6-17.7":0.28986,"18.0":0.06016,"18.1":0.12032,"18.2":0.16407,"18.3":0.28439,"18.4":0.17775,"18.5-18.7":3.6725,"26.0":0.17775,"26.1":0.18048,"26.2":0.47034,"26.3":0.50863,"26.4":0.3719,"26.5":2.49117,"26.6":15.37089,"27.0":1.17859,"27.1":0,"27.2":0.03008},P:{"4":0.00948,"21":0.01895,"25":0.00948,Line truncated
@@ -0,0 +1,80 @@
'use strict';
module.exports = function generate_multipleOf(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
if (!($isData || typeof $schema == 'number')) {
throw new Error($keyword + ' must be number');
}
out += 'var division' + ($lvl) + ';if (';
if ($isData) {
out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
}
out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
if (it.opts.multipleOfPrecision) {
out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
} else {
out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
}
out += ' ) ';
if ($isData) {
out += ' ) ';
}
out += ' ) { ';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should be multiple of ';
if ($isData) {
out += '\' + ' + ($schemaValue);
} else {
out += '' + ($schemaValue) + '\'';
}
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + ($schema);
}
out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += '} ';
if ($breakOnError) {
out += ' else { ';
}
return out;
}
@@ -0,0 +1,212 @@
export declare enum ImportType {
/**
* A normal static using any syntax variations
* import .. from 'module'
*/
Static = 1,
/**
* A dynamic import expression `import(specifier)`
* or `import(specifier, opts)`
*/
Dynamic = 2,
/**
* An import.meta expression
*/
ImportMeta = 3,
/**
* A source phase import
* import source x from 'module'
*/
StaticSourcePhase = 4,
/**
* A dynamic source phase import
* import.source('module')
*/
DynamicSourcePhase = 5,
/**
* A defer phase import
* import defer * as x from 'module'
*/
StaticDeferPhase = 6,
/**
* A dynamic defer phase import
* import.defer('module')
*/
DynamicDeferPhase = 7
}
export interface ImportSpecifier {
/**
* Module name
*
* To handle escape sequences in specifier strings, the .n field of imported specifiers will be provided where possible.
*
* For dynamic import expressions, this field will be empty if not a valid JS string.
* For static import expressions, this field will always be populated.
*
* @example
* const [imports1, exports1] = parse(String.raw`import './\u0061\u0062.js'`);
* imports1[0].n;
* // Returns "./ab.js"
*
* const [imports2, exports2] = parse(`import("./ab.js")`);
* imports2[0].n;
* // Returns "./ab.js"
*
* const [imports3, exports3] = parse(`import("./" + "ab.js")`);
* imports3[0].n;
* // Returns undefined
*/
readonly n: string | undefined;
/**
* Type of import statement
*/
readonly t: ImportType;
/**
* Start of module specifier
*
* @example
* const source = `import { a } from 'asdf'`;
* const [imports, exports] = parse(source);
* source.substring(imports[0].s, imports[0].e);
* // Returns "asdf"
*/
readonly s: number;
/**
* End of module specifier
*/
readonly e: number;
/**
* Start of import statement
*
* @example
* const source = `import { a } from 'asdf'`;
* const [imports, exports] = parse(source);
* source.substring(imports[0].ss, imports[0].se);
* // Returns "import { a } from 'asdf';"
*/
readonly ss: number;
/**
* End of import statement
*/
readonly se: number;
/**
* If this import keyword is a dynamic import, this is the start value.
* If this import keyword is a static import, this is -1.
* If this import keyword is an import.meta expresion, this is -2.
*/
readonly d: number;
/**
* If this import has an import attribute, this is the start value.
* Otherwise this is `-1`.
*/
readonly a: number;
/**
* Parsed import attributes as an array of [key, value] tuples.
* If this import has no attributes, this is `null`.
*
* @example
* const source = `import foo from 'bar' with { type: "json" }`;
* const [imports] = parse(source);
* imports[0].at;
* // Returns [['type', 'json']]
*
* @example
* const source = `import foo from 'bar' with { type: "json", integrity: "sha384-..." }`;
* const [imports] = parse(source);
* imports[0].at;
* // Returns [['type', 'json'], ['integrity', 'sha384-...']]
*/
readonly at: ReadonlyArray<readonly [string, string]> | null;
}
export interface ExportSpecifier {
/**
* Exported name
*
* @example
* const source = `export default []`;
* const [imports, exports] = parse(source);
* exports[0].n;
* // Returns "default"
*
* @example
* const source = `export const asdf = 42`;
* const [imports, exports] = parse(source);
* exports[0].n;
* // Returns "asdf"
*/
readonly n: string;
/**
* Local name, or undefined.
*
* @example
* const source = `export default []`;
* const [imports, exports] = parse(source);
* exports[0].ln;
* // Returns undefined
*
* @example
* const asdf = 42;
* const source = `export { asdf as a }`;
* const [imports, exports] = parse(source);
* exports[0].ln;
* // Returns "asdf"
*/
readonly ln: string | undefined;
/**
* Start of exported name
*
* @example
* const source = `export default []`;
* const [imports, exports] = parse(source);
* source.substring(exports[0].s, exports[0].e);
* // Returns "default"
*
* @example
* const source = `export { 42 as asdf }`;
* const [imports, exports] = parse(source);
* source.substring(exports[0].s, exports[0].e);
* // Returns "asdf"
*/
readonly s: number;
/**
* End of exported name
*/
readonly e: number;
/**
* Start of local name, or -1.
*
* @example
* const asdf = 42;
* const source = `export { asdf as a }`;
* const [imports, exports] = parse(source);
* source.substring(exports[0].ls, exports[0].le);
* // Returns "asdf"
*/
readonly ls: number;
/**
* End of local name, or -1.
*/
readonly le: number;
}
export interface ParseError extends Error {
idx: number;
}
/**
* Outputs the list of exports and locations of import specifiers,
* including dynamic import and import meta handling.
*
* @param source Source code to parser
* @param name Optional sourcename
* @returns Tuple contaning imports list and exports list.
*/
export declare function parse(source: string, name?: string): readonly [
imports: ReadonlyArray<ImportSpecifier>,
exports: ReadonlyArray<ExportSpecifier>,
facade: boolean,
hasModuleSyntax: boolean
];
/**
* Wait for init to resolve before calling `parse`.
*/
export declare const init: Promise<void>;
export declare const initSync: () => void;
@@ -0,0 +1,32 @@
import { AcceptHeader } from "../../utils/headers.js";
import { Context } from "../../context.js";
//#region src/helper/accepts/accepts.d.ts
export interface Accept {
type: string;
params: Record<string, string>;
q: number;
}
export interface acceptsConfig {
header: AcceptHeader;
supports: string[];
default: string;
}
export interface acceptsOptions extends acceptsConfig {
match?: (accepts: Accept[], config: acceptsConfig) => string;
}
export declare const defaultMatch: (accepts: Accept[], config: acceptsConfig) => string;
/**
* Match the accept header with the given options.
* @example
* ```ts
* app.get('/users', (c) => {
* const lang = accepts(c, {
* header: 'Accept-Language',
* supports: ['en', 'zh'],
* default: 'en',
* })
* })
* ```
*/
export declare const accepts: (c: Context, options: acceptsOptions) => string;
//#endregion
@@ -0,0 +1,60 @@
type FastUri = typeof fastUri
declare namespace fastUri {
export interface URIComponent {
scheme?: string;
userinfo?: string;
host?: string;
port?: number | string;
path?: string;
query?: string;
fragment?: string;
reference?: string;
nid?: string;
nss?: string;
resourceName?: string;
secure?: boolean;
uuid?: string;
error?: string;
}
export interface Options {
scheme?: string;
reference?: string;
unicodeSupport?: boolean;
domainHost?: boolean;
absolutePath?: boolean;
tolerant?: boolean;
skipEscape?: boolean;
nid?: string;
}
/**
* @deprecated Use Options instead
*/
export type options = Options
/**
* @deprecated Use URIComponent instead
*/
export type URIComponents = URIComponent
export function normalize (uri: string, opts?: Options): string
export function normalize (uri: URIComponent, opts?: Options): URIComponent
export function normalize (uri: any, opts?: Options): any
export function resolve (baseURI: string, relativeURI: string, options?: Options): string
export function resolveComponent (base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent
export function parse (uri: string, opts?: Options): URIComponent
export function serialize (component: URIComponent, opts?: Options): string
export function equal (uriA: string, uriB: string): boolean
export function resolve (base: string, path: string): string
export const fastUri: FastUri
export { fastUri as default }
}
export = fastUri
@@ -0,0 +1,7 @@
import Options from '../../Options';
import { MatchEstimated } from '../../types';
declare const _default: (options: Options, match: MatchEstimated, isSoleMatch?: boolean) => {
warning: string | null;
suggestions: string[];
};
export default _default;
@@ -0,0 +1,210 @@
"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 (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_crypto_1 = require("node:crypto");
const mcp_js_1 = require("../../server/mcp.js");
const streamableHttp_js_1 = require("../../server/streamableHttp.js");
const z = __importStar(require("zod/v4"));
const types_js_1 = require("../../types.js");
const express_js_1 = require("../../server/express.js");
// Create an MCP server with implementation details
const getServer = () => {
const server = new mcp_js_1.McpServer({
name: 'json-response-streamable-http-server',
version: '1.0.0'
}, {
capabilities: {
logging: {}
}
});
// Register a simple tool that returns a greeting
server.registerTool('greet', {
description: 'A simple greeting tool',
inputSchema: {
name: z.string().describe('Name to greet')
}
}, async ({ name }) => {
return {
content: [
{
type: 'text',
text: `Hello, ${name}!`
}
]
};
});
// Register a tool that sends multiple greetings with notifications
server.registerTool('multi-greet', {
description: 'A tool that sends different greetings with delays between them',
inputSchema: {
name: z.string().describe('Name to greet')
}
}, async ({ name }, extra) => {
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
await server.sendLoggingMessage({
level: 'debug',
data: `Starting multi-greet for ${name}`
}, extra.sessionId);
await sleep(1000); // Wait 1 second before first greeting
await server.sendLoggingMessage({
level: 'info',
data: `Sending first greeting to ${name}`
}, extra.sessionId);
await sleep(1000); // Wait another second before second greeting
await server.sendLoggingMessage({
level: 'info',
data: `Sending second greeting to ${name}`
}, extra.sessionId);
return {
content: [
{
type: 'text',
text: `Good morning, ${name}!`
}
]
};
});
return server;
};
const app = (0, express_js_1.createMcpExpressApp)();
// Close sessions that have been idle for IDLE_MS, and keep at most MAX_SESSIONS open
const IDLE_MS = 30 * 60000;
const MAX_SESSIONS = 1000;
const sessions = new Map();
// Count open responses so a long-running request is not treated as idle
const trackResponse = (session, res) => {
if (!res.socket || res.destroyed)
return;
session.open++;
res.on('close', () => {
session.open--;
session.lastActive = Date.now();
});
};
// Close sessions with nothing open and no activity for IDLE_MS
setInterval(() => {
const cutoff = Date.now() - IDLE_MS;
for (const { transport, open, lastActive } of sessions.values()) {
if (open === 0 && lastActive < cutoff)
transport.close().catch(console.error);
}
}, 60000).unref();
app.post('/mcp', async (req, res) => {
console.log('Received MCP request:', req.body);
try {
// Check for existing session ID
const sessionId = req.headers['mcp-session-id'];
const session = sessionId ? sessions.get(sessionId) : undefined;
let transport;
if (session) {
// Reuse existing transport
transport = session.transport;
trackResponse(session, res);
}
else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
// New initialization request - use JSON response mode
if (sessions.size >= MAX_SESSIONS) {
res.status(503).json({ jsonrpc: '2.0', error: { code: -32000, message: 'Too many open sessions' }, id: null });
return;
}
transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
enableJsonResponse: true, // Enable JSON response mode
onsessioninitialized: sessionId => {
// Store the transport by session ID when session is initialized
// This avoids race conditions where requests might come in before the session is stored
console.log(`Session initialized with ID: ${sessionId}`);
sessions.set(sessionId, { transport, open: 0, lastActive: Date.now() });
}
});
// Set up onclose handler to clean up transport when closed
transport.onclose = () => {
const sid = transport.sessionId;
if (sid && sessions.has(sid)) {
console.log(`Transport closed for session ${sid}, removing from sessions map`);
sessions.delete(sid);
}
};
// Connect the transport to the MCP server BEFORE handling the request
const server = getServer();
await server.connect(transport);
await transport.handleRequest(req, res, req.body);
return; // Already handled
}
else if (sessionId) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
else {
// Invalid request - no session ID and not an initialization request
res.status(400).json({
jsonrpc: '2.0',
error: {
code: -32000,
message: 'Bad Request: No valid session ID provided'
},
id: null
});
return;
}
// Handle the request with existing transport - no need to reconnect
await transport.handleRequest(req, res, req.body);
}
catch (error) {
console.error('Error handling MCP request:', error);
if (!res.headersSent) {
res.status(500).json({
jsonrpc: '2.0',
error: {
code: -32603,
message: 'Internal server error'
},
id: null
});
}
}
});
// Handle GET requests for SSE streams according to spec
app.get('/mcp', async (req, res) => {
// Since this is a very simple example, we don't support GET requests for this server
// The spec requires returning 405 Method Not Allowed in this case
res.status(405).set('Allow', 'POST').send('Method Not Allowed');
});
// Start the server
const PORT = 3000;
app.listen(PORT, error => {
if (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
console.log(`MCP Streamable HTTP Server listening on port ${PORT}`);
});
// Handle server shutdown
process.on('SIGINT', async () => {
console.log('Shutting down server...');
process.exit(0);
});
//# sourceMappingURL=jsonResponseStreamableHttp.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './rows-2.js';
//# sourceMappingURL=rows.js.map
@@ -0,0 +1,45 @@
{
"name": "browserslist",
"version": "4.28.7",
"description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
"keywords": [
"browsers",
"caniuse",
"target"
],
"license": "MIT",
"author": "Andrey Sitnik <andrey@sitnik.es>",
"repository": "browserslist/browserslist",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"bin": {
"browserslist": "cli.js"
},
"browser": {
"./node.js": "./browser.js",
"path": false
},
"types": "./index.d.ts",
"dependencies": {
"baseline-browser-mapping": "^2.10.44",
"caniuse-lite": "^1.0.30001806",
"electron-to-chromium": "^1.5.393",
"node-releases": "^2.0.51",
"update-browserslist-db": "^1.2.3"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
}
@@ -0,0 +1,34 @@
{
"name": "caniuse-lite",
"version": "1.0.30001816",
"description": "A smaller version of caniuse-db, with only the essentials!",
"keywords": [
"support"
],
"license": "CC-BY-4.0",
"author": {
"name": "Ben Briggs",
"email": "beneb.info@gmail.com",
"url": "http://beneb.info"
},
"repository": "browserslist/caniuse-lite",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"files": [
"data",
"dist"
],
"main": "dist/unpacker/index.js"
}
@@ -0,0 +1 @@
module.exports={C:{"115":0.03613,"120":0.13061,"121":0.25567,"123":0.00278,"124":0.00834,"125":0.00834,"128":0.00556,"129":0.00556,"131":0.00834,"132":0.00834,"133":0.00834,"134":0.00556,"135":0.00556,"136":0.00278,"139":0.06392,"140":0.0139,"146":0.00278,"147":0.00278,"149":0.00278,"150":0.00278,"151":0.00278,"152":0.00556,"153":0.01667,"154":0.02779,"155":0.17508,"156":0.21398,"157":0.00834,_:"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 52 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 130 137 138 141 142 143 144 145 148 158 159 160 3.5 3.6"},D:{"49":0.0139,"51":0.00278,"58":0.00278,"60":0.00278,"62":0.00834,"68":0.00834,"69":0.00556,"70":0.00556,"71":0.00556,"73":0.0139,"74":0.00278,"79":0.0139,"83":0.00278,"84":0.00556,"86":0.00278,"87":0.00834,"88":0.00556,"91":0.01112,"94":0.00278,"95":0.00278,"96":0.02223,"97":0.00278,"98":0.00278,"99":0.00278,"101":0.01112,"103":0.1195,"104":0.11672,"105":0.11394,"106":0.11116,"107":0.10282,"108":0.1056,"109":2.73732,"110":0.11116,"111":0.12228,"112":0.11672,"114":0.0139,"116":0.2251,"117":0.11116,"118":0.47521,"119":0.26956,"120":0.36127,"121":0.00556,"122":0.28902,"123":0.0139,"124":0.13895,"125":0.02501,"126":0.0139,"128":0.00556,"130":0.00834,"131":0.25567,"132":0.00278,"133":0.3446,"134":0.1195,"135":0.14451,"136":0.13061,"137":0.15285,"138":0.15562,"139":0.13617,"140":0.15562,"141":0.15007,"142":0.4502,"143":0.00834,"144":0.07503,"145":0.02501,"146":0.05836,"147":0.0139,"148":0.07503,"149":0.13617,"150":0.30291,"151":0.99766,"152":2.82902,"153":6.02209,"154":0.87261,"155":0.02223,"156":0.01945,_:"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 50 52 53 54 55 56 57 59 61 63 64 65 66 67 72 75 76 77 78 80 81 85 89 90 92 93 100 102 113 115 127 129 157"},F:{"40":0.00278,"46":0.00834,"67":0.00278,"79":0.01112,"91":0.00278,"95":0.26401,"100":0.00278,"101":0.00834,"102":0.00556,"110":0.00556,"112":0.00278,"113":0.00278,"115":0.00278,"117":0.00278,"119":0.00278,"134":0.03613,"135":0.37517,_:"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 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 92 93 94 96 97 98 99 103 104 105 106 107 108 109 111 114 116 118 120 121 122 123 124 125 126 127 131 132 133 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00278,"90":0.00278,"92":0.01945,"109":0.00278,"114":0.00556,"119":0.12506,"120":0.13617,"123":0.00834,"124":0.00556,"127":0.00556,"131":0.00278,"133":0.00278,"138":0.00278,"139":0.00556,"140":0.00278,"143":0.00556,"145":0.00278,"146":0.00278,"147":0.00834,"148":0.01112,"149":0.00278,"150":0.01667,"151":0.02501,"152":0.36127,"153":0.64195,"154":0.19175,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 122 125 126 128 129 130 132 134 135 136 137 141 142 144"},E:{"27":0.02779,_:"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 13.1 14.1 15.1 15.2-15.3 16.0 16.2 16.3 16.4 16.5 17.0 17.2 17.3 17.5 18.1 18.2 27.1 27.2 TP","15.4":0.00556,"15.5":0.00278,"15.6":0.00556,"16.1":0.00556,"16.6":0.02779,"17.1":0.0139,"17.4":0.0139,"17.6":0.00556,"18.0":0.00556,"18.3":0.00834,"18.4":0.00278,"18.5-18.7":0.00834,"26.0":0.00278,"26.1":0.00834,"26.2":0.02779,"26.3":0.00278,"26.4":0.00556,"26.5":0.02501,"26.6":0.12506},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00067,"5.0-5.1":0.00067,"6.0-6.1":0,"7.0-7.1":0.00134,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00668,"11.0-11.2":0.00067,"11.3-11.4":0.00134,"12.0-12.1":0,"12.2-12.5":0.01736,"13.0-13.1":0,"13.2":0.00334,"13.3":0,"13.4-13.7":0.00067,"14.0-14.4":0.00267,"14.5-14.8":0.00401,"15.0-15.1":0.00401,"15.2-15.3":0.00267,"15.4":0.00334,"15.5":0.00401,"15.6-15.8":0.08682,"16.0":0.00668,"16.1":0.01202,"16.2":0.00668,"16.3":0.01469,"16.4":0.00334,"16.5":0.00534,"16.6-16.7":0.12088,"17.0":0.00467,"17.1":0.00668,"17.2":0.00668,"17.3":0.01002,"17.4":0.01402,"17.5":0.02738,"17.6-17.7":0.07079,"18.0":0.01469,"18.1":0.02939,"18.2":0.04007,"18.3":0.06946,"18.4":0.04341,"18.5-18.7":0.89692,"26.0":0.04341,"26.1":0.04408,"26.2":0.11487,"26.3":0.12422,"26.4":0.09083,"26.5":0.60841,"26.6":3.75398,"27.0":0.28784,"27.1":0,"27.2":0.00735},P:{"21":0.01883,"22":0.01883,"23":0.00942,"24":0.01883,"25":0.02825,"26":0.15066,"27":0.04708,"28":0.14124,"29":0.30131,"30":1.31825,_:"4 20 10.1 11.1-11.2 12.0 15.0 16.0 17.0 18.0","5.0-5.4":0.03766,"6.2-6.4":0.01883,"7.2-7.4":0.0565,"8.2":0.00942,"9.2":0.0565,"13.0":0.00942,"14.0":0.00942,"19.0":0.00942},I:{"0":0.00721,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,Line truncated
@@ -0,0 +1,74 @@
{
"name": "@tanstack/react-virtual",
"version": "3.14.5",
"description": "Headless UI for virtualizing scrollable elements in React",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/TanStack/virtual.git",
"directory": "packages/react-virtual"
},
"homepage": "https://tanstack.com/virtual",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
"react",
"vue",
"solid",
"virtual",
"virtual-core",
"datagrid"
],
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"dependencies": {
"@tanstack/virtual-core": "3.17.3"
},
"devDependencies": {
"@testing-library/react": "^16.3.0",
"@types/react": "^19.2.16",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^4.5.2",
"babel-plugin-react-compiler": "^1.0.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"resize-observer-polyfill": "^1.5.1"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"scripts": {
"clean": "premove ./dist ./coverage",
"test:eslint": "eslint ./src",
"test:types": "tsc",
"test:lib": "vitest",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict",
"build": "vite build",
"test:e2e": "../../node_modules/.bin/playwright test"
}
}
@@ -0,0 +1,2 @@
import type TokenProcessor from "../TokenProcessor";
export default function elideImportEquals(tokens: TokenProcessor): void;
@@ -0,0 +1,440 @@
"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 });
exports.checkSyntaxError = checkSyntaxError;
const ts = __importStar(require("typescript"));
const check_modifiers_1 = require("./check-modifiers");
const node_utils_1 = require("./node-utils");
const SyntaxKind = ts.SyntaxKind;
function checkSyntaxError(tsNode, parent, allowPattern) {
(0, check_modifiers_1.checkModifiers)(tsNode);
const node = tsNode;
switch (node.kind) {
case SyntaxKind.SwitchStatement:
if (node.caseBlock.clauses.filter(switchCase => switchCase.kind === SyntaxKind.DefaultClause).length > 1) {
throw (0, node_utils_1.createError)(node, "A 'default' clause cannot appear more than once in a 'switch' statement.");
}
break;
case SyntaxKind.ThrowStatement:
if (node.expression.end === node.expression.pos) {
throw (0, node_utils_1.createError)(node, 'A throw statement must throw an expression.');
}
break;
case SyntaxKind.CatchClause:
if (node.variableDeclaration?.initializer) {
throw (0, node_utils_1.createError)(node.variableDeclaration.initializer, 'Catch clause variable cannot have an initializer.');
}
break;
case SyntaxKind.FunctionDeclaration: {
const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
const isAsync = (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node);
const isGenerator = !!node.asteriskToken;
if (isDeclare) {
if (node.body) {
throw (0, node_utils_1.createError)(node, 'An implementation cannot be declared in ambient contexts.');
}
else if (isAsync) {
throw (0, node_utils_1.createError)(node, "'async' modifier cannot be used in an ambient context.");
}
else if (isGenerator) {
throw (0, node_utils_1.createError)(node, 'Generators are not allowed in an ambient context.');
}
}
else if (!node.body && isGenerator) {
throw (0, node_utils_1.createError)(node, 'A function signature cannot be declared as a generator.');
}
break;
}
case SyntaxKind.VariableDeclaration: {
const hasExclamationToken = !!node.exclamationToken;
if (hasExclamationToken) {
if (node.initializer) {
throw (0, node_utils_1.createError)(node, 'Declarations with initializers cannot also have definite assignment assertions.');
}
else if (node.name.kind !== SyntaxKind.Identifier || !node.type) {
throw (0, node_utils_1.createError)(node, 'Declarations with definite assignment assertions must also have type annotations.');
}
}
if (node.parent.kind === SyntaxKind.VariableDeclarationList) {
const variableDeclarationList = node.parent;
const kind = (0, node_utils_1.getDeclarationKind)(variableDeclarationList);
if (kind === 'using' || kind === 'await using') {
if (variableDeclarationList.parent.kind === SyntaxKind.ForInStatement) {
throw (0, node_utils_1.createError)(variableDeclarationList, `The left-hand side of a 'for...in' statement cannot be a '${kind}' declaration.`);
}
if (variableDeclarationList.parent.kind === SyntaxKind.ForStatement ||
variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
if (!node.initializer) {
throw (0, node_utils_1.createError)(node, `'${kind}' declarations must be initialized.`);
}
if (node.name.kind !== SyntaxKind.Identifier) {
throw (0, node_utils_1.createError)(node.name, `'${kind}' declarations may not have binding patterns.`);
}
}
}
if (variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
const variableStatement = variableDeclarationList.parent;
const hasDeclareKeyword = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, variableStatement);
// Definite assignment only allowed for non-declare let and var
if ((hasDeclareKeyword ||
['await using', 'const', 'using'].includes(kind)) &&
hasExclamationToken) {
throw (0, node_utils_1.createError)(node, `A definite assignment assertion '!' is not permitted in this context.`);
}
if (hasDeclareKeyword &&
node.initializer &&
(['let', 'var'].includes(kind) || node.type)) {
throw (0, node_utils_1.createError)(node, `Initializers are not permitted in ambient contexts.`);
}
// Theoretically, only certain initializers are allowed for declare const,
// (TS1254: A 'const' initializer in an ambient context must be a string
// or numeric literal or literal enum reference.) but we just allow
// all expressions
// Note! No-declare does not mean the variable is not ambient, because
// it can be further nested in other declare contexts. Therefore we cannot
// check for const initializers.
}
}
break;
}
case SyntaxKind.VariableStatement: {
const declarations = node.declarationList.declarations;
if (!declarations.length) {
throw (0, node_utils_1.createError)(node, 'A variable declaration list must have at least one variable declarator.');
}
break;
}
case SyntaxKind.PropertyAssignment: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const { exclamationToken, questionToken } = node;
if (questionToken) {
throw (0, node_utils_1.createError)(questionToken, 'A property assignment cannot have a question token.');
}
if (exclamationToken) {
throw (0, node_utils_1.createError)(exclamationToken, 'A property assignment cannot have an exclamation token.');
}
break;
}
case SyntaxKind.ShorthandPropertyAssignment: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const { exclamationToken, modifiers, questionToken } = node;
if (modifiers) {
throw (0, node_utils_1.createError)(modifiers[0], 'A shorthand property assignment cannot have modifiers.');
}
if (questionToken) {
throw (0, node_utils_1.createError)(questionToken, 'A shorthand property assignment cannot have a question token.');
}
if (exclamationToken) {
throw (0, node_utils_1.createError)(exclamationToken, 'A shorthand property assignment cannot have an exclamation token.');
}
break;
}
case SyntaxKind.PropertyDeclaration: {
const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node);
if (isAbstract && node.initializer) {
throw (0, node_utils_1.createError)(node.initializer, `Abstract property cannot have an initializer.`);
}
if (node.name.kind === SyntaxKind.StringLiteral &&
node.name.text === 'constructor') {
throw (0, node_utils_1.createError)(node.name, "Classes may not have a field named 'constructor'.");
}
break;
}
case SyntaxKind.TaggedTemplateExpression:
if (node.tag.flags & ts.NodeFlags.OptionalChain) {
throw (0, node_utils_1.createError)(node, 'Tagged template expressions are not permitted in an optional chain.');
}
break;
case SyntaxKind.BinaryExpression:
if (node.operatorToken.kind !== SyntaxKind.InKeyword &&
node.left.kind === SyntaxKind.PrivateIdentifier) {
throw (0, node_utils_1.createError)(node.left, "Private identifiers cannot appear on the right-hand-side of an 'in' expression.");
}
else if (node.right.kind === SyntaxKind.PrivateIdentifier) {
throw (0, node_utils_1.createError)(node.right, "Private identifiers are only allowed on the left-hand-side of an 'in' expression.");
}
break;
case SyntaxKind.MappedType:
if (node.members && node.members.length > 0) {
throw (0, node_utils_1.createError)(node.members[0], 'A mapped type may not declare properties or methods.');
}
break;
case SyntaxKind.PropertySignature: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const { initializer } = node;
if (initializer) {
throw (0, node_utils_1.createError)(initializer, 'A property signature cannot have an initializer.');
}
break;
}
case SyntaxKind.FunctionType: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const { modifiers } = node;
if (modifiers) {
throw (0, node_utils_1.createError)(modifiers[0], 'A function type cannot have modifiers.');
}
break;
}
case SyntaxKind.EnumMember: {
const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName;
if (computed) {
throw (0, node_utils_1.createError)(node.name, 'Computed property names are not allowed in enums.');
}
if (node.name.kind === SyntaxKind.NumericLiteral ||
node.name.kind === SyntaxKind.BigIntLiteral) {
throw (0, node_utils_1.createError)(node.name, 'An enum member cannot have a numeric name.');
}
break;
}
case SyntaxKind.ExternalModuleReference:
if (node.expression.kind !== SyntaxKind.StringLiteral) {
throw (0, node_utils_1.createError)(node.expression, 'String literal expected.');
}
break;
case SyntaxKind.PrefixUnaryExpression:
case SyntaxKind.PostfixUnaryExpression: {
const operator = (0, node_utils_1.getTextForTokenKind)(node.operator);
/**
* ESTree uses UpdateExpression for ++/--
*/
if ((operator === '++' || operator === '--') &&
!(0, node_utils_1.isValidAssignmentTarget)(node.operand)) {
throw (0, node_utils_1.createError)(node.operand, 'Invalid left-hand side expression in unary operation');
}
break;
}
case SyntaxKind.ImportDeclaration: {
const { importClause } = node;
if (
// TODO swap to `phaseModifier` once we add support for `import defer`
// https://github.com/estree/estree/issues/328
// eslint-disable-next-line @typescript-eslint/no-deprecated
importClause?.isTypeOnly &&
importClause.name &&
importClause.namedBindings) {
throw (0, node_utils_1.createError)(importClause, 'A type-only import can specify a default import or named bindings, but not both.');
}
assertModuleSpecifier(node, false);
break;
}
case SyntaxKind.ExportDeclaration:
assertModuleSpecifier(node, node.exportClause?.kind === SyntaxKind.NamedExports);
break;
case SyntaxKind.ExportSpecifier: {
const local = node.propertyName ?? node.name;
if (local.kind === SyntaxKind.StringLiteral &&
parent.kind === SyntaxKind.ExportDeclaration &&
parent.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) {
throw (0, node_utils_1.createError)(local, 'A string literal cannot be used as a local exported binding without `from`.');
}
break;
}
case SyntaxKind.CallExpression:
if (node.expression.kind === SyntaxKind.ImportKeyword &&
node.arguments.length !== 1 &&
node.arguments.length !== 2) {
throw (0, node_utils_1.createError)(node.arguments.length > 1 ? node.arguments[2] : node, 'Dynamic import requires exactly one or two arguments.');
}
break;
case SyntaxKind.ClassDeclaration:
if (!node.name &&
(!(0, node_utils_1.hasModifier)(ts.SyntaxKind.ExportKeyword, node) ||
!(0, node_utils_1.hasModifier)(ts.SyntaxKind.DefaultKeyword, node))) {
throw (0, node_utils_1.createError)(node, "A class declaration without the 'default' modifier must have a name.");
}
// intentional fallthrough
case SyntaxKind.ClassExpression: {
const heritageClauses = node.heritageClauses ?? [];
let seenExtendsClause = false;
let seenImplementsClause = false;
for (const heritageClause of heritageClauses) {
const { token, types } = heritageClause;
if (types.length === 0) {
throw (0, node_utils_1.createError)(heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`);
}
if (token === SyntaxKind.ExtendsKeyword) {
if (seenExtendsClause) {
throw (0, node_utils_1.createError)(heritageClause, "'extends' clause already seen.");
}
if (seenImplementsClause) {
throw (0, node_utils_1.createError)(heritageClause, "'extends' clause must precede 'implements' clause.");
}
if (types.length > 1) {
throw (0, node_utils_1.createError)(types[1], 'Classes can only extend a single class.');
}
seenExtendsClause = true;
}
else {
// `implements`
if (seenImplementsClause) {
throw (0, node_utils_1.createError)(heritageClause, "'implements' clause already seen.");
}
for (const heritageType of heritageClause.types) {
if (!(0, node_utils_1.isEntityNameExpression)(heritageType.expression) ||
ts.isOptionalChain(heritageType.expression)) {
throw (0, node_utils_1.createError)(heritageType, 'A class can only implement an identifier/qualified-name with optional type arguments.');
}
}
seenImplementsClause = true;
}
}
break;
}
case SyntaxKind.InterfaceDeclaration: {
const interfaceHeritageClauses = node.heritageClauses ?? [];
let seenExtendsClause = false;
for (const heritageClause of interfaceHeritageClauses) {
const { token, types } = heritageClause;
if (token === SyntaxKind.ImplementsKeyword) {
throw (0, node_utils_1.createError)(heritageClause, "Interface declaration cannot have 'implements' clause.");
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (token !== SyntaxKind.ExtendsKeyword) {
throw (0, node_utils_1.createError)(heritageClause, 'Unexpected token.');
}
if (types.length === 0) {
throw (0, node_utils_1.createError)(heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`);
}
if (seenExtendsClause) {
throw (0, node_utils_1.createError)(heritageClause, "'extends' clause already seen.");
}
seenExtendsClause = true;
for (const heritageType of heritageClause.types) {
if (!(0, node_utils_1.isEntityNameExpression)(heritageType.expression) ||
ts.isOptionalChain(heritageType.expression)) {
throw (0, node_utils_1.createError)(heritageType, 'Interface declaration can only extend an identifier/qualified name with optional type arguments.');
}
}
}
break;
}
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
if (node.parent.kind === SyntaxKind.InterfaceDeclaration ||
node.parent.kind === SyntaxKind.TypeLiteral) {
return;
}
// otherwise, it is a non-type accessor - intentional fallthrough
case SyntaxKind.MethodDeclaration: {
const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node);
if (isAbstract && node.body) {
throw (0, node_utils_1.createError)(node.name, node.kind === SyntaxKind.GetAccessor ||
node.kind === SyntaxKind.SetAccessor
? 'An abstract accessor cannot have an implementation.'
: `Method '${(0, node_utils_1.declarationNameToString)(node.name)}' cannot have an implementation because it is marked abstract.`);
}
break;
}
case SyntaxKind.ObjectLiteralExpression: {
if (!allowPattern) {
for (const property of node.properties) {
if ((property.kind === SyntaxKind.GetAccessor ||
property.kind === SyntaxKind.SetAccessor ||
property.kind === SyntaxKind.MethodDeclaration) &&
!property.body) {
throw (0, node_utils_1.createError)(property.end - 1, "'{' expected.", node.getSourceFile());
}
}
}
break;
}
case SyntaxKind.ImportEqualsDeclaration:
if (node.isTypeOnly &&
node.moduleReference.kind !== SyntaxKind.ExternalModuleReference) {
throw (0, node_utils_1.createError)(node, "An import alias cannot use 'import type'");
}
break;
case SyntaxKind.ModuleDeclaration: {
if (node.flags & ts.NodeFlags.GlobalAugmentation) {
const { body } = node;
if (body == null || body.kind === SyntaxKind.ModuleDeclaration) {
throw (0, node_utils_1.createError)(node.body ?? node, 'Expected a valid module body');
}
const { name } = node;
if (name.kind !== ts.SyntaxKind.Identifier) {
throw (0, node_utils_1.createError)(name, 'global module augmentation must have an Identifier id');
}
return;
}
if (ts.isStringLiteral(node.name)) {
return;
}
if (node.body == null) {
throw (0, node_utils_1.createError)(node, 'Expected a module body');
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Fixme: confirm if it's possible
if (node.name.kind !== ts.SyntaxKind.Identifier) {
throw (0, node_utils_1.createError)(node.name, '`namespace`s must have an Identifier id');
}
break;
}
case SyntaxKind.ForInStatement:
case SyntaxKind.ForOfStatement: {
checkForStatementDeclaration(node);
break;
}
// No default
}
}
function checkForStatementDeclaration(node) {
const { initializer, kind } = node;
const loop = kind === SyntaxKind.ForInStatement ? 'for...in' : 'for...of';
if (ts.isVariableDeclarationList(initializer)) {
if (initializer.declarations.length !== 1) {
throw (0, node_utils_1.createError)(initializer, `Only a single variable declaration is allowed in a '${loop}' statement.`);
}
const declaration = initializer.declarations[0];
if (declaration.initializer) {
throw (0, node_utils_1.createError)(declaration, `The variable declaration of a '${loop}' statement cannot have an initializer.`);
}
else if (declaration.type) {
throw (0, node_utils_1.createError)(declaration, `The variable declaration of a '${loop}' statement cannot have a type annotation.`);
}
}
else if (!(0, node_utils_1.isValidAssignmentTarget)(initializer) &&
initializer.kind !== SyntaxKind.ObjectLiteralExpression &&
initializer.kind !== SyntaxKind.ArrayLiteralExpression) {
throw (0, node_utils_1.createError)(initializer, `The left-hand side of a '${loop}' statement must be a variable or a property access.`);
}
}
function assertModuleSpecifier(node, allowNull) {
if (!allowNull && node.moduleSpecifier == null) {
throw (0, node_utils_1.createError)(node, 'Module specifier must be a string literal.');
}
if (node.moduleSpecifier &&
node.moduleSpecifier.kind !== SyntaxKind.StringLiteral) {
throw (0, node_utils_1.createError)(node.moduleSpecifier, 'Module specifier must be a string literal.');
}
}
@@ -0,0 +1,6 @@
import { parseAnyDef } from "./any.js";
export function parseUndefinedDef(refs) {
return {
not: parseAnyDef(refs),
};
}
@@ -0,0 +1 @@
{"version":3,"file":"write-entry.d.ts","sourceRoot":"","sources":["../../src/write-entry.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
{"version":3,"file":"sailboat.js","sources":["../../../src/icons/sailboat.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Sailboat\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMThIMmE0IDQgMCAwIDAgNCA0aDEyYTQgNCAwIDAgMCA0LTRaIiAvPgogIDxwYXRoIGQ9Ik0yMSAxNCAxMCAyIDMgMTRoMThaIiAvPgogIDxwYXRoIGQ9Ik0xMCAydjE2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/sailboat\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Sailboat = createLucideIcon('Sailboat', [\n ['path', { d: 'M22 18H2a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4Z', key: '1404fh' }],\n ['path', { d: 'M21 14 10 2 3 14h18Z', key: '1nzg7v' }],\n ['path', { d: 'M10 2v16', key: '1labyt' }],\n]);\n\nexport default Sailboat;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,4 @@
import { getConnInfo } from "./conninfo.js";
import { serveStatic as module } from "./serve-static-module.js";
import { upgradeWebSocket } from "./websocket.js";
export { getConnInfo, module as serveStatic, upgradeWebSocket };
@@ -0,0 +1,15 @@
import { r as rpc } from './chunk-mocker.js';
class ModuleMockerServerInterceptor {
async register(module) {
await rpc("vitest:interceptor:register", module.toJSON());
}
async delete(id) {
await rpc("vitest:interceptor:delete", id);
}
async invalidate() {
await rpc("vitest:interceptor:invalidate");
}
}
export { ModuleMockerServerInterceptor as M };
@@ -0,0 +1,182 @@
//#region src/agents.d.ts
/**
* Represents the name of an AI coding agent.
*/
type AgentName = (string & {}) | "cursor" | "claude" | "devin" | "replit" | "gemini" | "codex" | "auggie" | "opencode" | "kiro" | "goose" | "pi";
/**
* Provides information about an AI coding agent.
*/
type AgentInfo = {
/**
* The name of the AI coding agent. See {@link AgentName} for possible values.
*/
name?: AgentName;
};
/**
* Detects the current AI coding agent from environment variables.
*
* Supported agents: `cursor`, `claude`, `devin`, `replit`, `gemini`, `codex`, `auggie`, `opencode`, `kiro`, `goose`, `pi`
*
* You can also set the `AI_AGENT` environment variable to explicitly specify the agent name.
*/
declare function detectAgent(): AgentInfo;
/**
* The detected agent information for the current execution context.
* This value is evaluated once at module initialisation.
*/
declare const agentInfo: AgentInfo;
/**
* Name of the detected agent.
*/
declare const agent: AgentName | undefined;
/**
* A boolean flag indicating whether the current environment is running inside an AI coding agent.
*/
declare const isAgent: boolean;
//#endregion
//#region src/env.d.ts
/**
* Runtime-agnostic reference to environment variables.
*
* Resolves to `globalThis.process.env` when available, otherwise an empty object.
*/
declare const env: Record<string, string | undefined>;
/**
* Runtime-agnostic reference to the `process` global.
*
* Resolves to `globalThis.process` when available, otherwise a minimal shim containing only `env`.
*/
declare const process: Partial<typeof globalThis.process>;
/**
* Current value of the `NODE_ENV` environment variable (or static value if replaced during build).
*
* If `NODE_ENV` is not set, this will be undefined.
*/
declare const nodeENV: string | undefined;
//#endregion
//#region src/flags.d.ts
/** Value of process.platform */
declare const platform: string;
/** Detect if `CI` environment variable is set or a provider CI detected */
declare const isCI: boolean;
/** Detect if stdout.TTY is available */
declare const hasTTY: boolean;
/** Detect if global `window` object is available */
declare const hasWindow: boolean;
/** Detect if `DEBUG` environment variable is set */
declare const isDebug: boolean;
/** Detect if `NODE_ENV` environment variable is `test` or `TEST` environment variable is set */
declare const isTest: boolean;
/** Detect if `NODE_ENV` or `MODE` environment variable is `production` */
declare const isProduction: boolean;
/** Detect if `NODE_ENV` environment variable is `dev` or `development`, or if `MODE` environment variable is `development` */
declare const isDevelopment: boolean;
/** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */
declare const isMinimal: boolean;
/** Detect if process.platform is Windows */
declare const isWindows: boolean;
/** Detect if process.platform is Linux */
declare const isLinux: boolean;
/** Detect if process.platform is macOS (darwin kernel) */
declare const isMacOS: boolean;
/** Detect if terminal color output is supported based on `NO_COLOR`, `FORCE_COLOR`, TTY, and CI environment */
declare const isColorSupported: boolean;
/** Node.js version string (e.g. `"20.11.0"`), or `null` if not running in Node.js */
declare const nodeVersion: string | null;
/** Node.js major version number (e.g. `20`), or `null` if not running in Node.js */
declare const nodeMajorVersion: number | null;
//#endregion
//#region src/providers.d.ts
/**
* Represents the name of a CI/CD or Deployment provider.
*/
type ProviderName = (string & {}) | "appveyor" | "aws_amplify" | "azure_pipelines" | "azure_static" | "appcircle" | "bamboo" | "bitbucket" | "bitrise" | "buddy" | "buildkite" | "circle" | "cirrus" | "cloudflare_pages" | "cloudflare_workers" | "google_cloudrun" | "google_cloudrun_job" | "codebuild" | "codefresh" | "drone" | "drone" | "dsari" | "github_actions" | "gitlab" | "gocd" | "layerci" | "hudson" | "jenkins" | "magnum" | "netlify" | "nevercode" | "render" | "sail" | "semaphore" | "screwdriver" | "shippable" | "solano" | "strider" | "teamcity" | "travis" | "vercel" | "appcenter" | "codesandbox" | "stackblitz" | "stormkit" | "cleavr" | "zeabur" | "codesphere" | "railway" | "deno-deploy" | "firebase_app_hosting" | "edgeone_pages";
/**
* Provides information about a CI/CD or Deployment provider, including its name and possibly other metadata.
*/
type ProviderInfo = {
/**
* The name of the CI/CD or Deployment provider. See {@link ProviderName} for possible values.
*/
name: ProviderName;
/**
* If is set to `true`, the environment is recognised as a CI/CD provider.
*/
ci?: boolean;
/**
* Arbitrary metadata associated with the provider.
*/
[meta: string]: any;
};
/**
* Detects the current CI/CD or Deployment provider from environment variables.
*/
declare function detectProvider(): ProviderInfo;
/**
* The detected provider information for the current execution context.
* This value is evaluated once at module initialisation.
*/
declare const providerInfo: ProviderInfo;
/**
* Name of the detected provider, defaults to an empty string if no provider is detected.
*/
declare const provider: ProviderName;
//#endregion
//#region src/runtimes.d.ts
/**
* Represents the name of a JavaScript runtime.
*
* @see https://runtime-keys.proposal.wintercg.org/
*/
type RuntimeName = (string & {}) | "workerd" | "deno" | "netlify" | "node" | "bun" | "edge-light" | "fastly";
type RuntimeInfo = {
/**
* The name of the detected runtime.
*/
name: RuntimeName;
};
/**
* Indicates if running in Node.js or a Node.js compatible runtime.
*
* **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.
*
* Use `runtime === "node"` if you need strict check for Node.js runtime.
*/
declare const isNode: boolean;
/**
* Indicates if running in Bun runtime.
*/
declare const isBun: boolean;
/**
* Indicates if running in Deno runtime.
*/
declare const isDeno: boolean;
/**
* Indicates if running in Fastly runtime.
*/
declare const isFastly: boolean;
/**
* Indicates if running in Netlify runtime.
*/
declare const isNetlify: boolean;
/**
* Indicates if running in EdgeLight (Vercel Edge) runtime.
*/
declare const isEdgeLight: boolean;
/**
* Indicates if running in Cloudflare Workers runtime.
*
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
*/
declare const isWorkerd: boolean;
/**
* Contains information about the detected runtime, if any.
*/
declare const runtimeInfo: RuntimeInfo | undefined;
/**
* A convenience constant that returns the name of the detected runtime,
* defaults to an empty string if no runtime is detected.
*/
declare const runtime: RuntimeName;
//#endregion
export { type AgentInfo, type AgentName, type ProviderInfo, type ProviderName, type RuntimeInfo, type RuntimeName, agent, agentInfo, detectAgent, detectProvider, env, hasTTY, hasWindow, isAgent, isBun, isCI, isColorSupported, isDebug, isDeno, isDevelopment, isEdgeLight, isFastly, isLinux, isMacOS, isMinimal, isNetlify, isNode, isProduction, isTest, isWindows, isWorkerd, nodeENV, nodeMajorVersion, nodeVersion, platform, process, provider, providerInfo, runtime, runtimeInfo };
@@ -0,0 +1,82 @@
{
"name": "@radix-ui/react-popover",
"version": "1.1.15",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"aria-hidden": "^1.2.4",
"react-remove-scroll": "^2.6.3",
"@radix-ui/primitive": "1.1.3",
"@radix-ui/react-compose-refs": "1.1.2",
"@radix-ui/react-dismissable-layer": "1.1.11",
"@radix-ui/react-focus-guards": "1.1.3",
"@radix-ui/react-focus-scope": "1.1.7",
"@radix-ui/react-id": "1.1.1",
"@radix-ui/react-context": "1.1.2",
"@radix-ui/react-presence": "1.1.5",
"@radix-ui/react-portal": "1.1.9",
"@radix-ui/react-popper": "1.2.8",
"@radix-ui/react-primitive": "2.1.3",
"@radix-ui/react-slot": "1.2.3",
"@radix-ui/react-use-controllable-state": "1.2.2"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,57 @@
# Installation
> `npm install --save @types/deep-eql`
# Summary
This package contains type definitions for deep-eql (https://github.com/chaijs/deep-eql).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/deep-eql.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/deep-eql/index.d.ts)
````ts
declare namespace deepEqual {
/**
* Memoization class used to speed up comparison.
*/
class MemoizeMap extends WeakMap<object, MemoizeMap | boolean> {}
interface DeepEqualOptions<T1 = unknown, T2 = unknown> {
/**
* Override default algorithm, determining custom equality.
*/
comparator?: (leftHandOperand: T1, rightHandOperand: T2) => boolean | null;
/**
* Provide a custom memoization object which will cache the results of
* complex objects for a speed boost.
*
* By passing `false` you can disable memoization, but this will cause circular
* references to blow the stack.
*/
memoize?: MemoizeMap | false;
}
}
/**
* Assert deeply nested sameValue equality between two objects of any type.
*
* @param leftHandOperand
* @param rightHandOperand
* @param [options] Additional options
* @return equal match
*/
declare function deepEqual<T1, T2>(
leftHandOperand: T1,
rightHandOperand: T2,
options?: deepEqual.DeepEqualOptions<T1, T2>,
): boolean;
export = deepEqual;
````
### Additional Details
* Last updated: Mon, 06 Nov 2023 22:41:05 GMT
* Dependencies: none
# Credits
These definitions were written by [Rodrigo Pietnechuk](https://github.com/ghnoob).
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleDotDashed = createLucideIcon("CircleDotDashed", [
["path", { d: "M10.1 2.18a9.93 9.93 0 0 1 3.8 0", key: "1qdqn0" }],
["path", { d: "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7", key: "1bq7p6" }],
["path", { d: "M21.82 10.1a9.93 9.93 0 0 1 0 3.8", key: "1rlaqf" }],
["path", { d: "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69", key: "1xk03u" }],
["path", { d: "M13.9 21.82a9.94 9.94 0 0 1-3.8 0", key: "l7re25" }],
["path", { d: "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7", key: "1v18p6" }],
["path", { d: "M2.18 13.9a9.93 9.93 0 0 1 0-3.8", key: "xdo6bj" }],
["path", { d: "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69", key: "1jjmaz" }],
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
]);
export { CircleDotDashed as default };
//# sourceMappingURL=circle-dot-dashed.js.map
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Plug2 = createLucideIcon("Plug2", [
["path", { d: "M9 2v6", key: "17ngun" }],
["path", { d: "M15 2v6", key: "s7yy2p" }],
["path", { d: "M12 17v5", key: "bb1du9" }],
["path", { d: "M5 8h14", key: "pcz4l3" }],
["path", { d: "M6 11V8h12v3a6 6 0 1 1-12 0Z", key: "wtfw2c" }]
]);
export { Plug2 as default };
//# sourceMappingURL=plug-2.js.map
@@ -0,0 +1 @@
{"version":3,"file":"file-heart.js","sources":["../../../src/icons/file-heart.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileHeart\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2MiIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNMTAuMjkgMTAuN2EyLjQzIDIuNDMgMCAwIDAtMi42Ni0uNTJjLS4yOS4xMi0uNTYuMy0uNzguNTNsLS4zNS4zNC0uMzUtLjM0YTIuNDMgMi40MyAwIDAgMC0yLjY1LS41M2MtLjMuMTItLjU2LjMtLjc5LjUzLS45NS45NC0xIDIuNTMuMiAzLjc0TDYuNSAxOGwzLjYtMy41NWMxLjItMS4yMSAxLjE0LTIuOC4xOS0zLjc0WiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-heart\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileHeart = createLucideIcon('FileHeart', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2', key: '17k7jt' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n [\n 'path',\n {\n d: 'M10.29 10.7a2.43 2.43 0 0 0-2.66-.52c-.29.12-.56.3-.78.53l-.35.34-.35-.34a2.43 2.43 0 0 0-2.65-.53c-.3.12-.56.3-.79.53-.95.94-1 2.53.2 3.74L6.5 18l3.6-3.55c1.2-1.21 1.14-2.8.19-3.74Z',\n key: '1c1fso',\n },\n ],\n]);\n\nexport default FileHeart;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,5 @@
import { isNode } from 'detect-node-es';
export const env = {
isNode,
forceCache: false,
};
@@ -0,0 +1,170 @@
/**
* @fileoverview Globals for ecmaVersion/sourceType
* @author Nicholas C. Zakas
*/
"use strict";
//-----------------------------------------------------------------------------
// Globals
//-----------------------------------------------------------------------------
const commonjs = {
exports: true,
global: false,
module: false,
require: false,
};
const es3 = {
Array: false,
Boolean: false,
constructor: false,
Date: false,
decodeURI: false,
decodeURIComponent: false,
encodeURI: false,
encodeURIComponent: false,
Error: false,
escape: false,
eval: false,
EvalError: false,
Function: false,
hasOwnProperty: false,
Infinity: false,
isFinite: false,
isNaN: false,
isPrototypeOf: false,
Math: false,
NaN: false,
Number: false,
Object: false,
parseFloat: false,
parseInt: false,
propertyIsEnumerable: false,
RangeError: false,
ReferenceError: false,
RegExp: false,
String: false,
SyntaxError: false,
toLocaleString: false,
toString: false,
TypeError: false,
undefined: false,
unescape: false,
URIError: false,
valueOf: false,
};
const es5 = {
...es3,
JSON: false,
};
const es2015 = {
...es5,
ArrayBuffer: false,
DataView: false,
Float32Array: false,
Float64Array: false,
Int16Array: false,
Int32Array: false,
Int8Array: false,
Intl: false,
Map: false,
Promise: false,
Proxy: false,
Reflect: false,
Set: false,
Symbol: false,
Uint16Array: false,
Uint32Array: false,
Uint8Array: false,
Uint8ClampedArray: false,
WeakMap: false,
WeakSet: false,
};
// no new globals in ES2016
const es2016 = {
...es2015,
};
const es2017 = {
...es2016,
Atomics: false,
SharedArrayBuffer: false,
};
// no new globals in ES2018
const es2018 = {
...es2017,
};
// no new globals in ES2019
const es2019 = {
...es2018,
};
const es2020 = {
...es2019,
BigInt: false,
BigInt64Array: false,
BigUint64Array: false,
globalThis: false,
};
const es2021 = {
...es2020,
AggregateError: false,
FinalizationRegistry: false,
WeakRef: false,
};
const es2022 = {
...es2021,
};
const es2023 = {
...es2022,
};
const es2024 = {
...es2023,
};
const es2025 = {
...es2024,
Float16Array: false,
Iterator: false,
};
const es2026 = {
...es2025,
AsyncDisposableStack: false,
DisposableStack: false,
SuppressedError: false,
Temporal: false,
};
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
module.exports = {
commonjs,
es3,
es5,
es2015,
es2016,
es2017,
es2018,
es2019,
es2020,
es2021,
es2022,
es2023,
es2024,
es2025,
es2026,
};
@@ -0,0 +1,9 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}