docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

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 @@
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/header.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAM9D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAA;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IAIZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,qBAAa,MAAO,YAAW,UAAU;;IACvC,UAAU,EAAE,OAAO,CAAQ;IAC3B,OAAO,EAAE,OAAO,CAAQ;IACxB,SAAS,EAAE,OAAO,CAAQ;IAE1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAI;IAClB,MAAM,EAAE,MAAM,CAAI;IAClB,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IAEZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;gBAGd,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,EAC1B,GAAG,GAAE,MAAU,EACf,EAAE,CAAC,EAAE,UAAU,EACf,GAAG,CAAC,EAAE,UAAU;IASlB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,UAAU;IA+IlE,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAU;IAiEpC,IAAI,IAAI,IAAI,aAAa,CAKxB;IAED,IAAI,OAAO,IAAI,aAAa,GAAG,aAAa,CAE3C;IAED,IAAI,IAAI,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,aAAa,EAS3D;CACF"}
@@ -0,0 +1 @@
{"version":3,"file":"dice-4.js","sources":["../../../src/icons/dice-4.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dice4\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNMTYgOGguMDEiIC8+CiAgPHBhdGggZD0iTTggOGguMDEiIC8+CiAgPHBhdGggZD0iTTggMTZoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xNiAxNmguMDEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/dice-4\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 Dice4 = createLucideIcon('Dice4', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['path', { d: 'M16 8h.01', key: 'cr5u4v' }],\n ['path', { d: 'M8 8h.01', key: '1e4136' }],\n ['path', { d: 'M8 16h.01', key: '18s6g9' }],\n ['path', { d: 'M16 16h.01', key: '1f9h7w' }],\n]);\n\nexport default Dice4;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,C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A,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,71 @@
declare const _default: {
parserOptions: {
program: null;
project: false;
projectService: false;
};
rules: {
'@typescript-eslint/await-thenable': "off";
'@typescript-eslint/consistent-return': "off";
'@typescript-eslint/consistent-type-exports': "off";
'@typescript-eslint/dot-notation': "off";
'@typescript-eslint/naming-convention': "off";
'@typescript-eslint/no-array-delete': "off";
'@typescript-eslint/no-base-to-string': "off";
'@typescript-eslint/no-confusing-void-expression': "off";
'@typescript-eslint/no-deprecated': "off";
'@typescript-eslint/no-duplicate-type-constituents': "off";
'@typescript-eslint/no-floating-promises': "off";
'@typescript-eslint/no-for-in-array': "off";
'@typescript-eslint/no-implied-eval': "off";
'@typescript-eslint/no-meaningless-void-operator': "off";
'@typescript-eslint/no-misused-promises': "off";
'@typescript-eslint/no-misused-spread': "off";
'@typescript-eslint/no-mixed-enums': "off";
'@typescript-eslint/no-redundant-type-constituents': "off";
'@typescript-eslint/no-unnecessary-boolean-literal-compare': "off";
'@typescript-eslint/no-unnecessary-condition': "off";
'@typescript-eslint/no-unnecessary-qualifier': "off";
'@typescript-eslint/no-unnecessary-template-expression': "off";
'@typescript-eslint/no-unnecessary-type-arguments': "off";
'@typescript-eslint/no-unnecessary-type-assertion': "off";
'@typescript-eslint/no-unnecessary-type-conversion': "off";
'@typescript-eslint/no-unnecessary-type-parameters': "off";
'@typescript-eslint/no-unsafe-argument': "off";
'@typescript-eslint/no-unsafe-assignment': "off";
'@typescript-eslint/no-unsafe-call': "off";
'@typescript-eslint/no-unsafe-enum-comparison': "off";
'@typescript-eslint/no-unsafe-member-access': "off";
'@typescript-eslint/no-unsafe-return': "off";
'@typescript-eslint/no-unsafe-type-assertion': "off";
'@typescript-eslint/no-unsafe-unary-minus': "off";
'@typescript-eslint/no-useless-default-assignment': "off";
'@typescript-eslint/non-nullable-type-assertion-style': "off";
'@typescript-eslint/only-throw-error': "off";
'@typescript-eslint/prefer-destructuring': "off";
'@typescript-eslint/prefer-find': "off";
'@typescript-eslint/prefer-includes': "off";
'@typescript-eslint/prefer-nullish-coalescing': "off";
'@typescript-eslint/prefer-optional-chain': "off";
'@typescript-eslint/prefer-promise-reject-errors': "off";
'@typescript-eslint/prefer-readonly': "off";
'@typescript-eslint/prefer-readonly-parameter-types': "off";
'@typescript-eslint/prefer-reduce-type-parameter': "off";
'@typescript-eslint/prefer-regexp-exec': "off";
'@typescript-eslint/prefer-return-this-type': "off";
'@typescript-eslint/prefer-string-starts-ends-with': "off";
'@typescript-eslint/promise-function-async': "off";
'@typescript-eslint/related-getter-setter-pairs': "off";
'@typescript-eslint/require-array-sort-compare': "off";
'@typescript-eslint/require-await': "off";
'@typescript-eslint/restrict-plus-operands': "off";
'@typescript-eslint/restrict-template-expressions': "off";
'@typescript-eslint/return-await': "off";
'@typescript-eslint/strict-boolean-expressions': "off";
'@typescript-eslint/strict-void-return': "off";
'@typescript-eslint/switch-exhaustiveness-check': "off";
'@typescript-eslint/unbound-method': "off";
'@typescript-eslint/use-unknown-in-catch-callback-variable': "off";
};
};
export = _default;
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-10.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,22 @@
"use strict";
const MS_IN_SECOND = 1e3;
const MS_IN_MINUTE = 6e4;
const MS_IN_HOUR = 36e5;
const MS_IN_DAY = 864e5;
const rangeOfUnits = [
"time",
"year",
"month",
"date",
"day",
"hour",
"minute",
"second",
"millisecond",
"utcOffset"
];
exports.MS_IN_DAY = MS_IN_DAY;
exports.MS_IN_HOUR = MS_IN_HOUR;
exports.MS_IN_MINUTE = MS_IN_MINUTE;
exports.MS_IN_SECOND = MS_IN_SECOND;
exports.rangeOfUnits = rangeOfUnits;
@@ -0,0 +1,113 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.GREATEST_LOWER_BOUND = 1;
exports.LEAST_UPPER_BOUND = 2;
/**
* Recursive implementation of binary search.
*
* @param aLow Indices here and lower do not contain the needle.
* @param aHigh Indices here and higher do not contain the needle.
* @param aNeedle The element being searched for.
* @param aHaystack The non-empty array being searched.
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
*/
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
// This function terminates when one of the following is true:
//
// 1. We find the exact element we are looking for.
//
// 2. We did not find the exact element, but we can return the index of
// the next-closest element.
//
// 3. We did not find the exact element, and there is no next-closest
// element than the one we are searching for, so we return -1.
const mid = Math.floor((aHigh - aLow) / 2) + aLow;
const cmp = aCompare(aNeedle, aHaystack[mid], true);
if (cmp === 0) {
// Found the element we are looking for.
return mid;
} else if (cmp > 0) {
// Our needle is greater than aHaystack[mid].
if (aHigh - mid > 1) {
// The element is in the upper half.
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
}
// The exact needle element was not found in this haystack. Determine if
// we are in termination case (3) or (2) and return the appropriate thing.
if (aBias === exports.LEAST_UPPER_BOUND) {
return aHigh < aHaystack.length ? aHigh : -1;
}
return mid;
}
// Our needle is less than aHaystack[mid].
if (mid - aLow > 1) {
// The element is in the lower half.
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
}
// we are in termination case (3) or (2) and return the appropriate thing.
if (aBias == exports.LEAST_UPPER_BOUND) {
return mid;
}
return aLow < 0 ? -1 : aLow;
}
/**
* This is an implementation of binary search which will always try and return
* the index of the closest element if there is no exact hit. This is because
* mappings between original and generated line/col pairs are single points,
* and there is an implicit region between each of them, so a miss just means
* that you aren't on the very start of a region.
*
* @param aNeedle The element you are looking for.
* @param aHaystack The array that is being searched.
* @param aCompare A function which takes the needle and an element in the
* array and returns -1, 0, or 1 depending on whether the needle is less
* than, equal to, or greater than the element, respectively.
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
*/
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
if (aHaystack.length === 0) {
return -1;
}
let index = recursiveSearch(
-1,
aHaystack.length,
aNeedle,
aHaystack,
aCompare,
aBias || exports.GREATEST_LOWER_BOUND
);
if (index < 0) {
return -1;
}
// We have found either the exact element, or the next-closest element to
// the one we are searching for. However, there may be more than one such
// element. Make sure we always return the smallest of these.
while (index - 1 >= 0) {
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
break;
}
--index;
}
return index;
};
@@ -0,0 +1,8 @@
import { ZodIntersectionDef } from "zod/v3";
import { JsonSchema7Type } from "../parseTypes.js";
import { Refs } from "../Refs.js";
export type JsonSchema7AllOfType = {
allOf: JsonSchema7Type[];
unevaluatedProperties?: boolean;
};
export declare function parseIntersectionDef(def: ZodIntersectionDef, refs: Refs): JsonSchema7AllOfType | JsonSchema7Type | undefined;
@@ -0,0 +1,20 @@
/**
* @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 FlipHorizontal = createLucideIcon("FlipHorizontal", [
["path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3", key: "1i73f7" }],
["path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3", key: "saxlbk" }],
["path", { d: "M12 20v2", key: "1lh1kg" }],
["path", { d: "M12 14v2", key: "8jcxud" }],
["path", { d: "M12 8v2", key: "1woqiv" }],
["path", { d: "M12 2v2", key: "tus03m" }]
]);
export { FlipHorizontal as default };
//# sourceMappingURL=flip-horizontal.js.map
@@ -0,0 +1 @@
{"version":3,"file":"stdio.d.mts","names":[],"sources":["../src/client/stdio.ts"],"sourcesContent":[],"mappings":";;;;;KASY,qBAAA;;AAAZ;;EAuBa,OAAA,EAAA,MAAA;EAAS;;AAqBtB;EA4BgB,IAAA,CAAA,EAAA,MAAA,EAAA;EAyBH;;;;;EAsFK,GAAA,CAAA,EAvKR,MAuKQ,CAAA,MAAA,EAAA,MAAA,CAAA;EAuFC;;;;;WAvPN,SAAS;;;;;;;;;;;;;;;;;;cAqBT;;;;iBA4BG,qBAAA,CAAA,GAAyB;;;;;;cAyB5B,oBAAA,YAAgC;;;;;;oBAOvB;wBACI;sBAEF;;;;WAWL;;;;;;;;gBAiED;;;;;;;;;;;;;;;;;WAuFC;gBAyCD,iBAAiB"}
@@ -0,0 +1,22 @@
/**
* @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 ShieldHalf = createLucideIcon("ShieldHalf", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "M12 22V2", key: "zs6s6o" }]
]);
export { ShieldHalf as default };
//# sourceMappingURL=shield-half.js.map
@@ -0,0 +1,66 @@
import { html } from "../html/index.js";
//#region src/helper/ssg/plugins.ts
/**
* The default plugin that defines the recommended behavior.
*
* @experimental
* `defaultPlugin` is an experimental feature.
* The API might be changed.
*/
const defaultPlugin = () => {
return { afterResponseHook: (res) => {
if (res.status !== 200) return false;
return res;
} };
};
const REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([
301,
302,
303,
307,
308
]);
const generateRedirectHtml = (location) => {
return html`<!DOCTYPE html>
<title>Redirecting to: ${location}</title>
<meta http-equiv="refresh" content="0;url=${location}" />
<meta name="robots" content="noindex" />
<link rel="canonical" href="${location}" />
<body>
<a href="${location}">Redirecting to <code>${location}</code></a>
</body>
`.toString().replace(/\n/g, "");
};
/**
* The redirect plugin that generates HTML redirect pages for HTTP redirect responses for status codes 301, 302, 303, 307 and 308.
*
* When used with `defaultPlugin`, place `redirectPlugin` before it, because `defaultPlugin` skips non-200 responses.
*
* ```ts
* // ✅ Will work as expected
* toSSG(app, fs, { plugins: [redirectPlugin(), defaultPlugin()] })
*
* // ❌ Will not work as expected
* toSSG(app, fs, { plugins: [defaultPlugin(), redirectPlugin()] })
* ```
*
* @experimental
* `redirectPlugin` is an experimental feature.
* The API might be changed.
*/
const redirectPlugin = () => {
return { afterResponseHook: (res) => {
if (REDIRECT_STATUS_CODES.has(res.status)) {
const location = res.headers.get("Location");
if (!location) return false;
const htmlBody = generateRedirectHtml(location);
return new Response(htmlBody, {
status: 200,
headers: { "Content-Type": "text/html; charset=utf-8" }
});
}
return res;
} };
};
//#endregion
export { defaultPlugin, redirectPlugin };
@@ -0,0 +1 @@
{"version":3,"file":"shimsWorkerd.mjs","names":[],"sources":["../src/shimsWorkerd.ts"],"sourcesContent":["/**\n * Cloudflare Workers runtime shims for client package\n *\n * This file is selected via package.json export conditions when running in workerd.\n */\nimport { preloadSchemas } from '@modelcontextprotocol/core-internal';\n\nexport { CfWorkerJsonSchemaValidator as DefaultJsonSchemaValidator } from '@modelcontextprotocol/core-internal/validators/cfWorker';\n\n// Platform asymmetry: isolate platforms like workerd evaluate module scope\n// during deployment/isolate warm-up, outside any request's billed CPU, while\n// lazy construction would land inside the first request each fresh isolate\n// serves. Node and browser shims stay lazy — there, module evaluation is\n// process/page startup and boot latency is the cost that matters.\npreloadSchemas();\n\n/**\n * Whether `fetch()` may throw `TypeError` due to CORS. CORS is a browser-only concept —\n * in Cloudflare Workers, a `TypeError` from `fetch` is always a real network/configuration\n * error, never a CORS error.\n */\nexport const CORS_IS_POSSIBLE = false;\n"],"mappings":";;;;;;;;;AAcA,gBAAgB;;;;;;AAOhB,MAAa,mBAAmB"}
@@ -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 Music = createLucideIcon("Music", [
["path", { d: "M9 18V5l12-2v13", key: "1jmyc2" }],
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
["circle", { cx: "18", cy: "16", r: "3", key: "1hluhg" }]
]);
export { Music as default };
//# sourceMappingURL=music.js.map
@@ -0,0 +1,13 @@
'use strict';
var test = require('tape');
var stringify = require('../');
test('custom comparison function', function (t) {
t.plan(1);
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
return a.key < b.key ? 1 : -1;
});
t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}');
});
@@ -0,0 +1,604 @@
/**
* @fileoverview A class to track messages reported by the linter for a file.
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const assert = require("../shared/assert");
const { RuleFixer } = require("./rule-fixer");
const { interpolate } = require("./interpolate");
const ruleReplacements = require("../../conf/replacements.json");
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../types").Linter.LintSuggestion} SuggestionResult */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */
/**
* An error message description
* @typedef {Object} MessageDescriptor
* @property {ASTNode} [node] The reported node
* @property {Location} loc The location of the problem.
* @property {string} message The problem message.
* @property {Object} [data] Optional data to use to fill in placeholders in the
* message.
* @property {Function} [fix] The function to call that creates a fix command.
* @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes.
*/
/**
* @typedef {Object} LintProblem
* @property {string} ruleId The rule ID that reported the problem.
* @property {string} message The problem message.
* @property {SourceLocation} loc The location of the problem.
*/
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const DEFAULT_ERROR_LOC = {
start: { line: 1, column: 0 },
end: { line: 1, column: 1 },
};
/**
* Updates a given location based on the language offsets. This allows us to
* change 0-based locations to 1-based locations. We always want ESLint
* reporting lines and columns starting from 1.
* @todo Potentially this should be moved into a shared utility file.
* @param {Object} location The location to update.
* @param {number} location.line The starting line number.
* @param {number} location.column The starting column number.
* @param {number} [location.endLine] The ending line number.
* @param {number} [location.endColumn] The ending column number.
* @param {Language} language The language to use to adjust the location information.
* @returns {Object} The updated location.
*/
function updateLocationInformation(
{ line, column, endLine, endColumn },
language,
) {
const columnOffset = language.columnStart === 1 ? 0 : 1;
const lineOffset = language.lineStart === 1 ? 0 : 1;
// calculate separately to account for undefined
const finalEndLine = endLine === void 0 ? endLine : endLine + lineOffset;
const finalEndColumn =
endColumn === void 0 ? endColumn : endColumn + columnOffset;
return {
line: line + lineOffset,
column: column + columnOffset,
endLine: finalEndLine,
endColumn: finalEndColumn,
};
}
/**
* creates a missing-rule message.
* @param {string} ruleId the ruleId to create
* @returns {string} created error message
* @private
*/
function createMissingRuleMessage(ruleId) {
return Object.hasOwn(ruleReplacements.rules, ruleId)
? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}`
: `Definition for rule '${ruleId}' was not found.`;
}
/**
* creates a linting problem
* @param {LintProblem} options to create linting error
* @param {RuleSeverity} severity the error message to report
* @param {Language} language the language to use to adjust the location information.
* @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId.
* @private
*/
function createLintingProblem(options, severity, language) {
const {
ruleId = null,
loc = DEFAULT_ERROR_LOC,
message = createMissingRuleMessage(options.ruleId),
} = options;
return {
ruleId,
message,
...updateLocationInformation(
{
line: loc.start.line,
column: loc.start.column,
endLine: loc.end.line,
endColumn: loc.end.column,
},
language,
),
severity,
};
}
/**
* Translates a multi-argument context.report() call into a single object argument call
* @param {...*} args A list of arguments passed to `context.report`
* @returns {MessageDescriptor} A normalized object containing report information
*/
function normalizeMultiArgReportCall(...args) {
// If there is one argument, it is considered to be a new-style call already.
if (args.length === 1) {
// Shallow clone the object to avoid surprises if reusing the descriptor
return Object.assign({}, args[0]);
}
// If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
if (typeof args[1] === "string") {
return {
node: args[0],
message: args[1],
data: args[2],
fix: args[3],
};
}
// Otherwise, the arguments are interpreted as [node, loc, message, data, fix].
return {
node: args[0],
loc: args[1],
message: args[2],
data: args[3],
fix: args[4],
};
}
/**
* Asserts that either a loc or a node was provided, and the node is valid if it was provided.
* @param {MessageDescriptor} descriptor A descriptor to validate
* @returns {void}
* @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object
*/
function assertValidNodeInfo(descriptor) {
if (descriptor.node) {
assert(typeof descriptor.node === "object", "Node must be an object");
} else {
assert(
descriptor.loc,
"Node must be provided when reporting error if location is not provided",
);
}
}
/**
* Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties
* @param {MessageDescriptor} descriptor A descriptor for the report from a rule.
* @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties
* from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor.
*/
function normalizeReportLoc(descriptor) {
if (descriptor.loc.start) {
return descriptor.loc;
}
return { start: descriptor.loc, end: null };
}
/**
* Clones the given fix object.
* @param {Fix|null} fix The fix to clone.
* @returns {Fix|null} Deep cloned fix object or `null` if `null` or `undefined` was passed in.
*/
function cloneFix(fix) {
if (!fix) {
return null;
}
return {
range: [fix.range[0], fix.range[1]],
text: fix.text,
};
}
/**
* Check that a fix has a valid range.
* @param {Fix|null} fix The fix to validate.
* @returns {void}
*/
function assertValidFix(fix) {
if (fix) {
assert(
fix.range &&
typeof fix.range[0] === "number" &&
typeof fix.range[1] === "number",
`Fix has invalid range: ${JSON.stringify(fix, null, 2)}`,
);
}
}
/**
* Compares items in a fixes array by range.
* @param {Fix} a The first message.
* @param {Fix} b The second message.
* @returns {number} -1 if a comes before b, 1 if a comes after b, 0 if equal.
* @private
*/
function compareFixesByRange(a, b) {
return a.range[0] - b.range[0] || a.range[1] - b.range[1];
}
/**
* Merges the given fixes array into one.
* @param {Fix[]} fixes The fixes to merge.
* @param {SourceCode} sourceCode The source code object to get the text between fixes.
* @returns {{text: string, range: number[]}} The merged fixes
*/
function mergeFixes(fixes, sourceCode) {
for (const fix of fixes) {
assertValidFix(fix);
}
if (fixes.length === 0) {
return null;
}
if (fixes.length === 1) {
return cloneFix(fixes[0]);
}
fixes.sort(compareFixesByRange);
const originalText = sourceCode.text;
const start = fixes[0].range[0];
const end = fixes.at(-1).range[1];
let text = "";
let lastPos = Number.MIN_SAFE_INTEGER;
for (const fix of fixes) {
assert(
fix.range[0] >= lastPos,
"Fix objects must not be overlapped in a report.",
);
if (fix.range[0] >= 0) {
text += originalText.slice(
Math.max(0, start, lastPos),
fix.range[0],
);
}
text += fix.text;
lastPos = fix.range[1];
}
text += originalText.slice(Math.max(0, start, lastPos), end);
return { range: [start, end], text };
}
/**
* Gets one fix object from the given descriptor.
* If the descriptor retrieves multiple fixes, this merges those to one.
* @param {MessageDescriptor} descriptor The report descriptor.
* @param {SourceCode} sourceCode The source code object to get text between fixes.
* @returns {({text: string, range: number[]}|null)} The fix for the descriptor
*/
function normalizeFixes(descriptor, sourceCode) {
if (typeof descriptor.fix !== "function") {
return null;
}
const ruleFixer = new RuleFixer({ sourceCode });
// @type {null | Fix | Fix[] | IterableIterator<Fix>}
const fix = descriptor.fix(ruleFixer);
// Merge to one.
if (fix && Symbol.iterator in fix) {
return mergeFixes(Array.from(fix), sourceCode);
}
assertValidFix(fix);
return cloneFix(fix);
}
/**
* Gets an array of suggestion objects from the given descriptor.
* @param {MessageDescriptor} descriptor The report descriptor.
* @param {SourceCode} sourceCode The source code object to get text between fixes.
* @param {Object} messages Object of meta messages for the rule.
* @returns {Array<SuggestionResult>} The suggestions for the descriptor
*/
function mapSuggestions(descriptor, sourceCode, messages) {
if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) {
return [];
}
return (
descriptor.suggest
.map(suggestInfo => {
const computedDesc =
suggestInfo.desc || messages[suggestInfo.messageId];
return {
...suggestInfo,
desc: interpolate(computedDesc, suggestInfo.data),
fix: normalizeFixes(suggestInfo, sourceCode),
};
})
// Remove suggestions that didn't provide a fix
.filter(({ fix }) => fix)
);
}
/**
* Creates information about the report from a descriptor
* @param {Object} options Information about the problem
* @param {string} options.ruleId Rule ID
* @param {(0|1|2)} options.severity Rule severity
* @param {string} options.message Error message
* @param {string} [options.messageId] The error message ID.
* @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location
* @param {{text: string, range: (number[]|null)}} options.fix The fix object
* @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects
* @param {Language} [options.language] The language to use to adjust line and column offsets.
* @returns {LintMessage} Information about the report
*/
function createProblem(options) {
const { language } = options;
// calculate offsets based on the language in use
const columnOffset = language.columnStart === 1 ? 0 : 1;
const lineOffset = language.lineStart === 1 ? 0 : 1;
const problem = {
ruleId: options.ruleId,
severity: options.severity,
message: options.message,
line: options.loc.start.line + lineOffset,
column: options.loc.start.column + columnOffset,
};
/*
* If this isn’t in the conditional, some of the tests fail
* because `messageId` is present in the problem object
*/
if (options.messageId) {
problem.messageId = options.messageId;
}
if (options.loc.end) {
problem.endLine = options.loc.end.line + lineOffset;
problem.endColumn = options.loc.end.column + columnOffset;
}
if (options.fix) {
problem.fix = options.fix;
}
if (options.suggestions && options.suggestions.length > 0) {
problem.suggestions = options.suggestions;
}
return problem;
}
/**
* Validates that suggestions are properly defined. Throws if an error is detected.
* @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data.
* @param {Object} messages Object of meta messages for the rule.
* @returns {void}
*/
function validateSuggestions(suggest, messages) {
if (suggest && Array.isArray(suggest)) {
suggest.forEach(suggestion => {
if (suggestion.messageId) {
const { messageId } = suggestion;
if (!messages) {
throw new TypeError(
`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`,
);
}
if (!messages[messageId]) {
throw new TypeError(
`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`,
);
}
if (suggestion.desc) {
throw new TypeError(
"context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one.",
);
}
} else if (!suggestion.desc) {
throw new TypeError(
"context.report() called with a suggest option that doesn't have either a `desc` or `messageId`",
);
}
if (typeof suggestion.fix !== "function") {
throw new TypeError(
`context.report() called with a suggest option without a fix function. See: ${JSON.stringify(suggestion, null, 2)}`,
);
}
});
}
}
/**
* Computes the message from a report descriptor.
* @param {MessageDescriptor} descriptor The report descriptor.
* @param {Object} messages Object of meta messages for the rule.
* @returns {string} The computed message.
* @throws {TypeError} If messageId is not found or both message and messageId are provided.
*/
function computeMessageFromDescriptor(descriptor, messages) {
if (descriptor.messageId) {
if (!messages) {
throw new TypeError(
"context.report() called with a messageId, but no messages were present in the rule metadata.",
);
}
const id = descriptor.messageId;
if (descriptor.message) {
throw new TypeError(
"context.report() called with a message and a messageId. Please only pass one.",
);
}
if (!messages || !Object.hasOwn(messages, id)) {
throw new TypeError(
`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`,
);
}
return messages[id];
}
if (descriptor.message) {
return descriptor.message;
}
throw new TypeError(
"Missing `message` property in report() call; add a message that describes the linting problem.",
);
}
/**
* A report object that contains the messages reported the linter
* for a file.
*/
class FileReport {
/**
* The messages reported by the linter for this file.
* @type {LintMessage[]}
*/
messages = [];
/**
* A rule mapper that maps rule IDs to their metadata.
* @type {(string) => RuleDefinition}
*/
#ruleMapper;
/**
* The source code object for the file.
* @type {SourceCode}
*/
#sourceCode;
/**
* The language to use to adjust line and column offsets.
* @type {Language}
*/
#language;
/**
* Whether to disable fixes for this report.
* @type {boolean}
*/
#disableFixes;
/**
* Creates a new FileReport instance.
* @param {Object} options The options for the file report
* @param {(string) => RuleDefinition} options.ruleMapper A rule mapper that maps rule IDs to their metadata.
* @param {SourceCode} options.sourceCode The source code object for the file.
* @param {Language} options.language The language to use to adjust line and column offsets.
* @param {boolean} [options.disableFixes=false] Whether to disable fixes for this report.
*/
constructor({ ruleMapper, sourceCode, language, disableFixes = false }) {
this.#ruleMapper = ruleMapper;
this.#sourceCode = sourceCode;
this.#language = language;
this.#disableFixes = disableFixes;
}
/**
* Adds a rule-generated message to the report.
* @param {string} ruleId The rule ID that reported the problem.
* @param {0|1|2} severity The severity of the problem (0 = off, 1 = warning, 2 = error).
* @param {...*} args The arguments passed to `context.report()`.
* @returns {LintMessage} The created message object.
* @throws {TypeError} If the messageId is not found or both message and messageId are provided.
* @throws {AssertionError} If the node is not an object or neither a node nor a loc is provided.
*/
addRuleMessage(ruleId, severity, ...args) {
const descriptor = normalizeMultiArgReportCall(...args);
const ruleDefinition = this.#ruleMapper(ruleId);
const messages = ruleDefinition?.meta?.messages;
assertValidNodeInfo(descriptor);
const computedMessage = computeMessageFromDescriptor(
descriptor,
messages,
);
validateSuggestions(descriptor.suggest, messages);
this.messages.push(
createProblem({
ruleId,
severity,
message: interpolate(computedMessage, descriptor.data),
messageId: descriptor.messageId,
loc: descriptor.loc
? normalizeReportLoc(descriptor)
: this.#sourceCode.getLoc(descriptor.node),
fix: this.#disableFixes
? null
: normalizeFixes(descriptor, this.#sourceCode),
suggestions: this.#disableFixes
? []
: mapSuggestions(descriptor, this.#sourceCode, messages),
language: this.#language,
}),
);
return this.messages.at(-1);
}
/**
* Adds an error message to the report. Meant to be called outside of rules.
* @param {LintProblem} descriptor The descriptor for the error message.
* @returns {LintMessage} The created message object.
*/
addError(descriptor) {
const message = createLintingProblem(descriptor, 2, this.#language);
this.messages.push(message);
return message;
}
/**
* Adds a fatal error message to the report. Meant to be called outside of rules.
* @param {LintProblem} descriptor The descriptor for the fatal error message.
* @returns {LintMessage} The created message object.
*/
addFatal(descriptor) {
const message = createLintingProblem(descriptor, 2, this.#language);
message.fatal = true;
this.messages.push(message);
return message;
}
/**
* Adds a warning message to the report. Meant to be called outside of rules.
* @param {LintProblem} descriptor The descriptor for the warning message.
* @returns {LintMessage} The created message object.
*/
addWarning(descriptor) {
const message = createLintingProblem(descriptor, 1, this.#language);
this.messages.push(message);
return message;
}
}
module.exports = {
FileReport,
updateLocationInformation,
};
@@ -0,0 +1,259 @@
'use strict';
const EventEmitter = require('events');
const JSONB = require('json-buffer');
const loadStore = options => {
const adapters = {
redis: '@keyv/redis',
rediss: '@keyv/redis',
mongodb: '@keyv/mongo',
mongo: '@keyv/mongo',
sqlite: '@keyv/sqlite',
postgresql: '@keyv/postgres',
postgres: '@keyv/postgres',
mysql: '@keyv/mysql',
etcd: '@keyv/etcd',
offline: '@keyv/offline',
tiered: '@keyv/tiered',
};
if (options.adapter || options.uri) {
const adapter = options.adapter || /^[^:+]*/.exec(options.uri)[0];
return new (require(adapters[adapter]))(options);
}
return new Map();
};
const iterableAdapters = [
'sqlite',
'postgres',
'mysql',
'mongo',
'redis',
'tiered',
];
class Keyv extends EventEmitter {
constructor(uri, {emitErrors = true, ...options} = {}) {
super();
this.opts = {
namespace: 'keyv',
serialize: JSONB.stringify,
deserialize: JSONB.parse,
...((typeof uri === 'string') ? {uri} : uri),
...options,
};
if (!this.opts.store) {
const adapterOptions = {...this.opts};
this.opts.store = loadStore(adapterOptions);
}
if (this.opts.compression) {
const compression = this.opts.compression;
this.opts.serialize = compression.serialize.bind(compression);
this.opts.deserialize = compression.deserialize.bind(compression);
}
if (typeof this.opts.store.on === 'function' && emitErrors) {
this.opts.store.on('error', error => this.emit('error', error));
}
this.opts.store.namespace = this.opts.namespace;
const generateIterator = iterator => async function * () {
for await (const [key, raw] of typeof iterator === 'function'
? iterator(this.opts.store.namespace)
: iterator) {
const data = await this.opts.deserialize(raw);
if (this.opts.store.namespace && !key.includes(this.opts.store.namespace)) {
continue;
}
if (typeof data.expires === 'number' && Date.now() > data.expires) {
this.delete(key);
continue;
}
yield [this._getKeyUnprefix(key), data.value];
}
};
// Attach iterators
if (typeof this.opts.store[Symbol.iterator] === 'function' && this.opts.store instanceof Map) {
this.iterator = generateIterator(this.opts.store);
} else if (typeof this.opts.store.iterator === 'function' && this.opts.store.opts
&& this._checkIterableAdaptar()) {
this.iterator = generateIterator(this.opts.store.iterator.bind(this.opts.store));
}
}
_checkIterableAdaptar() {
return iterableAdapters.includes(this.opts.store.opts.dialect)
|| iterableAdapters.findIndex(element => this.opts.store.opts.url.includes(element)) >= 0;
}
_getKeyPrefix(key) {
return `${this.opts.namespace}:${key}`;
}
_getKeyPrefixArray(keys) {
return keys.map(key => `${this.opts.namespace}:${key}`);
}
_getKeyUnprefix(key) {
return key
.split(':')
.splice(1)
.join(':');
}
get(key, options) {
const {store} = this.opts;
const isArray = Array.isArray(key);
const keyPrefixed = isArray ? this._getKeyPrefixArray(key) : this._getKeyPrefix(key);
if (isArray && store.getMany === undefined) {
const promises = [];
for (const key of keyPrefixed) {
promises.push(Promise.resolve()
.then(() => store.get(key))
.then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data))
.then(data => {
if (data === undefined || data === null) {
return undefined;
}
if (typeof data.expires === 'number' && Date.now() > data.expires) {
return this.delete(key).then(() => undefined);
}
return (options && options.raw) ? data : data.value;
}),
);
}
return Promise.allSettled(promises)
.then(values => {
const data = [];
for (const value of values) {
data.push(value.value);
}
return data;
});
}
return Promise.resolve()
.then(() => isArray ? store.getMany(keyPrefixed) : store.get(keyPrefixed))
.then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data))
.then(data => {
if (data === undefined || data === null) {
return undefined;
}
if (isArray) {
return data.map((row, index) => {
if ((typeof row === 'string')) {
row = this.opts.deserialize(row);
}
if (row === undefined || row === null) {
return undefined;
}
if (typeof row.expires === 'number' && Date.now() > row.expires) {
this.delete(key[index]).then(() => undefined);
return undefined;
}
return (options && options.raw) ? row : row.value;
});
}
if (typeof data.expires === 'number' && Date.now() > data.expires) {
return this.delete(key).then(() => undefined);
}
return (options && options.raw) ? data : data.value;
});
}
set(key, value, ttl) {
const keyPrefixed = this._getKeyPrefix(key);
if (typeof ttl === 'undefined') {
ttl = this.opts.ttl;
}
if (ttl === 0) {
ttl = undefined;
}
const {store} = this.opts;
return Promise.resolve()
.then(() => {
const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null;
if (typeof value === 'symbol') {
this.emit('error', 'symbol cannot be serialized');
}
value = {value, expires};
return this.opts.serialize(value);
})
.then(value => store.set(keyPrefixed, value, ttl))
.then(() => true);
}
delete(key) {
const {store} = this.opts;
if (Array.isArray(key)) {
const keyPrefixed = this._getKeyPrefixArray(key);
if (store.deleteMany === undefined) {
const promises = [];
for (const key of keyPrefixed) {
promises.push(store.delete(key));
}
return Promise.allSettled(promises)
.then(values => values.every(x => x.value === true));
}
return Promise.resolve()
.then(() => store.deleteMany(keyPrefixed));
}
const keyPrefixed = this._getKeyPrefix(key);
return Promise.resolve()
.then(() => store.delete(keyPrefixed));
}
clear() {
const {store} = this.opts;
return Promise.resolve()
.then(() => store.clear());
}
has(key) {
const keyPrefixed = this._getKeyPrefix(key);
const {store} = this.opts;
return Promise.resolve()
.then(async () => {
if (typeof store.has === 'function') {
return store.has(keyPrefixed);
}
const value = await store.get(keyPrefixed);
return value !== undefined;
});
}
disconnect() {
const {store} = this.opts;
if (typeof store.disconnect === 'function') {
return store.disconnect();
}
}
}
module.exports = Keyv;
@@ -0,0 +1,236 @@
/**
* Experimental task interfaces for MCP SDK.
* WARNING: These APIs are experimental and may change without notice.
*/
import { Task, RequestId, Result, JSONRPCRequest, JSONRPCNotification, JSONRPCResultResponse, JSONRPCErrorResponse, ServerRequest, ServerNotification, CallToolResult, GetTaskResult, ToolExecution, Request } from '../../types.js';
import { CreateTaskResult } from './types.js';
import type { RequestHandlerExtra, RequestTaskStore } from '../../shared/protocol.js';
import type { ZodRawShapeCompat, AnySchema, ShapeOutput } from '../../server/zod-compat.js';
/**
* Extended handler extra with task store for task creation.
* @experimental
*/
export interface CreateTaskRequestHandlerExtra extends RequestHandlerExtra<ServerRequest, ServerNotification> {
taskStore: RequestTaskStore;
}
/**
* Extended handler extra with task ID and store for task operations.
* @experimental
*/
export interface TaskRequestHandlerExtra extends RequestHandlerExtra<ServerRequest, ServerNotification> {
taskId: string;
taskStore: RequestTaskStore;
}
/**
* Base callback type for tool handlers.
* @experimental
*/
export type BaseToolCallback<SendResultT extends Result, ExtraT extends RequestHandlerExtra<ServerRequest, ServerNotification>, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = Args extends ZodRawShapeCompat ? (args: ShapeOutput<Args>, extra: ExtraT) => SendResultT | Promise<SendResultT> : Args extends AnySchema ? (args: unknown, extra: ExtraT) => SendResultT | Promise<SendResultT> : (extra: ExtraT) => SendResultT | Promise<SendResultT>;
/**
* Handler for creating a task.
* @experimental
*/
export type CreateTaskRequestHandler<SendResultT extends Result, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = BaseToolCallback<SendResultT, CreateTaskRequestHandlerExtra, Args>;
/**
* Handler for task operations (get, getResult).
* @experimental
*/
export type TaskRequestHandler<SendResultT extends Result, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = BaseToolCallback<SendResultT, TaskRequestHandlerExtra, Args>;
/**
* Interface for task-based tool handlers.
* @experimental
*/
export interface ToolTaskHandler<Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> {
createTask: CreateTaskRequestHandler<CreateTaskResult, Args>;
getTask: TaskRequestHandler<GetTaskResult, Args>;
getTaskResult: TaskRequestHandler<CallToolResult, Args>;
}
/**
* Task-specific execution configuration.
* taskSupport cannot be 'forbidden' for task-based tools.
* @experimental
*/
export type TaskToolExecution<TaskSupport = ToolExecution['taskSupport']> = Omit<ToolExecution, 'taskSupport'> & {
taskSupport: TaskSupport extends 'forbidden' | undefined ? never : TaskSupport;
};
/**
* Represents a message queued for side-channel delivery via tasks/result.
*
* This is a serializable data structure that can be stored in external systems.
* All fields are JSON-serializable.
*/
export type QueuedMessage = QueuedRequest | QueuedNotification | QueuedResponse | QueuedError;
export interface BaseQueuedMessage {
/** Type of message */
type: string;
/** When the message was queued (milliseconds since epoch) */
timestamp: number;
}
export interface QueuedRequest extends BaseQueuedMessage {
type: 'request';
/** The actual JSONRPC request */
message: JSONRPCRequest;
}
export interface QueuedNotification extends BaseQueuedMessage {
type: 'notification';
/** The actual JSONRPC notification */
message: JSONRPCNotification;
}
export interface QueuedResponse extends BaseQueuedMessage {
type: 'response';
/** The actual JSONRPC response */
message: JSONRPCResultResponse;
}
export interface QueuedError extends BaseQueuedMessage {
type: 'error';
/** The actual JSONRPC error */
message: JSONRPCErrorResponse;
}
/**
* Interface for managing per-task FIFO message queues.
*
* Similar to TaskStore, this allows pluggable queue implementations
* (in-memory, Redis, other distributed queues, etc.).
*
* Each method accepts taskId and optional sessionId parameters to enable
* a single queue instance to manage messages for multiple tasks, with
* isolation based on task ID and session ID.
*
* All methods are async to support external storage implementations.
* All data in QueuedMessage must be JSON-serializable.
*
* @experimental
*/
export interface TaskMessageQueue {
/**
* Adds a message to the end of the queue for a specific task.
* Atomically checks queue size and throws if maxSize would be exceeded.
* @param taskId The task identifier
* @param message The message to enqueue
* @param sessionId Optional session ID for binding the operation to a specific session
* @param maxSize Optional maximum queue size - if specified and queue is full, throws an error
* @throws Error if maxSize is specified and would be exceeded
*/
enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise<void>;
/**
* Removes and returns the first message from the queue for a specific task.
* @param taskId The task identifier
* @param sessionId Optional session ID for binding the query to a specific session
* @returns The first message, or undefined if the queue is empty
*/
dequeue(taskId: string, sessionId?: string): Promise<QueuedMessage | undefined>;
/**
* Removes and returns all messages from the queue for a specific task.
* Used when tasks are cancelled or failed to clean up pending messages.
* @param taskId The task identifier
* @param sessionId Optional session ID for binding the query to a specific session
* @returns Array of all messages that were in the queue
*/
dequeueAll(taskId: string, sessionId?: string): Promise<QueuedMessage[]>;
}
/**
* Task creation options.
* @experimental
*/
export interface CreateTaskOptions {
/**
* Time in milliseconds to keep task results available after completion.
* If null, the task has unlimited lifetime until manually cleaned up.
*/
ttl?: number | null;
/**
* Time in milliseconds to wait between task status requests.
*/
pollInterval?: number;
/**
* Additional context to pass to the task store.
*/
context?: Record<string, unknown>;
}
/**
* Interface for storing and retrieving task state and results.
*
* Similar to Transport, this allows pluggable task storage implementations
* (in-memory, database, distributed cache, etc.).
*
* Every method receives the sessionId of the request it serves. A store shared by several
* sessions should record the sessionId passed to createTask and treat a task as not found
* (and leave it out of listTasks) when a different sessionId asks for it.
*
* @experimental
*/
export interface TaskStore {
/**
* Creates a new task with the given creation parameters and original request.
* The implementation must generate a unique taskId and createdAt timestamp.
*
* TTL Management:
* - The implementation receives the TTL suggested by the requestor via taskParams.ttl
* - The implementation MAY override the requested TTL (e.g., to enforce limits)
* - The actual TTL used MUST be returned in the Task object
* - Null TTL indicates unlimited task lifetime (no automatic cleanup)
* - Cleanup SHOULD occur automatically after TTL expires, regardless of task status
*
* @param taskParams - The task creation parameters from the request (ttl, pollInterval)
* @param requestId - The JSON-RPC request ID
* @param request - The original request that triggered task creation
* @param sessionId - Optional session ID for binding the task to a specific session
* @returns The created task object
*/
createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, sessionId?: string): Promise<Task>;
/**
* Gets the current status of a task.
*
* @param taskId - The task identifier
* @param sessionId - Optional session ID for binding the query to a specific session
* @returns The task object, or null if it does not exist
*/
getTask(taskId: string, sessionId?: string): Promise<Task | null>;
/**
* Stores the result of a task and sets its final status.
*
* @param taskId - The task identifier
* @param status - The final status: 'completed' for success, 'failed' for errors
* @param result - The result to store
* @param sessionId - Optional session ID for binding the operation to a specific session
*/
storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, sessionId?: string): Promise<void>;
/**
* Retrieves the stored result of a task.
*
* @param taskId - The task identifier
* @param sessionId - Optional session ID for binding the query to a specific session
* @returns The stored result
*/
getTaskResult(taskId: string, sessionId?: string): Promise<Result>;
/**
* Updates a task's status (e.g., to 'cancelled', 'failed', 'completed').
*
* @param taskId - The task identifier
* @param status - The new status
* @param statusMessage - Optional diagnostic message for failed tasks or other status information
* @param sessionId - Optional session ID for binding the operation to a specific session
*/
updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, sessionId?: string): Promise<void>;
/**
* Lists tasks, optionally starting from a pagination cursor.
*
* @param cursor - Optional cursor for pagination
* @param sessionId - Optional session ID for binding the query to a specific session
* @returns An object containing the tasks array and an optional nextCursor
*/
listTasks(cursor?: string, sessionId?: string): Promise<{
tasks: Task[];
nextCursor?: string;
}>;
}
/**
* Checks if a task status represents a terminal state.
* Terminal states are those where the task has finished and will not change.
*
* @param status - The task status to check
* @returns True if the status is terminal (completed, failed, or cancelled)
* @experimental
*/
export declare function isTerminal(status: Task['status']): boolean;
//# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ClientOnly.js","names":[],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: React.ReactNode\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: React.ReactNode\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly({ children, fallback = null }: ClientOnlyProps) {\n return useHydrated() ? (\n <React.Fragment>{children}</React.Fragment>\n ) : (\n <React.Fragment>{fallback}</React.Fragment>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * let hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nexport function useHydrated(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n}\n\nfunction subscribe() {\n return () => {\n // noop\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,WAAW,EAAE,UAAU,WAAW,QAAyB;AACzE,QAAO,aAAa,GAClB,oBAAC,MAAM,UAAP,EAAiB,UAA0B,CAAA,GAE3C,oBAAC,MAAM,UAAP,EAAA,UAAiB,UAA0B,CAAA;;;;;;;;;;;;;;;;;;;;;AAuB/C,SAAgB,cAAuB;AACrC,QAAO,MAAM,qBACX,iBACM,YACA,MACP;;AAGH,SAAS,YAAY;AACnB,cAAa"}
@@ -0,0 +1 @@
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuRH;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,MAAsB;IAC7C,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACnF,CAAC"}
@@ -0,0 +1,525 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_jsx_constants = require("../constants.js");
const require_jsx_dom_context = require("./context.js");
const require_jsx_context = require("../context.js");
const require_jsx_children = require("../children.js");
const require_jsx_utils = require("../utils.js");
require("../hooks/index.js");
//#region src/jsx/dom/render.ts
const HONO_PORTAL_ELEMENT = "_hp";
const eventAliasMap = {
Change: "Input",
DoubleClick: "DblClick"
};
const nameSpaceMap = {
svg: "2000/svg",
math: "1998/Math/MathML"
};
const buildDataStack = [];
const refCleanupMap = /* @__PURE__ */ new WeakMap();
let nameSpaceContext = void 0;
const getNameSpaceContext = () => nameSpaceContext;
const isNodeString = (node) => "t" in node;
const eventCache = { onClick: ["click", false] };
const getEventSpec = (key) => {
if (!key.startsWith("on")) return;
if (eventCache[key]) return eventCache[key];
const match = key.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);
if (match) {
const [, eventName, capture] = match;
return eventCache[key] = [(eventAliasMap[eventName] || eventName).toLowerCase(), !!capture];
}
};
const toAttributeName = (element, key) => nameSpaceContext && element instanceof SVGElement && /[A-Z]/.test(key) && (key in element.style || key.match(/^(?:o|pai|str|u|ve)/)) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key;
const normalizeFormValue = (value) => value === null || value === void 0 || value === false ? null : value;
const applySelectValue = (select, props) => {
if (!("value" in props)) return;
select.value = normalizeFormValue(props["value"]);
if (!select.multiple && select.selectedIndex === -1) select.selectedIndex = 0;
};
const isIgnorableAttributeError = (error) => error instanceof DOMException && error.name === "InvalidCharacterError";
const applyProps = (container, attributes, oldAttributes) => {
attributes ||= {};
for (let key in attributes) {
const value = attributes[key];
if (key !== "children" && (!oldAttributes || oldAttributes[key] !== value)) {
key = require_jsx_utils.normalizeIntrinsicElementKey(key);
const eventSpec = getEventSpec(key);
if (eventSpec) {
if (oldAttributes?.[key] !== value) {
if (oldAttributes) container.removeEventListener(eventSpec[0], oldAttributes[key], eventSpec[1]);
if (value != null) {
if (typeof value !== "function") throw new Error(`Event handler for "${key}" is not a function`);
container.addEventListener(eventSpec[0], value, eventSpec[1]);
}
}
} else if (key === "dangerouslySetInnerHTML" && value) container.innerHTML = value.__html;
else if (key === "ref") {
refCleanupMap.get(container)?.();
let cleanup;
if (typeof value === "function") cleanup = value(container) || (() => value(null));
else if (value && "current" in value) {
value.current = container;
cleanup = () => value.current = null;
}
refCleanupMap.set(container, cleanup);
} else if (key === "style") {
const style = container.style;
if (typeof value === "string") style.cssText = value;
else {
style.cssText = "";
if (value != null) require_jsx_utils.styleObjectForEach(value, style.setProperty.bind(style));
}
} else {
if (key === "value") {
const nodeName = container.nodeName;
if (nodeName === "SELECT") continue;
else if (nodeName === "INPUT" || nodeName === "TEXTAREA") {
container.value = normalizeFormValue(value);
if (nodeName === "TEXTAREA") {
container.textContent = value;
continue;
}
}
} else if (key === "checked" && container.nodeName === "INPUT" || key === "selected" && container.nodeName === "OPTION") container[key] = value;
const k = toAttributeName(container, key);
try {
if (value === null || value === void 0 || value === false) container.removeAttribute(k);
else if (value === true) container.setAttribute(k, "");
else if (typeof value === "string" || typeof value === "number") container.setAttribute(k, value);
else container.setAttribute(k, value.toString());
} catch (e) {
if (!isIgnorableAttributeError(e)) throw e;
}
}
}
}
if (oldAttributes) for (let key in oldAttributes) {
const value = oldAttributes[key];
if (key !== "children" && !(key in attributes)) {
key = require_jsx_utils.normalizeIntrinsicElementKey(key);
const eventSpec = getEventSpec(key);
if (eventSpec) container.removeEventListener(eventSpec[0], value, eventSpec[1]);
else if (key === "ref") {
refCleanupMap.get(container)?.();
refCleanupMap.delete(container);
} else try {
container.removeAttribute(toAttributeName(container, key));
} catch (e) {
if (!isIgnorableAttributeError(e)) throw e;
}
}
}
};
const invokeTag = (context, node) => {
node[require_jsx_constants.DOM_STASH][0] = 0;
buildDataStack.push([context, node]);
const func = node.tag[require_jsx_constants.DOM_RENDERER] || node.tag;
const props = func.defaultProps ? {
...func.defaultProps,
...node.props
} : node.props;
try {
return [func.call(null, props)];
} finally {
buildDataStack.pop();
}
};
const getNextChildren = (node, container, nextChildren, childrenToRemove, callbacks) => {
if (node.vR?.length) {
childrenToRemove.push(...node.vR);
delete node.vR;
}
if (typeof node.tag === "function") node[require_jsx_constants.DOM_STASH][1][1]?.forEach((data) => callbacks.push(data));
node.vC.forEach((child) => {
if (isNodeString(child)) nextChildren.push(child);
else if (typeof child.tag === "function" || child.tag === "") {
child.c = container;
const currentNextChildrenIndex = nextChildren.length;
getNextChildren(child, container, nextChildren, childrenToRemove, callbacks);
if (child.s) {
for (let i = currentNextChildrenIndex; i < nextChildren.length; i++) nextChildren[i].s = true;
child.s = false;
}
} else {
nextChildren.push(child);
if (child.vR?.length) {
childrenToRemove.push(...child.vR);
delete child.vR;
}
}
});
};
const findInsertBefore = (node) => {
while (node && (node.tag === HONO_PORTAL_ELEMENT || !node.e)) node = node.tag === HONO_PORTAL_ELEMENT || !node.vC?.[0] ? node.nN : node.vC[0];
return node?.e;
};
const removeNode = (node) => {
if (!isNodeString(node)) {
node[require_jsx_constants.DOM_STASH]?.[1][1]?.forEach((data) => data[2]?.());
refCleanupMap.get(node.e)?.();
if (node.p === 2) node.vC?.forEach((n) => n.p = 2);
node.vC?.forEach(removeNode);
}
if (!node.p) {
node.e?.remove();
delete node.e;
}
if (typeof node.tag === "function") {
updateMap.delete(node);
fallbackUpdateFnArrayMap.delete(node);
delete node[require_jsx_constants.DOM_STASH][3];
node.a = true;
}
};
const apply = (node, container, isNew) => {
node.c = container;
applyNodeObject(node, container, isNew);
};
const findChildNodeIndex = (childNodes, child) => {
if (!child) return;
for (let i = 0, len = childNodes.length; i < len; i++) if (childNodes[i] === child) return i;
};
const cancelBuild = Symbol();
const applyNodeObject = (node, container, isNew) => {
const next = [];
const remove = [];
const callbacks = [];
getNextChildren(node, container, next, remove, callbacks);
remove.forEach(removeNode);
const childNodes = isNew ? void 0 : container.childNodes;
let offset;
let insertBeforeNode = null;
if (isNew) offset = -1;
else if (!childNodes.length) offset = 0;
else {
const offsetByNextNode = findChildNodeIndex(childNodes, findInsertBefore(node.nN));
if (offsetByNextNode !== void 0) {
insertBeforeNode = childNodes[offsetByNextNode];
offset = offsetByNextNode;
} else offset = findChildNodeIndex(childNodes, next.find((n) => n.tag !== HONO_PORTAL_ELEMENT && n.e)?.e) ?? -1;
if (offset === -1) isNew = true;
}
for (let i = 0, len = next.length; i < len; i++, offset++) {
const child = next[i];
let el;
if (child.s && child.e) {
el = child.e;
child.s = false;
} else {
const isNewLocal = isNew || !child.e;
if (isNodeString(child)) {
if (child.e && child.d) child.e.textContent = child.t;
child.d = false;
el = child.e ||= document.createTextNode(child.t);
} else {
el = child.e ||= child.n ? document.createElementNS(child.n, child.tag) : document.createElement(child.tag);
applyProps(el, child.props, child.pP);
applyNodeObject(child, el, isNewLocal);
if (child.tag === "select") applySelectValue(el, child.props);
}
}
if (child.tag === HONO_PORTAL_ELEMENT) offset--;
else if (isNew) {
if (!el.parentNode) container.appendChild(el);
} else if (childNodes[offset] !== el && childNodes[offset - 1] !== el) {
if (childNodes[offset + 1] === el) container.appendChild(childNodes[offset]);
else container.insertBefore(el, insertBeforeNode || childNodes[offset] || null);
}
}
if (node.pP) node.pP = void 0;
if (callbacks.length) {
const useLayoutEffectCbs = [];
const useEffectCbs = [];
callbacks.forEach(([, useLayoutEffectCb, , useEffectCb, useInsertionEffectCb]) => {
if (useLayoutEffectCb) useLayoutEffectCbs.push(useLayoutEffectCb);
if (useEffectCb) useEffectCbs.push(useEffectCb);
useInsertionEffectCb?.();
});
useLayoutEffectCbs.forEach((cb) => cb());
if (useEffectCbs.length) requestAnimationFrame(() => {
useEffectCbs.forEach((cb) => cb());
});
}
};
const isSameContext = (oldContexts, newContexts) => !!(oldContexts && oldContexts.length === newContexts.length && oldContexts.every((ctx, i) => ctx[1] === newContexts[i][1]));
const indexChildrenByKey = (children) => {
const index = /* @__PURE__ */ new Map();
for (const child of children) {
const key = child.key;
if (index.has(key)) return;
index.set(key, child);
}
return index;
};
const fallbackUpdateFnArrayMap = /* @__PURE__ */ new WeakMap();
const build = (context, node, children) => {
const buildWithPreviousChildren = !children && node.pC;
if (children) node.pC ||= node.vC;
let foundErrorHandler;
try {
children ||= typeof node.tag == "function" ? invokeTag(context, node) : require_jsx_children.toArray(node.props.children);
if (children[0]?.tag === "" && children[0][require_jsx_constants.DOM_ERROR_HANDLER]) {
foundErrorHandler = children[0][require_jsx_constants.DOM_ERROR_HANDLER];
context[5].push([
context,
foundErrorHandler,
node
]);
}
let oldVChildren = buildWithPreviousChildren ? [...node.pC] : node.vC ? [...node.vC] : void 0;
const vChildren = [];
let prevNode;
let scanBudget = (oldVChildren?.length || 0) * 2;
let oldChildrenByKey;
for (let i = 0; i < children.length; i++) {
if (Array.isArray(children[i])) {
children.splice(i, 1, ...children[i].flat(Infinity));
i--;
continue;
}
let child = buildNode(children[i]);
if (child) {
if (typeof child.tag === "function" && !child.tag[require_jsx_constants.DOM_INTERNAL_TAG]) {
if (require_jsx_context.globalContexts.length > 0) child[require_jsx_constants.DOM_STASH][2] = require_jsx_context.globalContexts.map((c) => [c, c.values.at(-1)]);
if (context[5]?.length) child[require_jsx_constants.DOM_STASH][3] = context[5].at(-1);
}
let oldChild;
if (oldChildrenByKey && child.key === void 0 && !isNodeString(child)) {
oldVChildren = [...oldChildrenByKey.values()];
oldChildrenByKey = void 0;
}
if (oldChildrenByKey) {
const key = child.key;
const candidate = oldChildrenByKey.get(key);
if (candidate && (isNodeString(child) ? isNodeString(candidate) : candidate.tag === child.tag && candidate.key === key)) {
oldChild = candidate;
oldChildrenByKey.delete(key);
}
} else if (oldVChildren && oldVChildren.length) {
const first = oldVChildren[0];
if (isNodeString(child) ? isNodeString(first) : !isNodeString(first) && (child.key !== void 0 ? first.key === child.key && first.tag === child.tag : first.tag === child.tag)) oldChild = oldVChildren.shift();
else {
const i = oldVChildren.findIndex(isNodeString(child) ? (c) => isNodeString(c) : child.key !== void 0 ? (c) => c.key === child.key && c.tag === child.tag : (c) => c.tag === child.tag);
scanBudget -= i === -1 ? oldVChildren.length : i;
if (i !== -1) {
oldChild = oldVChildren[i];
oldVChildren.splice(i, 1);
}
if (scanBudget < 0) {
scanBudget = Infinity;
oldChildrenByKey = indexChildrenByKey(oldVChildren);
}
}
}
if (oldChild) {
if (isNodeString(child)) {
if (oldChild.t !== child.t) {
oldChild.t = child.t;
oldChild.d = true;
}
child = oldChild;
} else {
const pP = oldChild.pP = oldChild.props;
oldChild.props = child.props;
oldChild.f ||= child.f || node.f;
if (typeof child.tag === "function") {
const oldContexts = oldChild[require_jsx_constants.DOM_STASH][2];
oldChild[require_jsx_constants.DOM_STASH][2] = child[require_jsx_constants.DOM_STASH][2] || [];
oldChild[require_jsx_constants.DOM_STASH][3] = child[require_jsx_constants.DOM_STASH][3];
if (!oldChild.f && ((oldChild.o || oldChild) === child.o || oldChild.tag[require_jsx_constants.DOM_MEMO]?.(pP, oldChild.props)) && isSameContext(oldContexts, oldChild[require_jsx_constants.DOM_STASH][2])) oldChild.s = true;
}
child = oldChild;
}
} else if (!isNodeString(child) && nameSpaceContext) {
const ns = require_jsx_context.useContext(nameSpaceContext);
if (ns) child.n = ns;
}
if (!isNodeString(child) && !child.s) {
build(context, child);
delete child.f;
}
vChildren.push(child);
if (prevNode && !prevNode.s && !child.s) for (let p = prevNode; p && !isNodeString(p); p = p.vC?.at(-1)) p.nN = child;
prevNode = child;
}
}
oldVChildren = oldChildrenByKey ? [...oldChildrenByKey.values()] : oldVChildren;
node.vR = buildWithPreviousChildren ? [...node.vC, ...oldVChildren || []] : oldVChildren || [];
node.vC = vChildren;
if (buildWithPreviousChildren) delete node.pC;
} catch (e) {
node.f = true;
if (e === cancelBuild) {
if (foundErrorHandler) return;
else throw e;
}
const [errorHandlerContext, errorHandler, errorHandlerNode] = node[require_jsx_constants.DOM_STASH]?.[3] || [];
if (errorHandler) {
const fallbackUpdateFn = () => update([
0,
false,
context[2]
], errorHandlerNode);
const fallbackUpdateFnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode) || [];
fallbackUpdateFnArray.push(fallbackUpdateFn);
fallbackUpdateFnArrayMap.set(errorHandlerNode, fallbackUpdateFnArray);
const fallback = errorHandler(e, () => {
const fnArray = fallbackUpdateFnArrayMap.get(errorHandlerNode);
if (fnArray) {
const i = fnArray.indexOf(fallbackUpdateFn);
if (i !== -1) {
fnArray.splice(i, 1);
return fallbackUpdateFn();
}
}
});
if (fallback) {
if (context[0] === 1) context[1] = true;
else {
build(context, errorHandlerNode, [fallback]);
if ((errorHandler.length === 1 || context !== errorHandlerContext) && errorHandlerNode.c) {
apply(errorHandlerNode, errorHandlerNode.c, false);
return;
}
}
throw cancelBuild;
}
}
throw e;
} finally {
if (foundErrorHandler) context[5].pop();
}
};
const buildNode = (node) => {
if (node === void 0 || node === null || typeof node === "boolean") return;
else if (typeof node === "string" || typeof node === "number") return {
t: node.toString(),
d: true
};
else {
if ("vR" in node) node = {
tag: node.tag,
props: node.props,
key: node.key,
f: node.f,
type: node.tag,
ref: node.props.ref,
o: node.o || node
};
if (typeof node.tag === "function") node[require_jsx_constants.DOM_STASH] = [0, []];
else {
const ns = nameSpaceMap[node.tag];
if (ns) {
nameSpaceContext ||= require_jsx_dom_context.createContext("");
node.props.children = [{
tag: nameSpaceContext,
props: {
value: node.n = `http://www.w3.org/${ns}`,
children: node.props.children
}
}];
}
}
return node;
}
};
const replaceContainer = (node, from, to) => {
if (node.c === from) {
node.c = to;
node.vC.forEach((child) => replaceContainer(child, from, to));
}
};
const updateSync = (context, node) => {
node[require_jsx_constants.DOM_STASH][2]?.forEach(([c, v]) => {
c.values.push(v);
});
try {
build(context, node, void 0);
} catch {
return;
}
if (node.a) {
delete node.a;
return;
}
node[require_jsx_constants.DOM_STASH][2]?.forEach(([c]) => {
c.values.pop();
});
if (context[0] !== 1 || !context[1]) apply(node, node.c, false);
};
const updateMap = /* @__PURE__ */ new WeakMap();
const currentUpdateSets = [];
const update = async (context, node) => {
context[5] ||= [];
const existing = updateMap.get(node);
if (existing) existing[0](void 0);
let resolve;
const promise = new Promise((r) => resolve = r);
updateMap.set(node, [resolve, () => {
if (context[2]) context[2](context, node, (context) => {
updateSync(context, node);
}).then(() => resolve(node));
else {
updateSync(context, node);
resolve(node);
}
}]);
if (currentUpdateSets.length) currentUpdateSets.at(-1).add(node);
else {
await Promise.resolve();
const latest = updateMap.get(node);
if (latest) {
updateMap.delete(node);
latest[1]();
}
}
return promise;
};
const renderNode = (node, container) => {
const context = [];
context[5] = [];
context[4] = true;
build(context, node, void 0);
context[4] = false;
const fragment = document.createDocumentFragment();
apply(node, fragment, true);
replaceContainer(node, fragment, container);
container.replaceChildren(fragment);
};
const render = (jsxNode, container) => {
renderNode(buildNode({
tag: "",
props: { children: jsxNode }
}), container);
};
const flushSync = (callback) => {
const set = /* @__PURE__ */ new Set();
currentUpdateSets.push(set);
callback();
set.forEach((node) => {
const latest = updateMap.get(node);
if (latest) {
updateMap.delete(node);
latest[1]();
}
});
currentUpdateSets.pop();
};
const createPortal = (children, container, key) => ({
tag: HONO_PORTAL_ELEMENT,
props: { children },
key,
e: container,
p: 1
});
//#endregion
exports.build = build;
exports.buildDataStack = buildDataStack;
exports.buildNode = buildNode;
exports.createPortal = createPortal;
exports.flushSync = flushSync;
exports.getNameSpaceContext = getNameSpaceContext;
exports.render = render;
exports.renderNode = renderNode;
exports.update = update;
@@ -0,0 +1,899 @@
flf2a$ 4 3 14 0 10 0 1920
SmShadow by Glenn Chappell 4/93 -- based on Small
Includes ISO Latin-1
figlet release 2.1 -- 12 Aug 1994
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
supported by FIGlet and FIGWin. May also be slightly modified for better use
of new full-width/kern/smush alternatives, but default output is NOT changed.
$$@
$$@
$$@
$$@@
|$@
_|$@
_)$@
@@
| )$@
V V$ @
@
@@
| |$ @
_ |_ |_|$@
_ |_ |_|$@
_| _|$ @@
|$ @
(_-<$@
_ _/$@
_|$ @@
_) /$ @
/$ @
_/ _)$@
@@
_|$ @
_| _|$@
\____|$ @
@@
)$@
/$ @
@
@@
/$@
|$ @
|$ @
\_\$@@
\ \$ @
|$@
|$@
_/$ @@
\ \ /$ @
_ _|$@
_/ _\$ @
@@
|$ @
__ __|$@
_|$ @
@@
@
@
)$@
/$ @@
@
____|$@
@
@@
@
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
\|$@
@
@@
@
_` |$@
\__,_|$@
@@
|$ @
_ \$@
_.__/$@
@@
@
_|$@
\__|$@
@@
|$@
_` |$@
\__,_|$@
@@
@
-_)$@
\___|$@
@@
_|$@
_|$@
_|$ @
@@
@
_` |$@
\__, |$@
____/$ @@
|$ @
\$ @
_| _|$@
@@
_)$@
|$@
_|$@
@@
_)$@
|$@
|$@
__/$ @@
|$ @
| /$@
_\_\$@
@@
|$@
|$@
_|$@
@@
@
` \$ @
_|_|_|$@
@@
@
\$ @
_| _|$@
@@
@
_ \$@
\___/$@
@@
@
_ \$@
.__/$@
_|$ @@
@
_` |$@
\__, |$@
_|$@@
@
_|$@
_|$ @
@@
@
(_-<$@
___/$@
@@
|$ @
_|$@
\__|$@
@@
@
| |$@
\_,_|$@
@@
@
\ \ /$@
\_/$ @
@@
@
\ \ \ /$@
\_/\_/$ @
@@
@
\ \ /$@
_\_\$@
@@
@
| |$@
\_, |$@
___/$ @@
@
_ /$@
___|$@
@@
/$@
_ |$ @
|$ @
\_\$@@
|$@
|$@
|$@
_|$@@
\ \$ @
|_$@
|$ @
_/$ @@
\ |$@
/\/$ @
@
@@
_) \_)$@
_ \$ @
/ _\$@
@@
_) _)$@
__ \$@
\____/$@
@@
_) _)$@
| |$@
\__/$ @
@@
_) _)$@
_` |$@
\__,_|$@
@@
_) _)$@
_ \$@
\___/$@
@@
_) _)$@
| |$@
\_,_|$@
@@
_ \$@
|< <$@
|__/$@
_|$ @@
160 NO-BREAK SPACE
$$@
$$@
$$@
$$@@
161 INVERTED EXCLAMATION MARK
_)$@
|$@
_|$@
@@
162 CENT SIGN
|$ @
_)$@
\ _)$@
|$ @@
163 POUND SIGN
_\$ @
_ _|$ @
_,___|$@
@@
164 CURRENCY SIGN
\ . /$@
_ \$@
\/ /$@
@@
165 YEN SIGN
\ \ /$ @
__ __|$@
__ __|$@
_|$ @@
166 BROKEN BAR
|$@
_|$@
|$@
_|$@@
167 SECTION SIGN
_)$@
\ \$ @
\ \/$ @
__/$ @@
168 DIAERESIS
_) _)$@
@
@
@@
169 COPYRIGHT SIGN
\$ @
_| \$@
\ \__| /$@
\____/$ @@
170 FEMININE ORDINAL INDICATOR
_` |$@
\__,_|$@
_____|$@
@@
171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
/ /$@
< < <$ @
\_\_\$@
@@
172 NOT SIGN
____ |$@
_|$@
@
@@
173 SOFT HYPHEN
@
___|$@
@
@@
174 REGISTERED SIGN
\$ @
-) \$@
\ |\\ /$@
\____/$ @@
175 MACRON
___|$@
@
@
@@
176 DEGREE SIGN
.\$@
\_/$@
@
@@
177 PLUS-MINUS SIGN
|$ @
_ _|$@
_|$ @
_____|$@@
178 SUPERSCRIPT TWO
_ )$@
__|$@
@
@@
179 SUPERSCRIPT THREE
_ /$@
__)$@
@
@@
180 ACUTE ACCENT
_/$@
@
@
@@
181 MICRO SIGN
@
| |$@
.,_|$@
_|$ @@
182 PILCROW SIGN
|$@
\_ | |$@
_|_|$@
@@
183 MIDDLE DOT
@
_)$@
@
@@
184 CEDILLA
@
@
@
_)$@@
185 SUPERSCRIPT ONE
_ |$@
_|$@
@
@@
186 MASCULINE ORDINAL INDICATOR
_ \$@
\___/$@
____|$@
@@
187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\ \ \$ @
> > >$@
_/_/$ @
@@
188 VULGAR FRACTION ONE QUARTER
_ | /$ @
_| /_' |$@
_/ _|$@
@@
189 VULGAR FRACTION ONE HALF
_ | /$ @
_| /_ )$@
_/ __|$@
@@
190 VULGAR FRACTION THREE QUARTERS
_ / /$ @
__) /_' |$@
_/ _|$@
@@
191 INVERTED QUESTION MARK
_)$ @
/$ @
\___|$@
@@
192 LATIN CAPITAL LETTER A WITH GRAVE
\_\$ @
--\$ @
_/\_\$@
@@
193 LATIN CAPITAL LETTER A WITH ACUTE
_/$ @
--\$ @
_/\_\$@
@@
194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
/\\$ @
--\$ @
_/\_\$@
@@
195 LATIN CAPITAL LETTER A WITH TILDE
/ _/$ @
--\$ @
_/\_\$@
@@
196 LATIN CAPITAL LETTER A WITH DIAERESIS
_) \_)$@
_ \$ @
/ _\$@
@@
197 LATIN CAPITAL LETTER A WITH RING ABOVE
( )$ @
_ \$ @
_/ _\$@
@@
198 LATIN CAPITAL LETTER AE
, __|$@
_ _|$ @
_/ ___|$@
@@
199 LATIN CAPITAL LETTER C WITH CEDILLA
|$@
($ @
\___|$@
_)$ @@
200 LATIN CAPITAL LETTER E WITH GRAVE
\_\$@
-<$@
__<$@
@@
201 LATIN CAPITAL LETTER E WITH ACUTE
_/$@
-<$@
__<$@
@@
202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
/\\$@
-<$@
__<$@
@@
203 LATIN CAPITAL LETTER E WITH DIAERESIS
_) _)$@
-<$ @
__<$ @
@@
204 LATIN CAPITAL LETTER I WITH GRAVE
\_\$ @
_ _|$@
___|$@
@@
205 LATIN CAPITAL LETTER I WITH ACUTE
_/$ @
_ _|$@
___|$@
@@
206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
/\\$ @
_ _|$@
___|$@
@@
207 LATIN CAPITAL LETTER I WITH DIAERESIS
_) _)$@
_ _|$ @
___|$ @
@@
208 LATIN CAPITAL LETTER ETH
_ \$ @
_ _| |$@
___/$ @
@@
209 LATIN CAPITAL LETTER N WITH TILDE
/ _/$@
\ |$@
_|\_|$@
@@
210 LATIN CAPITAL LETTER O WITH GRAVE
\_\$ @
__ \$@
\____/$@
@@
211 LATIN CAPITAL LETTER O WITH ACUTE
_/$ @
__ \$@
\____/$@
@@
212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
/\\$ @
__ \$@
\____/$@
@@
213 LATIN CAPITAL LETTER O WITH TILDE
/ _/$ @
__ \$@
\____/$@
@@
214 LATIN CAPITAL LETTER O WITH DIAERESIS
_) _)$@
__ \$@
\____/$@
@@
215 MULTIPLICATION SIGN
\ \$@
, '$@
\/\/$@
@@
216 LATIN CAPITAL LETTER O WITH STROKE
_ /\$ @
( / |$@
\_/__/$ @
@@
217 LATIN CAPITAL LETTER U WITH GRAVE
\_\$ @
| |$@
\__/$ @
@@
218 LATIN CAPITAL LETTER U WITH ACUTE
_/$ @
| |$@
\__/$ @
@@
219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
/\\$ @
| |$@
\__/$ @
@@
220 LATIN CAPITAL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\__/$ @
@@
221 LATIN CAPITAL LETTER Y WITH ACUTE
_/$ @
\ \ /$@
_|$ @
@@
222 LATIN CAPITAL LETTER THORN
|$ @
-_)$@
_|$ @
@@
223 LATIN SMALL LETTER SHARP S
_ \$@
|< <$@
|__/$@
_|$ @@
224 LATIN SMALL LETTER A WITH GRAVE
\_\$ @
_` |$@
\__,_|$@
@@
225 LATIN SMALL LETTER A WITH ACUTE
_/$ @
_` |$@
\__,_|$@
@@
226 LATIN SMALL LETTER A WITH CIRCUMFLEX
/\\$ @
_` |$@
\__,_|$@
@@
227 LATIN SMALL LETTER A WITH TILDE
/ _/$ @
_` |$@
\__,_|$@
@@
228 LATIN SMALL LETTER A WITH DIAERESIS
_) _)$@
_` |$@
\__,_|$@
@@
229 LATIN SMALL LETTER A WITH RING ABOVE
( )$ @
_` |$@
\__,_|$@
@@
230 LATIN SMALL LETTER AE
@
_` -_)$@
\__,___|$@
@@
231 LATIN SMALL LETTER C WITH CEDILLA
@
_|$@
\__|$@
_)$@@
232 LATIN SMALL LETTER E WITH GRAVE
\_\$ @
-_)$@
\___|$@
@@
233 LATIN SMALL LETTER E WITH ACUTE
_/$ @
-_)$@
\___|$@
@@
234 LATIN SMALL LETTER E WITH CIRCUMFLEX
/\\$ @
-_)$@
\___|$@
@@
235 LATIN SMALL LETTER E WITH DIAERESIS
_) _)$@
-_)$ @
\___|$ @
@@
236 LATIN SMALL LETTER I WITH GRAVE
\_\$@
|$@
_|$@
@@
237 LATIN SMALL LETTER I WITH ACUTE
_/$@
|$@
_|$@
@@
238 LATIN SMALL LETTER I WITH CIRCUMFLEX
/\\$@
|$ @
_|$ @
@@
239 LATIN SMALL LETTER I WITH DIAERESIS
_) _)$@
|$ @
_|$ @
@@
240 LATIN SMALL LETTER ETH
, \'$@
_` |$@
\___/$ @
@@
241 LATIN SMALL LETTER N WITH TILDE
/ _/$ @
' \$ @
_| _|$@
@@
242 LATIN SMALL LETTER O WITH GRAVE
\_\$ @
_ \$@
\___/$@
@@
243 LATIN SMALL LETTER O WITH ACUTE
_/$ @
_ \$@
\___/$@
@@
244 LATIN SMALL LETTER O WITH CIRCUMFLEX
/\\$ @
_ \$@
\___/$@
@@
245 LATIN SMALL LETTER O WITH TILDE
/ _/$@
_ \$@
\___/$@
@@
246 LATIN SMALL LETTER O WITH DIAERESIS
_) _)$@
_ \$@
\___/$@
@@
247 DIVISION SIGN
_)$ @
___|$@
_)$ @
@@
248 LATIN SMALL LETTER O WITH STROKE
@
/\$@
\_/_/$@
@@
249 LATIN SMALL LETTER U WITH GRAVE
\_\$ @
| |$@
\_,_|$@
@@
250 LATIN SMALL LETTER U WITH ACUTE
_/$ @
| |$@
\_,_|$@
@@
251 LATIN SMALL LETTER U WITH CIRCUMFLEX
/\\$ @
| |$@
\_,_|$@
@@
252 LATIN SMALL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\_,_|$@
@@
253 LATIN SMALL LETTER Y WITH ACUTE
_/$ @
| |$@
\_, |$@
___/$ @@
254 LATIN SMALL LETTER THORN
|$ @
'_ \$@
.__/$@
_|$ @@
255 LATIN SMALL LETTER Y WITH DIAERESIS
_) _)$@
| |$@
\_, |$@
___/$ @@
@@ -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-library.js';
//# sourceMappingURL=library-square.js.map
@@ -0,0 +1,21 @@
/**
* @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 Watch = createLucideIcon("Watch", [
["circle", { cx: "12", cy: "12", r: "6", key: "1vlfrh" }],
["polyline", { points: "12 10 12 12 13 13", key: "19dquz" }],
[
"path",
{ d: "m16.13 7.66-.81-4.05a2 2 0 0 0-2-1.61h-2.68a2 2 0 0 0-2 1.61l-.78 4.05", key: "18k57s" }
],
["path", { d: "m7.88 16.36.8 4a2 2 0 0 0 2 1.61h2.72a2 2 0 0 0 2-1.61l.81-4.05", key: "16ny36" }]
]);
export { Watch as default };
//# sourceMappingURL=watch.js.map
@@ -0,0 +1,24 @@
/**
* @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 SaveOff = createLucideIcon("SaveOff", [
["path", { d: "M13 13H8a1 1 0 0 0-1 1v7", key: "h8g396" }],
["path", { d: "M14 8h1", key: "1lfen6" }],
["path", { d: "M17 21v-4", key: "1yknxs" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
[
"path",
{ d: "M20.41 20.41A2 2 0 0 1 19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 .59-1.41", key: "1t4vdl" }
],
["path", { d: "M29.5 11.5s5 5 4 5", key: "zzn4i6" }],
["path", { d: "M9 3h6.2a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V15", key: "24cby9" }]
]);
export { SaveOff as default };
//# sourceMappingURL=save-off.js.map
@@ -0,0 +1,5 @@
<img src="https://static.scarf.sh/a.png?x-pxid=d988eb79-b0fc-4a2b-8514-6a1ab932d188" />
# TanStack Router Core
See [https://tanstack.com/router](https://tanstack.com/router) for documentation.
@@ -0,0 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { ScopeManager } from '../ScopeManager';
import type { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
export declare class FunctionTypeScope extends ScopeBase<ScopeType.functionType, TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSFunctionType | TSESTree.TSMethodSignature, Scope> {
constructor(scopeManager: ScopeManager, upperScope: FunctionTypeScope['upper'], block: FunctionTypeScope['block']);
}
@@ -0,0 +1,82 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = void 0;
const fs_minipass_1 = require("@isaacs/fs-minipass");
const node_path_1 = __importDefault(require("node:path"));
const list_js_1 = require("./list.js");
const make_command_js_1 = require("./make-command.js");
const pack_js_1 = require("./pack.js");
const createFileSync = (opt, files) => {
const p = new pack_js_1.PackSync(opt);
const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
mode: opt.mode || 0o666,
});
p.pipe(stream);
addFilesSync(p, files);
};
const createFile = (opt, files) => {
const p = new pack_js_1.Pack(opt);
const stream = new fs_minipass_1.WriteStream(opt.file, {
mode: opt.mode || 0o666,
});
p.pipe(stream);
const promise = new Promise((res, rej) => {
stream.on('error', rej);
stream.on('close', res);
p.on('error', rej);
});
addFilesAsync(p, files).catch(er => p.emit('error', er));
return promise;
};
const addFilesSync = (p, files) => {
files.forEach(file => {
if (file.charAt(0) === '@') {
(0, list_js_1.list)({
file: node_path_1.default.resolve(p.cwd, file.slice(1)),
sync: true,
noResume: true,
onReadEntry: entry => p.add(entry),
});
}
else {
p.add(file);
}
});
p.end();
};
const addFilesAsync = async (p, files) => {
for (const file of files) {
if (file.charAt(0) === '@') {
await (0, list_js_1.list)({
file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
noResume: true,
onReadEntry: entry => {
p.add(entry);
},
});
}
else {
p.add(file);
}
}
p.end();
};
const createSync = (opt, files) => {
const p = new pack_js_1.PackSync(opt);
addFilesSync(p, files);
return p;
};
const createAsync = (opt, files) => {
const p = new pack_js_1.Pack(opt);
addFilesAsync(p, files).catch(er => p.emit('error', er));
return p;
};
exports.create = (0, make_command_js_1.makeCommand)(createFileSync, createFile, createSync, createAsync, (_opt, files) => {
if (!files?.length) {
throw new TypeError('no paths specified to add to archive');
}
});
//# sourceMappingURL=create.js.map
@@ -0,0 +1,200 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
var AllowedType;
(function (AllowedType) {
AllowedType[AllowedType["Number"] = 0] = "Number";
AllowedType[AllowedType["String"] = 1] = "String";
AllowedType[AllowedType["Unknown"] = 2] = "Unknown";
})(AllowedType || (AllowedType = {}));
exports.default = (0, util_1.createRule)({
name: 'no-mixed-enums',
meta: {
type: 'problem',
docs: {
description: 'Disallow enums from having both number and string members',
recommended: 'strict',
requiresTypeChecking: true,
},
messages: {
mixed: `Mixing number and string enums can be confusing.`,
},
schema: [],
},
defaultOptions: [],
create(context) {
const parserServices = (0, util_1.getParserServices)(context);
const typeChecker = parserServices.program.getTypeChecker();
function collectNodeDefinitions(node) {
const { name } = node.id;
const found = {
imports: [],
previousSibling: undefined,
};
let scope = context.sourceCode.getScope(node);
for (const definition of scope.upper?.set.get(name)?.defs ?? []) {
if (definition.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration &&
definition.node.range[0] < node.range[0] &&
definition.node.body.members.length > 0) {
found.previousSibling = definition.node;
break;
}
}
while (scope) {
scope.set.get(name)?.defs.forEach(definition => {
if (definition.type === scope_manager_1.DefinitionType.ImportBinding) {
found.imports.push(definition.node);
}
});
scope = scope.upper;
}
return found;
}
function getAllowedTypeForNode(node) {
return tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(node), ts.TypeFlags.StringLike)
? AllowedType.String
: AllowedType.Number;
}
function getTypeFromImported(imported) {
const type = typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(imported));
const valueDeclaration = type.getSymbol()?.valueDeclaration;
if (!valueDeclaration ||
!ts.isEnumDeclaration(valueDeclaration) ||
valueDeclaration.members.length === 0) {
return undefined;
}
return getAllowedTypeForNode(valueDeclaration.members[0]);
}
function getMemberType(member) {
if (!member.initializer) {
return AllowedType.Number;
}
switch (member.initializer.type) {
case utils_1.AST_NODE_TYPES.Literal:
switch (typeof member.initializer.value) {
case 'number':
return AllowedType.Number;
case 'string':
return AllowedType.String;
default:
return AllowedType.Unknown;
}
case utils_1.AST_NODE_TYPES.TemplateLiteral:
return AllowedType.String;
default:
return getAllowedTypeForNode(parserServices.esTreeNodeToTSNodeMap.get(member.initializer));
}
}
function getDesiredTypeForDefinition(node) {
const { imports, previousSibling } = collectNodeDefinitions(node);
// Case: Merged ambiently via module augmentation
// import { MyEnum } from 'other-module';
// declare module 'other-module' {
// enum MyEnum { A }
// }
for (const imported of imports) {
const typeFromImported = getTypeFromImported(imported);
if (typeFromImported != null) {
return typeFromImported;
}
}
// Case: Multiple enum declarations in the same file
// enum MyEnum { A }
// enum MyEnum { B }
if (previousSibling) {
return getMemberType(previousSibling.body.members[0]);
}
// Case: Namespace declaration merging
// namespace MyNamespace {
// export enum MyEnum { A }
// }
// namespace MyNamespace {
// export enum MyEnum { B }
// }
if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration &&
node.parent.parent.type === utils_1.AST_NODE_TYPES.TSModuleBlock) {
// https://github.com/typescript-eslint/typescript-eslint/issues/8352
// TODO: We don't need to dip into the TypeScript type checker here!
// Merged namespaces must all exist in the same file.
// We could instead compare this file's nodes to find the merges.
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.id);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const declarations = typeChecker
.getSymbolAtLocation(tsNode)
.getDeclarations();
const [{ initializer }] = declarations[0]
.members;
return initializer &&
tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(initializer), ts.TypeFlags.StringLike)
? AllowedType.String
: AllowedType.Number;
}
// Finally, we default to the type of the first enum member
return getMemberType(node.body.members[0]);
}
return {
TSEnumDeclaration(node) {
if (!node.body.members.length) {
return;
}
let desiredType = getDesiredTypeForDefinition(node);
if (desiredType === ts.TypeFlags.Unknown) {
return;
}
for (const member of node.body.members) {
const currentType = getMemberType(member);
if (currentType === AllowedType.Unknown) {
return;
}
if (currentType === AllowedType.Number) {
desiredType ??= currentType;
}
if (currentType !== desiredType) {
context.report({
node: member.initializer ?? member,
messageId: 'mixed',
});
return;
}
}
},
};
},
});
@@ -0,0 +1,31 @@
/**
* @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 Church = createLucideIcon("Church", [
["path", { d: "M10 9h4", key: "u4k05v" }],
["path", { d: "M12 7v5", key: "ma6bk" }],
["path", { d: "M14 22v-4a2 2 0 0 0-4 0v4", key: "1pdhuj" }],
[
"path",
{
d: "M18 22V5.618a1 1 0 0 0-.553-.894l-4.553-2.277a2 2 0 0 0-1.788 0L6.553 4.724A1 1 0 0 0 6 5.618V22",
key: "1rkokr"
}
],
[
"path",
{
d: "m18 7 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.618a1 1 0 0 1 .553-.894L6 7",
key: "1w6esw"
}
]
]);
export { Church as default };
//# sourceMappingURL=church.js.map
@@ -0,0 +1 @@
{"version":3,"file":"stop-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,13 @@
# `rect`
## Installation
```sh
$ yarn add @radix-ui/rect
# or
$ npm install @radix-ui/rect
```
## Usage
This is an internal utility, not intended for public usage.
@@ -0,0 +1,158 @@
/**
* @fileoverview Rule to check the spacing around the * in yield* expressions.
* @author Bryan Smith
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// 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: "yield-star-spacing",
url: "https://eslint.style/rules/yield-star-spacing",
},
},
],
},
type: "layout",
docs: {
description:
"Require or disallow spacing around the `*` in `yield*` expressions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/yield-star-spacing",
},
fixable: "whitespace",
schema: [
{
oneOf: [
{
enum: ["before", "after", "both", "neither"],
},
{
type: "object",
properties: {
before: { type: "boolean" },
after: { type: "boolean" },
},
additionalProperties: false,
},
],
},
],
messages: {
missingBefore: "Missing space before *.",
missingAfter: "Missing space after *.",
unexpectedBefore: "Unexpected space before *.",
unexpectedAfter: "Unexpected space after *.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const mode = (function (option) {
if (!option || typeof option === "string") {
return {
before: { before: true, after: false },
after: { before: false, after: true },
both: { before: true, after: true },
neither: { before: false, after: false },
}[option || "after"];
}
return option;
})(context.options[0]);
/**
* Checks the spacing between two tokens before or after the star token.
* @param {string} side Either "before" or "after".
* @param {Token} leftToken `function` keyword token if side is "before", or
* star token if side is "after".
* @param {Token} rightToken Star token if side is "before", or identifier
* token if side is "after".
* @returns {void}
*/
function checkSpacing(side, leftToken, rightToken) {
if (
sourceCode.isSpaceBetween(leftToken, rightToken) !== mode[side]
) {
const after = leftToken.value === "*";
const spaceRequired = mode[side];
const node = after ? leftToken : rightToken;
let messageId;
if (spaceRequired) {
messageId =
side === "before" ? "missingBefore" : "missingAfter";
} else {
messageId =
side === "before"
? "unexpectedBefore"
: "unexpectedAfter";
}
context.report({
node,
messageId,
fix(fixer) {
if (spaceRequired) {
if (after) {
return fixer.insertTextAfter(node, " ");
}
return fixer.insertTextBefore(node, " ");
}
return fixer.removeRange([
leftToken.range[1],
rightToken.range[0],
]);
},
});
}
}
/**
* Enforces the spacing around the star if node is a yield* expression.
* @param {ASTNode} node A yield expression node.
* @returns {void}
*/
function checkExpression(node) {
if (!node.delegate) {
return;
}
const tokens = sourceCode.getFirstTokens(node, 3);
const yieldToken = tokens[0];
const starToken = tokens[1];
const nextToken = tokens[2];
checkSpacing("before", yieldToken, starToken);
checkSpacing("after", starToken, nextToken);
}
return {
YieldExpression: checkExpression,
};
},
};
@@ -0,0 +1,51 @@
export type Formatter = (input: string | number | null | undefined) => string
export interface Colors {
isColorSupported: boolean
reset: Formatter
bold: Formatter
dim: Formatter
italic: Formatter
underline: Formatter
inverse: Formatter
hidden: Formatter
strikethrough: Formatter
black: Formatter
red: Formatter
green: Formatter
yellow: Formatter
blue: Formatter
magenta: Formatter
cyan: Formatter
white: Formatter
gray: Formatter
bgBlack: Formatter
bgRed: Formatter
bgGreen: Formatter
bgYellow: Formatter
bgBlue: Formatter
bgMagenta: Formatter
bgCyan: Formatter
bgWhite: Formatter
blackBright: Formatter
redBright: Formatter
greenBright: Formatter
yellowBright: Formatter
blueBright: Formatter
magentaBright: Formatter
cyanBright: Formatter
whiteBright: Formatter
bgBlackBright: Formatter
bgRedBright: Formatter
bgGreenBright: Formatter
bgYellowBright: Formatter
bgBlueBright: Formatter
bgMagentaBright: Formatter
bgCyanBright: Formatter
bgWhiteBright: Formatter
}
@@ -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 IdCard = createLucideIcon("IdCard", [
["path", { d: "M16 10h2", key: "8sgtl7" }],
["path", { d: "M16 14h2", key: "epxaof" }],
["path", { d: "M6.17 15a3 3 0 0 1 5.66 0", key: "n6f512" }],
["circle", { cx: "9", cy: "11", r: "2", key: "yxgjnd" }],
["rect", { x: "2", y: "5", width: "20", height: "14", rx: "2", key: "qneu4z" }]
]);
export { IdCard as default };
//# sourceMappingURL=id-card.js.map
@@ -0,0 +1,57 @@
# balanced-match
Match balanced string pairs, like `{` and `}` or `<b>` and
`</b>`. Supports regular expressions as well!
## Example
Get the first matching pair of braces:
```js
import { balanced } from 'balanced-match'
console.log(balanced('{', '}', 'pre{in{nested}}post'))
console.log(balanced('{', '}', 'pre{first}between{second}post'))
console.log(
balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'),
)
```
The matches are:
```bash
$ node example.js
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
{ start: 3,
end: 9,
pre: 'pre',
body: 'first',
post: 'between{second}post' }
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
```
## API
### const m = balanced(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
object with those keys:
- **start** the index of the first match of `a`
- **end** the index of the matching `b`
- **pre** the preamble, `a` and `b` not included
- **body** the match, `a` and `b` not included
- **post** the postscript, `a` and `b` not included
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
### const r = balanced.range(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
array with indexes: `[ <a index>, <b index> ]`.
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
@@ -0,0 +1 @@
{"version":3,"file":"chevron-up.js","sources":["../../../src/icons/chevron-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChevronUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTggMTUtNi02LTYgNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chevron-up\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 ChevronUp = createLucideIcon('ChevronUp', [['path', { d: 'm18 15-6-6-6 6', key: '153udz' }]]);\n\nexport default ChevronUp;\n"],"names":[],"mappings":";;;;;;;;;AAaA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,WAAa,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,EAAE,CAAA,CAAA,CAAG,gBAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,40 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _tokenizer = require('../parser/tokenizer');
var _types = require('../parser/tokenizer/types');
const EMPTY_DECLARATION_INFO = {
typeDeclarations: new Set(),
valueDeclarations: new Set(),
}; exports.EMPTY_DECLARATION_INFO = EMPTY_DECLARATION_INFO;
/**
* Get all top-level identifiers that should be preserved when exported in TypeScript.
*
* Examples:
* - If an identifier is declared as `const x`, then `export {x}` should be preserved.
* - If it's declared as `type x`, then `export {x}` should be removed.
* - If it's declared as both `const x` and `type x`, then the export should be preserved.
* - Classes and enums should be preserved (even though they also introduce types).
* - Imported identifiers should be preserved since we don't have enough information to
* rule them out. --isolatedModules disallows re-exports, which catches errors here.
*/
function getDeclarationInfo(tokens) {
const typeDeclarations = new Set();
const valueDeclarations = new Set();
for (let i = 0; i < tokens.tokens.length; i++) {
const token = tokens.tokens[i];
if (token.type === _types.TokenType.name && _tokenizer.isTopLevelDeclaration.call(void 0, token)) {
if (token.isType) {
typeDeclarations.add(tokens.identifierNameForToken(token));
} else {
valueDeclarations.add(tokens.identifierNameForToken(token));
}
}
}
return {typeDeclarations, valueDeclarations};
} exports.default = getDeclarationInfo;
@@ -0,0 +1 @@
{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = true,\n }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1')\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
@@ -0,0 +1,59 @@
import { V as isNodeFirstInLine, f as createRule } from "../utils.js";
const MESSAGE_LOCATION = {
"tag-aligned": "matchIndent",
"line-aligned": "alignWithOpening"
};
var jsx_closing_tag_location_default = createRule({
name: "jsx-closing-tag-location",
meta: {
type: "layout",
docs: { description: "Enforce closing tag location for multiline JSX" },
fixable: "whitespace",
schema: [{ anyOf: [{
type: "string",
enum: ["tag-aligned", "line-aligned"]
}] }],
defaultOptions: ["tag-aligned"],
messages: {
onOwnLine: "Closing tag of a multiline JSX expression must be on its own line.",
matchIndent: "Expected closing tag to match indentation of opening.",
alignWithOpening: "Expected closing tag to be aligned with the line containing the opening tag"
}
},
create(context, [option]) {
function getIndentation(openingStartOfLine, opening) {
if (option === "line-aligned") return openingStartOfLine.column;
else return opening.loc.start.column;
}
function handleClosingElement(node) {
if (!node.parent) return;
const sourceCode = context.sourceCode;
const opening = "openingFragment" in node.parent ? node.parent.openingFragment : node.parent.openingElement;
const openingLoc = sourceCode.getFirstToken(opening).loc.start;
const openingLine = sourceCode.lines[openingLoc.line - 1];
const openingStartOfLine = {
column: /^\s*/.exec(openingLine)?.[0].length,
line: openingLoc.line
};
if (opening.loc.start.line === node.loc.start.line) return;
if (opening.loc.start.column === node.loc.start.column && option === "tag-aligned") return;
if (openingStartOfLine.column === node.loc.start.column && option === "line-aligned") return;
const messageId = isNodeFirstInLine(context, node) ? MESSAGE_LOCATION[option] : "onOwnLine";
context.report({
node,
messageId,
loc: node.loc,
fix(fixer) {
const indent = new Array((getIndentation(openingStartOfLine, opening) || 0) + 1).join(" ");
if (isNodeFirstInLine(context, node)) return fixer.replaceTextRange([node.range[0] - node.loc.start.column, node.range[0]], indent);
return fixer.insertTextBefore(node, `\n${indent}`);
}
});
}
return {
JSXClosingElement: handleClosingElement,
JSXClosingFragment: handleClosingElement
};
}
});
export { jsx_closing_tag_location_default as t };
@@ -0,0 +1,228 @@
'use strict';
module.exports = function generate_custom(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 $errorKeyword;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $errs = 'errs__' + $lvl;
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;
}
var $rule = this,
$definition = 'definition' + $lvl,
$rDef = $rule.definition,
$closingBraces = '';
var $compile, $inline, $macro, $ruleValidate, $validateCode;
if ($isData && $rDef.$data) {
$validateCode = 'keywordValidate' + $lvl;
var $validateSchema = $rDef.validateSchema;
out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
} else {
$ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
if (!$ruleValidate) return;
$schemaValue = 'validate.schema' + $schemaPath;
$validateCode = $ruleValidate.code;
$compile = $rDef.compile;
$inline = $rDef.inline;
$macro = $rDef.macro;
}
var $ruleErrs = $validateCode + '.errors',
$i = 'i' + $lvl,
$ruleErr = 'ruleErr' + $lvl,
$asyncKeyword = $rDef.async;
if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
if (!($inline || $macro)) {
out += '' + ($ruleErrs) + ' = null;';
}
out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
if ($isData && $rDef.$data) {
$closingBraces += '}';
out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
if ($validateSchema) {
$closingBraces += '}';
out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
}
}
if ($inline) {
if ($rDef.statements) {
out += ' ' + ($ruleValidate.validate) + ' ';
} else {
out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
}
} else if ($macro) {
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
$it.schema = $ruleValidate.validate;
$it.schemaPath = '';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
it.compositeRule = $it.compositeRule = $wasComposite;
out += ' ' + ($code);
} else {
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = '';
out += ' ' + ($validateCode) + '.call( ';
if (it.opts.passContext) {
out += 'this';
} else {
out += 'self';
}
if ($compile || $rDef.schema === false) {
out += ' , ' + ($data) + ' ';
} else {
out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
}
out += ' , (dataPath || \'\')';
if (it.errorPath != '""') {
out += ' + ' + (it.errorPath);
}
var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
$parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';
var def_callRuleValidate = out;
out = $$outStack.pop();
if ($rDef.errors === false) {
out += ' ' + ($valid) + ' = ';
if ($asyncKeyword) {
out += 'await ';
}
out += '' + (def_callRuleValidate) + '; ';
} else {
if ($asyncKeyword) {
$ruleErrs = 'customErrors' + $lvl;
out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
} else {
out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
}
}
}
if ($rDef.modifying) {
out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
}
out += '' + ($closingBraces);
if ($rDef.valid) {
if ($breakOnError) {
out += ' if (true) { ';
}
} else {
out += ' if ( ';
if ($rDef.valid === undefined) {
out += ' !';
if ($macro) {
out += '' + ($nextValid);
} else {
out += '' + ($valid);
}
} else {
out += ' ' + (!$rDef.valid) + ' ';
}
out += ') { ';
$errorKeyword = $rule.keyword;
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = '';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , 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++; ';
}
var def_customError = out;
out = $$outStack.pop();
if ($inline) {
if ($rDef.errors) {
if ($rDef.errors != 'full') {
out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
if (it.opts.verbose) {
out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
}
out += ' } ';
}
} else {
if ($rDef.errors === false) {
out += ' ' + (def_customError) + ' ';
} else {
out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
if (it.opts.verbose) {
out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
}
out += ' } } ';
}
}
} else if ($macro) {
out += ' var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError(vErrors); ';
} else {
out += ' validate.errors = vErrors; return false; ';
}
}
} else {
if ($rDef.errors === false) {
out += ' ' + (def_customError) + ' ';
} else {
out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; ';
if (it.opts.verbose) {
out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
}
out += ' } } else { ' + (def_customError) + ' } ';
}
}
out += ' } ';
if ($breakOnError) {
out += ' else { ';
}
}
return out;
}
@@ -0,0 +1 @@
{"version":3,"file":"dd-gridstack.js","sourceRoot":"","sources":["../src/dd-gridstack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAsCxD,yBAAyB;AAEzB;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IAEtB;;;;;;;;;;;;OAYG;IACI,SAAS,CAAC,EAAuB,EAAE,IAAY,EAAE,GAAW,EAAE,KAAe;QAClF,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1C,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,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AE,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe;QAC/G,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/**\r\n * dd-gridstack.ts 12.6.0\r\n * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license\r\n */\r\n\r\nLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"config.js","names":[],"sources":["../../src/config.ts"],"sourcesContent":["import type { SSROption } from './router'\nimport type { AnySerializationAdapter } from './ssr/serializer/transformer'\n\nexport interface RouterConfigOptions<\n in out TSerializationAdapters,\n in out TDefaultSsr,\n> {\n serializationAdapters?: TSerializationAdapters\n defaultSsr?: TDefaultSsr\n}\n\nexport interface RouterConfig<\n in out TSerializationAdapters,\n in out TDefaultSsr,\n> {\n '~types': RouterConfigTypes<TSerializationAdapters, TDefaultSsr>\n serializationAdapters: TSerializationAdapters\n defaultSsr: TDefaultSsr | undefined\n}\n\nexport interface RouterConfigTypes<\n in out TSerializationAdapters,\n in out TDefaultSsr,\n> {\n serializationAdapters: TSerializationAdapters\n defaultSsr: TDefaultSsr\n}\n\nexport const createRouterConfig = <\n const TSerializationAdapters extends ReadonlyArray<AnySerializationAdapter> =\n [],\n TDefaultSsr extends SSROption = SSROption,\n>(\n options: RouterConfigOptions<TSerializationAdapters, TDefaultSsr>,\n): RouterConfig<TSerializationAdapters, TDefaultSsr> => {\n return {\n serializationAdapters: options.serializationAdapters,\n defaultSsr: options.defaultSsr,\n } as RouterConfig<TSerializationAdapters, TDefaultSsr>\n}\n\nexport type AnyRouterConfig = RouterConfig<any, any>\n"],"mappings":";AA4BA,MAAa,sBAKX,YACsD;AACtD,QAAO;EACL,uBAAuB,QAAQ;EAC/B,YAAY,QAAQ;EACrB"}
@@ -0,0 +1,23 @@
import type {Vocabulary} from "../types"
import coreVocabulary from "./core"
import validationVocabulary from "./validation"
import getApplicatorVocabulary from "./applicator"
import dynamicVocabulary from "./dynamic"
import nextVocabulary from "./next"
import unevaluatedVocabulary from "./unevaluated"
import formatVocabulary from "./format"
import {metadataVocabulary, contentVocabulary} from "./metadata"
const draft2020Vocabularies: Vocabulary[] = [
dynamicVocabulary,
coreVocabulary,
validationVocabulary,
getApplicatorVocabulary(true),
formatVocabulary,
metadataVocabulary,
contentVocabulary,
nextVocabulary,
unevaluatedVocabulary,
]
export default draft2020Vocabularies
@@ -0,0 +1,143 @@
import { f as createRule, g as import_ast_utils, j as getSwitchCaseColonToken, z as isKeywordToken } from "../utils.js";
var space_before_blocks_default = createRule({
name: "space-before-blocks",
meta: {
type: "layout",
docs: { description: "Enforce consistent spacing before blocks" },
fixable: "whitespace",
schema: [{ oneOf: [{
type: "string",
enum: ["always", "never"]
}, {
type: "object",
properties: {
keywords: {
type: "string",
enum: [
"always",
"never",
"off"
]
},
functions: {
type: "string",
enum: [
"always",
"never",
"off"
]
},
classes: {
type: "string",
enum: [
"always",
"never",
"off"
]
},
modules: {
type: "string",
enum: [
"always",
"never",
"off"
]
}
},
additionalProperties: false
}] }],
defaultOptions: ["always"],
messages: {
unexpectedSpace: "Unexpected space before opening brace.",
missingSpace: "Missing space before opening brace."
}
},
create(context, [config]) {
const sourceCode = context.sourceCode;
let alwaysFunctions = true;
let alwaysKeywords = true;
let alwaysClasses = true;
let alwaysModules = true;
let neverFunctions = false;
let neverKeywords = false;
let neverClasses = false;
let neverModules = false;
if (typeof config === "object") {
alwaysFunctions = config.functions === "always";
alwaysKeywords = config.keywords === "always";
alwaysClasses = config.classes === "always";
alwaysModules = config.modules === "always";
neverFunctions = config.functions === "never";
neverKeywords = config.keywords === "never";
neverClasses = config.classes === "never";
neverModules = config.modules === "never";
} else if (config === "never") {
alwaysFunctions = false;
alwaysKeywords = false;
alwaysClasses = false;
alwaysModules = false;
neverFunctions = true;
neverKeywords = true;
neverClasses = true;
neverModules = true;
}
function isFunctionBody(node) {
if (!("parent" in node)) return false;
const parent = node.parent;
return node.type === "BlockStatement" && (0, import_ast_utils.isFunction)(parent) && parent.body === node;
}
function isConflicted(precedingToken, node) {
return (0, import_ast_utils.isArrowToken)(precedingToken) || isKeywordToken(precedingToken) && !isFunctionBody(node) || (0, import_ast_utils.isColonToken)(precedingToken) && "parent" in node && node.parent && node.parent.type === "SwitchCase" && precedingToken === getSwitchCaseColonToken(node.parent, sourceCode);
}
function checkPrecedingSpace(node) {
const precedingToken = sourceCode.getTokenBefore(node);
if (precedingToken && !isConflicted(precedingToken, node) && (0, import_ast_utils.isTokenOnSameLine)(precedingToken, node)) {
const hasSpace = sourceCode.isSpaceBetween(precedingToken, node);
let requireSpace;
let requireNoSpace;
if (isFunctionBody(node)) {
requireSpace = alwaysFunctions;
requireNoSpace = neverFunctions;
} else if (node.type === "ClassBody" || node.type === "TSEnumBody" || node.type === "TSInterfaceBody") {
requireSpace = alwaysClasses;
requireNoSpace = neverClasses;
} else if (node.type === "TSModuleBlock") {
requireSpace = alwaysModules;
requireNoSpace = neverModules;
} else {
requireSpace = alwaysKeywords;
requireNoSpace = neverKeywords;
}
if (requireSpace && !hasSpace) context.report({
node,
messageId: "missingSpace",
fix(fixer) {
return fixer.insertTextBefore(node, " ");
}
});
else if (requireNoSpace && hasSpace) context.report({
node,
messageId: "unexpectedSpace",
fix(fixer) {
return fixer.removeRange([precedingToken.range[1], node.range[0]]);
}
});
}
}
return {
BlockStatement: checkPrecedingSpace,
ClassBody: checkPrecedingSpace,
SwitchStatement(node) {
const cases = node.cases;
let openingBrace;
if (cases.length > 0) openingBrace = sourceCode.getTokenBefore(cases[0]);
else openingBrace = sourceCode.getLastToken(node, 1);
checkPrecedingSpace(openingBrace);
},
TSEnumBody: checkPrecedingSpace,
TSInterfaceBody: checkPrecedingSpace,
TSModuleBlock: checkPrecedingSpace
};
}
});
export { space_before_blocks_default as t };
@@ -0,0 +1,24 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2016_array_include = void 0;
const base_config_1 = require("./base-config");
exports.es2016_array_include = {
libs: [],
variables: [
['Array', base_config_1.TYPE],
['ReadonlyArray', base_config_1.TYPE],
['Int8Array', base_config_1.TYPE],
['Uint8Array', base_config_1.TYPE],
['Uint8ClampedArray', base_config_1.TYPE],
['Int16Array', base_config_1.TYPE],
['Uint16Array', base_config_1.TYPE],
['Int32Array', base_config_1.TYPE],
['Uint32Array', base_config_1.TYPE],
['Float32Array', base_config_1.TYPE],
['Float64Array', base_config_1.TYPE],
],
};
@@ -0,0 +1,20 @@
/**
* @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 LayoutList = createLucideIcon("LayoutList", [
["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
["path", { d: "M14 4h7", key: "3xa0d5" }],
["path", { d: "M14 9h7", key: "1icrd9" }],
["path", { d: "M14 15h7", key: "1mj8o2" }],
["path", { d: "M14 20h7", key: "11slyb" }]
]);
export { LayoutList as default };
//# sourceMappingURL=layout-list.js.map
@@ -0,0 +1 @@
{"version":3,"file":"folder-minus.js","sources":["../../../src/icons/folder-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAxM2g2IiAvPgogIDxwYXRoIGQ9Ik0yMCAyMGEyIDIgMCAwIDAgMi0yVjhhMiAyIDAgMCAwLTItMmgtNy45YTIgMiAwIDAgMS0xLjY5LS45TDkuNiAzLjlBMiAyIDAgMCAwIDcuOTMgM0g0YTIgMiAwIDAgMC0yIDJ2MTNhMiAyIDAgMCAwIDIgMloiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/folder-minus\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 FolderMinus = createLucideIcon('FolderMinus', [\n ['path', { d: 'M9 13h6', key: '1uhe8q' }],\n [\n 'path',\n {\n d: 'M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z',\n key: '1kt360',\n },\n ],\n]);\n\nexport default FolderMinus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAA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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 mcp_js_1 = require("../../server/mcp.js");
const sse_js_1 = require("../../server/sse.js");
const z = __importStar(require("zod/v4"));
const express_js_1 = require("../../server/express.js");
/**
* This example server demonstrates the deprecated HTTP+SSE transport
* (protocol version 2024-11-05). It mainly used for testing backward compatible clients.
*
* The server exposes two endpoints:
* - /mcp: For establishing the SSE stream (GET)
* - /messages: For receiving client messages (POST)
*
*/
// Create an MCP server instance
const getServer = () => {
const server = new mcp_js_1.McpServer({
name: 'simple-sse-server',
version: '1.0.0'
}, { capabilities: { logging: {} } });
server.registerTool('start-notification-stream', {
description: 'Starts sending periodic notifications',
inputSchema: {
interval: z.number().describe('Interval in milliseconds between notifications').default(1000),
count: z.number().describe('Number of notifications to send').default(10)
}
}, async ({ interval, count }, extra) => {
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
let counter = 0;
// Send the initial notification
await server.sendLoggingMessage({
level: 'info',
data: `Starting notification stream with ${count} messages every ${interval}ms`
}, extra.sessionId);
// Send periodic notifications
while (counter < count) {
counter++;
await sleep(interval);
try {
await server.sendLoggingMessage({
level: 'info',
data: `Notification #${counter} at ${new Date().toISOString()}`
}, extra.sessionId);
}
catch (error) {
console.error('Error sending notification:', error);
}
}
return {
content: [
{
type: 'text',
text: `Completed sending ${count} notifications every ${interval}ms`
}
]
};
});
return server;
};
const app = (0, express_js_1.createMcpExpressApp)();
// Store transports by session ID
const transports = {};
// SSE endpoint for establishing the stream
app.get('/mcp', async (req, res) => {
console.log('Received GET request to /sse (establishing SSE stream)');
try {
// Create a new SSE transport for the client
// The endpoint for POST messages is '/messages'
const transport = new sse_js_1.SSEServerTransport('/messages', res);
// Store the transport by session ID
const sessionId = transport.sessionId;
transports[sessionId] = transport;
// Set up onclose handler to clean up transport when closed
transport.onclose = () => {
console.log(`SSE transport closed for session ${sessionId}`);
delete transports[sessionId];
};
// Connect the transport to the MCP server
const server = getServer();
await server.connect(transport);
console.log(`Established SSE stream with session ID: ${sessionId}`);
}
catch (error) {
console.error('Error establishing SSE stream:', error);
if (!res.headersSent) {
res.status(500).send('Error establishing SSE stream');
}
}
});
// Messages endpoint for receiving client JSON-RPC requests
app.post('/messages', async (req, res) => {
console.log('Received POST request to /messages');
// Extract session ID from URL query parameter
// In the SSE protocol, this is added by the client based on the endpoint event
const sessionId = req.query.sessionId;
if (!sessionId) {
console.error('No session ID provided in request URL');
res.status(400).send('Missing sessionId parameter');
return;
}
const transport = transports[sessionId];
if (!transport) {
console.error(`No active transport found for session ID: ${sessionId}`);
res.status(404).send('Session not found');
return;
}
try {
// Handle the POST message with the transport
await transport.handlePostMessage(req, res, req.body);
}
catch (error) {
console.error('Error handling request:', error);
if (!res.headersSent) {
res.status(500).send('Error handling request');
}
}
});
// Start the server
const PORT = 3000;
app.listen(PORT, error => {
if (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`);
});
// Handle server shutdown
process.on('SIGINT', async () => {
console.log('Shutting down server...');
// Close all active transports to properly clean up resources
for (const sessionId in transports) {
try {
console.log(`Closing transport for session ${sessionId}`);
await transports[sessionId].close();
delete transports[sessionId];
}
catch (error) {
console.error(`Error closing transport for session ${sessionId}:`, error);
}
}
console.log('Server shutdown complete');
process.exit(0);
});
//# sourceMappingURL=simpleSseServer.js.map
@@ -0,0 +1,24 @@
import { LogLevels, createConsola as createConsola$1 } from './core.mjs';
export { Consola, LogTypes } from './core.mjs';
import { B as BasicReporter } from './shared/consola.DRwqZj3T.mjs';
import 'node:util';
import 'node:path';
function createConsola(options = {}) {
let level = LogLevels.info;
if (process.env.CONSOLA_LEVEL) {
level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
}
const consola2 = createConsola$1({
level,
defaults: { level },
stdout: process.stdout,
stderr: process.stderr,
reporters: options.reporters || [new BasicReporter()],
...options
});
return consola2;
}
const consola = createConsola();
export { LogLevels, consola, createConsola, consola as default };
@@ -0,0 +1 @@
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;AACrB,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAWY,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU;gBACzC,CAAC,CAAC,qCAAqC;gBACvC,CAAC,CAAC,uBAAuB,MAAM,CAAC,eAAe,GAAG;YACpD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAAC,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E,CAAC,IAAI,CAAC,SAAS;wBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;gBACrC,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,YAAY,CACnB,GAAS,EALine truncated
@@ -0,0 +1 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,c=t=>({x:t,y:t});function l(){return"undefined"!=typeof window}function s(t){return a(t)?(t.nodeName||"").toLowerCase():"#document"}function f(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function u(t){var e;return null==(e=(a(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function a(t){return!!l()&&(t instanceof Node||t instanceof f(t).Node)}function d(t){return!!l()&&(t instanceof Element||t instanceof f(t).Element)}function h(t){return!!l()&&(t instanceof HTMLElement||t instanceof f(t).HTMLElement)}function p(t){return!(!l()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof f(t).ShadowRoot)}function g(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function m(t){return/^(table|td|th)$/.test(s(t))}function y(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const w=/transform|translate|scale|rotate|perspective|filter/,x=/paint|layout|strict|content/,v=t=>!!t&&"none"!==t;let b;function L(t){const e=d(t)?C(t):t;return v(e.transform)||v(e.translate)||v(e.scale)||v(e.rotate)||v(e.perspective)||!R()&&(v(e.backdropFilter)||v(e.filter))||w.test(e.willChange||"")||x.test(e.contain||"")}function R(){return null==b&&(b="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function T(t){return/^(html|body|#document)$/.test(s(t))}function C(t){return f(t).getComputedStyle(t)}function S(t){return d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function E(t){if("html"===s(t))return t;const e=t.assignedSlot||t.parentNode||p(t)&&t.host||u(t);return p(e)?e.host:e}function F(t){const e=E(t);return T(e)?t.ownerDocument?t.ownerDocument.body:t.body:h(e)&&g(e)?e:F(e)}function O(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=F(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=f(i);if(r){const t=D(c);return e.concat(c,c.visualViewport||[],g(i)?i:[],t&&n?O(t):[])}return e.concat(i,O(i,[],n))}function D(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function W(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=h(t),c=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=i(n)!==c||i(o)!==l;return s&&(n=c,o=l),{width:n,height:o,$:s}}function M(t){return d(t)?t:t.contextElement}function H(t){const e=M(t);if(!h(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=W(e);let s=(l?i(n.width):n.width)/o,f=(l?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const P=c(0);function z(t){const e=f(t);return R()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:P}function A(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),l=M(t);let s=c(1);n&&(i?d(i)&&(s=H(i)):s=H(t));const u=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==f(t))&&e}(l,o,i)?z(l):c(0);let a=(r.left+u.x)/s.x,h=(r.top+u.y)/s.y,p=r.width/s.x,g=r.height/s.y;if(l){const t=f(l),e=i&&d(i)?f(i):i;let n=t,o=D(n);for(;o&&i&&e!==n;){const t=H(o),e=o.getBoundingClientRect(),i=C(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,h*=t.y,p*=t.x,g*=t.y,a+=r,h+=c,n=f(o),o=D(n)}}return e.rectToClientRect({width:p,height:g,x:a,y:h})}function B(t,e){const n=S(t).scrollLeft;return e?e.left+n:A(u(t)).left+n}function V(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-B(t,n),y:n.top+e.scrollTop}}function N(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=f(t),o=u(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=R();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}const a=B(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,c=Math.abs(o.clientWidth-e.clientWidth-i);c<=25&&(r-=c)}else a<=25&&(r+=a);return{width:r,height:c,x:l,y:s}}(t,i);else if("document"===n)r=function(t){const e=u(t),n=S(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+B(t);const s=-n.scrollTop;return"rtl"===C(i).direction&&(l+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:c,x:l,y:s}}(u(t));else if(d(n))r=function(t,e){const n=A(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=h(t)?H(t):c(1);retuLine truncated
@@ -0,0 +1,477 @@
declare module "buffer" {
type ImplicitArrayBuffer<T extends WithImplicitCoercion<ArrayBufferLike>> = T extends
{ valueOf(): infer V extends ArrayBufferLike } ? V : T;
global {
interface BufferConstructor {
// see buffer.d.ts for implementation shared with all TypeScript versions
/**
* Allocates a new buffer containing the given {str}.
*
* @param str String to store in buffer.
* @param encoding encoding to use, optional. Default is 'utf8'
* @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
*/
new(str: string, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
*/
new(size: number): Buffer<ArrayBuffer>;
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
*/
new(array: ArrayLike<number>): Buffer<ArrayBuffer>;
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}/{SharedArrayBuffer}.
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
* @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
*/
new<TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(arrayBuffer: TArrayBuffer): Buffer<TArrayBuffer>;
/**
* Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
* Array entries outside that range will be truncated to fit into it.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
* ```
*
* If `array` is an `Array`-like object (that is, one with a `length` property of
* type `number`), it is treated as if it is an array, unless it is a `Buffer` or
* a `Uint8Array`. This means all other `TypedArray` variants get treated as an
* `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use
* `Buffer.copyBytesFrom()`.
*
* A `TypeError` will be thrown if `array` is not an `Array` or another type
* appropriate for `Buffer.from()` variants.
*
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal
* `Buffer` pool like `Buffer.allocUnsafe()` does.
* @since v5.10.0
*/
from(array: WithImplicitCoercion<ArrayLike<number>>): Buffer<ArrayBuffer>;
/**
* This creates a view of the `ArrayBuffer` without copying the underlying
* memory. For example, when passed a reference to the `.buffer` property of a
* `TypedArray` instance, the newly created `Buffer` will share the same
* allocated memory as the `TypedArray`'s underlying `ArrayBuffer`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const arr = new Uint16Array(2);
*
* arr[0] = 5000;
* arr[1] = 4000;
*
* // Shares memory with `arr`.
* const buf = Buffer.from(arr.buffer);
*
* console.log(buf);
* // Prints: <Buffer 88 13 a0 0f>
*
* // Changing the original Uint16Array changes the Buffer also.
* arr[1] = 6000;
*
* console.log(buf);
* // Prints: <Buffer 88 13 70 17>
* ```
*
* The optional `byteOffset` and `length` arguments specify a memory range within
* the `arrayBuffer` that will be shared by the `Buffer`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const ab = new ArrayBuffer(10);
* const buf = Buffer.from(ab, 0, 2);
*
* console.log(buf.length);
* // Prints: 2
* ```
*
* A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a
* `SharedArrayBuffer` or another type appropriate for `Buffer.from()`
* variants.
*
* It is important to remember that a backing `ArrayBuffer` can cover a range
* of memory that extends beyond the bounds of a `TypedArray` view. A new
* `Buffer` created using the `buffer` property of a `TypedArray` may extend
* beyond the range of the `TypedArray`:
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements
* const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements
* console.log(arrA.buffer === arrB.buffer); // true
*
* const buf = Buffer.from(arrB.buffer);
* console.log(buf);
* // Prints: <Buffer 63 64 65 66>
* ```
* @since v5.10.0
* @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the
* `.buffer` property of a `TypedArray`.
* @param byteOffset Index of first byte to expose. **Default:** `0`.
* @param length Number of bytes to expose. **Default:**
* `arrayBuffer.byteLength - byteOffset`.
*/
from<TArrayBuffer extends WithImplicitCoercion<ArrayBufferLike>>(
arrayBuffer: TArrayBuffer,
byteOffset?: number,
length?: number,
): Buffer<ImplicitArrayBuffer<TArrayBuffer>>;
/**
* Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
* the character encoding to be used when converting `string` into bytes.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf1 = Buffer.from('this is a tést');
* const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
*
* console.log(buf1.toString());
* // Prints: this is a tést
* console.log(buf2.toString());
* // Prints: this is a tést
* console.log(buf1.toString('latin1'));
* // Prints: this is a tést
* ```
*
* A `TypeError` will be thrown if `string` is not a string or another type
* appropriate for `Buffer.from()` variants.
*
* `Buffer.from(string)` may also use the internal `Buffer` pool like
* `Buffer.allocUnsafe()` does.
* @since v5.10.0
* @param string A string to encode.
* @param encoding The encoding of `string`. **Default:** `'utf8'`.
*/
from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): Buffer<ArrayBuffer>;
/**
* Creates a new Buffer using the passed {data}
* @param values to create a new Buffer
*/
of(...items: number[]): Buffer<ArrayBuffer>;
/**
* Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together.
*
* If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned.
*
* If `totalLength` is not provided, it is calculated from the `Buffer` instances
* in `list` by adding their lengths.
*
* If `totalLength` is provided, it is coerced to an unsigned integer. If the
* combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
* truncated to `totalLength`. If the combined length of the `Buffer`s in `list` is
* less than `totalLength`, the remaining space is filled with zeros.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Create a single `Buffer` from a list of three `Buffer` instances.
*
* const buf1 = Buffer.alloc(10);
* const buf2 = Buffer.alloc(14);
* const buf3 = Buffer.alloc(18);
* const totalLength = buf1.length + buf2.length + buf3.length;
*
* console.log(totalLength);
* // Prints: 42
*
* const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
*
* console.log(bufA);
* // Prints: <Buffer 00 00 00 00 ...>
* console.log(bufA.length);
* // Prints: 42
* ```
*
* `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
* @since v0.7.11
* @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
* @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
*/
concat(list: readonly Uint8Array[], totalLength?: number): Buffer<ArrayBuffer>;
/**
* Copies the underlying memory of `view` into a new `Buffer`.
*
* ```js
* const u16 = new Uint16Array([0, 0xffff]);
* const buf = Buffer.copyBytesFrom(u16, 1, 1);
* u16[1] = 0;
* console.log(buf.length); // 2
* console.log(buf[0]); // 255
* console.log(buf[1]); // 255
* ```
* @since v19.8.0
* @param view The {TypedArray} to copy.
* @param [offset=0] The starting offset within `view`.
* @param [length=view.length - offset] The number of elements from `view` to copy.
*/
copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer<ArrayBuffer>;
/**
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.alloc(5);
*
* console.log(buf);
* // Prints: <Buffer 00 00 00 00 00>
* ```
*
* If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
*
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.alloc(5, 'a');
*
* console.log(buf);
* // Prints: <Buffer 61 61 61 61 61>
* ```
*
* If both `fill` and `encoding` are specified, the allocated `Buffer` will be
* initialized by calling `buf.fill(fill, encoding)`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
*
* console.log(buf);
* // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
* ```
*
* Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
* contents will never contain sensitive data from previous allocations, including
* data that might not have been allocated for `Buffer`s.
*
* A `TypeError` will be thrown if `size` is not a number.
* @since v5.10.0
* @param size The desired length of the new `Buffer`.
* @param [fill=0] A value to pre-fill the new `Buffer` with.
* @param [encoding='utf8'] If `fill` is a string, this is its encoding.
*/
alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
/**
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
*
* The underlying memory for `Buffer` instances created in this way is _not_
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.allocUnsafe(10);
*
* console.log(buf);
* // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
*
* buf.fill(0);
*
* console.log(buf);
* // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
* ```
*
* A `TypeError` will be thrown if `size` is not a number.
*
* The `Buffer` module pre-allocates an internal `Buffer` instance of
* size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
* and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two).
*
* Use of this pre-allocated internal memory pool is a key difference between
* calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
* Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
* than or equal to half `Buffer.poolSize`. The
* difference is subtle but can be important when an application requires the
* additional performance that `Buffer.allocUnsafe()` provides.
* @since v5.10.0
* @param size The desired length of the new `Buffer`.
*/
allocUnsafe(size: number): Buffer<ArrayBuffer>;
/**
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
* `size` is 0.
*
* The underlying memory for `Buffer` instances created in this way is _not_
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
* such `Buffer` instances with zeroes.
*
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
* allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
* from a single pre-allocated `Buffer`. This allows applications to avoid the
* garbage collection overhead of creating many individually allocated `Buffer`
* instances. This approach improves both performance and memory usage by
* eliminating the need to track and clean up as many individual `ArrayBuffer` objects.
*
* However, in the case where a developer may need to retain a small chunk of
* memory from a pool for an indeterminate amount of time, it may be appropriate
* to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
* then copying out the relevant bits.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Need to keep around a few small chunks of memory.
* const store = [];
*
* socket.on('readable', () => {
* let data;
* while (null !== (data = readable.read())) {
* // Allocate for retained data.
* const sb = Buffer.allocUnsafeSlow(10);
*
* // Copy the data into the new allocation.
* data.copy(sb, 0, 0, 10);
*
* store.push(sb);
* }
* });
* ```
*
* A `TypeError` will be thrown if `size` is not a number.
* @since v5.12.0
* @param size The desired length of the new `Buffer`.
*/
allocUnsafeSlow(size: number): Buffer<ArrayBuffer>;
}
interface Buffer<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> extends Uint8Array<TArrayBuffer> {
// see buffer.d.ts for implementation shared with all TypeScript versions
/**
* Returns a new `Buffer` that references the same memory as the original, but
* offset and cropped by the `start` and `end` indices.
*
* This method is not compatible with the `Uint8Array.prototype.slice()`,
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.from('buffer');
*
* const copiedBuf = Uint8Array.prototype.slice.call(buf);
* copiedBuf[0]++;
* console.log(copiedBuf.toString());
* // Prints: cuffer
*
* console.log(buf.toString());
* // Prints: buffer
*
* // With buf.slice(), the original buffer is modified.
* const notReallyCopiedBuf = buf.slice();
* notReallyCopiedBuf[0]++;
* console.log(notReallyCopiedBuf.toString());
* // Prints: cuffer
* console.log(buf.toString());
* // Also prints: cuffer (!)
* ```
* @since v0.3.0
* @deprecated Use `subarray` instead.
* @param [start=0] Where the new `Buffer` will start.
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
*/
slice(start?: number, end?: number): Buffer<ArrayBuffer>;
/**
* Returns a new `Buffer` that references the same memory as the original, but
* offset and cropped by the `start` and `end` indices.
*
* Specifying `end` greater than `buf.length` will return the same result as
* that of `end` equal to `buf.length`.
*
* This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
*
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
* // from the original `Buffer`.
*
* const buf1 = Buffer.allocUnsafe(26);
*
* for (let i = 0; i < 26; i++) {
* // 97 is the decimal ASCII value for 'a'.
* buf1[i] = i + 97;
* }
*
* const buf2 = buf1.subarray(0, 3);
*
* console.log(buf2.toString('ascii', 0, buf2.length));
* // Prints: abc
*
* buf1[0] = 33;
*
* console.log(buf2.toString('ascii', 0, buf2.length));
* // Prints: !bc
* ```
*
* Specifying negative indexes causes the slice to be generated relative to the
* end of `buf` rather than the beginning.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.from('buffer');
*
* console.log(buf.subarray(-6, -1).toString());
* // Prints: buffe
* // (Equivalent to buf.subarray(0, 5).)
*
* console.log(buf.subarray(-6, -2).toString());
* // Prints: buff
* // (Equivalent to buf.subarray(0, 4).)
*
* console.log(buf.subarray(-5, -2).toString());
* // Prints: uff
* // (Equivalent to buf.subarray(1, 4).)
* ```
* @since v3.0.0
* @param [start=0] Where the new `Buffer` will start.
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
*/
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
}
// TODO: remove globals in future version
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type NonSharedBuffer = Buffer<ArrayBuffer>;
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
}
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
var SlowBuffer: {
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
new(size: number): Buffer<ArrayBuffer>;
prototype: Buffer;
};
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type BufferView<T extends NodeJS.ArrayBufferView> = T extends NodeJS.ArrayBufferView<infer B> ? Buffer<B> : never;
}
@@ -0,0 +1,7 @@
// https://github.com/ajv-validator/ajv/issues/889
import * as equal from "fast-deep-equal"
type Equal = typeof equal & {code: string}
;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default'
export default equal as Equal
@@ -0,0 +1 @@
{"version":3,"file":"toolWithSampleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
/**
* @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 WalletMinimal = createLucideIcon("WalletMinimal", [
["path", { d: "M17 14h.01", key: "7oqj8z" }],
[
"path",
{
d: "M7 7h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14",
key: "u1rqew"
}
]
]);
export { WalletMinimal as default };
//# sourceMappingURL=wallet-minimal.js.map
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseCatchDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const parseCatchDef = (def, refs) => {
return (0, parseDef_js_1.parseDef)(def.innerType._def, refs);
};
exports.parseCatchDef = parseCatchDef;
@@ -0,0 +1 @@
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/shared/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KACzB,GAAG,EAAE;KACL,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACtB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,uBAAuB;YAChC,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC,KAAK,CAAC;IACnB,CAAC;AACL,CAAC,CAAC;KACD,MAAM,CACH,GAAG,CAAC,EAAE;IACF,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,CAAC,CAAC,QAAQ,KAAK,aAAa,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,WAAW,CAAC;AAChG,CAAC,EACD,EAAE,OAAO,EAAE,wDAAwD,EAAE,CACxE,CAAC;AAEN;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,WAAW,CAAC;IAC9D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EA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E,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClD,2BAA2B,EAAE,CAAC,CAAC,OAAO,EAAE,Line truncated
@@ -0,0 +1,2 @@
export { RouterClient } from './RouterClient'
export * from '@tanstack/router-core/ssr/client'
@@ -0,0 +1,238 @@
/*!
* accepts
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var Negotiator = require('negotiator')
var mime = require('mime-types')
/**
* Module exports.
* @public
*/
module.exports = Accepts
/**
* Create a new Accepts object for the given req.
*
* @param {object} req
* @public
*/
function Accepts (req) {
if (!(this instanceof Accepts)) {
return new Accepts(req)
}
this.headers = req.headers
this.negotiator = new Negotiator(req)
}
/**
* Check if the given `type(s)` is acceptable, returning
* the best match when true, otherwise `undefined`, in which
* case you should respond with 406 "Not Acceptable".
*
* The `type` value may be a single mime type string
* such as "application/json", the extension name
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
* or array is given the _best_ match, if any is returned.
*
* Examples:
*
* // Accept: text/html
* this.types('html');
* // => "html"
*
* // Accept: text/*, application/json
* this.types('html');
* // => "html"
* this.types('text/html');
* // => "text/html"
* this.types('json', 'text');
* // => "json"
* this.types('application/json');
* // => "application/json"
*
* // Accept: text/*, application/json
* this.types('image/png');
* this.types('png');
* // => undefined
*
* // Accept: text/*;q=.5, application/json
* this.types(['html', 'json']);
* this.types('html', 'json');
* // => "json"
*
* @param {String|Array} types...
* @return {String|Array|Boolean}
* @public
*/
Accepts.prototype.type =
Accepts.prototype.types = function (types_) {
var types = types_
// support flattened arguments
if (types && !Array.isArray(types)) {
types = new Array(arguments.length)
for (var i = 0; i < types.length; i++) {
types[i] = arguments[i]
}
}
// no types, return all requested types
if (!types || types.length === 0) {
return this.negotiator.mediaTypes()
}
// no accept header, return first given type
if (!this.headers.accept) {
return types[0]
}
var mimes = types.map(extToMime)
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
var first = accepts[0]
return first
? types[mimes.indexOf(first)]
: false
}
/**
* Return accepted encodings or best fit based on `encodings`.
*
* Given `Accept-Encoding: gzip, deflate`
* an array sorted by quality is returned:
*
* ['gzip', 'deflate']
*
* @param {String|Array} encodings...
* @return {String|Array}
* @public
*/
Accepts.prototype.encoding =
Accepts.prototype.encodings = function (encodings_) {
var encodings = encodings_
// support flattened arguments
if (encodings && !Array.isArray(encodings)) {
encodings = new Array(arguments.length)
for (var i = 0; i < encodings.length; i++) {
encodings[i] = arguments[i]
}
}
// no encodings, return all requested encodings
if (!encodings || encodings.length === 0) {
return this.negotiator.encodings()
}
return this.negotiator.encodings(encodings)[0] || false
}
/**
* Return accepted charsets or best fit based on `charsets`.
*
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
* an array sorted by quality is returned:
*
* ['utf-8', 'utf-7', 'iso-8859-1']
*
* @param {String|Array} charsets...
* @return {String|Array}
* @public
*/
Accepts.prototype.charset =
Accepts.prototype.charsets = function (charsets_) {
var charsets = charsets_
// support flattened arguments
if (charsets && !Array.isArray(charsets)) {
charsets = new Array(arguments.length)
for (var i = 0; i < charsets.length; i++) {
charsets[i] = arguments[i]
}
}
// no charsets, return all requested charsets
if (!charsets || charsets.length === 0) {
return this.negotiator.charsets()
}
return this.negotiator.charsets(charsets)[0] || false
}
/**
* Return accepted languages or best fit based on `langs`.
*
* Given `Accept-Language: en;q=0.8, es, pt`
* an array sorted by quality is returned:
*
* ['es', 'pt', 'en']
*
* @param {String|Array} langs...
* @return {Array|String}
* @public
*/
Accepts.prototype.lang =
Accepts.prototype.langs =
Accepts.prototype.language =
Accepts.prototype.languages = function (languages_) {
var languages = languages_
// support flattened arguments
if (languages && !Array.isArray(languages)) {
languages = new Array(arguments.length)
for (var i = 0; i < languages.length; i++) {
languages[i] = arguments[i]
}
}
// no languages, return all requested languages
if (!languages || languages.length === 0) {
return this.negotiator.languages()
}
return this.negotiator.languages(languages)[0] || false
}
/**
* Convert extnames to mime.
*
* @param {String} type
* @return {String}
* @private
*/
function extToMime (type) {
return type.indexOf('/') === -1
? mime.lookup(type)
: type
}
/**
* Check if mime is valid.
*
* @param {String} type
* @return {Boolean}
* @private
*/
function validMime (type) {
return typeof type === 'string'
}
@@ -0,0 +1,2 @@
import { LogFactory } from 'base-log-factory';
export declare const logFactory: LogFactory;
@@ -0,0 +1,76 @@
# universalify
![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/RyanZim/universalify/ci.yml?branch=master)
![Coveralls github branch](https://img.shields.io/coveralls/github/RyanZim/universalify/master.svg)
![npm](https://img.shields.io/npm/dm/universalify.svg)
![npm](https://img.shields.io/npm/l/universalify.svg)
Make a callback- or promise-based function support both promises and callbacks.
Uses the native promise implementation.
## Installation
```bash
npm install universalify
```
## API
### `universalify.fromCallback(fn)`
Takes a callback-based function to universalify, and returns the universalified function.
Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once.
```js
function callbackFn (n, cb) {
setTimeout(() => cb(null, n), 15)
}
const fn = universalify.fromCallback(callbackFn)
// Works with Promises:
fn('Hello World!')
.then(result => console.log(result)) // -> Hello World!
.catch(error => console.error(error))
// Works with Callbacks:
fn('Hi!', (error, result) => {
if (error) return console.error(error)
console.log(result)
// -> Hi!
})
```
### `universalify.fromPromise(fn)`
Takes a promise-based function to universalify, and returns the universalified function.
Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned.
```js
function promiseFn (n) {
return new Promise(resolve => {
setTimeout(() => resolve(n), 15)
})
}
const fn = universalify.fromPromise(promiseFn)
// Works with Promises:
fn('Hello World!')
.then(result => console.log(result)) // -> Hello World!
.catch(error => console.error(error))
// Works with Callbacks:
fn('Hi!', (error, result) => {
if (error) return console.error(error)
console.log(result)
// -> Hi!
})
```
## License
MIT
@@ -0,0 +1,510 @@
/**
* @fileoverview Rule to enforce return statements in callbacks of array's methods
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;
const TARGET_METHODS =
/^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u;
/**
* Checks a given node is a member access which has the specified name's
* property.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node is a member access which has
* the specified name's property. The node may be a `(Chain|Member)Expression` node.
*/
function isTargetMethod(node) {
return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS);
}
/**
* Checks all segments in a set and returns true if any are reachable.
* @param {Set<CodePathSegment>} segments The segments to check.
* @returns {boolean} True if any segment is reachable; false otherwise.
*/
function isAnySegmentReachable(segments) {
for (const segment of segments) {
if (segment.reachable) {
return true;
}
}
return false;
}
/**
* Returns a human-legible description of an array method
* @param {string} arrayMethodName A method name to fully qualify
* @returns {string} the method name prefixed with `Array.` if it is a class method,
* or else `Array.prototype.` if it is an instance method.
*/
function fullMethodName(arrayMethodName) {
if (["from", "fromAsync", "of", "isArray"].includes(arrayMethodName)) {
return "Array.".concat(arrayMethodName);
}
return "Array.prototype.".concat(arrayMethodName);
}
/**
* Checks whether or not a given node is a function expression which is the
* callback of an array method, returning the method name.
* Generators are excluded. Async functions are allowed only for `Array.fromAsync`.
* @param {ASTNode} node A node to check. This is one of
* FunctionExpression or ArrowFunctionExpression.
* @returns {string} The method name if the node is a callback method,
* null otherwise.
*/
function getArrayMethodName(node) {
// Generators are not checked for any methods.
if (node.generator) {
return null;
}
let currentNode = node;
while (currentNode) {
const parent = currentNode.parent;
switch (parent.type) {
/*
* Looks up the destination. e.g.,
* foo.every(nativeFoo || function foo() { ... });
*/
case "LogicalExpression":
case "ConditionalExpression":
case "ChainExpression":
currentNode = parent;
break;
/*
* If the upper function is IIFE, checks the destination of the return value.
* e.g.
* foo.every((function() {
* // setup...
* return function callback() { ... };
* })());
*/
case "ReturnStatement": {
const func = astUtils.getUpperFunction(parent);
if (func === null || !astUtils.isCallee(func)) {
return null;
}
currentNode = func.parent;
break;
}
/*
* e.g.
* Array.from([], function() {});
* list.every(function() {});
*/
case "CallExpression":
if (!node.async) {
if (astUtils.isArrayFromMethod(parent.callee)) {
if (
parent.arguments.length >= 2 &&
parent.arguments[1] === currentNode
) {
return "from";
}
}
if (isTargetMethod(parent.callee)) {
if (
parent.arguments.length >= 1 &&
parent.arguments[0] === currentNode
) {
return astUtils.getStaticPropertyName(
parent.callee,
);
}
}
}
if (astUtils.isArrayFromAsyncMethod(parent.callee)) {
if (
parent.arguments.length >= 2 &&
parent.arguments[1] === currentNode
) {
return "fromAsync";
}
}
return null;
// Otherwise this node is not target.
default:
return null;
}
}
/* c8 ignore next */
return null;
}
/**
* Checks if the given node is a void expression.
* @param {ASTNode} node The node to check.
* @returns {boolean} - `true` if the node is a void expression
*/
function isExpressionVoid(node) {
return node.type === "UnaryExpression" && node.operator === "void";
}
/**
* Fixes the linting error by prepending "void " to the given node
* @param {Object} sourceCode context given by context.sourceCode
* @param {ASTNode} node The node to fix.
* @param {Object} fixer The fixer object provided by ESLint.
* @returns {Array<Object>} - An array of fix objects to apply to the node.
*/
function voidPrependFixer(sourceCode, node, fixer) {
const requiresParens =
// prepending `void ` will fail if the node has a lower precedence than void
astUtils.getPrecedence(node) <
astUtils.getPrecedence({
type: "UnaryExpression",
operator: "void",
}) &&
// check if there are parentheses around the node to avoid redundant parentheses
!astUtils.isParenthesised(sourceCode, node);
// avoid parentheses issues
const returnOrArrowToken = sourceCode.getTokenBefore(
node,
node.parent.type === "ArrowFunctionExpression"
? astUtils.isArrowToken
: // isReturnToken
token => token.type === "Keyword" && token.value === "return",
);
const firstToken = sourceCode.getTokenAfter(returnOrArrowToken);
const prependSpace =
// is return token, as => allows void to be adjacent
returnOrArrowToken.value === "return" &&
// If two tokens (return and "(") are adjacent
returnOrArrowToken.range[1] === firstToken.range[0];
return [
fixer.insertTextBefore(
firstToken,
`${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`,
),
fixer.insertTextAfter(node, requiresParens ? ")" : ""),
];
}
/**
* Fixes the linting error by `wrapping {}` around the given node's body.
* @param {Object} sourceCode context given by context.sourceCode
* @param {ASTNode} node The node to fix.
* @param {Object} fixer The fixer object provided by ESLint.
* @returns {Array<Object>} - An array of fix objects to apply to the node.
*/
function curlyWrapFixer(sourceCode, node, fixer) {
const arrowToken = sourceCode.getTokenBefore(
node.body,
astUtils.isArrowToken,
);
const firstToken = sourceCode.getTokenAfter(arrowToken);
const lastToken = sourceCode.getLastToken(node);
return [
fixer.insertTextBefore(firstToken, "{"),
fixer.insertTextAfter(lastToken, "}"),
];
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
allowImplicit: false,
checkForEach: false,
allowVoid: false,
},
],
docs: {
description:
"Enforce `return` statements in callbacks of array methods",
recommended: false,
url: "https://eslint.org/docs/latest/rules/array-callback-return",
},
hasSuggestions: true,
schema: [
{
type: "object",
properties: {
allowImplicit: {
type: "boolean",
},
checkForEach: {
type: "boolean",
},
allowVoid: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
expectedAtEnd:
"{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.",
expectedInside:
"{{arrayMethodName}}() expects a return value from {{name}}.",
expectedReturnValue:
"{{arrayMethodName}}() expects a return value from {{name}}.",
expectedNoReturnValue:
"{{arrayMethodName}}() expects no useless return value from {{name}}.",
wrapBraces: "Wrap the expression in `{}`.",
prependVoid: "Prepend `void` to the expression.",
},
},
create(context) {
const [options] = context.options;
const sourceCode = context.sourceCode;
let funcInfo = {
arrayMethodName: null,
upper: null,
codePath: null,
hasReturn: false,
shouldCheck: false,
node: null,
};
/**
* Checks whether or not the last code path segment is reachable.
* Then reports this function if the segment is reachable.
*
* If the last code path segment is reachable, there are paths which are not
* returned or thrown.
* @param {ASTNode} node A node to check.
* @returns {void}
*/
function checkLastSegment(node) {
if (!funcInfo.shouldCheck) {
return;
}
const messageAndSuggestions = { messageId: "", suggest: [] };
if (funcInfo.arrayMethodName === "forEach") {
if (
options.checkForEach &&
node.type === "ArrowFunctionExpression" &&
node.expression
) {
if (options.allowVoid) {
if (isExpressionVoid(node.body)) {
return;
}
messageAndSuggestions.messageId =
"expectedNoReturnValue";
messageAndSuggestions.suggest = [
{
messageId: "wrapBraces",
fix(fixer) {
return curlyWrapFixer(
sourceCode,
node,
fixer,
);
},
},
{
messageId: "prependVoid",
fix(fixer) {
return voidPrependFixer(
sourceCode,
node.body,
fixer,
);
},
},
];
} else {
messageAndSuggestions.messageId =
"expectedNoReturnValue";
messageAndSuggestions.suggest = [
{
messageId: "wrapBraces",
fix(fixer) {
return curlyWrapFixer(
sourceCode,
node,
fixer,
);
},
},
];
}
}
} else {
if (
node.body.type === "BlockStatement" &&
isAnySegmentReachable(funcInfo.currentSegments)
) {
messageAndSuggestions.messageId = funcInfo.hasReturn
? "expectedAtEnd"
: "expectedInside";
}
}
if (messageAndSuggestions.messageId) {
const name = astUtils.getFunctionNameWithKind(node);
context.report({
node,
loc: astUtils.getFunctionHeadLoc(node, sourceCode),
messageId: messageAndSuggestions.messageId,
data: {
name,
arrayMethodName: fullMethodName(
funcInfo.arrayMethodName,
),
},
suggest:
messageAndSuggestions.suggest.length !== 0
? messageAndSuggestions.suggest
: null,
});
}
}
return {
// Stacks this function's information.
onCodePathStart(codePath, node) {
let methodName = null;
if (TARGET_NODE_TYPE.test(node.type)) {
methodName = getArrayMethodName(node);
}
funcInfo = {
arrayMethodName: methodName,
upper: funcInfo,
codePath,
hasReturn: false,
shouldCheck: !!methodName,
node,
currentSegments: new Set(),
};
},
// Pops this function's information.
onCodePathEnd() {
funcInfo = funcInfo.upper;
},
onUnreachableCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
onCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
// Checks the return statement is valid.
ReturnStatement(node) {
if (!funcInfo.shouldCheck) {
return;
}
funcInfo.hasReturn = true;
const messageAndSuggestions = { messageId: "", suggest: [] };
if (funcInfo.arrayMethodName === "forEach") {
// if checkForEach: true, returning a value at any path inside a forEach is not allowed
if (options.checkForEach && node.argument) {
if (options.allowVoid) {
if (isExpressionVoid(node.argument)) {
return;
}
messageAndSuggestions.messageId =
"expectedNoReturnValue";
messageAndSuggestions.suggest = [
{
messageId: "prependVoid",
fix(fixer) {
return voidPrependFixer(
sourceCode,
node.argument,
fixer,
);
},
},
];
} else {
messageAndSuggestions.messageId =
"expectedNoReturnValue";
}
}
} else {
// if allowImplicit: false, should also check node.argument
if (!options.allowImplicit && !node.argument) {
messageAndSuggestions.messageId = "expectedReturnValue";
}
}
if (messageAndSuggestions.messageId) {
context.report({
node,
messageId: messageAndSuggestions.messageId,
data: {
name: astUtils.getFunctionNameWithKind(
funcInfo.node,
),
arrayMethodName: fullMethodName(
funcInfo.arrayMethodName,
),
},
suggest:
messageAndSuggestions.suggest.length !== 0
? messageAndSuggestions.suggest
: null,
});
}
},
// Reports a given function if the last path is reachable.
"FunctionExpression:exit": checkLastSegment,
"ArrowFunctionExpression:exit": checkLastSegment,
};
},
};
@@ -0,0 +1,28 @@
# tinyrainbow
Output your colorful messages in the terminal or browser console that support ANSI colors (Chrome engines).
A small (`~ 6 kB` unpacked) fork of [picocolors](https://www.npmjs.com/package/picocolors) with support for `exports` field.
Supports only ESM.
## Installing
```bash
# with npm
$ npm install -D tinyrainbow
# with pnpm
$ pnpm add -D tinyrainbow
# with yarn
$ yarn add -D tinyrainbow
```
## Usage
```js
import c from 'tinyrainbow'
console.log(c.red(c.bold('Hello World!')))
```
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/use-effect-event.tsx"],
"sourcesContent": ["export { useEffectEvent } from './use-effect-event';\n", "/* eslint-disable react-hooks/rules-of-hooks */\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport * as React from 'react';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// See https://github.com/webpack/webpack/issues/14814\nconst useReactEffectEvent = (React as any)[' useEffectEvent '.trim().toString()];\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\n\n/**\n * Designed to approximate the behavior on `experimental_useEffectEvent` as best\n * as possible until its stable release, and back-fill it as a shim as needed.\n */\nexport function useEffectEvent<T extends AnyFunction>(callback?: T): T {\n if (typeof useReactEffectEvent === 'function') {\n return useReactEffectEvent(callback);\n }\n\n const ref = React.useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.');\n });\n // See https://github.com/webpack/webpack/issues/14814\n if (typeof useReactInsertionEffect === 'function') {\n useReactInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n ref.current = callback;\n });\n }\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => ref.current?.(...args)) as T, []);\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,qCAAgC;AAChC,YAAuB;AAKvB,IAAM,sBAAuB,MAAc,mBAAmB,KAAK,EAAE,SAAS,CAAC;AAC/E,IAAM,0BAA2B,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC;AAMhF,SAAS,eAAsC,UAAiB;AACrE,MAAI,OAAO,wBAAwB,YAAY;AAC7C,WAAO,oBAAoB,QAAQ;AAAA,EACrC;AAEA,QAAM,MAAY,aAAgC,MAAM;AACtD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,MAAI,OAAO,4BAA4B,YAAY;AACjD,4BAAwB,MAAM;AAC5B,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH,OAAO;AACL,wDAAgB,MAAM;AACpB,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH;AAGA,SAAa,cAAQ,OAAO,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,IAAS,CAAC,CAAC;AAC3E;",
"names": []
}
@@ -0,0 +1,512 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const regexpp_1 = require("@eslint-community/regexpp");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const EQ_OPERATORS = /^[=!]=/;
const regexpp = new regexpp_1.RegExpParser();
exports.default = (0, util_1.createRule)({
name: 'prefer-string-starts-ends-with',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings',
recommended: 'stylistic',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
preferEndsWith: "Use the 'String#endsWith' method instead.",
preferStartsWith: "Use 'String#startsWith' method instead.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowSingleElementEquality: {
type: 'string',
description: 'Whether to allow equality checks against the first or last element of a string.',
enum: ['always', 'never'],
},
},
},
],
},
defaultOptions: [{ allowSingleElementEquality: 'never' }],
create(context, [{ allowSingleElementEquality }]) {
const globalScope = context.sourceCode.getScope(context.sourceCode.ast);
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
/**
* Check if a given node is a string.
* @param node The node to check.
*/
function isStringType(node) {
const objectType = services.getTypeAtLocation(node);
return (0, util_1.getTypeName)(checker, objectType) === 'string';
}
/**
* Check if a given node is a `Literal` node that is null.
* @param node The node to check.
*/
function isNull(node) {
const evaluated = (0, util_1.getStaticValue)(node, globalScope);
return evaluated != null && evaluated.value == null;
}
/**
* Check if a given node is a `Literal` node that is a given value.
* @param node The node to check.
* @param value The expected value of the `Literal` node.
*/
function isNumber(node, value) {
const evaluated = (0, util_1.getStaticValue)(node, globalScope);
return evaluated?.value === value;
}
/**
* Check if a given node is a `Literal` node that is a character.
* @param node The node to check.
*/
function isCharacter(node) {
const evaluated = (0, util_1.getStaticValue)(node, globalScope);
return (evaluated != null &&
typeof evaluated.value === 'string' &&
// checks if the string is a character long
evaluated.value[0] === evaluated.value);
}
/**
* Check if a given node is `==`, `===`, `!=`, or `!==`.
* @param node The node to check.
*/
function isEqualityComparison(node) {
return (node.type === utils_1.AST_NODE_TYPES.BinaryExpression &&
EQ_OPERATORS.test(node.operator));
}
/**
* Check if two given nodes are the same meaning.
* @param node1 A node to compare.
* @param node2 Another node to compare.
*/
function isSameTokens(node1, node2) {
const tokens1 = context.sourceCode.getTokens(node1);
const tokens2 = context.sourceCode.getTokens(node2);
if (tokens1.length !== tokens2.length) {
return false;
}
for (let i = 0; i < tokens1.length; ++i) {
const token1 = tokens1[i];
const token2 = tokens2[i];
if (token1.type !== token2.type || token1.value !== token2.value) {
return false;
}
}
return true;
}
/**
* Check if a given node is the expression of the length of a string.
*
* - If `length` property access of `expectedObjectNode`, it's `true`.
* E.g., `foo` → `foo.length` / `"foo"` → `"foo".length`
* - If `expectedObjectNode` is a string literal, `node` can be a number.
* E.g., `"foo"` → `3`
*
* @param node The node to check.
* @param expectedObjectNode The node which is expected as the receiver of `length` property.
*/
function isLengthExpression(node, expectedObjectNode) {
if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) {
return ((0, util_1.getPropertyName)(node, globalScope) === 'length' &&
isSameTokens(node.object, expectedObjectNode));
}
const evaluatedLength = (0, util_1.getStaticValue)(node, globalScope);
const evaluatedString = (0, util_1.getStaticValue)(expectedObjectNode, globalScope);
return (evaluatedLength != null &&
evaluatedString != null &&
typeof evaluatedLength.value === 'number' &&
typeof evaluatedString.value === 'string' &&
evaluatedLength.value === evaluatedString.value.length);
}
/**
* Returns true if `node` is `-substring.length` or
* `parentString.length - substring.length`
*/
function isLengthAheadOfEnd(node, substring, parentString) {
return ((node.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
node.operator === '-' &&
isLengthExpression(node.argument, substring)) ||
(node.type === utils_1.AST_NODE_TYPES.BinaryExpression &&
node.operator === '-' &&
isLengthExpression(node.left, parentString) &&
isLengthExpression(node.right, substring)));
}
/**
* Check if a given node is the expression of the last index.
*
* E.g. `foo.length - 1`
*
* @param node The node to check.
* @param expectedObjectNode The node which is expected as the receiver of `length` property.
*/
function isLastIndexExpression(node, expectedObjectNode) {
return (node.type === utils_1.AST_NODE_TYPES.BinaryExpression &&
node.operator === '-' &&
isLengthExpression(node.left, expectedObjectNode) &&
isNumber(node.right, 1));
}
/**
* Get the range of the property of a given `MemberExpression` node.
*
* - `obj[foo]` → the range of `[foo]`
* - `obf.foo` → the range of `.foo`
* - `(obj).foo` → the range of `.foo`
*
* @param node The member expression node to get.
*/
function getPropertyRange(node) {
const dotOrOpenBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.object, util_1.isNotClosingParenToken), util_1.NullThrowsReasons.MissingToken('closing parenthesis', 'member'));
return [dotOrOpenBracket.range[0], node.range[1]];
}
/**
* Parse a given `RegExp` pattern to that string if it's a static string.
* @param pattern The RegExp pattern text to parse.
* @param unicode Whether the RegExp is unicode.
*/
function parseRegExpText(pattern, unicode) {
// Parse it.
const ast = regexpp.parsePattern(pattern, undefined, undefined, {
unicode,
});
if (ast.alternatives.length !== 1) {
return null;
}
// Drop `^`/`$` assertion.
const chars = ast.alternatives[0].elements;
const first = chars[0];
if (first.type === 'Assertion' && first.kind === 'start') {
chars.shift();
}
else {
chars.pop();
}
// Check if it can determine a unique string.
if (!chars.every(c => c.type === 'Character')) {
return null;
}
// To string.
return String.fromCodePoint(...chars.map(c => c.value));
}
/**
* Parse a given node if it's a `RegExp` instance.
* @param node The node to parse.
*/
function parseRegExp(node) {
const evaluated = (0, util_1.getStaticValue)(node, globalScope);
if (evaluated == null || !(evaluated.value instanceof RegExp)) {
return null;
}
const { flags, source } = evaluated.value;
const isStartsWith = source.startsWith('^');
const isEndsWith = source.endsWith('$');
if (isStartsWith === isEndsWith ||
flags.includes('i') ||
flags.includes('m')) {
return null;
}
const text = parseRegExpText(source, flags.includes('u'));
if (text == null) {
return null;
}
return { isEndsWith, isStartsWith, text };
}
function getLeftNode(init) {
const node = (0, util_1.skipChainExpression)(init);
const leftNode = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node;
if (leftNode.type !== utils_1.AST_NODE_TYPES.MemberExpression) {
throw new Error(`Expected a MemberExpression, got ${leftNode.type}`);
}
return leftNode;
}
/**
* Fix code with using the right operand as the search string.
* For example: `foo.slice(0, 3) === 'bar'` → `foo.startsWith('bar')`
* @param fixer The rule fixer.
* @param node The node which was reported.
* @param kind The kind of the report.
* @param isNegative The flag to fix to negative condition.
*/
function* fixWithRightOperand(fixer, node, kind, isNegative, isOptional) {
// left is CallExpression or MemberExpression.
const leftNode = getLeftNode(node.left);
const propertyRange = getPropertyRange(leftNode);
if (isNegative) {
yield fixer.insertTextBefore(node, '!');
}
yield fixer.replaceTextRange([propertyRange[0], node.right.range[0]], `${isOptional ? '?.' : '.'}${kind}sWith(`);
yield fixer.replaceTextRange([node.right.range[1], node.range[1]], ')');
}
/**
* Fix code with using the first argument as the search string.
* For example: `foo.indexOf('bar') === 0` → `foo.startsWith('bar')`
* @param fixer The rule fixer.
* @param node The node which was reported.
* @param kind The kind of the report.
* @param negative The flag to fix to negative condition.
*/
function* fixWithArgument(fixer, node, callNode, calleeNode, kind, negative, isOptional) {
if (negative) {
yield fixer.insertTextBefore(node, '!');
}
yield fixer.replaceTextRange(getPropertyRange(calleeNode), `${isOptional ? '?.' : '.'}${kind}sWith`);
yield fixer.removeRange([callNode.range[1], node.range[1]]);
}
function getParent(node) {
return node.parent.type === utils_1.AST_NODE_TYPES.ChainExpression
? node.parent.parent
: node.parent;
}
return {
// foo[0] === "a"
// foo.charAt(0) === "a"
// foo[foo.length - 1] === "a"
// foo.charAt(foo.length - 1) === "a"
[[
'BinaryExpression > MemberExpression.left[computed=true]',
'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="charAt"][computed=false]',
'BinaryExpression > ChainExpression.left > MemberExpression[computed=true]',
'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="charAt"][computed=false]',
].join(', ')](node) {
let parentNode = getParent(node);
let indexNode = null;
if (parentNode.type === utils_1.AST_NODE_TYPES.CallExpression) {
if (parentNode.arguments.length === 1) {
indexNode = parentNode.arguments[0];
}
parentNode = getParent(parentNode);
}
else {
indexNode = node.property;
}
if (indexNode == null ||
!isEqualityComparison(parentNode) ||
!isStringType(node.object)) {
return;
}
const isEndsWith = isLastIndexExpression(indexNode, node.object);
if (allowSingleElementEquality === 'always' && isEndsWith) {
return;
}
const isStartsWith = !isEndsWith && isNumber(indexNode, 0);
if ((allowSingleElementEquality === 'always' && isStartsWith) ||
(!isStartsWith && !isEndsWith)) {
return;
}
const eqNode = parentNode;
context.report({
node: parentNode,
messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith',
fix(fixer) {
// Don't fix if it can change the behavior.
if (!isCharacter(eqNode.right)) {
return null;
}
return fixWithRightOperand(fixer, eqNode, isStartsWith ? 'start' : 'end', eqNode.operator.startsWith('!'), node.optional);
},
});
},
// foo.indexOf('bar') === 0
[[
'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="indexOf"][computed=false]',
'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="indexOf"][computed=false]',
].join(', ')](node) {
const callNode = getParent(node);
const parentNode = getParent(callNode);
if (callNode.arguments.length !== 1 ||
!isEqualityComparison(parentNode) ||
!isNumber(parentNode.right, 0) ||
!isStringType(node.object)) {
return;
}
context.report({
node: parentNode,
messageId: 'preferStartsWith',
fix(fixer) {
return fixWithArgument(fixer, parentNode, callNode, node, 'start', parentNode.operator.startsWith('!'), node.optional);
},
});
},
// foo.lastIndexOf('bar') === foo.length - 3
// foo.lastIndexOf(bar) === foo.length - bar.length
[[
'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="lastIndexOf"][computed=false]',
'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="lastIndexOf"][computed=false]',
].join(', ')](node) {
const callNode = getParent(node);
const parentNode = getParent(callNode);
if (callNode.arguments.length !== 1 ||
!isEqualityComparison(parentNode) ||
parentNode.right.type !== utils_1.AST_NODE_TYPES.BinaryExpression ||
parentNode.right.operator !== '-' ||
!isLengthExpression(parentNode.right.left, node.object) ||
!isLengthExpression(parentNode.right.right, callNode.arguments[0]) ||
!isStringType(node.object)) {
return;
}
context.report({
node: parentNode,
messageId: 'preferEndsWith',
fix(fixer) {
return fixWithArgument(fixer, parentNode, callNode, node, 'end', parentNode.operator.startsWith('!'), node.optional);
},
});
},
// foo.match(/^bar/) === null
// foo.match(/bar$/) === null
[[
'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="match"][computed=false]',
'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="match"][computed=false]',
].join(', ')](node) {
const callNode = getParent(node);
const parentNode = getParent(callNode);
if (!isNull(parentNode.right) || !isStringType(node.object)) {
return;
}
const parsed = callNode.arguments.length === 1
? parseRegExp(callNode.arguments[0])
: null;
if (parsed == null) {
return;
}
const { isStartsWith, text } = parsed;
context.report({
node: callNode,
messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith',
*fix(fixer) {
if (!parentNode.operator.startsWith('!')) {
yield fixer.insertTextBefore(parentNode, '!');
}
yield fixer.replaceTextRange(getPropertyRange(node), `${node.optional ? '?.' : '.'}${isStartsWith ? 'start' : 'end'}sWith`);
yield fixer.replaceText(callNode.arguments[0], JSON.stringify(text));
yield fixer.removeRange([callNode.range[1], parentNode.range[1]]);
},
});
},
// foo.slice(0, 3) === 'bar'
// foo.slice(-3) === 'bar'
// foo.slice(-3, foo.length) === 'bar'
// foo.substring(0, 3) === 'bar'
// foo.substring(foo.length - 3) === 'bar'
// foo.substring(foo.length - 3, foo.length) === 'bar'
[[
'BinaryExpression > CallExpression.left > MemberExpression',
'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression',
].join(', ')](node) {
if (!(0, util_1.isStaticMemberAccessOfValue)(node, context, 'slice', 'substring')) {
return;
}
const callNode = getParent(node);
const parentNode = getParent(callNode);
if (!isEqualityComparison(parentNode) || !isStringType(node.object)) {
return;
}
let isEndsWith = false;
let isStartsWith = false;
if (callNode.arguments.length === 1) {
if (
// foo.slice(-bar.length) === bar
// foo.slice(foo.length - bar.length) === bar
isLengthAheadOfEnd(callNode.arguments[0], parentNode.right, node.object)) {
isEndsWith = true;
}
}
else if (callNode.arguments.length === 2) {
if (
// foo.slice(0, bar.length) === bar
isNumber(callNode.arguments[0], 0) &&
isLengthExpression(callNode.arguments[1], parentNode.right)) {
isStartsWith = true;
}
else if (
// foo.slice(foo.length - bar.length, foo.length) === bar
// foo.slice(foo.length - bar.length, 0) === bar
// foo.slice(-bar.length, foo.length) === bar
// foo.slice(-bar.length, 0) === bar
(isLengthExpression(callNode.arguments[1], node.object) ||
isNumber(callNode.arguments[1], 0)) &&
isLengthAheadOfEnd(callNode.arguments[0], parentNode.right, node.object)) {
isEndsWith = true;
}
}
if (!isStartsWith && !isEndsWith) {
return;
}
const eqNode = parentNode;
const negativeIndexSupported = node.property.name === 'slice';
context.report({
node: parentNode,
messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith',
fix(fixer) {
// Don't fix if it can change the behavior.
if (eqNode.operator.length === 2 &&
(eqNode.right.type !== utils_1.AST_NODE_TYPES.Literal ||
typeof eqNode.right.value !== 'string')) {
return null;
}
// code being checked is likely mistake:
// unequal length of strings being checked for equality
// or reliant on behavior of substring (negative indices interpreted as 0)
if (isStartsWith) {
if (!isLengthExpression(callNode.arguments[1], eqNode.right)) {
return null;
}
}
else {
const posNode = callNode.arguments[0];
const posNodeIsAbsolutelyValid = (posNode.type === utils_1.AST_NODE_TYPES.BinaryExpression &&
posNode.operator === '-' &&
isLengthExpression(posNode.left, node.object) &&
isLengthExpression(posNode.right, eqNode.right)) ||
(negativeIndexSupported &&
posNode.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
posNode.operator === '-' &&
isLengthExpression(posNode.argument, eqNode.right));
if (!posNodeIsAbsolutelyValid) {
return null;
}
}
return fixWithRightOperand(fixer, parentNode, isStartsWith ? 'start' : 'end', parentNode.operator.startsWith('!'), node.optional);
},
});
},
// /^bar/.test(foo)
// /bar$/.test(foo)
'CallExpression > MemberExpression.callee[property.name="test"][computed=false]'(node) {
const callNode = getParent(node);
const parsed = callNode.arguments.length === 1 ? parseRegExp(node.object) : null;
if (parsed == null) {
return;
}
const { isStartsWith, text } = parsed;
const messageId = isStartsWith ? 'preferStartsWith' : 'preferEndsWith';
const methodName = isStartsWith ? 'startsWith' : 'endsWith';
context.report({
node: callNode,
messageId,
*fix(fixer) {
const argNode = callNode.arguments[0];
const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal &&
argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral &&
argNode.type !== utils_1.AST_NODE_TYPES.Identifier &&
argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression &&
argNode.type !== utils_1.AST_NODE_TYPES.CallExpression;
yield fixer.removeRange([callNode.range[0], argNode.range[0]]);
if (needsParen) {
yield fixer.insertTextBefore(argNode, '(');
yield fixer.insertTextAfter(argNode, ')');
}
yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}${methodName}(${JSON.stringify(text)}`);
},
});
},
};
},
});
@@ -0,0 +1,9 @@
'use strict';
var repeatMatcher = ({
baseGuesses,
repeatCount
}) => baseGuesses * repeatCount;
module.exports = repeatMatcher;
//# sourceMappingURL=scoring.cjs.map
@@ -0,0 +1,123 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.constants = void 0;
// Update with any zlib constants that are added or changed in the future.
// Node v6 didn't export this, so we just hard code the version and rely
// on all the other hard-coded values from zlib v4736. When node v6
// support drops, we can just export the realZlibConstants object.
const zlib_1 = __importDefault(require("zlib"));
/* c8 ignore start */
const realZlibConstants = zlib_1.default.constants || { ZLIB_VERNUM: 4736 };
/* c8 ignore stop */
exports.constants = Object.freeze(Object.assign(Object.create(null), {
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
Z_MEM_ERROR: -4,
Z_BUF_ERROR: -5,
Z_VERSION_ERROR: -6,
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
DEFLATE: 1,
INFLATE: 2,
GZIP: 3,
GUNZIP: 4,
DEFLATERAW: 5,
INFLATERAW: 6,
UNZIP: 7,
BROTLI_DECODE: 8,
BROTLI_ENCODE: 9,
Z_MIN_WINDOWBITS: 8,
Z_MAX_WINDOWBITS: 15,
Z_DEFAULT_WINDOWBITS: 15,
Z_MIN_CHUNK: 64,
Z_MAX_CHUNK: Infinity,
Z_DEFAULT_CHUNK: 16384,
Z_MIN_MEMLEVEL: 1,
Z_MAX_MEMLEVEL: 9,
Z_DEFAULT_MEMLEVEL: 8,
Z_MIN_LEVEL: -1,
Z_MAX_LEVEL: 9,
Z_DEFAULT_LEVEL: -1,
BROTLI_OPERATION_PROCESS: 0,
BROTLI_OPERATION_FLUSH: 1,
BROTLI_OPERATION_FINISH: 2,
BROTLI_OPERATION_EMIT_METADATA: 3,
BROTLI_MODE_GENERIC: 0,
BROTLI_MODE_TEXT: 1,
BROTLI_MODE_FONT: 2,
BROTLI_DEFAULT_MODE: 0,
BROTLI_MIN_QUALITY: 0,
BROTLI_MAX_QUALITY: 11,
BROTLI_DEFAULT_QUALITY: 11,
BROTLI_MIN_WINDOW_BITS: 10,
BROTLI_MAX_WINDOW_BITS: 24,
BROTLI_LARGE_MAX_WINDOW_BITS: 30,
BROTLI_DEFAULT_WINDOW: 22,
BROTLI_MIN_INPUT_BLOCK_BITS: 16,
BROTLI_MAX_INPUT_BLOCK_BITS: 24,
BROTLI_PARAM_MODE: 0,
BROTLI_PARAM_QUALITY: 1,
BROTLI_PARAM_LGWIN: 2,
BROTLI_PARAM_LGBLOCK: 3,
BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,
BROTLI_PARAM_SIZE_HINT: 5,
BROTLI_PARAM_LARGE_WINDOW: 6,
BROTLI_PARAM_NPOSTFIX: 7,
BROTLI_PARAM_NDIRECT: 8,
BROTLI_DECODER_RESULT_ERROR: 0,
BROTLI_DECODER_RESULT_SUCCESS: 1,
BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,
BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,
BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,
BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,
BROTLI_DECODER_NO_ERROR: 0,
BROTLI_DECODER_SUCCESS: 1,
BROTLI_DECODER_NEEDS_MORE_INPUT: 2,
BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,
BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,
BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,
BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,
BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,
BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,
BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,
BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,
BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,
BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,
BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,
BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,
BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,
BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,
BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,
BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,
BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,
BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,
BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,
BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,
BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,
BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,
BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,
BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,
BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,
BROTLI_DECODER_ERROR_UNREACHABLE: -31,
}, realZlibConstants));
//# sourceMappingURL=constants.js.map
@@ -0,0 +1,57 @@
/**
* @fileoverview Rule to flag assignment of the exception parameter
* @author Stephen Murray <spmurrayzzz>
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow reassigning exceptions in `catch` clauses",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-ex-assign",
},
schema: [],
messages: {
unexpected: "Do not assign to the exception parameter.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Finds and reports references that are non initializer and writable.
* @param {Variable} variable A variable to check.
* @returns {void}
*/
function checkVariable(variable) {
astUtils
.getModifyingReferences(variable.references)
.forEach(reference => {
context.report({
node: reference.identifier,
messageId: "unexpected",
});
});
}
return {
CatchClause(node) {
sourceCode.getDeclaredVariables(node).forEach(checkVariable);
},
};
},
};
@@ -0,0 +1,7 @@
function makeAnimationInstant(options) {
options.duration = 0;
options.type = "keyframes";
}
export { makeAnimationInstant };
//# sourceMappingURL=make-animation-instant.mjs.map
@@ -0,0 +1 @@
module.exports={C:{"52":0.00344,"113":0.00344,"115":0.1308,"120":0.28913,"121":0.58514,"123":0.00344,"124":0.00344,"127":0.00344,"140":0.01721,"147":0.00688,"148":0.00688,"149":0.00344,"150":0.01033,"151":0.01377,"152":0.00688,"153":0.03442,"154":0.14112,"155":0.46123,"156":0.53351,"157":0.02409,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 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 114 116 117 118 119 122 125 126 128 129 130 131 132 133 134 135 136 137 138 139 141 142 143 144 145 146 158 159 160 3.5 3.6"},D:{"60":0.00344,"71":0.00344,"80":0.00344,"83":0.00344,"87":0.00688,"92":0.00344,"93":0.00344,"98":0.00344,"101":0.00344,"103":0.07572,"104":0.05163,"105":0.25471,"106":0.05163,"107":0.05163,"108":0.05163,"109":1.13586,"110":0.05163,"111":0.05163,"112":0.05163,"114":0.00344,"116":0.13424,"117":0.05163,"118":0.37174,"119":0.59891,"120":0.63333,"121":0.00344,"122":0.02065,"123":0.01033,"124":0.06196,"125":0.01377,"126":0.01377,"127":0.00688,"128":0.01033,"129":0.00688,"130":0.01033,"131":0.12735,"132":0.00688,"133":0.12735,"134":0.03442,"135":0.03442,"136":0.04475,"137":0.03442,"138":0.08949,"139":0.04819,"140":0.03786,"141":0.03786,"142":0.08949,"143":0.03098,"144":0.05851,"145":0.03098,"146":0.07228,"147":0.04819,"148":0.0654,"149":0.12391,"150":0.26159,"151":1.65904,"152":9.69267,"153":8.17475,"154":1.80705,"155":0.05163,"156":0.00344,_:"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 61 62 63 64 65 66 67 68 69 70 72 73 74 75 76 77 78 79 81 84 85 86 88 89 90 91 94 95 96 97 99 100 102 113 115 157"},F:{"95":0.00688,"101":0.00344,"106":0.00344,"126":0.00344,"134":0.02065,"135":0.23406,_:"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 89 90 91 92 93 94 96 97 98 99 100 102 103 104 105 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 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:{"92":0.00344,"109":0.00344,"119":0.28224,"120":0.29257,"122":0.00344,"138":0.00344,"140":0.01033,"143":0.00344,"144":0.00344,"145":0.00344,"146":0.00344,"147":0.00344,"148":0.01033,"149":0.01377,"150":0.01721,"151":0.04475,"152":0.79854,"153":0.89836,"154":0.25127,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 139 141 142"},E:{"27":0.05163,_:"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 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.3 16.5 17.0 17.2 18.0 18.1 27.1 27.2 TP","11.1":0.00344,"12.1":0.00688,"13.1":0.00344,"14.1":0.00688,"15.6":0.01377,"16.1":0.00344,"16.4":0.00344,"16.6":0.02409,"17.1":0.00688,"17.3":0.00344,"17.4":0.00344,"17.5":0.00688,"17.6":0.02754,"18.2":0.00688,"18.3":0.00688,"18.4":0.00688,"18.5-18.7":0.00688,"26.0":0.01033,"26.1":0.00344,"26.2":0.01377,"26.3":0.01377,"26.4":0.00688,"26.5":0.06884,"26.6":0.25471},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00137,"5.0-5.1":0.00137,"6.0-6.1":0,"7.0-7.1":0.00273,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01367,"11.0-11.2":0.00137,"11.3-11.4":0.00273,"12.0-12.1":0,"12.2-12.5":0.03553,"13.0-13.1":0,"13.2":0.00683,"13.3":0,"13.4-13.7":0.00137,"14.0-14.4":0.00547,"14.5-14.8":0.0082,"15.0-15.1":0.0082,"15.2-15.3":0.00547,"15.4":0.00683,"15.5":0.0082,"15.6-15.8":0.17767,"16.0":0.01367,"16.1":0.0246,"16.2":0.01367,"16.3":0.03007,"16.4":0.00683,"16.5":0.01093,"16.6-16.7":0.24737,"17.0":0.00957,"17.1":0.01367,"17.2":0.01367,"17.3":0.0205,"17.4":0.0287,"17.5":0.05603,"17.6-17.7":0.14487,"18.0":0.03007,"18.1":0.06013,"18.2":0.082,"18.3":0.14214,"18.4":0.08883,"18.5-18.7":1.83546,"26.0":0.08883,"26.1":0.0902,"26.2":0.23507,"26.3":0.2542,"26.4":0.18587,"26.5":1.24505,"26.6":7.68215,"27.0":0.58904,"27.1":0,"27.2":0.01503},P:{"26":0.00955,"27":0.00955,"28":0.00955,"29":0.02865,"30":0.46792,_:"4 20 21 22 23 24 25 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.0191},I:{"0":0.01311,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.36725,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":51.36442},R:{_:"0"},M:{"0":0.05246},Q:{_:"14.9"},O:{"0":0.60334},H:{all:0}};