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":"navigation-off.js","sources":["../../../src/icons/navigation-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name NavigationOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOC40MyA4LjQzIDMgMTFsOCAyIDIgOCAyLjU3LTUuNDMiIC8+CiAgPHBhdGggZD0iTTE3LjM5IDExLjczIDIyIDJsLTkuNzMgNC42MSIgLz4KICA8bGluZSB4MT0iMiIgeDI9IjIyIiB5MT0iMiIgeTI9IjIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/navigation-off\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 NavigationOff = createLucideIcon('NavigationOff', [\n ['path', { d: 'M8.43 8.43 3 11l8 2 2 8 2.57-5.43', key: '1vdtb7' }],\n ['path', { d: 'M17.39 11.73 22 2l-9.73 4.61', key: 'tya3r6' }],\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n]);\n\nexport default NavigationOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC7D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,469 @@
'use strict'
// Escapes sequences that could break out of an HTML <style> context.
// Uses CSS unicode escaping (\3c = '<') which is valid CSS and parsed
// correctly by all compliant CSS consumers.
const STYLE_TAG = /(<)(\/?style\b)/gi
const COMMENT_OPEN = /(<)(!--)/g
// Characters that end an at-rule name, mirroring RE_AT_END in the tokenizer.
// Params starting with anything else need a space to stay separate tokens.
const AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/
function escapeHTMLInCSS(str) {
if (typeof str !== 'string') return str
if (!str.includes('<')) return str
return str.replace(STYLE_TAG, '\\3c $2').replace(COMMENT_OPEN, '\\3c $2')
}
const DEFAULT_RAW = {
after: '\n',
beforeClose: '\n',
beforeComment: '\n',
beforeDecl: '\n',
beforeOpen: ' ',
beforeRule: '\n',
colon: ': ',
commentLeft: ' ',
commentRight: ' ',
emptyBody: '',
indent: ' ',
semicolon: false
}
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1)
}
function atruleStart(str, node) {
let name = '@' + node.name
let params = node.params ? str.rawValue(node, 'params') : ''
let afterName = node.raws.afterName
if (typeof afterName === 'undefined') {
afterName = params ? ' ' : ''
} else if (afterName === '' && params && !AT_NAME_END.test(params[0])) {
afterName = ' '
}
return name + afterName + params
}
// `*--x` is not a custom property: the parser checks the first token, and the
// `*`/`_` hack prefix moves from `prop` into `before` only after that.
function isCustomProperty(node) {
if (!node.prop.startsWith('--')) return false
let before = node.raws.before
return typeof before === 'undefined' || !/\S$/.test(before)
}
function pushBody(str, stack, node) {
let nodes = node.nodes
let last = nodes.length - 1
while (last > 0) {
if (nodes[last].type !== 'comment') break
last -= 1
}
let semicolon = str.raw(node, 'semicolon')
let isDocument = node.type === 'document'
for (let i = nodes.length - 1; i >= 0; i--) {
let child = nodes[i]
let childSemicolon = last !== i || semicolon
// A childless at-rule or a custom property declaration that still has
// following siblings must be terminated. Without the semicolon those
// trailing comments are folded into the at-rule's prelude or the custom
// property's value and disappear when the output is re-parsed.
if (
!childSemicolon &&
i < nodes.length - 1 &&
((child.type === 'atrule' && !child.nodes) ||
(child.type === 'decl' && isCustomProperty(child)))
) {
childSemicolon = true
}
stack.push({
document: isDocument,
node: child,
semicolon: childSemicolon
})
}
}
function pushBlock(str, stack, node, start) {
let between = str.raw(node, 'between', 'beforeOpen')
str.builder(escapeHTMLInCSS(start + between) + '{', node, 'start')
let hasNodes = node.nodes && node.nodes.length
let close = () => {
let after = hasNodes
? str.raw(node, 'after')
: str.raw(node, 'after', 'emptyBody')
if (after) str.builder(escapeHTMLInCSS(after))
str.builder('}', node, 'end')
if (node.type === 'rule' && node.raws.ownSemicolon) {
str.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, 'end')
}
}
if (hasNodes) {
stack.push(close)
pushBody(str, stack, node)
} else {
close()
}
}
class Stringifier {
constructor(builder) {
this.builder = builder
}
atrule(node, semicolon) {
let start = atruleStart(this, node)
if (node.nodes) {
this.block(node, start)
} else {
let end = (node.raws.between || '') + (semicolon ? ';' : '')
this.builder(escapeHTMLInCSS(start + end), node)
}
}
beforeAfter(node, detect) {
let value
if (node.type === 'decl') {
value = this.raw(node, null, 'beforeDecl')
} else if (node.type === 'comment') {
value = this.raw(node, null, 'beforeComment')
} else if (detect === 'before') {
value = this.raw(node, null, 'beforeRule')
} else {
value = this.raw(node, null, 'beforeClose')
}
let buf = node.parent
let depth = 0
while (buf && buf.type !== 'root') {
depth += 1
buf = buf.parent
}
if (value.includes('\n')) {
let indent = this.raw(node, null, 'indent')
if (indent.length) {
for (let step = 0; step < depth; step++) value += indent
}
}
return value
}
block(node, start) {
let between = this.raw(node, 'between', 'beforeOpen')
this.builder(escapeHTMLInCSS(start + between) + '{', node, 'start')
let after
if (node.nodes && node.nodes.length) {
this.body(node)
after = this.raw(node, 'after')
} else {
after = this.raw(node, 'after', 'emptyBody')
}
if (after) this.builder(escapeHTMLInCSS(after))
this.builder('}', node, 'end')
}
body(node) {
// Rules and at-rules are expanded into an explicit stack instead of
// recursive `stringify()` calls to survive deeply nested trees.
// If a subclass changes the traversal methods, its children go
// through `stringify()` to keep the override in charge.
let proto = Stringifier.prototype
let expandable = ['atrule', 'block', 'body', 'rule', 'stringify'].every(
method => this[method] === proto[method]
)
let stack = []
pushBody(this, stack, node)
while (stack.length > 0) {
let entry = stack.pop()
if (typeof entry === 'function') {
entry()
continue
}
let child = entry.node
let before = this.raw(child, 'before')
if (before) {
this.builder(entry.document ? before : escapeHTMLInCSS(before))
}
if (expandable && child.type === 'rule') {
pushBlock(this, stack, child, this.rawValue(child, 'selector'))
} else if (expandable && child.type === 'atrule' && child.nodes) {
pushBlock(this, stack, child, atruleStart(this, child))
} else {
this.stringify(child, entry.semicolon)
}
}
}
comment(node) {
let left = this.raw(node, 'left', 'commentLeft')
let right = this.raw(node, 'right', 'commentRight')
this.builder(escapeHTMLInCSS('/*' + left + node.text + right + '*/'), node)
}
decl(node, semicolon) {
let raws = node.raws
let between = this.raw(node, 'between', 'colon')
let string = node.prop + between + this.rawValue(node, 'value')
if (node.important) {
string += raws.important || ' !important'
}
if (semicolon) string += ';'
this.builder(escapeHTMLInCSS(string), node)
}
document(node) {
this.body(node)
}
raw(node, own, detect) {
let value
if (!detect) detect = own
// Already had
if (own) {
value = node.raws[own]
if (typeof value !== 'undefined') return value
}
let parent = node.parent
if (detect === 'before') {
// Hack for first rule in CSS
if (!parent || (parent.type === 'root' && parent.first === node)) {
return ''
}
// `root` nodes in `document` should use only their own raws
if (parent && parent.type === 'document') {
return ''
}
}
// Floating child without parent
if (!parent) return DEFAULT_RAW[detect]
// Detect style by other nodes
let root = node.root()
let cache = root.rawCache || (root.rawCache = {})
if (typeof cache[detect] !== 'undefined') {
return cache[detect]
}
if (detect === 'before' || detect === 'after') {
return this.beforeAfter(node, detect)
} else {
let method = 'raw' + capitalize(detect)
if (this[method]) {
value = this[method](root, node)
} else {
root.walk(i => {
value = i.raws[own]
if (typeof value !== 'undefined') return false
})
}
}
if (typeof value === 'undefined') value = DEFAULT_RAW[detect]
cache[detect] = value
return value
}
rawBeforeClose(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length > 0) {
if (typeof i.raws.after !== 'undefined') {
value = i.raws.after
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
}
})
if (value) value = value.replace(/\S/g, '')
return value
}
rawBeforeComment(root, node) {
let value
root.walkComments(i => {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
})
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeDecl')
} else if (value) {
value = value.replace(/\S/g, '')
}
return value
}
rawBeforeDecl(root, node) {
let value
root.walkDecls(i => {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
})
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeRule')
} else if (value) {
value = value.replace(/\S/g, '')
}
return value
}
rawBeforeOpen(root) {
let value
root.walk(i => {
if (i.type !== 'decl') {
value = i.raws.between
if (typeof value !== 'undefined') return false
}
})
return value
}
rawBeforeRule(root) {
let value
root.walk(i => {
if (i.nodes && (i.parent !== root || root.first !== i)) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '')
}
return false
}
}
})
if (value) value = value.replace(/\S/g, '')
return value
}
rawColon(root) {
let value
root.walkDecls(i => {
if (typeof i.raws.between !== 'undefined') {
value = i.raws.between.replace(/[^\s:]/g, '')
return false
}
})
return value
}
rawEmptyBody(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length === 0) {
value = i.raws.after
if (typeof value !== 'undefined') return false
}
})
return value
}
rawIndent(root) {
if (root.raws.indent) return root.raws.indent
let value
root.walk(i => {
let p = i.parent
if (p && p !== root && p.parent && p.parent === root) {
if (typeof i.raws.before !== 'undefined') {
let parts = i.raws.before.split('\n')
value = parts[parts.length - 1]
value = value.replace(/\S/g, '')
return false
}
}
})
return value
}
rawSemicolon(root) {
let value
root.walk(i => {
if (i.nodes && i.nodes.length && i.last.type === 'decl') {
value = i.raws.semicolon
if (typeof value !== 'undefined') return false
}
})
return value
}
rawValue(node, prop) {
let value = node[prop]
let raw = node.raws[prop]
if (raw && raw.value === value) {
return raw.raw
}
return value
}
root(node) {
if (node.source && node.source.input.hasBOM) {
this.builder('\uFEFF', node, 'start')
}
this.body(node)
if (node.raws.after) {
let after = node.raws.after
let isDocument = node.parent && node.parent.type === 'document'
this.builder(isDocument ? after : escapeHTMLInCSS(after))
}
}
rule(node) {
this.block(node, this.rawValue(node, 'selector'))
if (node.raws.ownSemicolon) {
this.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, 'end')
}
}
stringify(node, semicolon) {
/* c8 ignore start */
if (!this[node.type]) {
throw new Error(
'Unknown AST node type ' +
node.type +
'. ' +
'Maybe you need to change PostCSS stringifier.'
)
}
/* c8 ignore stop */
this[node.type](node, semicolon)
}
}
module.exports = Stringifier
Stringifier.default = Stringifier
@@ -0,0 +1,3 @@
# `react-dialog`
View docs [here](https://radix-ui.com/primitives/docs/components/dialog).
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es7: LibDefinition;
@@ -0,0 +1,19 @@
Copyright (C) 2011 by Beau Gunderson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"names":["_AwaitValue","value","wrapped"],"sources":["../../src/helpers/AwaitValue.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nexport default function _AwaitValue(value) {\n this.wrapped = value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,WAAWA,CAACC,KAAK,EAAE;EACzC,IAAI,CAACC,OAAO,GAAGD,KAAK;AACtB","ignoreList":[]}
@@ -0,0 +1,260 @@
/**
* @fileoverview Rule to flag fall-through cases in switch statements.
* @author Matt DuVall <http://mattduvall.com/>
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const { directivesPattern } = require("../shared/directives");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu;
/**
* 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;
}
/**
* Checks whether or not a given comment string is really a fallthrough comment and not an ESLint directive.
* @param {string} comment The comment string to check.
* @param {RegExp} fallthroughCommentPattern The regular expression used for checking for fallthrough comments.
* @returns {boolean} `true` if the comment string is truly a fallthrough comment.
*/
function isFallThroughComment(comment, fallthroughCommentPattern) {
return (
fallthroughCommentPattern.test(comment) &&
!directivesPattern.test(comment.trim())
);
}
/**
* Checks whether or not a given case has a fallthrough comment.
* @param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through.
* @param {ASTNode} subsequentCase The case after caseWhichFallsThrough.
* @param {RuleContext} context A rule context which stores comments.
* @param {RegExp} fallthroughCommentPattern A pattern to match comment to.
* @returns {null | object} the comment if the case has a valid fallthrough comment, otherwise null
*/
function getFallthroughComment(
caseWhichFallsThrough,
subsequentCase,
context,
fallthroughCommentPattern,
) {
const sourceCode = context.sourceCode;
if (
caseWhichFallsThrough.consequent.length === 1 &&
caseWhichFallsThrough.consequent[0].type === "BlockStatement"
) {
const trailingCloseBrace = sourceCode.getLastToken(
caseWhichFallsThrough.consequent[0],
);
const commentInBlock = sourceCode
.getCommentsBefore(trailingCloseBrace)
.pop();
if (
commentInBlock &&
isFallThroughComment(
commentInBlock.value,
fallthroughCommentPattern,
)
) {
return commentInBlock;
}
}
const comment = sourceCode.getCommentsBefore(subsequentCase).pop();
if (
comment &&
isFallThroughComment(comment.value, fallthroughCommentPattern)
) {
return comment;
}
return null;
}
/**
* Checks whether a node and a token are separated by blank lines
* @param {ASTNode} node The node to check
* @param {Token} token The token to compare against
* @returns {boolean} `true` if there are blank lines between node and token
*/
function hasBlankLinesBetween(node, token) {
return token.loc.start.line > node.loc.end.line + 1;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
allowEmptyCase: false,
reportUnusedFallthroughComment: false,
},
],
docs: {
description: "Disallow fallthrough of `case` statements",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-fallthrough",
},
schema: [
{
type: "object",
properties: {
commentPattern: {
type: "string",
},
allowEmptyCase: {
type: "boolean",
},
reportUnusedFallthroughComment: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unusedFallthroughComment:
"Found a comment that would permit fallthrough, but case cannot fall through.",
case: "Expected a 'break' statement before 'case'.",
default: "Expected a 'break' statement before 'default'.",
},
},
create(context) {
const codePathSegments = [];
let currentCodePathSegments = new Set();
const sourceCode = context.sourceCode;
const [
{ allowEmptyCase, commentPattern, reportUnusedFallthroughComment },
] = context.options;
const fallthroughCommentPattern = commentPattern
? new RegExp(commentPattern, "u")
: DEFAULT_FALLTHROUGH_COMMENT;
/*
* We need to use leading comments of the next SwitchCase node because
* trailing comments is wrong if semicolons are omitted.
*/
let previousCase = null;
return {
onCodePathStart() {
codePathSegments.push(currentCodePathSegments);
currentCodePathSegments = new Set();
},
onCodePathEnd() {
currentCodePathSegments = codePathSegments.pop();
},
onUnreachableCodePathSegmentStart(segment) {
currentCodePathSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
currentCodePathSegments.delete(segment);
},
onCodePathSegmentStart(segment) {
currentCodePathSegments.add(segment);
},
onCodePathSegmentEnd(segment) {
currentCodePathSegments.delete(segment);
},
SwitchCase(node) {
/*
* Checks whether or not there is a fallthrough comment.
* And reports the previous fallthrough node if that does not exist.
*/
if (previousCase && previousCase.node.parent === node.parent) {
const previousCaseFallthroughComment =
getFallthroughComment(
previousCase.node,
node,
context,
fallthroughCommentPattern,
);
if (
previousCase.isFallthrough &&
!previousCaseFallthroughComment
) {
context.report({
messageId: node.test ? "case" : "default",
node,
});
} else if (
reportUnusedFallthroughComment &&
!previousCase.isSwitchExitReachable &&
previousCaseFallthroughComment
) {
context.report({
messageId: "unusedFallthroughComment",
node: previousCaseFallthroughComment,
});
}
}
previousCase = null;
},
"SwitchCase:exit"(node) {
const nextToken = sourceCode.getTokenAfter(node);
/*
* `reachable` meant fall through because statements preceded by
* `break`, `return`, or `throw` are unreachable.
* And allows empty cases and the last case.
*/
const isSwitchExitReachable = isAnySegmentReachable(
currentCodePathSegments,
);
const isFallthrough =
isSwitchExitReachable &&
(node.consequent.length > 0 ||
(!allowEmptyCase &&
hasBlankLinesBetween(node, nextToken))) &&
node.parent.cases.at(-1) !== node;
previousCase = {
node,
isSwitchExitReachable,
isFallthrough,
};
},
};
},
};
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {HermesNode} from './HermesAST';
import type HermesParserDeserializer from './HermesParserDeserializer';
declare module.exports: $ReadOnlyArray<
(this: HermesParserDeserializer) => HermesNode,
>;
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Ghost = createLucideIcon("Ghost", [
["path", { d: "M9 10h.01", key: "qbtxuw" }],
["path", { d: "M15 10h.01", key: "1qmjsl" }],
[
"path",
{
d: "M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",
key: "uwwb07"
}
]
]);
export { Ghost as default };
//# sourceMappingURL=ghost.js.map
@@ -0,0 +1,497 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamableHTTPClientTransport = exports.StreamableHTTPError = void 0;
const mediaType_js_1 = require("../shared/mediaType.js");
const transport_js_1 = require("../shared/transport.js");
const types_js_1 = require("../types.js");
const auth_js_1 = require("./auth.js");
const stream_1 = require("eventsource-parser/stream");
// Default reconnection options for StreamableHTTP connections
const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
initialReconnectionDelay: 1000,
maxReconnectionDelay: 30000,
reconnectionDelayGrowFactor: 1.5,
maxRetries: 2
};
class StreamableHTTPError extends Error {
constructor(code, message) {
super(`Streamable HTTP error: ${message}`);
this.code = code;
}
}
exports.StreamableHTTPError = StreamableHTTPError;
/**
* Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification.
* It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events
* for receiving messages.
*/
class StreamableHTTPClientTransport {
constructor(url, opts) {
this._hasCompletedAuthFlow = false; // Circuit breaker: detect auth success followed by immediate 401
this._url = url;
this._resourceMetadataUrl = undefined;
this._scope = undefined;
this._requestInit = opts?.requestInit;
this._authProvider = opts?.authProvider;
this._fetch = opts?.fetch;
this._fetchWithInit = (0, transport_js_1.createFetchWithInit)(opts?.fetch, opts?.requestInit);
this._followRedirects = opts?.redirectPolicy === 'follow';
if (this._followRedirects) {
this._fetch = (0, transport_js_1.fetchLeavingRedirects)(this._fetch);
this._fetchWithInit = (0, transport_js_1.fetchLeavingRedirects)(this._fetchWithInit);
}
this._sessionId = opts?.sessionId;
this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS;
}
/** Error text for a redirect `response` that was not followed, or `undefined` for any other response. */
_unfollowedRedirect(response, url) {
const text = (0, transport_js_1.unfollowedRedirect)(response, url);
return text && !this._followRedirects ? `${text} (redirectPolicy: 'same-origin')` : text;
}
async _authThenStart() {
if (!this._authProvider) {
throw new auth_js_1.UnauthorizedError('No auth provider');
}
let result;
try {
result = await (0, auth_js_1.auth)(this._authProvider, {
serverUrl: this._url,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetchWithInit
});
}
catch (error) {
this.onerror?.(error);
throw error;
}
if (result !== 'AUTHORIZED') {
throw new auth_js_1.UnauthorizedError();
}
return await this._startOrAuthSse({ resumptionToken: undefined });
}
async _commonHeaders() {
const headers = {};
if (this._authProvider) {
const tokens = await this._authProvider.tokens();
if (tokens) {
headers['Authorization'] = `Bearer ${tokens.access_token}`;
}
}
if (this._sessionId) {
headers['mcp-session-id'] = this._sessionId;
}
if (this._protocolVersion) {
headers['mcp-protocol-version'] = this._protocolVersion;
}
const extraHeaders = (0, transport_js_1.normalizeHeaders)(this._requestInit?.headers);
return new Headers({
...headers,
...extraHeaders
});
}
async _startOrAuthSse(options) {
const { resumptionToken } = options;
try {
// Try to open an initial SSE stream with GET to listen for server messages
// This is optional according to the spec - server may not support it
const headers = await this._commonHeaders();
headers.set('Accept', 'text/event-stream');
// Include Last-Event-ID header for resumable streams if provided
if (resumptionToken) {
headers.set('last-event-id', resumptionToken);
}
const fetchFn = this._fetch ?? fetch;
const init = { method: 'GET', headers, signal: this._abortController?.signal };
// A response that is not a redirect is used as it arrives, so reading the stream starts as early as before.
let response = await fetchFn(this._url, this._followRedirects ? init : { ...init, redirect: 'manual' });
const followed = this._followRedirects ? undefined : (0, transport_js_1.followWithinOrigin)(fetchFn, this._url, init, response);
if (followed) {
response = await followed;
}
if (!response.ok) {
await response.body?.cancel();
if (response.status === 401 && this._authProvider) {
// Need to authenticate
return await this._authThenStart();
}
// 405 indicates that the server does not offer an SSE stream at GET endpoint
// This is an expected case that should not trigger an error
if (response.status === 405) {
return;
}
throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${this._unfollowedRedirect(response, this._url) ?? response.statusText}`);
}
this._handleSseStream(response.body, options, true);
}
catch (error) {
this.onerror?.(error);
throw error;
}
}
/**
* Calculates the next reconnection delay using backoff algorithm
*
* @param attempt Current reconnection attempt count for the specific stream
* @returns Time to wait in milliseconds before next reconnection attempt
*/
_getNextReconnectionDelay(attempt) {
// Use server-provided retry value if available
if (this._serverRetryMs !== undefined) {
return this._serverRetryMs;
}
// Fall back to exponential backoff
const initialDelay = this._reconnectionOptions.initialReconnectionDelay;
const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor;
const maxDelay = this._reconnectionOptions.maxReconnectionDelay;
// Cap at maximum delay
return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay);
}
/**
* Schedule a reconnection attempt using server-provided retry interval or backoff
*
* @param lastEventId The ID of the last received event for resumability
* @param attemptCount Current reconnection attempt count for this specific stream
*/
_scheduleReconnection(options, attemptCount = 0) {
// Use provided options or default options
const maxRetries = this._reconnectionOptions.maxRetries;
// Check if we've exceeded maximum retry attempts
if (attemptCount >= maxRetries) {
this.onerror?.(new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`));
return;
}
// Calculate next delay based on current attempt count
const delay = this._getNextReconnectionDelay(attemptCount);
// Schedule the reconnection
this._reconnectionTimeout = setTimeout(() => {
// Use the last event ID to resume where we left off
this._startOrAuthSse(options).catch(error => {
this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error instanceof Error ? error.message : String(error)}`));
// Schedule another attempt if this one failed, incrementing the attempt counter
this._scheduleReconnection(options, attemptCount + 1);
});
}, delay);
}
_handleSseStream(stream, options, isReconnectable) {
if (!stream) {
return;
}
const { onresumptiontoken, replayMessageId } = options;
let lastEventId;
// Track whether we've received a priming event (event with ID)
// Per spec, server SHOULD send a priming event with ID before closing
let hasPrimingEvent = false;
// Track whether we've received a response - if so, no need to reconnect
// Reconnection is for when server disconnects BEFORE sending response
let receivedResponse = false;
const processStream = async () => {
// this is the closest we can get to trying to catch network errors
// if something happens reader will throw
try {
// Create a pipeline: binary stream -> text decoder -> SSE parser
const reader = stream
.pipeThrough(new TextDecoderStream())
.pipeThrough(new stream_1.EventSourceParserStream({
onRetry: (retryMs) => {
// Capture server-provided retry value for reconnection timing
this._serverRetryMs = retryMs;
}
}))
.getReader();
while (true) {
const { value: event, done } = await reader.read();
if (done) {
break;
}
// Update last event ID if provided
if (event.id) {
lastEventId = event.id;
// Mark that we've received a priming event - stream is now resumable
hasPrimingEvent = true;
onresumptiontoken?.(event.id);
}
// Skip events with no data (priming events, keep-alives)
if (!event.data) {
continue;
}
if (!event.event || event.event === 'message') {
try {
const message = types_js_1.JSONRPCMessageSchema.parse(JSON.parse(event.data));
if ((0, types_js_1.isJSONRPCResultResponse)(message)) {
// Mark that we received a response - no need to reconnect for this request
receivedResponse = true;
if (replayMessageId !== undefined) {
message.id = replayMessageId;
}
}
this.onmessage?.(message);
}
catch (error) {
this.onerror?.(error);
}
}
}
// Handle graceful server-side disconnect
// Server may close connection after sending event ID and retry field
// Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID)
// BUT don't reconnect if we already received a response - the request is complete
const canResume = isReconnectable || hasPrimingEvent;
const needsReconnect = canResume && !receivedResponse;
if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
this._scheduleReconnection({
resumptionToken: lastEventId,
onresumptiontoken,
replayMessageId
}, 0);
}
}
catch (error) {
// Handle stream errors - likely a network disconnect
this.onerror?.(new Error(`SSE stream disconnected: ${error}`));
// Attempt to reconnect if the stream disconnects unexpectedly and we aren't closing
// Reconnect if: already reconnectable (GET stream) OR received a priming event (POST stream with event ID)
// BUT don't reconnect if we already received a response - the request is complete
const canResume = isReconnectable || hasPrimingEvent;
const needsReconnect = canResume && !receivedResponse;
if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
// Use the exponential backoff reconnection strategy
try {
this._scheduleReconnection({
resumptionToken: lastEventId,
onresumptiontoken,
replayMessageId
}, 0);
}
catch (error) {
this.onerror?.(new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`));
}
}
}
};
processStream();
}
async start() {
if (this._abortController) {
throw new Error('StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.');
}
this._abortController = new AbortController();
}
/**
* Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
*/
async finishAuth(authorizationCode) {
if (!this._authProvider) {
throw new auth_js_1.UnauthorizedError('No auth provider');
}
const result = await (0, auth_js_1.auth)(this._authProvider, {
serverUrl: this._url,
authorizationCode,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetchWithInit
});
if (result !== 'AUTHORIZED') {
throw new auth_js_1.UnauthorizedError('Failed to authorize');
}
}
async close() {
if (this._reconnectionTimeout) {
clearTimeout(this._reconnectionTimeout);
this._reconnectionTimeout = undefined;
}
this._abortController?.abort();
this.onclose?.();
}
async send(message, options) {
try {
const { resumptionToken, onresumptiontoken } = options || {};
if (resumptionToken) {
// If we have at last event ID, we need to reconnect the SSE stream
this._startOrAuthSse({ resumptionToken, replayMessageId: (0, types_js_1.isJSONRPCRequest)(message) ? message.id : undefined }).catch(err => this.onerror?.(err));
return;
}
const headers = await this._commonHeaders();
headers.set('content-type', 'application/json');
headers.set('accept', 'application/json, text/event-stream');
const init = {
...this._requestInit,
method: 'POST',
headers,
body: JSON.stringify(message),
signal: this._abortController?.signal
};
const response = await (0, transport_js_1.fetchWithinOrigin)(this._fetch ?? fetch)(this._url, init);
// Handle session ID received during initialization
const sessionId = response.headers.get('mcp-session-id');
if (sessionId) {
this._sessionId = sessionId;
}
if (!response.ok) {
const text = await response.text().catch(() => null);
if (response.status === 401 && this._authProvider) {
// Prevent infinite recursion when server returns 401 after successful auth
if (this._hasCompletedAuthFlow) {
throw new StreamableHTTPError(401, 'Server returned 401 after successful authentication');
}
const { resourceMetadataUrl, scope } = (0, auth_js_1.extractWWWAuthenticateParams)(response);
this._resourceMetadataUrl = resourceMetadataUrl;
this._scope = scope;
const result = await (0, auth_js_1.auth)(this._authProvider, {
serverUrl: this._url,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetchWithInit
});
if (result !== 'AUTHORIZED') {
throw new auth_js_1.UnauthorizedError();
}
// Mark that we completed auth flow
this._hasCompletedAuthFlow = true;
// Purposely _not_ awaited, so we don't call onerror twice
return this.send(message);
}
if (response.status === 403 && this._authProvider) {
const { resourceMetadataUrl, scope, error } = (0, auth_js_1.extractWWWAuthenticateParams)(response);
if (error === 'insufficient_scope') {
const wwwAuthHeader = response.headers.get('WWW-Authenticate');
// Check if we've already tried upscoping with this header to prevent infinite loops.
if (this._lastUpscopingHeader === wwwAuthHeader) {
throw new StreamableHTTPError(403, 'Server returned 403 after trying upscoping');
}
if (scope) {
this._scope = scope;
}
if (resourceMetadataUrl) {
this._resourceMetadataUrl = resourceMetadataUrl;
}
// Mark that upscoping was tried.
this._lastUpscopingHeader = wwwAuthHeader ?? undefined;
const result = await (0, auth_js_1.auth)(this._authProvider, {
serverUrl: this._url,
resourceMetadataUrl: this._resourceMetadataUrl,
scope: this._scope,
fetchFn: this._fetch
});
if (result !== 'AUTHORIZED') {
throw new auth_js_1.UnauthorizedError();
}
return this.send(message);
}
}
throw new StreamableHTTPError(response.status, `Error POSTing to endpoint: ${this._unfollowedRedirect(response, this._url) ?? text}`);
}
// Reset auth loop flag on successful response
this._hasCompletedAuthFlow = false;
this._lastUpscopingHeader = undefined;
// If the response is 202 Accepted, there's no body to process
if (response.status === 202) {
await response.body?.cancel();
// if the accepted notification is initialized, we start the SSE stream
// if it's supported by the server
if ((0, types_js_1.isInitializedNotification)(message)) {
// Start without a lastEventId since this is a fresh connection
this._startOrAuthSse({ resumptionToken: undefined }).catch(err => this.onerror?.(err));
}
return;
}
// Get original message(s) for detecting request IDs
const messages = Array.isArray(message) ? message : [message];
const hasRequests = messages.filter(msg => 'method' in msg && 'id' in msg && msg.id !== undefined).length > 0;
// Check the response type (parsed media type — see mediaTypeEssence)
const contentType = response.headers.get('content-type');
const responseMediaType = (0, mediaType_js_1.mediaTypeEssence)(contentType);
if (hasRequests) {
if (responseMediaType === 'text/event-stream') {
// Handle SSE stream responses for requests
// We use the same handler as standalone streams, which now supports
// reconnection with the last event ID
this._handleSseStream(response.body, { onresumptiontoken }, false);
}
else if (responseMediaType === 'application/json') {
// For non-streaming servers, we might get direct JSON responses
const data = await response.json();
const responseMessages = Array.isArray(data)
? data.map(msg => types_js_1.JSONRPCMessageSchema.parse(msg))
: [types_js_1.JSONRPCMessageSchema.parse(data)];
for (const msg of responseMessages) {
this.onmessage?.(msg);
}
}
else {
await response.body?.cancel();
throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType}`);
}
}
else {
// No requests in message but got 200 OK - still need to release connection
await response.body?.cancel();
}
}
catch (error) {
this.onerror?.(error);
throw error;
}
}
get sessionId() {
return this._sessionId;
}
/**
* Terminates the current session by sending a DELETE request to the server.
*
* Clients that no longer need a particular session
* (e.g., because the user is leaving the client application) SHOULD send an
* HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly
* terminate the session.
*
* The server MAY respond with HTTP 405 Method Not Allowed, indicating that
* the server does not allow clients to terminate sessions.
*/
async terminateSession() {
if (!this._sessionId) {
return; // No session to terminate
}
try {
const headers = await this._commonHeaders();
const init = {
...this._requestInit,
method: 'DELETE',
headers,
signal: this._abortController?.signal
};
const response = await (0, transport_js_1.fetchWithinOrigin)(this._fetch ?? fetch)(this._url, init);
await response.body?.cancel();
// We specifically handle 405 as a valid response according to the spec,
// meaning the server does not support explicit session termination
if (!response.ok && response.status !== 405) {
throw new StreamableHTTPError(response.status, `Failed to terminate session: ${this._unfollowedRedirect(response, this._url) ?? response.statusText}`);
}
this._sessionId = undefined;
}
catch (error) {
this.onerror?.(error);
throw error;
}
}
setProtocolVersion(version) {
this._protocolVersion = version;
}
get protocolVersion() {
return this._protocolVersion;
}
/**
* Resume an SSE stream from a previous event ID.
* Opens a GET SSE connection with Last-Event-ID header to replay missed events.
*
* @param lastEventId The event ID to resume from
* @param options Optional callback to receive new resumption tokens
*/
async resumeStream(lastEventId, options) {
await this._startOrAuthSse({
resumptionToken: lastEventId,
onresumptiontoken: options?.onresumptiontoken
});
}
}
exports.StreamableHTTPClientTransport = StreamableHTTPClientTransport;
//# sourceMappingURL=streamableHttp.js.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es5: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"rows-3.js","sources":["../../../src/icons/rows-3.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Rows3\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0yMSA5SDMiIC8+CiAgPHBhdGggZD0iTTIxIDE1SDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/rows-3\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 Rows3 = createLucideIcon('Rows3', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M21 9H3', key: '1338ky' }],\n ['path', { d: 'M21 15H3', key: '9uk58r' }],\n]);\n\nexport default Rows3;\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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_x","260":"_VB"},C:{"1":"_4L","2":"_HF","33":"_1B _2Q"},D:{"1":"_KK","2":"_gJ","33":"_EC _ME _SE"},E:{"1":"_pB","2":"_qB"},F:{"1":"_QL","2":"_j _gF _O","33":"_GL _BE"},G:{"1":"_AB","2":"_XB"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"D","130":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_hB","33":"_rC"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"WebRTC Peer-to-peer connections",D:true};
@@ -0,0 +1,64 @@
/**
* @fileoverview ESLint Parser
* @author Nicholas C. Zakas
*/
/* eslint class-methods-use-this: off -- Anticipate future constructor arguments. */
"use strict";
//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------
/** @typedef {import("../linter/vfile.js").VFile} VFile */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").LanguageOptions} LanguageOptions */
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* The parser for ESLint.
*/
class ParserService {
/**
* Parses the given file synchronously.
* @param {VFile} file The file to parse.
* @param {{language:Language,languageOptions:LanguageOptions}} config The configuration to use.
* @returns {Object} An object with the parsed source code or errors.
* @throws {Error} If the parser returns a promise.
*/
parseSync(file, config) {
const { language, languageOptions } = config;
const result = language.parse(file, { languageOptions });
if (typeof result.then === "function") {
throw new Error("Unsupported: Language parser returned a promise.");
}
if (result.ok) {
return {
ok: true,
sourceCode: language.createSourceCode(file, result, {
languageOptions,
}),
};
}
// if we made it to here there was an error
return {
ok: false,
errors: result.errors.map(error => ({
ruleId: null,
fatal: true,
severity: 2,
message: `Parsing error: ${error.message}`,
line: error.line,
column: error.column,
})),
};
}
}
module.exports = { ParserService };
@@ -0,0 +1,56 @@
import { progress, velocityPerSecond } from 'motion-utils';
/**
* A time in milliseconds, beyond which we consider the scroll velocity to be 0.
*/
const maxElapsed = 50;
const createAxisInfo = () => ({
current: 0,
offset: [],
progress: 0,
scrollLength: 0,
targetOffset: 0,
targetLength: 0,
containerLength: 0,
velocity: 0,
});
const createScrollInfo = () => ({
time: 0,
x: createAxisInfo(),
y: createAxisInfo(),
});
const keys = {
x: {
length: "Width",
position: "Left",
},
y: {
length: "Height",
position: "Top",
},
};
function updateAxisInfo(element, axisName, info, time) {
const axis = info[axisName];
const { length, position } = keys[axisName];
const prev = axis.current;
const prevTime = info.time;
axis.current = Math.abs(element[`scroll${position}`]);
axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];
axis.offset.length = 0;
axis.offset[0] = 0;
axis.offset[1] = axis.scrollLength;
axis.progress = progress(0, axis.scrollLength, axis.current);
const elapsed = time - prevTime;
axis.velocity =
elapsed > maxElapsed
? 0
: velocityPerSecond(axis.current - prev, elapsed);
}
function updateScrollInfo(element, info, time) {
updateAxisInfo(element, "x", info, time);
updateAxisInfo(element, "y", info, time);
info.time = time;
}
export { createScrollInfo, updateScrollInfo };
//# sourceMappingURL=info.mjs.map
@@ -0,0 +1,48 @@
import { isHTMLElement } from 'motion-dom';
function calcInset(element, container) {
const inset = { x: 0, y: 0 };
let current = element;
while (current && current !== container) {
if (isHTMLElement(current)) {
inset.x += current.offsetLeft;
inset.y += current.offsetTop;
current = current.offsetParent;
}
else if (current.tagName === "svg") {
/**
* This isn't an ideal approach to measuring the offset of <svg /> tags.
* It would be preferable, given they behave like HTMLElements in most ways
* to use offsetLeft/Top. But these don't exist on <svg />. Likewise we
* can't use .getBBox() like most SVG elements as these provide the offset
* relative to the SVG itself, which for <svg /> is usually 0x0.
*/
const svgBoundingBox = current.getBoundingClientRect();
current = current.parentElement;
const parentBoundingBox = current.getBoundingClientRect();
inset.x += svgBoundingBox.left - parentBoundingBox.left;
inset.y += svgBoundingBox.top - parentBoundingBox.top;
}
else if (current instanceof SVGGraphicsElement) {
const { x, y } = current.getBBox();
inset.x += x;
inset.y += y;
let svg = null;
let parent = current.parentNode;
while (!svg) {
if (parent.tagName === "svg") {
svg = parent;
}
parent = current.parentNode;
}
current = svg;
}
else {
break;
}
}
return inset;
}
export { calcInset };
//# sourceMappingURL=inset.mjs.map
@@ -0,0 +1,5 @@
declare function getProto<O extends object>(object: O): object | null;
declare const x: typeof getProto | null;
export = x;
@@ -0,0 +1 @@
{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}
@@ -0,0 +1,16 @@
/**
* @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 ChevronsDown = createLucideIcon("ChevronsDown", [
["path", { d: "m7 6 5 5 5-5", key: "1lc07p" }],
["path", { d: "m7 13 5 5 5-5", key: "1d48rs" }]
]);
export { ChevronsDown as default };
//# sourceMappingURL=chevrons-down.js.map
@@ -0,0 +1,21 @@
export function parseLiteralDef(def, refs) {
const parsedType = typeof def.value;
if (parsedType !== "bigint" &&
parsedType !== "number" &&
parsedType !== "boolean" &&
parsedType !== "string") {
return {
type: Array.isArray(def.value) ? "array" : "object",
};
}
if (refs.target === "openApi3") {
return {
type: parsedType === "bigint" ? "integer" : parsedType,
enum: [def.value],
};
}
return {
type: parsedType === "bigint" ? "integer" : parsedType,
const: def.value,
};
}
@@ -0,0 +1,14 @@
/**
* Subtracts a specified number of days from a date.
* 从日期中减去指定数量的天数。
*
* @param date - The date to subtract days from. (要减去天数的日期。)
* @param days - The number of days to subtract. (要减去的天数。)
* @returns A new date with the subtracted days. (减去天数后的新日期。)
* @example
* ```ts
* const newDate = subDays(new Date(), 5);
* console.log(newDate); // Outputs the date 5 days ago (输出5天前的日期)
* ```
*/
export default function subDays(date: Date, days: number): Date;
@@ -0,0 +1,18 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
// This file's contents are now included in the main types file.
// The file has been left for backward compatibility.
@@ -0,0 +1,374 @@
"use strict";
"use client";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
Close: () => Close,
Content: () => Content,
Description: () => Description,
Dialog: () => Dialog,
DialogClose: () => DialogClose,
DialogContent: () => DialogContent,
DialogDescription: () => DialogDescription,
DialogOverlay: () => DialogOverlay,
DialogPortal: () => DialogPortal,
DialogTitle: () => DialogTitle,
DialogTrigger: () => DialogTrigger,
Overlay: () => Overlay,
Portal: () => Portal,
Root: () => Root,
Title: () => Title,
Trigger: () => Trigger,
WarningProvider: () => WarningProvider,
createDialogScope: () => createDialogScope
});
module.exports = __toCommonJS(index_exports);
// src/dialog.tsx
var React = __toESM(require("react"));
var import_primitive = require("@radix-ui/primitive");
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
var import_react_context = require("@radix-ui/react-context");
var import_react_id = require("@radix-ui/react-id");
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer");
var import_react_focus_scope = require("@radix-ui/react-focus-scope");
var import_react_portal = require("@radix-ui/react-portal");
var import_react_presence = require("@radix-ui/react-presence");
var import_react_primitive = require("@radix-ui/react-primitive");
var import_react_focus_guards = require("@radix-ui/react-focus-guards");
var import_react_remove_scroll = require("react-remove-scroll");
var import_aria_hidden = require("aria-hidden");
var import_react_slot = require("@radix-ui/react-slot");
var import_jsx_runtime = require("react/jsx-runtime");
var DIALOG_NAME = "Dialog";
var [createDialogContext, createDialogScope] = (0, import_react_context.createContextScope)(DIALOG_NAME);
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
var Dialog = (props) => {
const {
__scopeDialog,
children,
open: openProp,
defaultOpen,
onOpenChange,
modal = true
} = props;
const triggerRef = React.useRef(null);
const contentRef = React.useRef(null);
const [open, setOpen] = (0, import_react_use_controllable_state.useControllableState)({
prop: openProp,
defaultProp: defaultOpen ?? false,
onChange: onOpenChange,
caller: DIALOG_NAME
});
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
DialogProvider,
{
scope: __scopeDialog,
triggerRef,
contentRef,
contentId: (0, import_react_id.useId)(),
titleId: (0, import_react_id.useId)(),
descriptionId: (0, import_react_id.useId)(),
open,
onOpenChange: setOpen,
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
modal,
children
}
);
};
Dialog.displayName = DIALOG_NAME;
var TRIGGER_NAME = "DialogTrigger";
var DialogTrigger = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...triggerProps } = props;
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
const composedTriggerRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_primitive.Primitive.button,
{
type: "button",
"aria-haspopup": "dialog",
"aria-expanded": context.open,
"aria-controls": context.contentId,
"data-state": getState(context.open),
...triggerProps,
ref: composedTriggerRef,
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, context.onOpenToggle)
}
);
}
);
DialogTrigger.displayName = TRIGGER_NAME;
var PORTAL_NAME = "DialogPortal";
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
forceMount: void 0
});
var DialogPortal = (props) => {
const { __scopeDialog, forceMount, children, container } = props;
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { asChild: true, container, children: child }) })) });
};
DialogPortal.displayName = PORTAL_NAME;
var OVERLAY_NAME = "DialogOverlay";
var DialogOverlay = React.forwardRef(
(props, forwardedRef) => {
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
return context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
}
);
DialogOverlay.displayName = OVERLAY_NAME;
var Slot = (0, import_react_slot.createSlot)("DialogOverlay.RemoveScroll");
var DialogOverlayImpl = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...overlayProps } = props;
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
return (
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
// ie. when `Overlay` and `Content` are siblings
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_remove_scroll.RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_primitive.Primitive.div,
{
"data-state": getState(context.open),
...overlayProps,
ref: forwardedRef,
style: { pointerEvents: "auto", ...overlayProps.style }
}
) })
);
}
);
var CONTENT_NAME = "DialogContent";
var DialogContent = React.forwardRef(
(props, forwardedRef) => {
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
const { forceMount = portalContext.forceMount, ...contentProps } = props;
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_presence.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
}
);
DialogContent.displayName = CONTENT_NAME;
var DialogContentModal = React.forwardRef(
(props, forwardedRef) => {
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
const contentRef = React.useRef(null);
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.contentRef, contentRef);
React.useEffect(() => {
const content = contentRef.current;
if (content) return (0, import_aria_hidden.hideOthers)(content);
}, []);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
DialogContentImpl,
{
...props,
ref: composedRefs,
trapFocus: context.open,
disableOutsidePointerEvents: true,
onCloseAutoFocus: (0, import_primitive.composeEventHandlers)(props.onCloseAutoFocus, (event) => {
event.preventDefault();
context.triggerRef.current?.focus();
}),
onPointerDownOutside: (0, import_primitive.composeEventHandlers)(props.onPointerDownOutside, (event) => {
const originalEvent = event.detail.originalEvent;
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
if (isRightClick) event.preventDefault();
}),
onFocusOutside: (0, import_primitive.composeEventHandlers)(
props.onFocusOutside,
(event) => event.preventDefault()
)
}
);
}
);
var DialogContentNonModal = React.forwardRef(
(props, forwardedRef) => {
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
const hasInteractedOutsideRef = React.useRef(false);
const hasPointerDownOutsideRef = React.useRef(false);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
DialogContentImpl,
{
...props,
ref: forwardedRef,
trapFocus: false,
disableOutsidePointerEvents: false,
onCloseAutoFocus: (event) => {
props.onCloseAutoFocus?.(event);
if (!event.defaultPrevented) {
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
event.preventDefault();
}
hasInteractedOutsideRef.current = false;
hasPointerDownOutsideRef.current = false;
},
onInteractOutside: (event) => {
props.onInteractOutside?.(event);
if (!event.defaultPrevented) {
hasInteractedOutsideRef.current = true;
if (event.detail.originalEvent.type === "pointerdown") {
hasPointerDownOutsideRef.current = true;
}
}
const target = event.target;
const targetIsTrigger = context.triggerRef.current?.contains(target);
if (targetIsTrigger) event.preventDefault();
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
event.preventDefault();
}
}
}
);
}
);
var DialogContentImpl = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
const contentRef = React.useRef(null);
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, contentRef);
(0, import_react_focus_guards.useFocusGuards)();
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_focus_scope.FocusScope,
{
asChild: true,
loop: true,
trapped: trapFocus,
onMountAutoFocus: onOpenAutoFocus,
onUnmountAutoFocus: onCloseAutoFocus,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_dismissable_layer.DismissableLayer,
{
role: "dialog",
id: context.contentId,
"aria-describedby": context.descriptionId,
"aria-labelledby": context.titleId,
"data-state": getState(context.open),
...contentProps,
ref: composedRefs,
onDismiss: () => context.onOpenChange(false)
}
)
}
),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWarning, { titleId: context.titleId }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
] })
] });
}
);
var TITLE_NAME = "DialogTitle";
var DialogTitle = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...titleProps } = props;
const context = useDialogContext(TITLE_NAME, __scopeDialog);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
}
);
DialogTitle.displayName = TITLE_NAME;
var DESCRIPTION_NAME = "DialogDescription";
var DialogDescription = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...descriptionProps } = props;
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
}
);
DialogDescription.displayName = DESCRIPTION_NAME;
var CLOSE_NAME = "DialogClose";
var DialogClose = React.forwardRef(
(props, forwardedRef) => {
const { __scopeDialog, ...closeProps } = props;
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_primitive.Primitive.button,
{
type: "button",
...closeProps,
ref: forwardedRef,
onClick: (0, import_primitive.composeEventHandlers)(props.onClick, () => context.onOpenChange(false))
}
);
}
);
DialogClose.displayName = CLOSE_NAME;
function getState(open) {
return open ? "open" : "closed";
}
var TITLE_WARNING_NAME = "DialogTitleWarning";
var [WarningProvider, useWarningContext] = (0, import_react_context.createContext)(TITLE_WARNING_NAME, {
contentName: CONTENT_NAME,
titleName: TITLE_NAME,
docsSlug: "dialog"
});
var TitleWarning = ({ titleId }) => {
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
React.useEffect(() => {
if (titleId) {
const hasTitle = document.getElementById(titleId);
if (!hasTitle) console.error(MESSAGE);
}
}, [MESSAGE, titleId]);
return null;
};
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
var DescriptionWarning = ({ contentRef, descriptionId }) => {
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
React.useEffect(() => {
const describedById = contentRef.current?.getAttribute("aria-describedby");
if (descriptionId && describedById) {
const hasDescription = document.getElementById(descriptionId);
if (!hasDescription) console.warn(MESSAGE);
}
}, [MESSAGE, contentRef, descriptionId]);
return null;
};
var Root = Dialog;
var Trigger = DialogTrigger;
var Portal = DialogPortal;
var Overlay = DialogOverlay;
var Content = DialogContent;
var Title = DialogTitle;
var Description = DialogDescription;
var Close = DialogClose;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
/**
* Experimental McpServer task features for MCP SDK.
* WARNING: These APIs are experimental and may change without notice.
*
* @experimental
*/
/**
* Experimental task features for McpServer.
*
* Access via `server.experimental.tasks`:
* ```typescript
* server.experimental.tasks.registerToolTask('long-running', config, handler);
* ```
*
* @experimental
*/
export class ExperimentalMcpServerTasks {
constructor(_mcpServer) {
this._mcpServer = _mcpServer;
}
registerToolTask(name, config, handler) {
// Validate that taskSupport is not 'forbidden' for task-based tools
const execution = { taskSupport: 'required', ...config.execution };
if (execution.taskSupport === 'forbidden') {
throw new Error(`Cannot register task-based tool '${name}' with taskSupport 'forbidden'. Use registerTool() instead.`);
}
// Access McpServer's internal _createRegisteredTool method
const mcpServerInternal = this._mcpServer;
return mcpServerInternal._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler);
}
}
//# sourceMappingURL=mcp-server.js.map
@@ -0,0 +1,194 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/helper/css/common.ts
const PSEUDO_GLOBAL_SELECTOR = ":-hono-global";
const isPseudoGlobalSelectorRe = new RegExp(`^${PSEUDO_GLOBAL_SELECTOR}{(.*)}$`);
const DEFAULT_STYLE_ID = "hono-css";
const SELECTOR = Symbol();
const CLASS_NAME = Symbol();
const STYLE_STRING = Symbol();
const SELECTORS = Symbol();
const EXTERNAL_CLASS_NAMES = Symbol();
const CSS_ESCAPED = Symbol();
const IS_CSS_ESCAPED = Symbol();
/**
* @experimental
* `rawCssString` is an experimental feature.
* The API might be changed.
*/
const rawCssString = (value) => {
return { [CSS_ESCAPED]: value };
};
/**
* Used the goober'code as a reference:
* https://github.com/cristianbote/goober/blob/master/src/core/to-hash.js
* MIT License, Copyright (c) 2019 Cristian Bote
*/
const toHash = (str) => {
let i = 0, out = 11;
while (i < str.length) out = 101 * out + str.charCodeAt(i++) >>> 0;
return "css-" + out;
};
const normalizeLabel = (label) => {
return label.trim().replace(/\s+/g, "-");
};
const isValidClassName = (name) => /^-?[_a-zA-Z][_a-zA-Z0-9-]*$/.test(name);
const hasUnsafeSelectorChar = (name) => /[<{}]/.test(name);
const RESERVED_KEYFRAME_NAMES = /* @__PURE__ */ new Set([
"default",
"inherit",
"initial",
"none",
"revert",
"revert-layer",
"unset"
]);
const isValidKeyframeName = (name) => isValidClassName(name) && !RESERVED_KEYFRAME_NAMES.has(name.toLowerCase());
const defaultOnInvalidSlug = (slug) => {
console.warn(`Invalid slug: ${slug}`);
};
const cssStringReStr = ["\"(?:(?:\\\\[\\s\\S]|[^\"\\\\])*)\"", "'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'"].join("|");
const minifyCssRe = new RegExp([
"(" + cssStringReStr + ")",
"(?:" + [
"^\\s+",
"\\/\\*.*?\\*\\/\\s*",
"\\/\\/.*\\n\\s*",
"\\s+$"
].join("|") + ")",
"\\s*;\\s*(}|$)\\s*",
"\\s*([{};:,])\\s*",
"(\\s)\\s+"
].join("|"), "g");
const minify = (css) => {
return css.replace(minifyCssRe, (_, $1, $2, $3, $4) => $1 || $2 || $3 || $4 || "");
};
const buildStyleString = (strings, values) => {
const selectors = [];
const externalClassNames = [];
const label = strings[0].match(/^\s*\/\*(.*?)\*\//)?.[1] || "";
let styleString = "";
for (let i = 0, len = strings.length; i < len; i++) {
styleString += strings[i];
let vArray = values[i];
if (typeof vArray === "boolean" || vArray === null || vArray === void 0) continue;
if (!Array.isArray(vArray)) vArray = [vArray];
for (let j = 0, len = vArray.length; j < len; j++) {
let value = vArray[j];
if (typeof value === "boolean" || value === null || value === void 0) continue;
if (typeof value === "string") {
if (/([\\"'\/])/.test(value)) styleString += value.replace(/([\\"']|(?<=<)\/)/g, "\\$1");
else styleString += value;
} else if (typeof value === "number") styleString += value;
else if (value[CSS_ESCAPED]) styleString += value[CSS_ESCAPED];
else if (value[CLASS_NAME].startsWith("@keyframes ")) {
selectors.push(value);
styleString += ` ${value[CLASS_NAME].substring(11)} `;
} else {
if (strings[i + 1]?.match(/^\s*{/)) {
selectors.push(value);
value = `.${value[CLASS_NAME]}`;
} else {
selectors.push(...value[SELECTORS]);
externalClassNames.push(...value[EXTERNAL_CLASS_NAMES]);
value = value[STYLE_STRING];
const valueLen = value.length;
if (valueLen > 0) {
const lastChar = value[valueLen - 1];
if (lastChar !== ";" && lastChar !== "}") value += ";";
}
}
styleString += `${value || ""}`;
}
}
}
return [
label,
minify(styleString),
selectors,
externalClassNames
];
};
const cssCommon = (strings, values, classNameSlug, onInvalidSlug) => {
let [label, thisStyleString, selectors, externalClassNames] = buildStyleString(strings, values);
const isPseudoGlobal = isPseudoGlobalSelectorRe.exec(thisStyleString);
if (isPseudoGlobal) thisStyleString = isPseudoGlobal[1];
const hash = toHash(label + thisStyleString);
let customSlug;
if (classNameSlug) {
const slug = classNameSlug(hash, normalizeLabel(label), thisStyleString);
if (slug) {
if (isValidClassName(slug)) customSlug = slug;
else (onInvalidSlug || defaultOnInvalidSlug)(slug);
}
}
const selector = (isPseudoGlobal ? PSEUDO_GLOBAL_SELECTOR : "") + (customSlug || hash);
const className = (isPseudoGlobal ? selectors.map((s) => s[CLASS_NAME]) : [selector, ...externalClassNames]).join(" ");
return {
[SELECTOR]: selector,
[CLASS_NAME]: className,
[STYLE_STRING]: thisStyleString,
[SELECTORS]: selectors,
[EXTERNAL_CLASS_NAMES]: externalClassNames
};
};
const cxCommon = (args) => {
for (let i = 0, len = args.length; i < len; i++) {
const arg = args[i];
if (typeof arg === "string") args[i] = {
[SELECTOR]: "",
[CLASS_NAME]: "",
[STYLE_STRING]: "",
[SELECTORS]: [],
[EXTERNAL_CLASS_NAMES]: hasUnsafeSelectorChar(arg) ? [] : [arg]
};
}
return args;
};
const keyframesCommon = (strings, values, classNameSlug, onInvalidSlug) => {
const [label, styleString] = buildStyleString(strings, values);
const hash = toHash(label + styleString);
let customSlug;
if (classNameSlug) {
const slug = classNameSlug(hash, normalizeLabel(label), styleString);
if (slug) {
if (isValidKeyframeName(slug)) customSlug = slug;
else (onInvalidSlug || defaultOnInvalidSlug)(slug);
}
}
return {
[SELECTOR]: "",
[CLASS_NAME]: `@keyframes ${customSlug || hash}`,
[STYLE_STRING]: styleString,
[SELECTORS]: [],
[EXTERNAL_CLASS_NAMES]: []
};
};
let viewTransitionNameIndex = 0;
const viewTransitionCommon = ((strings, values, classNameSlug, onInvalidSlug) => {
if (!strings) strings = [`/* h-v-t ${viewTransitionNameIndex++} */`];
const content = Array.isArray(strings) ? cssCommon(strings, values, classNameSlug, onInvalidSlug) : strings;
const transitionName = content[CLASS_NAME];
const res = cssCommon(["view-transition-name:", ""], [transitionName], classNameSlug, onInvalidSlug);
content[CLASS_NAME] = PSEUDO_GLOBAL_SELECTOR + content[CLASS_NAME];
content[STYLE_STRING] = content[STYLE_STRING].replace(/(?<=::view-transition(?:[a-z-]*)\()(?=\))/g, transitionName);
res[CLASS_NAME] = res[SELECTOR] = transitionName;
res[SELECTORS] = [...content[SELECTORS], content];
return res;
});
//#endregion
exports.CLASS_NAME = CLASS_NAME;
exports.DEFAULT_STYLE_ID = DEFAULT_STYLE_ID;
exports.EXTERNAL_CLASS_NAMES = EXTERNAL_CLASS_NAMES;
exports.IS_CSS_ESCAPED = IS_CSS_ESCAPED;
exports.PSEUDO_GLOBAL_SELECTOR = PSEUDO_GLOBAL_SELECTOR;
exports.SELECTOR = SELECTOR;
exports.SELECTORS = SELECTORS;
exports.STYLE_STRING = STYLE_STRING;
exports.buildStyleString = buildStyleString;
exports.cssCommon = cssCommon;
exports.cxCommon = cxCommon;
exports.isPseudoGlobalSelectorRe = isPseudoGlobalSelectorRe;
exports.keyframesCommon = keyframesCommon;
exports.minify = minify;
exports.rawCssString = rawCssString;
exports.viewTransitionCommon = viewTransitionCommon;
@@ -0,0 +1,263 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReaddirpStream = exports.EntryTypes = void 0;
exports.readdirp = readdirp;
exports.readdirpPromise = readdirpPromise;
const promises_1 = require("node:fs/promises");
const node_stream_1 = require("node:stream");
const node_path_1 = require("node:path");
exports.EntryTypes = {
FILE_TYPE: 'files',
DIR_TYPE: 'directories',
FILE_DIR_TYPE: 'files_directories',
EVERYTHING_TYPE: 'all',
};
const defaultOptions = {
root: '.',
fileFilter: (_entryInfo) => true,
directoryFilter: (_entryInfo) => true,
type: exports.EntryTypes.FILE_TYPE,
lstat: false,
depth: 2147483648,
alwaysStat: false,
highWaterMark: 4096,
};
Object.freeze(defaultOptions);
const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);
const ALL_TYPES = [
exports.EntryTypes.DIR_TYPE,
exports.EntryTypes.EVERYTHING_TYPE,
exports.EntryTypes.FILE_DIR_TYPE,
exports.EntryTypes.FILE_TYPE,
];
const DIR_TYPES = new Set([
exports.EntryTypes.DIR_TYPE,
exports.EntryTypes.EVERYTHING_TYPE,
exports.EntryTypes.FILE_DIR_TYPE,
]);
const FILE_TYPES = new Set([
exports.EntryTypes.EVERYTHING_TYPE,
exports.EntryTypes.FILE_DIR_TYPE,
exports.EntryTypes.FILE_TYPE,
]);
const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
const wantBigintFsStats = process.platform === 'win32';
const emptyFn = (_entryInfo) => true;
const normalizeFilter = (filter) => {
if (filter === undefined)
return emptyFn;
if (typeof filter === 'function')
return filter;
if (typeof filter === 'string') {
const fl = filter.trim();
return (entry) => entry.basename === fl;
}
if (Array.isArray(filter)) {
const trItems = filter.map((item) => item.trim());
return (entry) => trItems.some((f) => entry.basename === f);
}
return emptyFn;
};
/** Readable readdir stream, emitting new files as they're being listed. */
class ReaddirpStream extends node_stream_1.Readable {
constructor(options = {}) {
super({
objectMode: true,
autoDestroy: true,
highWaterMark: options.highWaterMark,
});
const opts = { ...defaultOptions, ...options };
const { root, type } = opts;
this._fileFilter = normalizeFilter(opts.fileFilter);
this._directoryFilter = normalizeFilter(opts.directoryFilter);
const statMethod = opts.lstat ? promises_1.lstat : promises_1.stat;
// Use bigint stats if it's windows and stat() supports options (node 10+).
if (wantBigintFsStats) {
this._stat = (path) => statMethod(path, { bigint: true });
}
else {
this._stat = statMethod;
}
this._maxDepth = opts.depth ?? defaultOptions.depth;
this._wantsDir = type ? DIR_TYPES.has(type) : false;
this._wantsFile = type ? FILE_TYPES.has(type) : false;
this._wantsEverything = type === exports.EntryTypes.EVERYTHING_TYPE;
this._root = (0, node_path_1.resolve)(root);
this._isDirent = !opts.alwaysStat;
this._statsProp = this._isDirent ? 'dirent' : 'stats';
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
// Launch stream with one parent, the root dir.
this.parents = [this._exploreDir(root, 1)];
this.reading = false;
this.parent = undefined;
}
async _read(batch) {
if (this.reading)
return;
this.reading = true;
try {
while (!this.destroyed && batch > 0) {
const par = this.parent;
const fil = par && par.files;
if (fil && fil.length > 0) {
const { path, depth } = par;
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
const awaited = await Promise.all(slice);
for (const entry of awaited) {
if (!entry)
continue;
if (this.destroyed)
return;
const entryType = await this._getEntryType(entry);
if (entryType === 'directory' && this._directoryFilter(entry)) {
if (depth <= this._maxDepth) {
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
}
if (this._wantsDir) {
this.push(entry);
batch--;
}
}
else if ((entryType === 'file' || this._includeAsFile(entry)) &&
this._fileFilter(entry)) {
if (this._wantsFile) {
this.push(entry);
batch--;
}
}
}
}
else {
const parent = this.parents.pop();
if (!parent) {
this.push(null);
break;
}
this.parent = await parent;
if (this.destroyed)
return;
}
}
}
catch (error) {
this.destroy(error);
}
finally {
this.reading = false;
}
}
async _exploreDir(path, depth) {
let files;
try {
files = await (0, promises_1.readdir)(path, this._rdOptions);
}
catch (error) {
this._onError(error);
}
return { files, depth, path };
}
async _formatEntry(dirent, path) {
let entry;
const basename = this._isDirent ? dirent.name : dirent;
try {
const fullPath = (0, node_path_1.resolve)((0, node_path_1.join)(path, basename));
entry = { path: (0, node_path_1.relative)(this._root, fullPath), fullPath, basename };
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
}
catch (err) {
this._onError(err);
return;
}
return entry;
}
_onError(err) {
if (isNormalFlowError(err) && !this.destroyed) {
this.emit('warn', err);
}
else {
this.destroy(err);
}
}
async _getEntryType(entry) {
// entry may be undefined, because a warning or an error were emitted
// and the statsProp is undefined
if (!entry && this._statsProp in entry) {
return '';
}
const stats = entry[this._statsProp];
if (stats.isFile())
return 'file';
if (stats.isDirectory())
return 'directory';
if (stats && stats.isSymbolicLink()) {
const full = entry.fullPath;
try {
const entryRealPath = await (0, promises_1.realpath)(full);
const entryRealPathStats = await (0, promises_1.lstat)(entryRealPath);
if (entryRealPathStats.isFile()) {
return 'file';
}
if (entryRealPathStats.isDirectory()) {
const len = entryRealPath.length;
if (full.startsWith(entryRealPath) && full.substr(len, 1) === node_path_1.sep) {
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
// @ts-ignore
recursiveError.code = RECURSIVE_ERROR_CODE;
return this._onError(recursiveError);
}
return 'directory';
}
}
catch (error) {
this._onError(error);
return '';
}
}
}
_includeAsFile(entry) {
const stats = entry && entry[this._statsProp];
return stats && this._wantsEverything && !stats.isDirectory();
}
}
exports.ReaddirpStream = ReaddirpStream;
/**
* Streaming version: Reads all files and directories in given root recursively.
* Consumes ~constant small amount of RAM.
* @param root Root directory
* @param options Options to specify root (start directory), filters and recursion depth
*/
function readdirp(root, options = {}) {
// @ts-ignore
let type = options.entryType || options.type;
if (type === 'both')
type = exports.EntryTypes.FILE_DIR_TYPE; // backwards-compatibility
if (type)
options.type = type;
if (!root) {
throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
}
else if (typeof root !== 'string') {
throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
}
else if (type && !ALL_TYPES.includes(type)) {
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
}
options.root = root;
return new ReaddirpStream(options);
}
/**
* Promise version: Reads all files and directories in given root recursively.
* Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed.
* @returns array of paths and their entry infos
*/
function readdirpPromise(root, options = {}) {
return new Promise((resolve, reject) => {
const files = [];
readdirp(root, options)
.on('data', (entry) => files.push(entry))
.on('end', () => resolve(files))
.on('error', (error) => reject(error));
});
}
exports.default = readdirp;
@@ -0,0 +1 @@
{"version":3,"file":"feedback.cjs","sources":["../../../src/matcher/separator/feedback.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA,uBAAe,MAAK;AAClB;AACA,EAAA,OAAO,IAAI;AACb,CAAC;;;;"}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026-present, rolldown/plugins repository contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,935 @@
flf2a$ 9 8 22 63 16 0 24511 0
Author : LG Beard
Date : 2004/3/27 20:45:15
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
.=-.-. #
/==/_ / #
|==|, | #
|==| | #
/==/. / #
`--`-` #
.=. #
:=; : #
`=` ##
,--.- ,--.-, #
/==/, /==/ -/ #
|==|_ |==|_ | #
|==| |==| | #
/==/, /==/, / #
`--`-'`--`-' #
#
#
##
,--, ,--, #
__ /-\==\/-\==\_ #
/\_ \'/==/ '/==/_\#
\/================/#
/\__ \/==/ /==/_\/ #
\/===============/ #
/ `/==/ `/==/ #
`--`-` -`-` #
##
$#
#
#
#
#
#
#
#
##
.=. ,--, #
:=; :/-\==\ #
`=`/ '/==/ #
/ /==/ #
/ -/==/ #
/ `/==/ #
/ -/==/.=. #
/ `/==/:=; : #
`--`-` `=` ##
,---.--. #
/ -_ \==\ #
|` / \/==/ #
\ \ /==/ #
/ \==/ #
/. / \==\ #
| _ \_/\==\ #
\ . - /\==\ #
'----`-`--` ##
.--.-. #
/==/ / #
\==\ -\ #
\==\- \ #
`--`-' #
#
#
#
##
.-.--. #
\ \==\ #
/- /==/ #
/' /==/ #
|,|==| #
\ \==\ #
\ ,\==\ #
/ -/==/ #
`-'--' ##
.--.-. #
/==/ / #
\==\ -\ #
\==\ `\ #
|==|,| #
/==/ / #
/==/, / #
\==\- \ #
`--`-' ##
*#
#
#
#
#
#
#
#
##
.--.-. #
/==/ / #
\==\ -\ #
,--,--`--`--`--. #
\==\ ========== \ #
`--`-,--,--,---` #
/==/, / #
\==\- \ #
`--`-' ##
#
#
#
#
,--, #
/-\==\ #
/ '/==/ #
/ /==/ #
`--`--` ##
#
#
,--.--------. #
/==/, - , -\ #
\==\.-. - ,-./ #
`--`--------` #
#
#
##
#
#
#
#
#
#
.=. #
:=; : #
`=` ##
,--, #
/-\==\ #
/ '/==/ #
/ /==/ #
/ -/==/ #
/ `/==/ #
/ -/==/ #
/ `/==/ #
`--`-` ##
_.---.,_ #
.' - , `.-, #
/ - , ,_\==\ #
| .=. |==| #
| - :=; : _|==| #
| `=` , |==| #
\ _, - /==/ #
`. - .`=.` #
``--'--' ##
,-----.--. #
/` ` - /==/ #
`-'-. -|==| #
| `|==| #
| -|==| #
| `|==| #
.-','|==| #
/ \==\ #
`-----`---` ##
,-----,--, #
| '- -\==\ #
\,--, '/==/ #
/ /==/ #
/ -/==/ #
/ -/==/ #
/ `\==\_,--, #
/` - ,/==/ #
`------`--` ##
.----, #
/ ``--`.-, #
'-._ -|==| #
.-.' |==| #
\ , _\==\ #
`-. |==| #
_.-', _|==| #
\ , \==\ #
``-----'--' ##
.--, .-.--, #
| |=| -\==\ #
| `-' _|==| #
\ , |==| #
`--. -|==| #
\_ |==| #
| \==\ #
\ /==/ #
`--` ##
,-.--. #
/ - \==\ #
/ /\/==/ #
| \==\ #
/ `-.`-. #
`--. \==\ #
.-/ /==/ #
/ /==/ #
`-----`-` ##
.,-. #
/ \==\ #
/ -/==/ #
/- /==/ #
/ /==/ #
/. / \==\ #
| _ \_/\==\ #
\ . - /==/ #
'----`--` ##
,-----,--, #
| '- -\==\ #
\,--, '/==/ #
/ /==/ #
/ -/==/ #
/ `/==/ #
/ -/==/ #
/ `/==/ #
`--`-` ##
,---.--. #
/ -_ \==\ #
|` / \/==/ #
\ \ /==/ #
/ \==/ #
/. / \==\ #
| _ \_/\==\ #
\ . - /==/ #
'----`--` ##
,--,----. #
/==/ .=. \ #
\==\ '='\ \ #
`--`--'/ `/ #
/==/ -/ #
/==/ -/ #
/==/- / #
\==\ / #
`-'` ##
#
.=. #
:=; : #
`=` #
.=. #
:=; : #
`=` #
#
##
#
.=. #
:=; : #
`=` #
.=. #
:=; : #
`.` #
#
##
.--. #
/ \==\ #
/- /==/ #
/' /==/ #
| ,|==| #
\ \==\ #
\ ,\==\ #
\- \==\ #
`./==/ ##
,--.--------. #
/==/, - , -\ #
\==\.-. - ,-./ #
`--`--------` #
,--.--------. #
/==/, - , -\ #
\==\.-. - ,-./ #
`--`--------` #
##
.--. #
/==/ \ #
\==\ -\ #
\==\ `\ #
|==|, | #
/==/ / #
/==/, / #
/==/ -/ #
\==\.' ##
,--,---. #
/==/ - ` \ #
\==\/\ - | #
`--`/ `/ #
|==| | #
`--`--` #
.=. #
:=; : #
`=` ##
_,----. #
,-.--` , \ #
/==/- _.-`\ #
/==/ `.-. \ #
\==\_ , / / #
\==\ .-' / #
`._`.___.' #
#
##
,---. #
.--.' \ #
\==\-/\ \ #
/==/-|_\ | #
\==\, - \ #
/==/ - ,| #
/==/- /\ - \ #
\==\ _.\=\.-' #
`--` ##
#
_..---. #
.' .'.-. \ #
/==/- '=' / #
|==|-, ' #
|==| .=. \ #
/==/- '=' ,| #
|==| - / #
`-._`.___,' ##
_,.----. #
.' .' - \ #
/==/ , ,-' #
|==|- | . #
|==|_ `-' \ #
|==| _ , | #
\==\. / #
`-.`.___.-' #
##
#
_,..---._ #
/==/, - \ #
|==| _ _\ #
|==| .=. | #
|==|,| | -| #
|==| '=' / #
|==|-, _`/ #
`-.`.____.' ##
,----. #
,-.--` , \ #
|==|- _.-` #
|==| `.-. #
/==/_ , / #
|==| .-' #
|==|_ ,`-._ #
/==/ , / #
`--`-----`` ##
_,---. #
.-`.' , \ #
/==/_ _.-' #
/==/- '..-. #
|==|_ , / #
|==| .--' #
|==|- | #
/==/ \ #
`--`---' ##
_,---. #
_.='.'-, \ #
/==.'- / #
/==/ - .-' #
|==|_ /_,-. #
|==| , \_.' ) #
\==\- , ( #
/==/ _ , / #
`--`------' ##
,--.-,,-,--, #
/==/ /|=| | #
|==|_ ||=|, | #
|==| ,|/=| _| #
|==|- `-' _ | #
|==| _ | #
|==| .-. ,\ #
/==/, //=/ | #
`--`-' `-`--` ##
.=-.-. #
/==/_ / #
|==|, | #
|==| | #
|==|- | #
|==| ,| #
|==|- | #
/==/. / #
`--`-` ##
,--.-, #
|==' -| #
|==|- | #
__|==|, | #
,--.-'\=|- | #
|==|- |=/ ,| #
|==|. /=| -| #
\==\, `-' / #
`--`----' ##
,--.-.,-. #
/==/- |\ \ #
|==|_ `/_ / #
|==| , / #
|==|- .| #
|==| _ , \ #
/==/ '\ | #
\==\ /\=\.' #
`--` ##
#
_.-. #
.-,.'| #
|==|, | #
|==|- | #
|==|, | #
|==|- `-._ #
/==/ - , ,/ #
`--`-----' ##
___ #
.-._ .'=.'\ #
/==/ \|==| | #
|==|,| / - | #
|==| \/ , | #
|==|- , _ | #
|==| _ /\ | #
/==/ / / , / #
`--`./ `--` ##
.-._ #
/==/ \ .-._ #
|==|, \/ /, / #
|==|- \| | #
|==| , | -| #
|==| - _ | #
|==| /\ , | #
/==/, | |- | #
`--`./ `--` ##
_,.---._ #
,-.' , - `. #
/==/_, , - \ #
|==| .=. | #
|==|_ : ;=: - | #
|==| , '=' | #
\==\ - ,_ / #
'.='. - .' #
`--`--'' ##
_ __ #
.-`.' ,`. #
/==/, - \ #
|==| _ .=. | #
|==| , '=',| #
|==|- '..' #
|==|, | #
/==/ - | #
`--`---' ##
_,.---._ #
,-.' - , `. #
/==/ , - \ #
|==| - .=. , | #
|==| : ;=: - | #
|==|, '=' , | #
\==\ _ - ; #
'.='. , ; -\ #
`--`--'' `--` ##
#
.-.,.---. #
/==/ ` \ #
|==|-, .=., | #
|==| '=' / #
|==|- , .' #
|==|_ . ,'. #
/==/ /\ , ) #
`--`-`--`--' ##
,-,--. #
,-.'- _\ #
/==/_ ,_.' #
\==\ \ #
\==\ -\ #
_\==\ ,\ #
/==/\/ _ | #
\==\ - , / #
`--`---' ##
,--.--------. #
/==/, - , -\ #
\==\.-. - ,-./ #
`--`\==\- \ #
\==\_ \ #
|==|- | #
|==|, | #
/==/ -/ #
`--`--` ##
#
.--.-. .-.-. #
/==/ -|/=/ | #
|==| ,||=| -| #
|==|- | =/ | #
|==|, \/ - | #
|==|- , / #
/==/ , _ .' #
`--`..---' ##
,-.-. #
,--.-./=/ ,/ #
/==/, ||=| -| #
\==\, \ / ,| #
\==\ - ' - / #
\==\ , | #
|==| - ,/ #
\==\ _ / #
`--`--' ##
,-.-. #
,-..-.-./ \==\ #
|, \=/\=|- |==| #
|- |/ |/ , /==/ #
\, , _|==| #
| - - , |==| #
\ , - /==/ #
|- /\ /==/ #
`--` `--` ##
,-.--, #
.--.-. /=/, .' #
\==\ -\/=/- / #
\==\ `-' ,/ #
|==|, - | #
/==/ , \ #
/==/, .--, - \ #
\==\- \/=/ , / #
`--`-' `--` ##
#
,--.-. .-,--. #
/==/- / /=/_ / #
\==\, \/=/. / #
\==\ \/ -/ #
|==| ,_/ #
\==\-, / #
/==/._/ #
`--`-` ##
#
,--,----. #
/==/` - ./ #
`--`=/. / #
/==/- / #
/==/- /-. #
/==/, `--`\ #
\==\- -, | #
`--`.-.--` ##
,--.---, #
\==\ - '\ #
|==|- .-' #
|==|' | #
|==|- | #
|==|' | #
|==|`,`-. #
/==/ / #
`--`---' ##
,--, #
/==/-\ #
\==\` \ #
\==\ \ #
\==\- \ #
\==\' \ #
\==\- \ #
\==\' \ #
'-'--' ##
,---.--. #
/` - /==/ #
`-. -|==| #
| `|==| #
| -|==| #
| `|==| #
.-','|==| #
\ \==\ #
`---`---` ##
,--.--. #
/==/ _- \ #
/==/ -/\. \ #
/==/, /==\ ,\ #
\==\-/ \==\ .` #
`--` `--` #
#
#
##
#
#
#
#
#
,--.--------. #
/==/, - , -\ #
\==\.-. - ,-./ #
`--`--------` ##
,--, #
/==/-\ #
\==\` \ #
\==\-.' #
`--` #
#
#
#
##
,---. #
.--.' \ #
\==\-/\ \ #
/==/-|_\ | #
\==\, - \ #
/==/ - ,| #
/==/- /\ - \ #
\==\ _.\=\.-' #
`--` ##
#
_..---. #
.' .'.-. \ #
/==/- '=' / #
|==|-, ' #
|==| .=. \ #
/==/- '=' ,| #
|==| - / #
`-._`.___,' ##
_,.----. #
.' .' - \ #
/==/ , ,-' #
|==|- | . #
|==|_ `-' \ #
|==| _ , | #
\==\. / #
`-.`.___.-' #
##
#
_,..---._ #
/==/, - \ #
|==| _ _\ #
|==| .=. | #
|==|,| | -| #
|==| '=' / #
|==|-, _`/ #
`-.`.____.' ##
,----. #
,-.--` , \ #
|==|- _.-` #
|==| `.-. #
/==/_ , / #
|==| .-' #
|==|_ ,`-._ #
/==/ , / #
`--`-----`` ##
_,---. #
.-`.' , \ #
/==/_ _.-' #
/==/- '..-. #
|==|_ , / #
|==| .--' #
|==|- | #
/==/ \ #
`--`---' ##
_,---. #
_.='.'-, \ #
/==.'- / #
/==/ - .-' #
|==|_ /_,-. #
|==| , \_.' ) #
\==\- , ( #
/==/ _ , / #
`--`------' ##
,--.-,,-,--, #
/==/ /|=| | #
|==|_ ||=|, | #
|==| ,|/=| _| #
|==|- `-' _ | #
|==| _ | #
|==| .-. ,\ #
/==/, //=/ | #
`--`-' `-`--` ##
.=-.-. #
/==/_ / #
|==|, | #
|==| | #
|==|- | #
|==| ,| #
|==|- | #
/==/. / #
`--`-` ##
,--.-, #
|==' -| #
|==|- | #
__|==|, | #
,--.-'\=|- | #
|==|- |=/ ,| #
|==|. /=| -| #
\==\, `-' / #
`--`----' ##
,--.-.,-. #
/==/- |\ \ #
|==|_ `/_ / #
|==| , / #
|==|- .| #
|==| _ , \ #
/==/ '\ | #
\==\ /\=\.' #
`--` ##
#
_.-. #
.-,.'| #
|==|, | #
|==|- | #
|==|, | #
|==|- `-._ #
/==/ - , ,/ #
`--`-----' ##
___ #
.-._ .'=.'\ #
/==/ \|==| | #
|==|,| / - | #
|==| \/ , | #
|==|- , _ | #
|==| _ /\ | #
/==/ / / , / #
`--`./ `--` ##
.-._ #
/==/ \ .-._ #
|==|, \/ /, / #
|==|- \| | #
|==| , | -| #
|==| - _ | #
|==| /\ , | #
/==/, | |- | #
`--`./ `--` ##
_,.---._ #
,-.' , - `. #
/==/_, , - \ #
|==| .=. | #
|==|_ : ;=: - | #
|==| , '=' | #
\==\ - ,_ / #
'.='. - .' #
`--`--'' ##
_ __ #
.-`.' ,`. #
/==/, - \ #
|==| _ .=. | #
|==| , '=',| #
|==|- '..' #
|==|, | #
/==/ - | #
`--`---' ##
_,.---._ #
,-.' - , `. #
/==/ , - \ #
|==| - .=. , | #
|==| : ;=: - | #
|==|, '=' , | #
\==\ _ - ; #
'.='. , ; -\ #
`--`--'' `--` ##
#
.-.,.---. #
/==/ ` \ #
|==|-, .=., | #
|==| '=' / #
|==|- , .' #
|==|_ . ,'. #
/==/ /\ , ) #
`--`-`--`--' ##
,-,--. #
,-.'- _\ #
/==/_ ,_.' #
\==\ \ #
\==\ -\ #
_\==\ ,\ #
/==/\/ _ | #
\==\ - , / #
`--`---' ##
,--.--------. #
/==/, - , -\ #
\==\.-. - ,-./ #
`--`\==\- \ #
\==\_ \ #
|==|- | #
|==|, | #
/==/ -/ #
`--`--` ##
#
.--.-. .-.-. #
/==/ -|/=/ | #
|==| ,||=| -| #
|==|- | =/ | #
|==|, \/ - | #
|==|- , / #
/==/ , _ .' #
`--`..---' ##
,-.-. #
,--.-./=/ ,/ #
/==/, ||=| -| #
\==\, \ / ,| #
\==\ - ' - / #
\==\ , | #
|==| - ,/ #
\==\ _ / #
`--`--' ##
,-.-. #
,-..-.-./ \==\ #
|, \=/\=|- |==| #
|- |/ |/ , /==/ #
\, , _|==| #
| - - , |==| #
\ , - /==/ #
|- /\ /==/ #
`--` `--` ##
,-.--, #
.--.-. /=/, .' #
\==\ -\/=/- / #
\==\ `-' ,/ #
|==|, - | #
/==/ , \ #
/==/, .--, - \ #
\==\- \/=/ , / #
`--`-' `--` ##
#
,--.-. .-,--. #
/==/- / /=/_ / #
\==\, \/=/. / #
\==\ \/ -/ #
|==| ,_/ #
\==\-, / #
/==/._/ #
`--`-` ##
#
,--,----. #
/==/` - ./ #
`--`=/. / #
/==/- / #
/==/- /-. #
/==/, `--`\ #
\==\- -, | #
`--`.-.--` ##
.-.--. #
\ \==\ #
/- /==/ #
/' /==/ #
|,|==| #
\ \==\ #
\ ,\==\ #
/ -/==/ #
`-'--' ##
,--.-, #
/==/ / #
|==|_ | #
|==| ,| #
|==|- | #
|==| | #
|==| | #
/==/, / #
`--`-' ##
.--.-. #
/==/ / #
\==\ -\ #
\==\ `\ #
|==|,| #
/==/ / #
/==/, / #
\==\- \ #
`--`-' ##
~#
#
#
#
#
#
#
#
##
,---. #
.--.' \ #
\==\-/\ \ #
/==/-|_\ | #
\==\, - \ #
/==/ - ,| #
/==/- /\ - \ #
\==\ _.\=\.-' #
`--` ##
_,.---._ #
,-.' , - `. #
/==/_, , - \ #
|==| .=. | #
|==|_ : ;=: - | #
|==| , '=' | #
\==\ - ,_ / #
'.='. - .' #
`--`--'' ##
#
.--.-. .-.-. #
/==/ -|/=/ | #
|==| ,||=| -| #
|==|- | =/ | #
|==|, \/ - | #
|==|- , / #
/==/ , _ .' #
`--`..---' ##
,---. #
.--.' \ #
\==\-/\ \ #
/==/-|_\ | #
\==\, - \ #
/==/ - ,| #
/==/- /\ - \ #
\==\ _.\=\.-' #
`--` ##
_,.---._ #
,-.' , - `. #
/==/_, , - \ #
|==| .=. | #
|==|_ : ;=: - | #
|==| , '=' | #
\==\ - ,_ / #
'.='. - .' #
`--`--'' ##
#
.--.-. .-.-. #
/==/ -|/=/ | #
|==| ,||=| -| #
|==|- | =/ | #
|==|, \/ - | #
|==|- , / #
/==/ , _ .' #
`--`..---' ##
ß#
#
#
#
#
#
#
#
##
@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findPackageData = findPackageData;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _utils = require("./utils.js");
var _configError = require("../../errors/config-error.js");
const PACKAGE_FILENAME = "package.json";
const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
let options;
try {
options = JSON.parse(content);
} catch (err) {
throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath);
}
if (!options) throw new Error(`${filepath}: No config detected`);
if (typeof options !== "object") {
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
}
if (Array.isArray(options)) {
throw new _configError.default(`Expected config object but found array`, filepath);
}
return {
filepath,
dirname: _path().dirname(filepath),
options
};
});
function* findPackageData(filepath) {
let pkg = null;
const directories = [];
let isPackage = true;
let dirname = _path().dirname(filepath);
while (!pkg && _path().basename(dirname) !== "node_modules") {
directories.push(dirname);
pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME));
const nextLoc = _path().dirname(dirname);
if (dirname === nextLoc) {
isPackage = false;
break;
}
dirname = nextLoc;
}
return {
filepath,
directories,
pkg,
isPackage
};
}
0 && 0;
//# sourceMappingURL=package.js.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_error: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"feedback.mjs","sources":["../../../src/matcher/sequence/feedback.ts"],"sourcesContent":[null],"names":["options","warning","translations","warnings","sequences","suggestions"],"mappings":"AAEA,sBAAgBA,OAAgB,IAAI;EAClC,OAAO;AACLC,IAAAA,OAAO,EAAED,OAAO,CAACE,YAAY,CAACC,QAAQ,CAACC,SAAS;IAChDC,WAAW,EAAE,CAACL,OAAO,CAACE,YAAY,CAACG,WAAW,CAACD,SAAS;GACzD;AACH,CAAC;;;;"}
@@ -0,0 +1,98 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseThenCall = parseThenCall;
exports.parseCatchCall = parseCatchCall;
exports.parseFinallyCall = parseFinallyCall;
const utils_1 = require("@typescript-eslint/utils");
const misc_1 = require("./misc");
/**
* Parses a syntactically possible `Promise.then()` call. Does not check the
* type of the callee.
*/
function parseThenCall(node, context) {
if (node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) {
const methodName = (0, misc_1.getStaticMemberAccessValue)(node.callee, context);
if (methodName === 'then') {
if (node.arguments.length >= 1) {
if (node.arguments[0].type === utils_1.AST_NODE_TYPES.SpreadElement) {
return {
object: node.callee.object,
};
}
if (node.arguments.length >= 2) {
if (node.arguments[1].type === utils_1.AST_NODE_TYPES.SpreadElement) {
return {
object: node.callee.object,
onFulfilled: node.arguments[0],
};
}
return {
object: node.callee.object,
onFulfilled: node.arguments[0],
onRejected: node.arguments[1],
};
}
return {
object: node.callee.object,
onFulfilled: node.arguments[0],
};
}
return {
object: node.callee.object,
};
}
}
return undefined;
}
/**
* Parses a syntactically possible `Promise.catch()` call. Does not check the
* type of the callee.
*/
function parseCatchCall(node, context) {
if (node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) {
const methodName = (0, misc_1.getStaticMemberAccessValue)(node.callee, context);
if (methodName === 'catch') {
if (node.arguments.length >= 1) {
if (node.arguments[0].type === utils_1.AST_NODE_TYPES.SpreadElement) {
return {
object: node.callee.object,
};
}
return {
object: node.callee.object,
onRejected: node.arguments[0],
};
}
return {
object: node.callee.object,
};
}
}
return undefined;
}
/**
* Parses a syntactically possible `Promise.finally()` call. Does not check the
* type of the callee.
*/
function parseFinallyCall(node, context) {
if (node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) {
const methodName = (0, misc_1.getStaticMemberAccessValue)(node.callee, context);
if (methodName === 'finally') {
if (node.arguments.length >= 1) {
if (node.arguments[0].type === utils_1.AST_NODE_TYPES.SpreadElement) {
return {
object: node.callee.object,
};
}
return {
object: node.callee.object,
onFinally: node.arguments[0],
};
}
return {
object: node.callee.object,
};
}
}
return undefined;
}
@@ -0,0 +1,103 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.attributeNames = exports.elementNames = void 0;
exports.elementNames = new Map([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath",
].map(function (val) { return [val.toLowerCase(), val]; }));
exports.attributeNames = new Map([
"definitionURL",
"attributeName",
"attributeType",
"baseFrequency",
"baseProfile",
"calcMode",
"clipPathUnits",
"diffuseConstant",
"edgeMode",
"filterUnits",
"glyphRef",
"gradientTransform",
"gradientUnits",
"kernelMatrix",
"kernelUnitLength",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"limitingConeAngle",
"markerHeight",
"markerUnits",
"markerWidth",
"maskContentUnits",
"maskUnits",
"numOctaves",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"refX",
"refY",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"specularConstant",
"specularExponent",
"spreadMethod",
"startOffset",
"stdDeviation",
"stitchTiles",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textLength",
"viewBox",
"viewTarget",
"xChannelSelector",
"yChannelSelector",
"zoomAndPan",
].map(function (val) { return [val.toLowerCase(), val]; }));
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_CM","2":"_oL"},D:{"1":"_aE","2":"_rG"},E:{"1":"_PB","2":"_UB"},F:{"1":"_BF","2":"_9G"},G:{"1":"_s","2":"_3"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"Case-insensitive CSS attribute selectors",D:true};
@@ -0,0 +1,125 @@
/**
* @fileoverview A collection of methods for processing Espree's options.
* @author Kai Cataldo
*/
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SUPPORTED_VERSIONS = [
3,
5,
6, // 2015
7, // 2016
8, // 2017
9, // 2018
10, // 2019
11, // 2020
12, // 2021
13, // 2022
14, // 2023
15, // 2024
16, // 2025
17 // 2026
];
/**
* Get the latest ECMAScript version supported by Espree.
* @returns {number} The latest ECMAScript version.
*/
export function getLatestEcmaVersion() {
return SUPPORTED_VERSIONS.at(-1);
}
/**
* Get the list of ECMAScript versions supported by Espree.
* @returns {number[]} An array containing the supported ECMAScript versions.
*/
export function getSupportedEcmaVersions() {
return [...SUPPORTED_VERSIONS];
}
/**
* Normalize ECMAScript version from the initial config
* @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config
* @throws {Error} throws an error if the ecmaVersion is invalid.
* @returns {number} normalized ECMAScript version
*/
function normalizeEcmaVersion(ecmaVersion = 5) {
let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;
if (typeof version !== "number") {
throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);
}
// Calculate ECMAScript edition number from official year version starting with
// ES2015, which corresponds with ES6 (or a difference of 2009).
if (version >= 2015) {
version -= 2009;
}
if (!SUPPORTED_VERSIONS.includes(version)) {
throw new Error("Invalid ecmaVersion.");
}
return version;
}
/**
* Normalize sourceType from the initial config
* @param {string} sourceType to normalize
* @throws {Error} throw an error if sourceType is invalid
* @returns {string} normalized sourceType
*/
function normalizeSourceType(sourceType = "script") {
if (sourceType === "script" || sourceType === "module") {
return sourceType;
}
if (sourceType === "commonjs") {
return "script";
}
throw new Error("Invalid sourceType.");
}
/**
* Normalize parserOptions
* @param {Object} options the parser options to normalize
* @throws {Error} throw an error if found invalid option.
* @returns {Object} normalized options
*/
export function normalizeOptions(options) {
const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
const sourceType = normalizeSourceType(options.sourceType);
const ranges = options.range === true;
const locations = options.loc === true;
if (ecmaVersion !== 3 && options.allowReserved) {
// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
throw new Error("`allowReserved` is only supported when ecmaVersion is 3");
}
if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") {
throw new Error("`allowReserved`, when present, must be `true` or `false`");
}
const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false;
const ecmaFeatures = options.ecmaFeatures || {};
const allowReturnOutsideFunction = options.sourceType === "commonjs" ||
Boolean(ecmaFeatures.globalReturn);
if (sourceType === "module" && ecmaVersion < 6) {
throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
}
return Object.assign({}, options, {
ecmaVersion,
sourceType,
ranges,
locations,
allowReserved,
allowReturnOutsideFunction
});
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_SC","2":"FD"},B:{"1":"_J"},C:{"1":"_SL _XC","8":"_g _wB _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_wJ","33":"_qC"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_ZB","33":"_cB"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"CSS3 Text-overflow",D:true};
@@ -0,0 +1,842 @@
flf2a$ 8 4 14 0 25 0 16256
Cricket by Leslie Bates Jan. 1, 1996
cricket9@aros.net http://www.aros.net/~cricket9
I wish to thank Wade Fincher for the SIG that was used as a base for Cricket as
well as Chris Gill who designed the Square font, some of which was used in
Cricket. And finally I wish to thank Paul Burton, who if it was not for his
desire to create FIGWin, I may never have had the motivation to create a
FIGfont.
FIGWin is the Windows clone of FIGlet with a full featured FIGfont editor!
Forget about doing the math to figure out the smushmode number. Just check a
few boxes for each smushing rule. Forget about endmarks -- let the computer
figure out how tall and how wide your font is. Just draw FIGfonts with the
mouse and wipe the smudgemarks off your screen from all that counting!
FIGWin is full of features, but it's designed for use by a complete idiot. If
you qualify, visit the FIGWin website. Screen shots are shown, and of course
you can download it. (FREE!)
http://home.earthlink.net/~solution
Also see the FIGlet website: http://st-www.cs.uiuc.edu/users/chai/figlet.html
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
__ @
| |@
|__|@
|__|@
@
@
@
@@
____ @
| | |@
|_|_|@
@
@
@
@
@@
_____ @
_| | |_ @
|_ _|@
|_ _|@
|__|__| @
@
@
@@
__,-,__ @
| ' '__|@
|__ |@
|_______|@
|_| @
@
@
@@
__ ___ @
|__| |@
| __|@
|___|__|@
@
@
@
@@
__,-,__ @
| ' '__|@
| __|@
|_______|@
|_| @
@
@
@@
__ @
| |@
|_|@
@
@
@
@
@@
___ @
,' _|@
| | @
| |_ @
`.___|@
@
@
@@
___ @
|_ `.@
| |@
_| |@
|___,'@
@
@
@@
__ _ __ @
| | | |@
> < @
|__|_|__|@
@
@
@
@@
__ @
_| |_ @
|_ _|@
|__| @
@
@
@
@@
@
@
__ @
| |@
|_|@
@
@
@@
@
______ @
|______|@
@
@
@
@
@@
@
@
__ @
|__|@
@
@
@
@@
___@
/ /@
,' ,' @
/__/ @
@
@
@
@@
_______ @
| _ |@
|. | |@
|. | |@
|: 1 |@
|::.. . |@
`-------'@
@@
_____ @
| _ |@
|.| |@
`-|. |@
|: |@
|::.|@
`---'@
@@
_______ @
| |@
|___| |@
/ ___/ @
|: 1 \ @
|::.. . |@
`-------'@
@@
_______ @
| _ |@
|___| |@
_(__ |@
|: 1 |@
|::.. . |@
`-------'@
@@
___ ___ @
| Y |@
| | |@
|____ |@
|: |@
|::.|@
`---'@
@@
_______ @
| _ |@
| 1___|@
|____ |@
|: 1 |@
|::.. . |@
`-------'@
@@
_______ @
| _ |@
| 1___|@
|. \ @
|: 1 |@
|::.. . |@
`-------'@
@@
_______ @
| _ |@
|___| |@
/ / @
| | @
| | @
`---' @
@@
_______ @
| _ |@
|. | |@
|. _ |@
|: 1 |@
|::.. . |@
`-------'@
@@
_______ @
| _ |@
| | |@
\___ |@
|: 1 |@
|::.. . |@
`-------'@
@@
__ @
|__|@
__ @
|__|@
@
@
@
@@
__ @
|__|@
__ @
| |@
|_|@
@
@
@@
__ @
,' _|@
/ / @
\ \_ @
`.__|@
@
@
@@
@
______ @
|______|@
|______|@
@
@
@
@@
__ @
|_ `. @
\ \@
_/ /@
|__,' @
@
@
@@
_____ @
|__ |@
', ,- @
|--| @
'-- @
@
@
@@
_________ @
| ___ |@
| | _ |@
| |______|@
|_________|@
@
@
@@
_______ @
| _ |@
|. 1 |@
|. _ |@
|: | |@
|::.|:. |@
`--- ---'@
@@
_______ @
| _ \ @
|. 1 / @
|. _ \ @
|: 1 \@
|::.. . /@
`-------' @
@@
_______ @
| _ |@
|. 1___|@
|. |___ @
|: 1 |@
|::.. . |@
`-------'@
@@
______ @
| _ \ @
|. | \ @
|. | \@
|: 1 /@
|::.. . / @
`------' @
@@
_______ @
| _ |@
|. 1___|@
|. __)_ @
|: 1 |@
|::.. . |@
`-------'@
@@
_______ @
| _ |@
|. 1___|@
|. __) @
|: | @
|::.| @
`---' @
@@
_______ @
| _ |@
|. |___|@
|. | |@
|: 1 |@
|::.. . |@
`-------'@
@@
___ ___ @
| Y |@
|. 1 |@
|. _ |@
|: | |@
|::.|:. |@
`--- ---'@
@@
___ @
| |@
|. |@
|. |@
|: |@
|::.|@
`---'@
@@
_______ @
| _ |@
|___| |@
|. | |@
|: 1 |@
|::.. . |@
`-------'@
@@
___ ___ @
| Y ) @
|. 1 / @
|. _ \ @
|: | \ @
|::.| . )@
`--- ---' @
@@
___ @
| | @
|. | @
|. |___ @
|: 1 |@
|::.. . |@
`-------'@
@@
___ ___ @
| Y |@
|. |@
|. \_/ |@
|: | |@
|::.|:. |@
`--- ---'@
@@
______ @
| _ \ @
|. | |@
|. | |@
|: | |@
|::.| |@
`--- ---'@
@@
_______ @
| _ |@
|. | |@
|. | |@
|: 1 |@
|::.. . |@
`-------'@
@@
_______ @
| _ |@
|. 1 |@
|. ____|@
|: | @
|::.| @
`---' @
@@
_______ @
| _ |@
|. | |@
|. | |@
|: 1 |@
|::.. |@
`----|:.|@
`--'@@
_______ @
| _ \@
|. l /@
|. _ 1@
|: | |@
|::.|:. |@
`--- ---'@
@@
_______ @
| _ |@
| 1___|@
|____ |@
|: 1 |@
|::.. . |@
`-------'@
@@
_______ @
| |@
|.| | |@
`-|. |-'@
|: | @
|::.| @
`---' @
@@
___ ___ @
| Y |@
|. | |@
|. | |@
|: 1 |@
|::.. . |@
`-------'@
@@
___ ___ @
| Y |@
|. | |@
|. | |@
|: 1 |@
\:.. ./ @
`---' @
@@
___ ___ @
| Y |@
|. | |@
|. / \ |@
|: |@
|::.|:. |@
`--- ---'@
@@
___ ___ @
( Y ) @
\ 1 / @
/ _ \ @
/: | \ @
(::. |:. )@
`--- ---' @
@@
___ ___ @
| Y |@
| 1 |@
\_ _/ @
|: | @
|::.| @
`---' @
@@
_______ @
| _ |@
|___| |@
/ ___/ @
|: 1 \ @
|::.. . |@
`-------'@
@@
____ @
| _|@
| | @
| |_ @
|____|@
@
@
@@
___ @
\ \ @
`. `. @
\__\@
@
@
@
@@
____ @
|_ |@
| |@
_| |@
|____|@
@
@
@@
____ @
| |@
|_/\_|@
@
@
@
@
@@
@
@
@
______ @
|______|@
@
@
@@
__ @
| |@
|_| @
@
@
@
@
@@
@
.---.-.@
| _ |@
|___._|@
@
@
@
@@
__ @
| |--.@
| _ |@
|_____|@
@
@
@
@@
@
.----.@
| __|@
|____|@
@
@
@
@@
__ @
.--| |@
| _ |@
|_____|@
@
@
@
@@
@
.-----.@
| -__|@
|_____|@
@
@
@
@@
___ @
.' _|@
| _|@
|__| @
@
@
@
@@
@
.-----.@
| _ |@
|___ |@
|_____|@
@
@
@@
__ @
| |--.@
| |@
|__|__|@
@
@
@
@@
__ @
|__|@
| |@
|__|@
@
@
@
@@
__ @
|__|@
| |@
| |@
|___|@
@
@
@@
__ @
| |--.@
| < @
|__|__|@
@
@
@
@@
__ @
| |@
| |@
|__|@
@
@
@
@@
@
.--------.@
| |@
|__|__|__|@
@
@
@
@@
@
.-----.@
| |@
|__|__|@
@
@
@
@@
@
.-----.@
| _ |@
|_____|@
@
@
@
@@
@
.-----.@
| _ |@
| __|@
|__| @
@
@
@@
@
.-----.@
| _ |@
|__ |@
|__|@
@
@
@@
@
.----.@
| _|@
|__| @
@
@
@
@@
@
.-----.@
|__ --|@
|_____|@
@
@
@
@@
__ @
| |_ @
| _|@
|____|@
@
@
@
@@
@
.--.--.@
| | |@
|_____|@
@
@
@
@@
@
.--.--.@
| | |@
\___/ @
@
@
@
@@
@
.--.--.--.@
| | | |@
|________|@
@
@
@
@@
@
.--.--.@
|_ _|@
|__.__|@
@
@
@
@@
@
.--.--.@
| | |@
|___ |@
|_____|@
@
@
@@
@
.-----.@
|-- __|@
|_____|@
@
@
@
@@
___ @
| _|@
/ / @
\ \_ @
|___|@
@
@
@@
__ @
| |@
| |@
| |@
|__|@
@
@
@@
___ @
|_ | @
\ \@
_/ /@
|___| @
@
@
@@
___ @
| ' |@
|_,_| @
@
@
@
@
@@
.--.--.@
|-----|@
| - |@
|__|__|@
@
@
@
@@
.--.--.@
|-----|@
| _ |@
|_____|@
@
@
@
@@
.--.--.@
|--|--|@
| | |@
|_____|@
@
@
@
@@
.--.--.@
|---.-|@
| _ |@
|___._|@
@
@
@
@@
.--.--.@
|-----|@
| _ |@
|_____|@
@
@
@
@@
.--.--.@
|--|--|@
| | |@
|_____|@
@
@
@
@@
_______ @
| __ \@
| __ <@
| |____/@
|__| @
@
@
@@
@@ -0,0 +1 @@
{"version":3,"file":"winchars.js","sourceRoot":"","sources":["../../src/winchars.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,kCAAkC;AAElC,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAErC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACzB,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3D,CAAA;AAED,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC3D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAClC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACxD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAClC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA","sourcesContent":["// When writing files on Windows, translate the characters to their\n// 0xf000 higher-encoded versions.\n\nconst raw = ['|', '<', '>', '?', ':']\n\nconst win = raw.map(char =>\n String.fromCodePoint(0xf000 + Number(char.codePointAt(0))),\n)\n\nconst toWin = new Map(raw.map((char, i) => [char, win[i]]))\nconst toRaw = new Map(win.map((char, i) => [char, raw[i]]))\n\nexport const encode = (s: string) =>\n raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s)\nexport const decode = (s: string) =>\n win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s)\n"]}
@@ -0,0 +1,722 @@
export default `flf2a$ 7 7 20 -1 6
banner.flf by Ryan Youck (youck@cs.uregina.ca)
(From a unix program called banner)
I am not responsible for use of this font
Thanks to Glenn Chappell for his help
March 7, 1994
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
###$@
###$@
###$@
# $@
$@
###$@
###$@@
### ###$@
### ###$@
# # $@
$ $@
$ $@
$@
$@@
# # $@
# # $@
#######$@
# # $@
#######$@
# # $@
# # $@@
##### $@
# # #$@
# # $@
##### $@
# #$@
# # #$@
##### $@@
### #$@
# # # $@
### # $@
# $@
# ###$@
# # #$@
# ###$@@
## $@
# # $@
## $@
### $@
# # #$@
# # $@
### #$@@
###$@
###$@
# $@
# $@
$@
$@
$@@
##$@
# $@
# $@
# $@
# $@
# $@
##$@@
## $@
# $@
#$@
#$@
#$@
# $@
## $@@
$@
# # $@
# # $@
#######$@
# # $@
# # $@
$@@
$@
# $@
# $@
#####$@
# $@
# $@
$@@
$@
$@
$@
###$@
###$@
# $@
# $@@
$@
$@
$@
#####$@
$@
$@
$@@
$@
$@
$@
$@
###$@
###$@
###$@@
#$@
# $@
# $@
# $@
# $@
# $@
# $@@
### $@
# # $@
# #$@
# #$@
# #$@
# # $@
### $@@
# $@
## $@
# # $@
# $@
# $@
# $@
#####$@@
##### $@
# #$@
#$@
##### $@
# $@
# $@
#######$@@
##### $@
# #$@
#$@
##### $@
#$@
# #$@
##### $@@
# $@
# # $@
# # $@
# # $@
#######$@
# $@
# $@@
#######$@
# $@
# $@
###### $@
#$@
# #$@
##### $@@
##### $@
# #$@
# $@
###### $@
# #$@
# #$@
##### $@@
#######$@
# # $@
# $@
# $@
# $@
# $@
# $@@
##### $@
# #$@
# #$@
##### $@
# #$@
# #$@
##### $@@
##### $@
# #$@
# #$@
######$@
#$@
# #$@
##### $@@
# $@
###$@
# $@
$@
# $@
###$@
# $@@
###$@
###$@
$@
###$@
###$@
# $@
# $@@
#$@
# $@
# $@
# $@
# $@
# $@
#$@@
$@
$@
#####$@
$@
#####$@
$@
$@@
# $@
# $@
# $@
#$@
# $@
# $@
# $@@
##### $@
# #$@
#$@
### $@
# $@
$@
# $@@
##### $@
# #$@
# ### #$@
# ### #$@
# #### $@
# $@
##### $@@
# $@
# # $@
# # $@
# #$@
#######$@
# #$@
# #$@@
###### $@
# #$@
# #$@
###### $@
# #$@
# #$@
###### $@@
##### $@
# #$@
# $@
# $@
# $@
# #$@
##### $@@
###### $@
# #$@
# #$@
# #$@
# #$@
# #$@
###### $@@
#######$@
# $@
# $@
##### $@
# $@
# $@
#######$@@
#######$@
# $@
# $@
##### $@
# $@
# $@
# $@@
##### $@
# #$@
# $@
# ####$@
# #$@
# #$@
##### $@@
# #$@
# #$@
# #$@
#######$@
# #$@
# #$@
# #$@@
###$@
# $@
# $@
# $@
# $@
# $@
###$@@
#$@
#$@
#$@
#$@
# #$@
# #$@
##### $@@
# #$@
# # $@
# # $@
### $@
# # $@
# # $@
# #$@@
# $@
# $@
# $@
# $@
# $@
# $@
#######$@@
# #$@
## ##$@
# # # #$@
# # #$@
# #$@
# #$@
# #$@@
# #$@
## #$@
# # #$@
# # #$@
# # #$@
# ##$@
# #$@@
#######$@
# #$@
# #$@
# #$@
# #$@
# #$@
#######$@@
###### $@
# #$@
# #$@
###### $@
# $@
# $@
# $@@
##### $@
# #$@
# #$@
# #$@
# # #$@
# # $@
#### #$@@
###### $@
# #$@
# #$@
###### $@
# # $@
# # $@
# #$@@
##### $@
# #$@
# $@
##### $@
#$@
# #$@
##### $@@
#######$@
# $@
# $@
# $@
# $@
# $@
# $@@
# #$@
# #$@
# #$@
# #$@
# #$@
# #$@
##### $@@
# #$@
# #$@
# #$@
# #$@
# # $@
# # $@
# $@@
# #$@
# # #$@
# # #$@
# # #$@
# # #$@
# # #$@
## ## $@@
# #$@
# # $@
# # $@
# $@
# # $@
# # $@
# #$@@
# #$@
# # $@
# # $@
# $@
# $@
# $@
# $@@
#######$@
# $@
# $@
# $@
# $@
# $@
#######$@@
#####$@
# $@
# $@
# $@
# $@
# $@
#####$@@
# $@
# $@
# $@
# $@
# $@
# $@
#$@@
#####$@
#$@
#$@
#$@
#$@
#$@
#####$@@
# $@
# # $@
# #$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
#######$@@
###$@
###$@
# $@
#$@
$@
$@
$@@
$@
## $@
# # $@
# #$@
######$@
# #$@
# #$@@
$@
##### $@
# #$@
##### $@
# #$@
# #$@
##### $@@
$@
#### $@
# #$@
# $@
# $@
# #$@
#### $@@
$@
##### $@
# #$@
# #$@
# #$@
# #$@
##### $@@
$@
######$@
# $@
##### $@
# $@
# $@
######$@@
$@
######$@
# $@
##### $@
# $@
# $@
# $@@
$@
#### $@
# #$@
# $@
# ###$@
# #$@
#### $@@
$@
# #$@
# #$@
######$@
# #$@
# #$@
# #$@@
$@
#$@
#$@
#$@
#$@
#$@
#$@@
$@
#$@
#$@
#$@
#$@
# #$@
#### $@@
$@
# #$@
# # $@
#### $@
# # $@
# # $@
# #$@@
$@
# $@
# $@
# $@
# $@
# $@
######$@@
$@
# #$@
## ##$@
# ## #$@
# #$@
# #$@
# #$@@
$@
# #$@
## #$@
# # #$@
# # #$@
# ##$@
# #$@@
$@
#### $@
# #$@
# #$@
# #$@
# #$@
#### $@@
$@
##### $@
# #$@
# #$@
##### $@
# $@
# $@@
$@
#### $@
# #$@
# #$@
# # #$@
# # $@
### #$@@
$@
##### $@
# #$@
# #$@
##### $@
# # $@
# #$@@
$@
#### $@
# $@
#### $@
#$@
# #$@
#### $@@
$@
#####$@
# $@
# $@
# $@
# $@
# $@@
$@
# #$@
# #$@
# #$@
# #$@
# #$@
#### $@@
$@
# #$@
# #$@
# #$@
# #$@
# # $@
## $@@
$@
# #$@
# #$@
# #$@
# ## #$@
## ##$@
# #$@@
$@
# #$@
# # $@
## $@
## $@
# # $@
# #$@@
$@
# #$@
# # $@
# $@
# $@
# $@
# $@@
$@
######$@
# $@
# $@
# $@
# $@
######$@@
###$@
# $@
# $@
## $@
# $@
# $@
###$@@
#$@
#$@
#$@
$@
#$@
#$@
#$@@
### $@
# $@
# $@
##$@
# $@
# $@
### $@@
## $@
# # #$@
## $@
$@
$@
$@
$@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,127 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
test("instanceof", async () => {
class Test {}
class Subtest extends Test {}
abstract class AbstractBar {
constructor(public val: string) {}
}
class Bar extends AbstractBar {}
const TestSchema = z.instanceof(Test);
const SubtestSchema = z.instanceof(Subtest);
const AbstractSchema = z.instanceof(AbstractBar);
const BarSchema = z.instanceof(Bar);
TestSchema.parse(new Test());
TestSchema.parse(new Subtest());
SubtestSchema.parse(new Subtest());
AbstractSchema.parse(new Bar("asdf"));
const bar = BarSchema.parse(new Bar("asdf"));
expect(bar.val).toEqual("asdf");
await expect(() => SubtestSchema.parse(new Test())).toThrow();
await expect(() => TestSchema.parse(12)).toThrow();
expectTypeOf<Test>().toEqualTypeOf<z.infer<typeof TestSchema>>();
});
test("instanceof fatal", () => {
const schema = z.instanceof(Date).refine((d) => d.toString());
const res = schema.safeParse(null);
expect(res.success).toBe(false);
});
test("instanceof respects customError", () => {
class Test {
name!: string;
}
z.config({
customError: () => {
return "This is invalid!";
},
});
const TestSchema = z.instanceof(Test);
const result = TestSchema.safeParse("whatever");
expect(result.success).toBe(false);
if (!result.success) {
const issue = result.error.issues[0];
expect(issue.code).toBe("invalid_type");
if (issue.code === "invalid_type") {
expect(issue.expected).toBe("Test");
}
expect(issue.message).toBe("This is invalid!");
}
z.config({ customError: undefined });
});
test("z.properties", () => {
const httpsUrl = z.instanceof(URL).check(
...z.properties({
protocol: z.literal("https:"),
hostname: z.string().regex(z.regexes.domain),
})
);
expectTypeOf<URL>().toEqualTypeOf<z.infer<typeof httpsUrl>>();
expect(httpsUrl.safeParse(new URL("https://example.com")).success).toBe(true);
// One check iterates the whole shape, so every failing property reports — unlike the equivalent chain of z.property() calls, which aborts on the first.
const both = httpsUrl.safeParse(new URL("http://localhost"));
expect(both.error!.issues.map((i) => i.path)).toEqual([["protocol"], ["hostname"]]);
// A failing base schema yields its own issue and no property issues.
for (const input of ["not a url", null]) {
const issues = httpsUrl.safeParse(input).error!.issues;
expect(issues.map((i) => [i.code, i.path])).toEqual([["custom", []]]);
}
// Not specific to z.instanceof(). A base whose type mismatch aborts implicitly rather than explicitly must still not run the property checks against the rejected value.
const obj = z
.object({ a: z.string(), b: z.string() })
.check(...z.properties({ a: z.literal("x"), b: z.literal("y") }));
expect(obj.safeParse({ a: "x", b: "y" }).success).toBe(true);
expect(obj.safeParse({ a: "!", b: "!" }).error!.issues.map((i) => i.path)).toEqual([["a"], ["b"]]);
for (const input of [null, undefined, 5]) {
expect(obj.safeParse(input).error!.issues.map((i) => [i.code, i.path])).toEqual([["invalid_type", []]]);
}
// Known looseness versus the longhand, pinned so it stays deliberate: the check is typed over the whole shape, and `$ZodCheckInternals.check()` is a method, so TypeScript compares it bivariantly and accepts a check type that is a subtype of the target. Naming a key the target lacks therefore compiles here and fails at parse time, where the equivalent chain of `z.property()` calls rejects it outright.
z.object({ a: z.string() }).check(...z.properties({ a: z.literal("x"), b: z.literal("y") }));
expect(
z
.object({ a: z.string() })
.check(...z.properties({ a: z.string(), b: z.literal("y") }))
.safeParse({ a: "ok" })
.error!.issues.map((i) => [i.code, i.path])
).toEqual([["invalid_value", ["b"]]]);
// literal and enum inputs widen to their primitive, so a `string`/`boolean` property accepts them without a cast, while a genuine type mismatch or an unknown key still fails to compile
z.instanceof(URL).check(z.property("protocol", z.literal("https:")));
z.instanceof(Request).check(...z.properties({ method: z.enum(["POST", "PUT"]), bodyUsed: z.literal(false) }));
// @ts-expect-error length is a number
z.string().check(z.property("length", z.string()));
// @ts-expect-error no such key
z.instanceof(URL).check(z.property("nope", z.string()));
// the check feeds the property value into its schema, so it is typed over the input side rather than the output
const stringToLength = z.property(
"a",
z.string().transform((s) => s.length)
);
z.object({ a: z.string() }).check(stringToLength);
// @ts-expect-error a is a number, the schema takes a string
z.object({ a: z.number() }).check(stringToLength);
// The properties check carries no `when`, so the schema stays on the compiled fast path.
const compiled = z.compile(httpsUrl);
expect(compiled.safeParse(new URL("https://example.com")).success).toBe(true);
expect(compiled.safeParse(new URL("http://localhost")).error!.issues.map((i) => i.path)).toEqual([
["protocol"],
["hostname"],
]);
});
@@ -0,0 +1,22 @@
// borrowed from tsx implementation:
// https://github.com/esbuild-kit/tsx
const ignoreWarnings = new Set([
'--experimental-loader is an experimental feature. This feature could change at any time',
'Custom ESM Loaders is an experimental feature. This feature could change at any time',
'Custom ESM Loaders is an experimental feature and might change at any time',
'VM Modules is an experimental feature and might change at any time',
'VM Modules is an experimental feature. This feature could change at any time',
'stripTypeScriptTypes is an experimental feature and might change at any time',
])
const { emit } = process
process.emit = function (event, warning) {
if (event === 'warning' && ignoreWarnings.has(warning.message)) {
return
}
// eslint-disable-next-line prefer-rest-params
return Reflect.apply(emit, this, arguments)
}
@@ -0,0 +1,19 @@
export * as core from "../core/index.js";
export * from "./schemas.js";
export * from "./checks.js";
export * from "./errors.js";
export * from "./parse.js";
export * from "./compat.js";
export type { infer } from "../core/index.js";
export type { JSONType } from "../core/util.js";
export type { CompileOptions } from "../core/index.js";
export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
export { toJSONSchema } from "../core/json-schema-processors.js";
export { fromJSONSchema } from "./from-json-schema.js";
export { deepPartial } from "./deep-partial.js";
export { input, output } from "./in-out.js";
export * as locales from "../locales/index.js";
export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
export * as iso from "./iso.js";
export type { ZodCoercedString, ZodCoercedNumber, ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, } from "./coerce.js";
export * as coerce from "./coerce.js";
@@ -0,0 +1,7 @@
import { i as isLeapYear$1 } from "./isLeapYear-G37NadS-.mjs";
function isLeapYear(date) {
return isLeapYear$1(date.getFullYear());
}
export {
isLeapYear as default
};
@@ -0,0 +1 @@
{"version":3,"file":"demoInMemoryOAuthProvider.js","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1 @@
{"version":3,"file":"visibility.mjs","sources":["../../../../src/utils/mix/visibility.ts"],"sourcesContent":["export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC;AAEzD;;;;AAIG;AACG,SAAU,aAAa,CAAC,MAAc,EAAE,MAAc,EAAA;AACxD,IAAA,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC7B,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD;SAAO;AACH,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD;AACJ;;;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_z"},B:{"1":"_J"},C:{"1":"_mR","2":"_VS"},D:{"1":"_Q"},E:{"132":"_R"},F:{"1":"_eD","2":"_6C"},G:{"132":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_XD","2":"_gB"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"B","2":"A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"Window.devicePixelRatio",D:true};
@@ -0,0 +1,924 @@
export default `flf2a$ 9 3 15 0 5 0 64 0
Font Author: pC wIZARd
Font modified by patorjk to add X character
FIGFont created by patorjk.com's FIGFont Editor: http://patorjk.com/figfont-editor
$   $@
$   $@
$   $@
$   $@
$   $@
$   $@
$   $@
$   $@
$ $@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
.______  @
:      \\ @
|   .   |@
|   :   |@
|___|   |@
    |___|@
@
@
@@
._______ @
: __   / @
|  |>  \\ @
|  |>   \\@
|_______/@
         @
@
@
@@
._______ @
:_.  ___\\@
|  : |/\\ @
|    /  \\@
|. _____/@
 :/      @
 :       @
@
@@
.______  @
:_ _   \\ @
|   |   |@
| . |   |@
|. ____/ @
 :/      @
 :       @
@
@@
._______@
: .____/@
| : _/\\ @
|   /  \\@
|_.: __/@
   :/   @
        @
@
@@
._______@
:_ ____/@
|   _/  @
|   |   @
|_. |   @
  :/    @
  :     @
@
@@
._____  @
:_ ___\\ @
|   |___@
|   /  |@
|. __  |@
 :/ |. |@
 :   :/ @
     : @
@@
.___.__  @
:   |  \\ @
|   :   |@
|   .   |@
|___|   |@
    |___|@
@
@
@@
.___ @
: __|@
| : |@
|   |@
|   |@
|___|@
@
@
@@
.________ @
:____.   \\@
 __|  :/ |@
|     :  |@
 \\__. __/ @
    :/    @
    :     @
@
@@
.____/\\ @
:   /  \\@
|.  ___/@
|     \\ @
|      \\@
|___\\  /@
     \\/ @
@
@@
.___    @
|   |   @
|   |   @
|   |/\\ @
|   /  \\@
|______/@
        @
@
@@
._____.___ @
:         |@
|   \\  /  |@
|   |\\/   |@
|___| |   |@
      |___|@
           @
@
@@
.______  @
:      \\ @
|       |@
|   |   |@
|___|   |@
    |___|@
         @
@
@@
._______  @
: .___  \\ @
| :   |  |@
|     :  |@
 \\_. ___/ @
   :/     @
   :      @
@
@@
._______ @
: ____  |@
|    :  |@
|   |___|@
|___|    @
         @
         @
@
@@
._______ @
: .___  \\ @
| :   |  |@
|     :  |@
 \\_____. :@
       :/ @
       : @
@
@@
.______  @
: __   \\ @
|  \\____|@
|   :  \\ @
|   |___\\@
|___|    @
@
@
@@
.________@
|    ___/@
|___    \\@
|       /@
|__:___/ @
   :     @
@
@
@@
_____._@
\\__ _:|@
  |  :|@
  |   |@
  |   |@
  |___|@
       @
@
@@
.____     @
|    |___ @
|    |   |@
|    :   |@
|        |@
|. _____/ @
 :/       @
 :        @
@@
.___     @
|   |___ @
|   |   |@
|   :   |@
 \\      |@
  \\____/ @
         @
@
@@
         ___ @
.___    |   |@
:   | /\\|   |@
|   |/  :   |@
|   /       |@
|______/|___|@
        : @
        : @
@@
 ____   ____@
 \\   \\_/   /@
  \\___ ___/ @
  /   _   \\ @
 /___/ \\___\\@
         @
@
@
@@
 ____   ____@
 \\   \\_/   /@
  \\___ ___/ @
    |   | @
    |___| @
@
@
@
@@
.______ @
\\____  |@
/  ____|@
\\      |@
 \\__:__|@
    :   @
    •   @
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
.______  @
:      \\ @
|   .   |@
|   :   |@
|___|   |@
    |___|@
@
@
@@
._______ @
: __   / @
|  |>  \\ @
|  |>   \\@
|_______/@
         @
@
@
@@
._______ @
:_.  ___\\@
|  : |/\\ @
|    /  \\@
|. _____/@
 :/      @
 :       @
@
@@
.______  @
:_ _   \\ @
|   |   |@
| . |   |@
|. ____/ @
 :/      @
 :       @
@
@@
._______@
: .____/@
| : _/\\ @
|   /  \\@
|_.: __/@
   :/   @
        @
@
@@
._______@
:_ ____/@
|   _/  @
|   |   @
|_. |   @
  :/    @
  :     @
@
@@
._____  @
:_ ___\\ @
|   |___@
|   /  |@
|. __  |@
 :/ |. |@
 :   :/ @
     : @
@@
.___.__  @
:   |  \\ @
|   :   |@
|   .   |@
|___|   |@
    |___|@
@
@
@@
.___ @
: __|@
| : |@
|   |@
|   |@
|___|@
@
@
@@
.________ @
:____.   \\@
 __|  :/ |@
|     :  |@
 \\__. __/ @
    :/    @
    :     @
@
@@
.____/\\ @
:   /  \\@
|.  ___/@
|     \\ @
|      \\@
|___\\  /@
     \\/ @
@
@@
.___    @
|   |   @
|   |   @
|   |/\\ @
|   /  \\@
|______/@
        @
@
@@
._____.___ @
:         |@
|   \\  /  |@
|   |\\/   |@
|___| |   |@
      |___|@
           @
@
@@
.______  @
:      \\ @
|       |@
|   |   |@
|___|   |@
    |___|@
         @
@
@@
._______  @
: .___  \\ @
| :   |  |@
|     :  |@
 \\_. ___/ @
   :/     @
   :      @
@
@@
._______ @
: ____  |@
|    :  |@
|   |___|@
|___|    @
         @
         @
@
@@
._______ @
: .___  \\ @
| :   |  |@
|     :  |@
 \\_____. :@
       :/ @
       : @
@
@@
.______  @
: __   \\ @
|  \\____|@
|   :  \\ @
|   |___\\@
|___|    @
@
@
@@
.________@
|    ___/@
|___    \\@
|       /@
|__:___/ @
   :     @
@
@
@@
_____._@
\\__ _:|@
  |  :|@
  |   |@
  |   |@
  |___|@
       @
@
@@
.____     @
|    |___ @
|    |   |@
|    :   |@
|        |@
|. _____/ @
 :/       @
 :        @
@@
.___     @
|   |___ @
|   |   |@
|   :   |@
 \\      |@
  \\____/ @
         @
@
@@
         ___ @
.___    |   |@
:   | /\\|   |@
|   |/  :   |@
|   /       |@
|______/|___|@
        : @
        : @
@@
 ____   ____@
 \\   \\_/   /@
  \\___ ___/ @
  /   _   \\ @
 /___/ \\___\\@
         @
@
@
@@
 ____   ____@
 \\   \\_/   /@
  \\___ ___/ @
    |   | @
    |___| @
@
@
@
@@
.______ @
\\____  |@
/  ____|@
\\      |@
 \\__:__|@
    :   @
    •   @
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@`
@@ -0,0 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.1](https://github.com/ljharb/side-channel-map/compare/v1.0.0...v1.0.1) - 2024-12-10
### Commits
- [Deps] update `call-bound` [`6d05aaa`](https://github.com/ljharb/side-channel-map/commit/6d05aaa4ce5f2be4e7825df433d650696f0ba40f)
- [types] fix generics ordering [`11c0184`](https://github.com/ljharb/side-channel-map/commit/11c0184132ac11fdc16857e12682e148e5e9ee74)
## v1.0.0 - 2024-12-10
### Commits
- Initial implementation, tests, readme, types [`ad877b4`](https://github.com/ljharb/side-channel-map/commit/ad877b42926d46d63fff76a2bd01d2b4a01959a9)
- Initial commit [`28f8879`](https://github.com/ljharb/side-channel-map/commit/28f8879c512abe8fcf9b6a4dc7754a0287e5eba4)
- npm init [`2c9604e`](https://github.com/ljharb/side-channel-map/commit/2c9604e5aa40223e425ea7cea78f8a07697504bd)
- Only apps should have lockfiles [`5e7ba9c`](https://github.com/ljharb/side-channel-map/commit/5e7ba9cffe3ef42095815adc8ac1255b49bbadf5)
@@ -0,0 +1,82 @@
import type { SerovalNode } from 'seroval';
import { createPlugin } from 'seroval';
import HeadersPlugin from './headers';
import ReadableStreamPlugin from './readable-stream';
function createRequestOptions(
current: Request,
body: ArrayBuffer | ReadableStream | null,
): RequestInit {
return {
body,
cache: current.cache,
credentials: current.credentials,
headers: current.headers,
integrity: current.integrity,
keepalive: current.keepalive,
method: current.method,
mode: current.mode,
redirect: current.redirect,
referrer: current.referrer,
referrerPolicy: current.referrerPolicy,
};
}
type RequestNode = {
url: SerovalNode;
options: SerovalNode;
};
const RequestPlugin = /* @__PURE__ */ createPlugin<Request, RequestNode>({
tag: 'seroval-plugins/web/Request',
extends: [ReadableStreamPlugin, HeadersPlugin],
test(value) {
if (typeof Request === 'undefined') {
return false;
}
return value instanceof Request;
},
parse: {
async async(value, ctx) {
return {
url: await ctx.parse(value.url),
options: await ctx.parse(
createRequestOptions(
value,
value.body && !value.bodyUsed
? await value.clone().arrayBuffer()
: null,
),
),
};
},
stream(value, ctx) {
return {
url: ctx.parse(value.url),
options: ctx.parse(
createRequestOptions(
value,
value.body && !value.bodyUsed ? value.clone().body : null,
),
),
};
},
},
serialize(node, ctx) {
return (
'new Request(' +
ctx.serialize(node.url) +
',' +
ctx.serialize(node.options) +
')'
);
},
deserialize(node, ctx) {
return new Request(
ctx.deserialize(node.url) as string,
ctx.deserialize(node.options) as RequestInit,
);
},
});
export default RequestPlugin;
@@ -0,0 +1,10 @@
import { isCSSVar } from './is-css-var.mjs';
function setStyle(element, name, value) {
isCSSVar(name)
? element.style.setProperty(name, value)
: (element.style[name] = value);
}
export { setStyle };
//# sourceMappingURL=style-set.mjs.map
@@ -0,0 +1,378 @@
/**
* @fileoverview Rule to disallow use of unmodified expressions in loop conditions
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const Traverser = require("../shared/traverser"),
astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------
/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SENTINEL_PATTERN =
/(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u;
const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property.
const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u;
const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u;
const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u;
/**
* @typedef {Object} LoopConditionInfo
* @property {Reference} reference - The reference.
* @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes
* that the reference is belonging to.
* @property {Function} isInLoop - The predicate which checks a given reference
* is in this loop.
* @property {boolean} modified - The flag that the reference is modified in
* this loop.
*/
/**
* Checks whether or not a given reference is a write reference.
* @param {Reference} reference A reference to check.
* @returns {boolean} `true` if the reference is a write reference.
*/
function isWriteReference(reference) {
if (reference.init) {
const def = reference.resolved && reference.resolved.defs[0];
if (!def || def.type !== "Variable" || def.parent.kind !== "var") {
return false;
}
}
return reference.isWrite();
}
/**
* Checks whether or not a given loop condition info does not have the modified
* flag.
* @param {LoopConditionInfo} condition A loop condition info to check.
* @returns {boolean} `true` if the loop condition info is "unmodified".
*/
function isUnmodified(condition) {
return !condition.modified;
}
/**
* Checks whether or not a given loop condition info does not have the modified
* flag and does not have the group this condition belongs to.
* @param {LoopConditionInfo} condition A loop condition info to check.
* @returns {boolean} `true` if the loop condition info is "unmodified".
*/
function isUnmodifiedAndNotBelongToGroup(condition) {
return !(condition.modified || condition.group);
}
/**
* Checks whether or not a given reference is inside of a given node.
* @param {ASTNode} node A node to check.
* @param {Reference} reference A reference to check.
* @returns {boolean} `true` if the reference is inside of the node.
*/
function isInRange(node, reference) {
const or = node.range;
const ir = reference.identifier.range;
return or[0] <= ir[0] && ir[1] <= or[1];
}
/**
* Checks whether or not a given reference is inside of a loop node's condition.
* @param {ASTNode} node A node to check.
* @param {Reference} reference A reference to check.
* @returns {boolean} `true` if the reference is inside of the loop node's
* condition.
*/
const isInLoop = {
WhileStatement: isInRange,
DoWhileStatement: isInRange,
ForStatement(node, reference) {
return (
isInRange(node, reference) &&
!(node.init && isInRange(node.init, reference))
);
},
};
/**
* Gets the function which encloses a given reference.
* This supports only FunctionDeclaration.
* @param {Reference} reference A reference to get.
* @returns {ASTNode|null} The function node or null.
*/
function getEncloseFunctionDeclaration(reference) {
let node = reference.identifier;
while (node) {
if (node.type === "FunctionDeclaration") {
return node.id ? node : null;
}
node = node.parent;
}
return null;
}
/**
* Checks whether a given modifier is in a loop.
*
* Besides checking for the condition being in the loop, this also checks
* whether the function that this modifier is belonging to is called
* in the loop.
* @param {LoopConditionInfo} condition The condition to check.
* @param {Reference} modifier The modifier to check.
* @returns {boolean} `true` if the modifier is in a loop.
*/
function hasModifierInLoop(condition, modifier) {
if (condition.isInLoop(modifier)) {
return true;
}
const funcNode = getEncloseFunctionDeclaration(modifier);
if (!funcNode) {
return false;
}
const funcVar = astUtils.getVariableByName(
modifier.from.upper,
funcNode.id.name,
);
return Boolean(funcVar && funcVar.references.some(condition.isInLoop));
}
/**
* Updates the "modified" flags of given loop conditions with given modifiers.
* @param {LoopConditionInfo[]} conditions The loop conditions to be updated.
* @param {Reference[]} modifiers The references to update.
* @returns {void}
*/
function updateModifiedFlag(conditions, modifiers) {
for (let i = 0; i < conditions.length; ++i) {
const condition = conditions[i];
for (let j = 0; !condition.modified && j < modifiers.length; ++j) {
const modifier = modifiers[j];
condition.modified = hasModifierInLoop(condition, modifier);
}
}
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow unmodified loop conditions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition",
},
schema: [],
messages: {
loopConditionNotModified:
"'{{name}}' is not modified in this loop.",
},
},
create(context) {
const sourceCode = context.sourceCode;
let groupMap = null;
/**
* Reports a given condition info.
* @param {LoopConditionInfo} condition A loop condition info to report.
* @returns {void}
*/
function report(condition) {
const node = condition.reference.identifier;
context.report({
node,
messageId: "loopConditionNotModified",
data: node,
});
}
/**
* Registers given conditions to the group the condition belongs to.
* @param {LoopConditionInfo[]} conditions A loop condition info to
* register.
* @returns {void}
*/
function registerConditionsToGroup(conditions) {
for (let i = 0; i < conditions.length; ++i) {
const condition = conditions[i];
if (condition.group) {
let group = groupMap.get(condition.group);
if (!group) {
group = [];
groupMap.set(condition.group, group);
}
group.push(condition);
}
}
}
/**
* Reports references which are inside of unmodified groups.
* @param {LoopConditionInfo[]} conditions A loop condition info to report.
* @returns {void}
*/
function checkConditionsInGroup(conditions) {
if (conditions.every(isUnmodified)) {
conditions.forEach(report);
}
}
/**
* Checks whether or not a given group node has any dynamic elements.
* @param {ASTNode} root A node to check.
* This node is one of BinaryExpression or ConditionalExpression.
* @returns {boolean} `true` if the node is dynamic.
*/
function hasDynamicExpressions(root) {
let retv = false;
Traverser.traverse(root, {
visitorKeys: sourceCode.visitorKeys,
enter(node) {
if (DYNAMIC_PATTERN.test(node.type)) {
retv = true;
this.break();
} else if (SKIP_PATTERN.test(node.type)) {
this.skip();
}
},
});
return retv;
}
/**
* Creates the loop condition information from a given reference.
* @param {Reference} reference A reference to create.
* @returns {LoopConditionInfo|null} Created loop condition info, or null.
*/
function toLoopCondition(reference) {
if (reference.init) {
return null;
}
let group = null;
let child = reference.identifier;
let node = child.parent;
while (node) {
if (SENTINEL_PATTERN.test(node.type)) {
if (LOOP_PATTERN.test(node.type) && node.test === child) {
// This reference is inside of a loop condition.
return {
reference,
group,
isInLoop: isInLoop[node.type].bind(null, node),
modified: false,
};
}
// This reference is outside of a loop condition.
break;
}
/*
* If it's inside of a group, OK if either operand is modified.
* So stores the group this reference belongs to.
*/
if (GROUP_PATTERN.test(node.type)) {
// If this expression is dynamic, no need to check.
if (hasDynamicExpressions(node)) {
break;
} else {
group = node;
}
}
child = node;
node = node.parent;
}
return null;
}
/**
* Finds unmodified references which are inside of a loop condition.
* Then reports the references which are outside of groups.
* @param {Variable} variable A variable to report.
* @returns {void}
*/
function checkReferences(variable) {
// Gets references that exist in loop conditions.
const conditions = variable.references
.map(toLoopCondition)
.filter(Boolean);
if (conditions.length === 0) {
return;
}
// Registers the conditions to belonging groups.
registerConditionsToGroup(conditions);
// Check the conditions are modified.
const modifiers = variable.references.filter(isWriteReference);
if (modifiers.length > 0) {
updateModifiedFlag(conditions, modifiers);
}
/*
* Reports the conditions which are not belonging to groups.
* Others will be reported after all variables are done.
*/
conditions.filter(isUnmodifiedAndNotBelongToGroup).forEach(report);
}
return {
"Program:exit"(node) {
const queue = [sourceCode.getScope(node)];
groupMap = new Map();
let scope;
while ((scope = queue.pop())) {
queue.push(...scope.childScopes);
scope.variables.forEach(checkReferences);
}
groupMap.forEach(checkConditionsInGroup);
groupMap = null;
},
};
},
};
@@ -0,0 +1 @@
module.exports={C:{"47":0.00294,"48":0.00294,"54":0.00294,"59":0.00294,"61":0.00294,"62":0.00294,"63":0.00294,"64":0.00294,"65":0.00587,"66":0.00294,"67":0.00294,"68":0.00587,"72":0.00881,"102":0.00294,"103":0.00294,"107":0.00294,"109":0.00294,"112":0.02055,"115":0.06164,"120":0.06164,"121":0.12034,"123":0.00294,"124":0.00587,"127":0.02055,"128":0.00294,"133":0.00294,"134":0.00294,"136":0.02055,"140":0.03816,"141":0.00294,"142":0.00294,"143":0.00294,"144":0.00294,"146":0.00294,"147":0.01174,"148":0.00294,"149":0.00294,"150":0.00881,"151":0.00881,"152":0.01468,"153":0.0499,"154":0.22013,"155":0.59874,"156":0.62222,"157":0.02935,_:"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 49 50 51 52 53 55 56 57 58 60 69 70 71 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 104 105 106 108 110 111 113 114 116 117 118 119 122 125 126 129 130 131 132 135 137 138 139 145 158 159 160 3.5 3.6"},D:{"49":0.00587,"55":0.00587,"58":0.00294,"59":0.00294,"60":0.00294,"61":0.00294,"62":0.00294,"63":0.00294,"64":0.00294,"65":0.00294,"66":0.00294,"68":0.00294,"69":0.00587,"70":0.00587,"71":0.01761,"72":0.00294,"73":0.00294,"74":0.00881,"75":0.00294,"76":0.00294,"77":0.00587,"78":0.00294,"79":0.02348,"80":0.00587,"81":0.00881,"83":0.00587,"86":0.01174,"87":0.00587,"88":0.00587,"90":0.0499,"92":0.00294,"93":0.00294,"94":0.01468,"95":0.00294,"97":0.00294,"98":0.00294,"99":0.00587,"100":0.00294,"101":0.02055,"103":0.03229,"104":0.00881,"105":0.00881,"106":0.01174,"107":0.00587,"108":0.00881,"109":0.50189,"110":0.00881,"111":0.1174,"112":0.01174,"113":0.00881,"114":0.01761,"116":0.05283,"117":0.00881,"118":0.24654,"119":0.12914,"120":0.13501,"121":0.01174,"122":0.05283,"123":0.02935,"124":0.01468,"125":0.00294,"126":0.01174,"127":0.00587,"128":0.01468,"129":0.00587,"130":0.02348,"131":0.04696,"132":0.00587,"133":0.05283,"134":0.04109,"135":0.0499,"136":0.04109,"137":0.05577,"138":0.21426,"139":0.05283,"140":0.05283,"141":0.06164,"142":0.14088,"143":0.04696,"144":0.10273,"145":0.01761,"146":0.08512,"147":0.05577,"148":0.08512,"149":0.09099,"150":0.25828,"151":1.18574,"152":6.31906,"153":4.41131,"154":1.07715,"155":0.01468,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 56 57 67 84 85 89 91 96 102 115 156 157"},F:{"40":0.00294,"42":0.00294,"46":0.00294,"79":0.02642,"86":0.00294,"90":0.00294,"95":0.00881,"96":0.02055,"100":0.01761,"101":0.02935,"102":0.01174,"105":0.00294,"106":0.00294,"107":0.00294,"120":0.00294,"121":0.00294,"122":0.00294,"131":0.00294,"132":0.00294,"133":0.01174,"134":0.13795,"135":0.67212,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 41 43 44 45 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 80 81 82 83 84 85 87 88 89 91 92 93 94 97 98 99 103 104 108 109 110 111 112 113 114 115 116 117 118 119 123 124 125 126 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.00587,"15":0.01468,"16":0.01761,"17":0.00294,"18":0.03816,"89":0.00294,"90":0.01468,"92":0.03816,"100":0.00587,"109":0.07925,"111":0.00587,"112":0.00294,"114":0.01761,"117":0.00294,"119":0.05577,"120":0.0587,"122":0.01468,"123":0.00294,"124":0.00294,"129":0.00294,"130":0.00294,"131":0.00294,"134":0.00587,"136":0.00294,"137":0.02642,"138":0.00294,"139":0.00587,"140":0.01468,"141":0.00294,"142":0.01761,"143":0.01468,"144":0.00587,"145":0.05577,"146":0.02348,"147":0.01761,"148":0.02642,"149":0.04696,"150":0.05283,"151":0.20839,"152":1.26792,"153":1.17107,"154":0.30231,_:"12 13 79 80 81 83 84 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 113 115 116 118 121 125 126 127 128 132 133 135"},E:{"11":0.00294,"27":0.02055,_:"4 5 6 7 8 9 10 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.4 16.5 17.0 17.3 17.4 18.0 18.1 18.2 18.4 26.0 27.1 27.2 TP","11.1":0.00587,"12.1":0.00587,"13.1":0.00587,"14.1":0.01174,"15.6":0.02935,"16.1":0.00587,"16.6":0.01761,"17.1":0.00294,"17.2":0.00294,"17.5":0.00294,"17.6":0.03816,"18.3":0.00294,"18.5-18.7":0.00294,"26.1":0.00294,"26.2":0.00294,"26.3":0.00881,"26.4":0.00587,"26.5":0.03816,"26.6":0.1174},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00047,"5.0-5.1":0.00047,"6.0-6.1":0,"7.0-7.1":0.00094,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00472,"11.0-11.2":0.00047,"11.3-11.4":0.00094,"12.0-12.1":0,"12.2-12.5":0.01227,"13.0-13.1":0,"13.2":0.00236,"13.3":0,"13.4-13.7":0.00047,"14.0-14.4":0.00189,"14.5-14.8":0.00283,"15.0-15.1":0.00283,"15.2-15.3":0.00189,"15.4":0.00236,"15.5":0.00283,"15.6-15.8":0.06135,"16.0":0.00472,"16.1":0.00849,"16.2":0.00472,"16.3":0.01038,"16.4":0.00236,"16.5":0.00378,"16.6-16.7":0.08542,"17.0":0.0033,"17.1":0.00472,"17.2":0.00472,"17.3":0.00708,"17.4":0.00991,"17.5":0.01935,"17.6-17.7":0.05003,"18.0":0.01038,"18.1":0.02077,"18.2":0.02832,"18.3Line truncated
@@ -0,0 +1,40 @@
{
"name": "jsonfile",
"version": "6.2.0",
"description": "Easily read/write JSON files.",
"repository": {
"type": "git",
"url": "git@github.com:jprichardson/node-jsonfile.git"
},
"keywords": [
"read",
"write",
"file",
"json",
"fs",
"fs-extra"
],
"author": "JP Richardson <jprichardson@gmail.com>",
"license": "MIT",
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
},
"devDependencies": {
"mocha": "^8.2.0",
"rimraf": "^2.4.0",
"standard": "^16.0.1"
},
"main": "index.js",
"files": [
"index.js",
"utils.js"
],
"scripts": {
"lint": "standard",
"test": "npm run lint && npm run unit",
"unit": "mocha"
}
}
@@ -0,0 +1 @@
module.exports={C:{"48":0.04368,"78":0.00624,"115":0.08736,"120":0.00624,"121":0.01248,"123":0.07488,"124":0.00624,"128":0.00624,"139":0.01248,"140":0.88608,"149":0.04992,"150":0.01248,"151":0.02496,"152":0.0312,"153":0.11856,"154":0.33072,"155":0.96096,"156":0.72384,"157":0.03744,"158":0.00624,_:"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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 125 126 127 129 130 131 132 133 134 135 136 137 138 141 142 143 144 145 146 147 148 159 160 3.5 3.6"},D:{"26":0.01248,"97":0.00624,"103":0.0312,"104":0.00624,"105":0.00624,"106":0.00624,"107":0.01248,"108":0.00624,"109":0.156,"110":0.02496,"111":0.01248,"112":0.01248,"114":0.00624,"116":0.08736,"117":0.00624,"118":0.05616,"119":0.10608,"120":0.18096,"121":0.03744,"122":0.11856,"123":0.02496,"124":0.01248,"125":0.00624,"126":0.06864,"128":0.13728,"129":0.01248,"130":0.01872,"131":0.02496,"132":0.00624,"133":0.01872,"134":0.01248,"135":0.00624,"136":0.01248,"137":0.02496,"138":0.31824,"139":0.01248,"140":0.0624,"141":0.07488,"142":0.29952,"143":0.03744,"144":0.11856,"145":0.10608,"146":0.38688,"147":0.312,"148":0.26208,"149":0.39312,"150":0.84864,"151":3.22608,"152":12.52992,"153":12.8856,"154":3.28848,"155":0.09984,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 98 99 100 101 102 113 115 127 156 157"},F:{"46":0.00624,"95":0.04368,"101":0.0624,"102":0.00624,"114":0.00624,"125":0.00624,"133":0.01248,"134":0.14976,"135":1.3728,_:"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 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 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 122 123 124 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.00624,"119":0.00624,"120":0.01248,"128":0.08112,"142":0.00624,"143":0.00624,"146":0.00624,"147":0.01872,"148":0.01248,"149":0.1248,"150":0.02496,"151":0.34944,"152":2.87664,"153":3.93744,"154":1.00464,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 122 123 124 125 126 127 129 130 131 132 133 134 135 136 137 138 139 140 141 144 145"},E:{"27":0.51792,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 16.0 17.0 27.1 TP","13.1":0.00624,"14.1":0.00624,"15.4":0.0312,"15.5":0.06864,"15.6":0.1872,"16.1":0.00624,"16.2":0.00624,"16.3":0.01872,"16.4":0.00624,"16.5":0.04368,"16.6":0.09984,"17.1":0.2808,"17.2":0.00624,"17.3":0.0312,"17.4":0.06864,"17.5":0.33696,"17.6":0.26208,"18.0":0.06864,"18.1":0.08736,"18.2":0.01872,"18.3":0.04368,"18.4":0.07488,"18.5-18.7":0.11856,"26.0":0.08736,"26.1":0.03744,"26.2":0.27456,"26.3":0.19344,"26.4":0.14976,"26.5":1.01712,"26.6":3.94992,"27.2":0.00624},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00182,"5.0-5.1":0.00182,"6.0-6.1":0,"7.0-7.1":0.00364,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01818,"11.0-11.2":0.00182,"11.3-11.4":0.00364,"12.0-12.1":0,"12.2-12.5":0.04728,"13.0-13.1":0,"13.2":0.00909,"13.3":0,"13.4-13.7":0.00182,"14.0-14.4":0.00727,"14.5-14.8":0.01091,"15.0-15.1":0.01091,"15.2-15.3":0.00727,"15.4":0.00909,"15.5":0.01091,"15.6-15.8":0.23638,"16.0":0.01818,"16.1":0.03273,"16.2":0.01818,"16.3":0.04,"16.4":0.00909,"16.5":0.01455,"16.6-16.7":0.32912,"17.0":0.01273,"17.1":0.01818,"17.2":0.01818,"17.3":0.02728,"17.4":0.03819,"17.5":0.07455,"17.6-17.7":0.19274,"18.0":0.04,"18.1":0.08001,"18.2":0.1091,"18.3":0.18911,"18.4":0.11819,"18.5-18.7":2.44203,"26.0":0.11819,"26.1":0.12001,"26.2":0.31275,"26.3":0.33821,"26.4":0.24729,"26.5":1.6565,"26.6":10.22087,"27.0":0.7837,"27.1":0,"27.2":0.02},P:{"23":0.00921,"26":0.00921,"28":0.00921,"29":0.11976,"30":1.87004,_:"4 20 21 22 24 25 27 6.2-6.4 7.2-7.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","5.0-5.4":0.00921},I:{"0":0.00751,"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},K:{"0":0.19928,_:"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":16.6728},R:{_:"0"},M:{"0":0.6768},Q:{_:"14.9"},O:{"0":0.00752},H:{all:0}};
@@ -0,0 +1,291 @@
# `node-gyp` - Node.js native addon build tool
[![Build Status](https://github.com/nodejs/node-gyp/workflows/Tests/badge.svg?branch=main)](https://github.com/nodejs/node-gyp/actions?query=workflow%3ATests+branch%3Amain)
![npm](https://img.shields.io/npm/dm/node-gyp)
`node-gyp` is a cross-platform command-line tool written in Node.js for
compiling native addon modules for Node.js. It contains a vendored copy of the
[gyp-next](https://github.com/nodejs/gyp-next) project that was previously used
by the Chromium team and extended to support the development of Node.js native
addons.
Note that `node-gyp` is _not_ used to build Node.js itself.
All current and LTS target versions of Node.js are supported. Depending on what version of Node.js is actually installed on your system
`node-gyp` downloads the necessary development files or headers for the target version. List of stable Node.js versions can be found on [Node.js website](https://nodejs.org/en/about/previous-releases).
## Features
* The same build commands work on any of the supported platforms
* Supports the targeting of different versions of Node.js
## Installation
> [!Important]
> Python >= v3.12 requires `node-gyp` >= v10
You can install `node-gyp` using `npm`:
``` bash
npm install -g node-gyp
```
Depending on your operating system, you will need to install:
### On Unix
* [A supported version of Python](https://devguide.python.org/versions/)
* `make`
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
### On macOS
* [A supported version of Python](https://devguide.python.org/versions/)
* `Xcode Command Line Tools` which will install `clang`, `clang++`, and `make`.
* Install the `Xcode Command Line Tools` standalone by running `xcode-select --install`. -- OR --
* Alternatively, if you already have the [full Xcode installed](https://developer.apple.com/xcode/download/), you can install the Command Line Tools under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`.
### On Windows
Install tools with [Chocolatey](https://community.chocolatey.org/) using the
[visualstudio2026-workload-vctools](https://community.chocolatey.org/packages/visualstudio2026-workload-vctools) package:
``` bash
choco install python visualstudio2026-workload-vctools -y
```
Or install and configure Python and Visual Studio tools manually:
* Follow the instructions in [Using Python on Windows](https://docs.python.org/3/using/windows.html) to install
the current [version of Python](https://www.python.org/downloads/).
* Install Visual C++ Build Environment: For Visual Studio 2019 or later, use the `Desktop development with C++` workload from [Visual Studio Community](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community). For a version older than Visual Studio 2019, install [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools) with the `Visual C++ build tools` option.
To target native ARM64 Node.js on Windows on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64".
To use the native ARM64 C++ compiler on Windows on ARM, ensure that you have Visual Studio 2022 [17.4 or later](https://devblogs.microsoft.com/visualstudio/arm64-visual-studio-is-officially-here/) installed.
It's advised to install the following PowerShell module: [VSSetup](https://github.com/microsoft/vssetup.powershell) using `Install-Module VSSetup -Scope CurrentUser`.
This will make Visual Studio detection logic use a more flexible and accessible method, avoiding PowerShell's `ConstrainedLanguage` mode.
### Configuring Python Dependency
`node-gyp` requires that you have installed a [supported version of Python](https://devguide.python.org/versions/).
If you have multiple versions of Python installed, you can identify which version
`node-gyp` should use in one of the following ways:
1. by setting the `--python` command-line option, e.g.:
``` bash
node-gyp <command> --python /path/to/executable/python
```
2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of
Python installed, then you can set the `npm_config_python` environment variable
to the appropriate path:
``` bash
export npm_config_python=/path/to/executable/python
```
&nbsp;&nbsp;&nbsp;&nbsp;Or on Windows:
```console
py --list-paths # To see the installed Python versions
set npm_config_python=C:\path\to\python.exe # CMD
$Env:npm_config_python="C:\path\to\python.exe" # PowerShell
```
3. If the `PYTHON` environment variable is set to the path of a Python executable,
then that version will be used if it is a supported version.
4. If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a
Python executable, it will be used instead of any of the other configured or
built-in Python search paths. If it's not a compatible version, no further
searching will be done.
### Build for Third Party Node.js Runtimes
When building modules for third-party Node.js runtimes like Electron, which have
different build configurations from the official Node.js distribution, you
should use `--dist-url` or `--nodedir` flags to specify the headers of the
runtime to build for.
Also when `--dist-url` or `--nodedir` flags are passed, node-gyp will use the
`config.gypi` shipped in the headers distribution to generate build
configurations, which is different from the default mode that would use the
`process.config` object of the running Node.js instance.
Some old versions of Electron shipped malformed `config.gypi` in their headers
distributions, and you might need to pass `--force-process-config` to node-gyp
to work around configuration errors.
## How to Use
To compile your native addon first go to its root directory:
``` bash
cd my_node_addon
```
The next step is to generate the appropriate project build files for the current
platform. Use `configure` for that:
``` bash
node-gyp configure
```
Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015`
needs to be added (not needed when run by npm as configured above):
``` bash
node-gyp configure --msvs_version=2015
```
__Note__: The `configure` step looks for a `binding.gyp` file in the current
directory to process. See below for instructions on creating a `binding.gyp` file.
Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file
(on Windows) in the `build/` directory. Next, invoke the `build` command:
``` bash
node-gyp build
```
Now you have your compiled `.node` bindings file! The compiled bindings end up
in `build/Debug/` or `build/Release/`, depending on the build mode. At this point,
you can require the `.node` file with Node.js and run your tests!
__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or
`-d`) switch when running either the `configure`, `build` or `rebuild` commands.
## The `binding.gyp` file
A `binding.gyp` file describes the configuration to build your module, in a
JSON-like format. This file gets placed in the root of your package, alongside
`package.json`.
A barebones `gyp` file appropriate for building a Node.js addon could look like:
```python
{
"targets": [
{
"target_name": "binding",
"sources": [ "src/binding.cc" ]
}
]
}
```
## Further reading
The **[docs](./docs/)** directory contains additional documentation on specific node-gyp topics that may be useful if you are experiencing problems installing or building addons using node-gyp.
Some additional resources for Node.js native addons and writing `gyp` configuration files:
* ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative)
* ["Hello World" node addon example](https://github.com/nodejs/node/tree/main/test/addons/hello-world)
* [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md)
* [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md)
* [*"binding.gyp" files out in the wild* wiki page](./docs/binding.gyp-files-in-the-wild.md)
## Commands
`node-gyp` responds to the following commands:
| **Command** | **Description**
|:--------------|:---------------------------------------------------------------
| `help` | Shows the help dialog
| `build` | Invokes `make`/`msbuild.exe` and builds the native addon
| `clean` | Removes the `build` directory if it exists
| `configure` | Generates project build files for the current platform
| `rebuild` | Runs `clean`, `configure` and `build` all in a row
| `install` | Installs Node.js header files for the given version
| `list` | Lists the currently installed Node.js header versions
| `remove` | Removes the Node.js header files for the given version
## Command Options
`node-gyp` accepts the following command options:
| **Command** | **Description**
|:----------------------------------|:------------------------------------------
| `-j n`, `--jobs n` | Run `make` in parallel. The value `max` will use all available CPU cores
| `--target=v6.2.1` | Node.js version to build for (default is `process.version`)
| `--silly`, `--loglevel=silly` | Log all progress to console
| `--verbose`, `--loglevel=verbose` | Log most progress to console
| `--silent`, `--loglevel=silent` | Don't log anything to console
| `debug`, `--debug` | Make Debug build (default is `Release`)
| `--release`, `--no-debug` | Make Release build
| `-C $dir`, `--directory=$dir` | Run command in different directory
| `--make=$make` | Override `make` command (e.g. `gmake`)
| `--thin=yes` | Enable thin static libraries
| `--arch=$arch` | Set target architecture (e.g. ia32)
| `--tarball=$path` | Get headers from a local tarball
| `--devdir=$path` | SDK download directory (default is OS cache directory)
| `--ensure` | Don't reinstall headers if already present
| `--dist-url=$url` | Download header tarball from custom URL
| `--proxy=$url` | Set HTTP(S) proxy for downloading header tarball
| `--noproxy=$urls` | Set urls to ignore proxies when downloading header tarball
| `--cafile=$cafile` | Override default CA chain (to download tarball)
| `--nodedir=$path` | Set the path to the node source code
| `--python=$path` | Set path to the Python binary
| `--msvs_version=$version` | Set Visual Studio version (Windows only)
| `--solution=$solution` | Set Visual Studio Solution version (Windows only)
| `--force-process-config` | Force using runtime's `process.config` object to generate `config.gypi` file
## Configuration
### package.json
Use the `config` object in your package.json with each key in the form `node_gyp_OPTION_NAME`. Any of the command
options listed above can be set (dashes in option names should be replaced by underscores).
For example, to set `devdir` equal to `/tmp/.gyp`, your package.json would contain this:
```json
{
"config": {
"node_gyp_devdir": "/tmp/.gyp"
}
}
```
### Environment variables
Use the form `npm_package_config_node_gyp_OPTION_NAME` for any of the command options listed
above (dashes in option names should be replaced by underscores).
For example, to set `devdir` equal to `/tmp/.gyp`, you would:
Run this on Unix:
```bash
export npm_package_config_node_gyp_devdir=/tmp/.gyp
```
Or this on Windows:
```console
set npm_package_config_node_gyp_devdir=c:\temp\.gyp
```
Note that in versions of npm before v11 it was possible to use the prefix `npm_config_` for
environment variables. This was deprecated in npm@11 and will be removed in npm@12 so it
is recommended to convert your environment variables to the above format.
### `npm` configuration for npm versions before v9
Use the form `OPTION_NAME` for any of the command options listed above.
For example, to set `devdir` equal to `/tmp/.gyp`, you would run:
```bash
npm config set [--global] devdir /tmp/.gyp
```
**Note:** Configuration set via `npm` will only be used when `node-gyp`
is run via `npm`, not when `node-gyp` is run directly.
## License
`node-gyp` is available under the MIT license. See the [LICENSE
file](LICENSE) for details.
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2023_full: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"unpack.d.ts","sourceRoot":"","sources":["../../src/unpack.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,89 @@
{
"name": "tailwindcss",
"version": "4.2.2",
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/tailwindlabs/tailwindcss.git",
"directory": "packages/tailwindcss"
},
"bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
"homepage": "https://tailwindcss.com",
"exports": {
".": {
"types": "./dist/lib.d.mts",
"style": "./index.css",
"require": "./dist/lib.js",
"import": "./dist/lib.mjs"
},
"./plugin": {
"require": "./dist/plugin.js",
"import": "./dist/plugin.mjs"
},
"./plugin.js": {
"require": "./dist/plugin.js",
"import": "./dist/plugin.mjs"
},
"./defaultTheme": {
"require": "./dist/default-theme.js",
"import": "./dist/default-theme.mjs"
},
"./defaultTheme.js": {
"require": "./dist/default-theme.js",
"import": "./dist/default-theme.mjs"
},
"./colors": {
"require": "./dist/colors.js",
"import": "./dist/colors.mjs"
},
"./colors.js": {
"require": "./dist/colors.js",
"import": "./dist/colors.mjs"
},
"./lib/util/flattenColorPalette": {
"require": "./dist/flatten-color-palette.js",
"import": "./dist/flatten-color-palette.mjs"
},
"./lib/util/flattenColorPalette.js": {
"require": "./dist/flatten-color-palette.js",
"import": "./dist/flatten-color-palette.mjs"
},
"./package.json": "./package.json",
"./index.css": "./index.css",
"./index": "./index.css",
"./preflight.css": "./preflight.css",
"./preflight": "./preflight.css",
"./theme.css": "./theme.css",
"./theme": "./theme.css",
"./utilities.css": "./utilities.css",
"./utilities": "./utilities.css"
},
"publishConfig": {
"provenance": true,
"access": "public"
},
"style": "index.css",
"files": [
"dist",
"index.css",
"preflight.css",
"theme.css",
"utilities.css"
],
"devDependencies": {
"@jridgewell/remapping": "^2.3.5",
"@types/node": "^20.19.0",
"dedent": "1.7.1",
"lightningcss": "1.32.0",
"magic-string": "^0.30.21",
"source-map-js": "^1.2.1",
"@tailwindcss/oxide": "^4.2.2"
},
"scripts": {
"lint": "tsc --noEmit",
"build": "tsup-node --env.NODE_ENV production",
"dev": "tsup-node --env.NODE_ENV development --watch",
"test:ui": "playwright test"
}
}
@@ -0,0 +1,562 @@
/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$", "caughtErrors": "none" }] */
'use strict';
const EventEmitter = require('events');
const http = require('http');
const { Duplex } = require('stream');
const { createHash } = require('crypto');
const extension = require('./extension');
const PerMessageDeflate = require('./permessage-deflate');
const subprotocol = require('./subprotocol');
const WebSocket = require('./websocket');
const { CLOSE_TIMEOUT, GUID, kWebSocket } = require('./constants');
const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
const RUNNING = 0;
const CLOSING = 1;
const CLOSED = 2;
/**
* Class representing a WebSocket server.
*
* @extends EventEmitter
*/
class WebSocketServer extends EventEmitter {
/**
* Create a `WebSocketServer` instance.
*
* @param {Object} options Configuration options
* @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
* any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
* multiple times in the same tick
* @param {Boolean} [options.autoPong=true] Specifies whether or not to
* automatically send a pong in response to a ping
* @param {Number} [options.backlog=511] The maximum length of the queue of
* pending connections
* @param {Boolean} [options.clientTracking=true] Specifies whether or not to
* track clients
* @param {Number} [options.closeTimeout=30000] Duration in milliseconds to
* wait for the closing handshake to finish after `websocket.close()` is
* called
* @param {Function} [options.handleProtocols] A hook to handle protocols
* @param {String} [options.host] The hostname where to bind the server
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
* buffered data chunks
* @param {Number} [options.maxFragments=16384] The maximum number of message
* fragments
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
* size
* @param {Boolean} [options.noServer=false] Enable no server mode
* @param {String} [options.path] Accept only connections matching this path
* @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
* permessage-deflate
* @param {Number} [options.port] The port where to bind the server
* @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
* server to use
* @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
* not to skip UTF-8 validation for text and close messages
* @param {Function} [options.verifyClient] A hook to reject connections
* @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
* class to use. It must be the `WebSocket` class or class that extends it
* @param {Function} [callback] A listener for the `listening` event
*/
constructor(options, callback) {
super();
options = {
allowSynchronousEvents: true,
autoPong: true,
maxBufferedChunks: 256 * 1024,
maxFragments: 16 * 1024,
maxPayload: 100 * 1024 * 1024,
skipUTF8Validation: false,
perMessageDeflate: false,
handleProtocols: null,
clientTracking: true,
closeTimeout: CLOSE_TIMEOUT,
verifyClient: null,
noServer: false,
backlog: null, // use default (511 as implemented in net.js)
server: null,
host: null,
path: null,
port: null,
WebSocket,
...options
};
if (
(options.port == null && !options.server && !options.noServer) ||
(options.port != null && (options.server || options.noServer)) ||
(options.server && options.noServer)
) {
throw new TypeError(
'One and only one of the "port", "server", or "noServer" options ' +
'must be specified'
);
}
if (options.port != null) {
this._server = http.createServer((req, res) => {
const body = http.STATUS_CODES[426];
res.writeHead(426, {
'Content-Length': body.length,
'Content-Type': 'text/plain'
});
res.end(body);
});
this._server.listen(
options.port,
options.host,
options.backlog,
callback
);
} else if (options.server) {
this._server = options.server;
}
if (this._server) {
const emitConnection = this.emit.bind(this, 'connection');
this._removeListeners = addListeners(this._server, {
listening: this.emit.bind(this, 'listening'),
error: this.emit.bind(this, 'error'),
upgrade: (req, socket, head) => {
this.handleUpgrade(req, socket, head, emitConnection);
}
});
}
if (options.perMessageDeflate === true) options.perMessageDeflate = {};
if (options.clientTracking) {
this.clients = new Set();
this._shouldEmitClose = false;
}
this.options = options;
this._state = RUNNING;
}
/**
* Returns the bound address, the address family name, and port of the server
* as reported by the operating system if listening on an IP socket.
* If the server is listening on a pipe or UNIX domain socket, the name is
* returned as a string.
*
* @return {(Object|String|null)} The address of the server
* @public
*/
address() {
if (this.options.noServer) {
throw new Error('The server is operating in "noServer" mode');
}
if (!this._server) return null;
return this._server.address();
}
/**
* Stop the server from accepting new connections and emit the `'close'` event
* when all existing connections are closed.
*
* @param {Function} [cb] A one-time listener for the `'close'` event
* @public
*/
close(cb) {
if (this._state === CLOSED) {
if (cb) {
this.once('close', () => {
cb(new Error('The server is not running'));
});
}
process.nextTick(emitClose, this);
return;
}
if (cb) this.once('close', cb);
if (this._state === CLOSING) return;
this._state = CLOSING;
if (this.options.noServer || this.options.server) {
if (this._server) {
this._removeListeners();
this._removeListeners = this._server = null;
}
if (this.clients) {
if (!this.clients.size) {
process.nextTick(emitClose, this);
} else {
this._shouldEmitClose = true;
}
} else {
process.nextTick(emitClose, this);
}
} else {
const server = this._server;
this._removeListeners();
this._removeListeners = this._server = null;
//
// The HTTP/S server was created internally. Close it, and rely on its
// `'close'` event.
//
server.close(() => {
emitClose(this);
});
}
}
/**
* See if a given request should be handled by this server instance.
*
* @param {http.IncomingMessage} req Request object to inspect
* @return {Boolean} `true` if the request is valid, else `false`
* @public
*/
shouldHandle(req) {
if (this.options.path) {
const index = req.url.indexOf('?');
const pathname = index !== -1 ? req.url.slice(0, index) : req.url;
if (pathname !== this.options.path) return false;
}
return true;
}
/**
* Handle a HTTP Upgrade request.
*
* @param {http.IncomingMessage} req The request object
* @param {Duplex} socket The network socket between the server and client
* @param {Buffer} head The first packet of the upgraded stream
* @param {Function} cb Callback
* @public
*/
handleUpgrade(req, socket, head, cb) {
socket.on('error', socketOnError);
const key = req.headers['sec-websocket-key'];
const upgrade = req.headers.upgrade;
const version = +req.headers['sec-websocket-version'];
if (req.method !== 'GET') {
const message = 'Invalid HTTP method';
abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
return;
}
if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {
const message = 'Invalid Upgrade header';
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
return;
}
if (key === undefined || !keyRegex.test(key)) {
const message = 'Missing or invalid Sec-WebSocket-Key header';
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
return;
}
if (version !== 13 && version !== 8) {
const message = 'Missing or invalid Sec-WebSocket-Version header';
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {
'Sec-WebSocket-Version': '13, 8'
});
return;
}
if (!this.shouldHandle(req)) {
abortHandshake(socket, 400);
return;
}
const secWebSocketProtocol = req.headers['sec-websocket-protocol'];
let protocols = new Set();
if (secWebSocketProtocol !== undefined) {
try {
protocols = subprotocol.parse(secWebSocketProtocol);
} catch (err) {
const message = 'Invalid Sec-WebSocket-Protocol header';
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
return;
}
}
const secWebSocketExtensions = req.headers['sec-websocket-extensions'];
const extensions = {};
if (
this.options.perMessageDeflate &&
secWebSocketExtensions !== undefined
) {
const perMessageDeflate = new PerMessageDeflate({
...this.options.perMessageDeflate,
isServer: true,
maxPayload: this.options.maxPayload
});
try {
const offers = extension.parse(secWebSocketExtensions);
if (offers[PerMessageDeflate.extensionName]) {
perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
}
} catch (err) {
const message =
'Invalid or unacceptable Sec-WebSocket-Extensions header';
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
return;
}
}
//
// Optionally call external client verification handler.
//
if (this.options.verifyClient) {
const info = {
origin:
req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
secure: !!(req.socket.authorized || req.socket.encrypted),
req
};
if (this.options.verifyClient.length === 2) {
this.options.verifyClient(info, (verified, code, message, headers) => {
if (!verified) {
return abortHandshake(socket, code || 401, message, headers);
}
this.completeUpgrade(
extensions,
key,
protocols,
req,
socket,
head,
cb
);
});
return;
}
if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
}
this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);
}
/**
* Upgrade the connection to WebSocket.
*
* @param {Object} extensions The accepted extensions
* @param {String} key The value of the `Sec-WebSocket-Key` header
* @param {Set} protocols The subprotocols
* @param {http.IncomingMessage} req The request object
* @param {Duplex} socket The network socket between the server and client
* @param {Buffer} head The first packet of the upgraded stream
* @param {Function} cb Callback
* @throws {Error} If called more than once with the same socket
* @private
*/
completeUpgrade(extensions, key, protocols, req, socket, head, cb) {
//
// Destroy the socket if the client has already sent a FIN packet.
//
if (!socket.readable || !socket.writable) return socket.destroy();
if (socket[kWebSocket]) {
throw new Error(
'server.handleUpgrade() was called more than once with the same ' +
'socket, possibly due to a misconfiguration'
);
}
if (this._state > RUNNING) return abortHandshake(socket, 503);
const digest = createHash('sha1')
.update(key + GUID)
.digest('base64');
const headers = [
'HTTP/1.1 101 Switching Protocols',
'Upgrade: websocket',
'Connection: Upgrade',
`Sec-WebSocket-Accept: ${digest}`
];
const ws = new this.options.WebSocket(null, undefined, this.options);
if (protocols.size) {
//
// Optionally call external protocol selection handler.
//
const protocol = this.options.handleProtocols
? this.options.handleProtocols(protocols, req)
: protocols.values().next().value;
if (protocol) {
headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
ws._protocol = protocol;
}
}
if (extensions[PerMessageDeflate.extensionName]) {
const params = extensions[PerMessageDeflate.extensionName].params;
const value = extension.format({
[PerMessageDeflate.extensionName]: [params]
});
headers.push(`Sec-WebSocket-Extensions: ${value}`);
ws._extensions = extensions;
}
//
// Allow external modification/inspection of handshake headers.
//
this.emit('headers', headers, req);
socket.write(headers.concat('\r\n').join('\r\n'));
socket.removeListener('error', socketOnError);
ws.setSocket(socket, head, {
allowSynchronousEvents: this.options.allowSynchronousEvents,
maxBufferedChunks: this.options.maxBufferedChunks,
maxFragments: this.options.maxFragments,
maxPayload: this.options.maxPayload,
skipUTF8Validation: this.options.skipUTF8Validation
});
if (this.clients) {
this.clients.add(ws);
ws.on('close', () => {
this.clients.delete(ws);
if (this._shouldEmitClose && !this.clients.size) {
process.nextTick(emitClose, this);
}
});
}
cb(ws, req);
}
}
module.exports = WebSocketServer;
/**
* Add event listeners on an `EventEmitter` using a map of <event, listener>
* pairs.
*
* @param {EventEmitter} server The event emitter
* @param {Object.<String, Function>} map The listeners to add
* @return {Function} A function that will remove the added listeners when
* called
* @private
*/
function addListeners(server, map) {
for (const event of Object.keys(map)) server.on(event, map[event]);
return function removeListeners() {
for (const event of Object.keys(map)) {
server.removeListener(event, map[event]);
}
};
}
/**
* Emit a `'close'` event on an `EventEmitter`.
*
* @param {EventEmitter} server The event emitter
* @private
*/
function emitClose(server) {
server._state = CLOSED;
server.emit('close');
}
/**
* Handle socket errors.
*
* @private
*/
function socketOnError() {
this.destroy();
}
/**
* Close the connection when preconditions are not fulfilled.
*
* @param {Duplex} socket The socket of the upgrade request
* @param {Number} code The HTTP response status code
* @param {String} [message] The HTTP response body
* @param {Object} [headers] Additional HTTP response headers
* @private
*/
function abortHandshake(socket, code, message, headers) {
//
// The socket is writable unless the user destroyed or ended it before calling
// `server.handleUpgrade()` or in the `verifyClient` function, which is a user
// error. Handling this does not make much sense as the worst that can happen
// is that some of the data written by the user might be discarded due to the
// call to `socket.end()` below, which triggers an `'error'` event that in
// turn causes the socket to be destroyed.
//
message = message || http.STATUS_CODES[code];
headers = {
Connection: 'close',
'Content-Type': 'text/html',
'Content-Length': Buffer.byteLength(message),
...headers
};
socket.once('finish', socket.destroy);
socket.end(
`HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
Object.keys(headers)
.map((h) => `${h}: ${headers[h]}`)
.join('\r\n') +
'\r\n\r\n' +
message
);
}
/**
* Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least
* one listener for it, otherwise call `abortHandshake()`.
*
* @param {WebSocketServer} server The WebSocket server
* @param {http.IncomingMessage} req The request object
* @param {Duplex} socket The socket of the upgrade request
* @param {Number} code The HTTP response status code
* @param {String} message The HTTP response body
* @param {Object} [headers] The HTTP response headers
* @private
*/
function abortHandshakeOrEmitwsClientError(
server,
req,
socket,
code,
message,
headers
) {
if (server.listenerCount('wsClientError')) {
const err = new Error(message);
Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
server.emit('wsClientError', err, socket, req);
} else {
abortHandshake(socket, code, message, headers);
}
}
@@ -0,0 +1 @@
{"version":3,"file":"magnet.js","sources":["../../../src/icons/magnet.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Magnet\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNiAxNS00LTQgNi43NS02Ljc3YTcuNzkgNy43OSAwIDAgMSAxMSAxMUwxMyAyMmwtNC00IDYuMzktNi4zNmEyLjE0IDIuMTQgMCAwIDAtMy0zTDYgMTUiIC8+CiAgPHBhdGggZD0ibTUgOCA0IDQiIC8+CiAgPHBhdGggZD0ibTEyIDE1IDQgNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/magnet\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 Magnet = createLucideIcon('Magnet', [\n [\n 'path',\n {\n d: 'm6 15-4-4 6.75-6.77a7.79 7.79 0 0 1 11 11L13 22l-4-4 6.39-6.36a2.14 2.14 0 0 0-3-3L6 15',\n key: '1i3lhw',\n },\n ],\n ['path', { d: 'm5 8 4 4', key: 'j6kj7e' }],\n ['path', { d: 'm12 15 4 4', key: 'lnac28' }],\n]);\n\nexport default Magnet;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
/**
* @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 Minus = createLucideIcon("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
export { Minus as default };
//# sourceMappingURL=minus.js.map
@@ -0,0 +1,112 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "àmi", verb: "ní" },
file: { unit: "bytes", verb: "ní" },
array: { unit: "nkan", verb: "ní" },
set: { unit: "nkan", verb: "ní" },
map: { unit: "nkan", verb: "ní" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "ẹ̀rọ ìbáwọlé",
email: "àdírẹ́sì ìmẹ́lì",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "àkókò ISO",
date: "ọjọ́ ISO",
time: "àkókò ISO",
duration: "àkókò tó pé ISO",
ipv4: "àdírẹ́sì IPv4",
ipv6: "àdírẹ́sì IPv6",
mac: "àdírẹ́sì MAC",
cidrv4: "àgbègbè IPv4",
cidrv6: "àgbègbè IPv6",
base64: "ọ̀rọ̀ tí a kọ́ ní base64",
base64url: "ọ̀rọ̀ base64url",
json_string: "ọ̀rọ̀ JSON",
e164: "nọ́mbà E.164",
credit_card: "nọmba kaadi gbese",
currency_code: "koodu owó",
iban: "IBAN",
jwt: "JWT",
template_literal: "ẹ̀rọ ìbáwọlé",
};
const TypeDictionary = {
nan: "NaN",
number: "nọ́mbà",
array: "akopọ",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${issue.expected}, àmọ̀ a rí ${received}`;
}
return `Ìbáwọlé aṣìṣe: a ní láti fi ${expected}, àmọ̀ a rí ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Ìbáwọlé aṣìṣe: a ní láti fi ${util.stringifyPrimitive(issue.values[0])}`;
return `Àṣàyàn aṣìṣe: yan ọ̀kan lára ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Tó pọ̀ jù: a ní láti jẹ́ pé ${issue.origin ?? "iye"} ${sizing.verb} ${adj}${issue.maximum} ${sizing.unit}`;
return `Tó pọ̀ jù: a ní láti jẹ́ ${adj}${issue.maximum}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing)
return `Kéré ju: a ní láti jẹ́ pé ${issue.origin} ${sizing.verb} ${adj}${issue.minimum} ${sizing.unit}`;
return `Kéré ju: a ní láti jẹ́ ${adj}${issue.minimum}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${_issue.includes}"`;
if (_issue.format === "regex")
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${_issue.pattern}`;
return `Aṣìṣe: ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${issue.divisor}`;
case "unrecognized_keys":
return `Bọtìnì àìmọ̀: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Bọtìnì aṣìṣe nínú ${issue.origin}`;
case "invalid_union":
return "Ìbáwọlé aṣìṣe";
case "invalid_element":
return `Iye aṣìṣe nínú ${issue.origin}`;
default:
return "Ìbáwọlé aṣìṣe";
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_zH","2":"_tG"},D:{"1":"_ZD","16":"_Y"},E:{"1":"_YB","2":"_4"},F:{"1":"_eD","2":"_6C"},G:{"1":"_t","16":"_d"},H:{"1":"1D"},I:{"1":"_X","16":"_W"},J:{"16":"_B"},K:{"1":"_XD","2":"_gB"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"SVG vector-effect: non-scaling-stroke",D:true};
@@ -0,0 +1,4 @@
declare module 'fast-deep-equal' {
const equal: (a: any, b: any) => boolean;
export = equal;
}