Compare commits

...
1 Commits
Author SHA1 Message Date
TanTan 2a69b23b47 docs: 仓库链接指向本镜像仓库
Dev Build / typecheck (push) Waiting to run
Dev Build / cleanup (push) Waiting to run
2026-11-13 09:27:07 +08:00
18210 changed files with 5101211 additions and 16 deletions

No files matched your search

@@ -0,0 +1,183 @@
import type { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree';
import type { ClassicConfig } from './Config';
import type { Linter } from './Linter';
import type { ParserOptions } from './ParserOptions';
import type { ReportDescriptorMessageData, RuleCreateFunction, RuleModule, SharedConfigurationSettings } from './Rule';
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface ValidTestCase<Options extends readonly unknown[]> {
/**
* Code for the test case.
*/
readonly code: string;
/**
* Environments for the test case.
*/
readonly env?: Readonly<Linter.EnvironmentConfig>;
/**
* The fake filename for the test case. Useful for rules that make assertion about filenames.
*/
readonly filename?: string;
/**
* The additional global variables.
*/
readonly globals?: Readonly<Linter.GlobalsConfig>;
/**
* Name for the test case.
*/
readonly name?: string;
/**
* Run this case exclusively for debugging in supported test frameworks.
*/
readonly only?: boolean;
/**
* Options for the test case.
*/
readonly options?: Readonly<Options>;
/**
* The absolute path for the parser.
*/
readonly parser?: string;
/**
* Options for the parser.
*/
readonly parserOptions?: Readonly<ParserOptions>;
/**
* Settings for the test case.
*/
readonly settings?: Readonly<SharedConfigurationSettings>;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface SuggestionOutput<MessageIds extends string> {
/**
* The data used to fill the message template.
*/
readonly data?: ReportDescriptorMessageData;
/**
* Reported message ID.
*/
readonly messageId: MessageIds;
/**
* NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes.
* Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion.
*/
readonly output: string;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface InvalidTestCase<MessageIds extends string, Options extends readonly unknown[]> extends ValidTestCase<Options> {
/**
* Expected errors.
*/
readonly errors: readonly TestCaseError<MessageIds>[];
/**
* The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested.
*/
readonly output?: string | string[] | null;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface TestCaseError<MessageIds extends string> {
/**
* The 1-based column number of the reported start location.
*/
readonly column?: number;
/**
* The data used to fill the message template.
*/
readonly data?: ReportDescriptorMessageData;
/**
* The 1-based column number of the reported end location.
*/
readonly endColumn?: number;
/**
* The 1-based line number of the reported end location.
*/
readonly endLine?: number;
/**
* The 1-based line number of the reported start location.
*/
readonly line?: number;
/**
* Reported message ID.
*/
readonly messageId: MessageIds;
/**
* Reported suggestions.
*/
readonly suggestions?: readonly SuggestionOutput<MessageIds>[] | null;
/**
* The type of the reported AST node.
*/
readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES;
}
/**
* @param text a string describing the rule
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export type RuleTesterTestFrameworkFunction = (text: string, callback: () => void) => void;
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface RunTests<MessageIds extends string, Options extends readonly unknown[]> {
readonly invalid: readonly InvalidTestCase<MessageIds, Options>[];
readonly valid: readonly (string | ValidTestCase<Options>)[];
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export interface RuleTesterConfig extends ClassicConfig.Config {
readonly parser: string;
readonly parserOptions?: Readonly<ParserOptions>;
}
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
declare class RuleTesterBase {
/**
* Creates a new instance of RuleTester.
* @param testerConfig extra configuration for the tester
*/
constructor(testerConfig?: RuleTesterConfig);
/**
* Adds a new rule test to execute.
* @param ruleName The name of the rule to run.
* @param rule The rule to test.
* @param tests The collection of tests to run.
*/
run<MessageIds extends string, Options extends readonly unknown[]>(ruleName: string, rule: RuleModule<MessageIds, Options>, tests: RunTests<MessageIds, Options>): void;
/**
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
* the global namespace.
*/
static get describe(): RuleTesterTestFrameworkFunction;
static set describe(value: RuleTesterTestFrameworkFunction | undefined);
/**
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
* the global namespace.
*/
static get it(): RuleTesterTestFrameworkFunction;
static set it(value: RuleTesterTestFrameworkFunction | undefined);
/**
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
* the global namespace.
*/
static get itOnly(): RuleTesterTestFrameworkFunction;
static set itOnly(value: RuleTesterTestFrameworkFunction | undefined);
/**
* Define a rule for one particular run of tests.
*/
defineRule<MessageIds extends string, Options extends readonly unknown[]>(name: string, rule: RuleCreateFunction<MessageIds, Options> | RuleModule<MessageIds, Options>): void;
}
declare const RuleTester_base: typeof RuleTesterBase;
/**
* @deprecated Use `@typescript-eslint/rule-tester` instead.
*/
export declare class RuleTester extends RuleTester_base {
}
export {};
@@ -0,0 +1,84 @@
#!/usr/bin/env node
var proc = require('child_process')
var os = require('os')
var path = require('path')
if (!buildFromSource()) {
proc.exec('node-gyp-build-test', function (err, stdout, stderr) {
if (err) {
if (verbose()) console.error(stderr)
preinstall()
}
})
} else {
preinstall()
}
function build () {
var win32 = os.platform() === 'win32'
var shell = win32
var args = [win32 ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']
try {
var pkg = require('node-gyp/package.json')
args = [
process.execPath,
path.join(require.resolve('node-gyp/package.json'), '..', typeof pkg.bin === 'string' ? pkg.bin : pkg.bin['node-gyp']),
'rebuild'
]
shell = false
} catch (_) {}
proc.spawn(args[0], args.slice(1), { stdio: 'inherit', shell, windowsHide: true }).on('exit', function (code) {
if (code || !process.argv[3]) process.exit(code)
exec(process.argv[3]).on('exit', function (code) {
process.exit(code)
})
})
}
function preinstall () {
if (!process.argv[2]) return build()
exec(process.argv[2]).on('exit', function (code) {
if (code) process.exit(code)
build()
})
}
function exec (cmd) {
if (process.platform !== 'win32') {
var shell = os.platform() === 'android' ? 'sh' : true
return proc.spawn(cmd, [], {
shell,
stdio: 'inherit'
})
}
return proc.spawn(cmd, [], {
windowsVerbatimArguments: true,
stdio: 'inherit',
shell: true,
windowsHide: true
})
}
function buildFromSource () {
return hasFlag('--build-from-source') || process.env.npm_config_build_from_source === 'true'
}
function verbose () {
return hasFlag('--verbose') || process.env.npm_config_loglevel === 'verbose'
}
// TODO (next major): remove in favor of env.npm_config_* which works since npm
// 0.1.8 while npm_config_argv will stop working in npm 7. See npm/rfcs#90
function hasFlag (flag) {
if (!process.env.npm_config_argv) return false
try {
return JSON.parse(process.env.npm_config_argv).original.indexOf(flag) !== -1
} catch (_) {
return false
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_ZE","2":"_5B"},C:{"1":"_1D","2":"_RM"},D:{"1":"_yH","2":"_IC"},E:{"1":"_QB","2":"_TB"},F:{"1":"_1L","2":"_rR"},G:{"1":"_BB","2":"_OB"},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":"ME","2":"LE"}},B:1,C:"Passive event listeners",D:true};
@@ -0,0 +1,18 @@
/**
* @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 Music4 = createLucideIcon("Music4", [
["path", { d: "M9 18V5l12-2v13", key: "1jmyc2" }],
["path", { d: "m9 9 12-2", key: "1e64n2" }],
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
["circle", { cx: "18", cy: "16", r: "3", key: "1hluhg" }]
]);
export { Music4 as default };
//# sourceMappingURL=music-4.js.map
@@ -0,0 +1,39 @@
/**
Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
@param flag - CLI flag to look for. The `--` prefix is optional.
@param argv - CLI arguments. Default: `process.argv`.
@returns Whether the flag exists.
@example
```
// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
// foo.ts
import hasFlag = require('has-flag');
hasFlag('unicorn');
//=> true
hasFlag('--unicorn');
//=> true
hasFlag('f');
//=> true
hasFlag('-f');
//=> true
hasFlag('foo=bar');
//=> true
hasFlag('foo');
//=> false
hasFlag('rainbow');
//=> false
```
*/
declare function hasFlag(flag: string, argv?: string[]): boolean;
export = hasFlag;
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Signal = createLucideIcon("Signal", [
["path", { d: "M2 20h.01", key: "4haj6o" }],
["path", { d: "M7 20v-4", key: "j294jx" }],
["path", { d: "M12 20v-8", key: "i3yub9" }],
["path", { d: "M17 20V8", key: "1tkaf5" }],
["path", { d: "M22 4v16", key: "sih9yq" }]
]);
export { Signal as default };
//# sourceMappingURL=signal.js.map
@@ -0,0 +1,182 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-inferrable-types',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean',
recommended: 'stylistic',
},
fixable: 'code',
messages: {
noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
ignoreParameters: {
type: 'boolean',
description: 'Whether to ignore function parameters.',
},
ignoreProperties: {
type: 'boolean',
description: 'Whether to ignore class properties.',
},
},
},
],
},
defaultOptions: [
{
ignoreParameters: false,
ignoreProperties: false,
},
],
create(context, [{ ignoreParameters, ignoreProperties }]) {
function isFunctionCall(init, callName) {
const node = (0, util_1.skipChainExpression)(init);
return (node.type === utils_1.AST_NODE_TYPES.CallExpression &&
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
node.callee.name === callName);
}
function isLiteral(init, typeName) {
return (init.type === utils_1.AST_NODE_TYPES.Literal && typeof init.value === typeName);
}
function isIdentifier(init, ...names) {
return (init.type === utils_1.AST_NODE_TYPES.Identifier && names.includes(init.name));
}
function hasUnaryPrefix(init, ...operators) {
return (init.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
operators.includes(init.operator));
}
const keywordMap = {
[utils_1.AST_NODE_TYPES.TSBigIntKeyword]: 'bigint',
[utils_1.AST_NODE_TYPES.TSBooleanKeyword]: 'boolean',
[utils_1.AST_NODE_TYPES.TSNullKeyword]: 'null',
[utils_1.AST_NODE_TYPES.TSNumberKeyword]: 'number',
[utils_1.AST_NODE_TYPES.TSStringKeyword]: 'string',
[utils_1.AST_NODE_TYPES.TSSymbolKeyword]: 'symbol',
[utils_1.AST_NODE_TYPES.TSUndefinedKeyword]: 'undefined',
};
/**
* Returns whether a node has an inferrable value or not
*/
function isInferrable(annotation, init) {
switch (annotation.type) {
case utils_1.AST_NODE_TYPES.TSBigIntKeyword: {
// note that bigint cannot have + prefixed to it
const unwrappedInit = hasUnaryPrefix(init, '-')
? init.argument
: init;
return (isFunctionCall(unwrappedInit, 'BigInt') ||
unwrappedInit.type === utils_1.AST_NODE_TYPES.Literal);
}
case utils_1.AST_NODE_TYPES.TSBooleanKeyword:
return (hasUnaryPrefix(init, '!') ||
isFunctionCall(init, 'Boolean') ||
isLiteral(init, 'boolean'));
case utils_1.AST_NODE_TYPES.TSNumberKeyword: {
const unwrappedInit = hasUnaryPrefix(init, '+', '-')
? init.argument
: init;
return (isIdentifier(unwrappedInit, 'Infinity', 'NaN') ||
isFunctionCall(unwrappedInit, 'Number') ||
isLiteral(unwrappedInit, 'number'));
}
case utils_1.AST_NODE_TYPES.TSNullKeyword:
return init.type === utils_1.AST_NODE_TYPES.Literal && init.value == null;
case utils_1.AST_NODE_TYPES.TSStringKeyword:
return (isFunctionCall(init, 'String') ||
isLiteral(init, 'string') ||
init.type === utils_1.AST_NODE_TYPES.TemplateLiteral);
case utils_1.AST_NODE_TYPES.TSSymbolKeyword:
return isFunctionCall(init, 'Symbol');
case utils_1.AST_NODE_TYPES.TSTypeReference: {
if (annotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
annotation.typeName.name === 'RegExp') {
const isRegExpLiteral = init.type === utils_1.AST_NODE_TYPES.Literal &&
init.value instanceof RegExp;
const isRegExpNewCall = init.type === utils_1.AST_NODE_TYPES.NewExpression &&
init.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
init.callee.name === 'RegExp';
const isRegExpCall = isFunctionCall(init, 'RegExp');
return isRegExpLiteral || isRegExpCall || isRegExpNewCall;
}
return false;
}
case utils_1.AST_NODE_TYPES.TSUndefinedKeyword:
return (hasUnaryPrefix(init, 'void') || isIdentifier(init, 'undefined'));
}
return false;
}
/**
* Reports an inferrable type declaration, if any
*/
function reportInferrableType(node, typeNode, initNode) {
if (!typeNode || !initNode) {
return;
}
if (!isInferrable(typeNode.typeAnnotation, initNode)) {
return;
}
const type = typeNode.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference
? // TODO - if we add more references
'RegExp'
: keywordMap[typeNode.typeAnnotation.type];
context.report({
node,
messageId: 'noInferrableType',
data: {
type,
},
*fix(fixer) {
if ((node.type === utils_1.AST_NODE_TYPES.AssignmentPattern &&
node.left.optional) ||
(node.type === utils_1.AST_NODE_TYPES.PropertyDefinition && node.definite)) {
yield fixer.remove((0, util_1.nullThrows)(context.sourceCode.getTokenBefore(typeNode), util_1.NullThrowsReasons.MissingToken('token before', 'type node')));
}
yield fixer.remove(typeNode);
},
});
}
function inferrableVariableVisitor(node) {
reportInferrableType(node, node.id.typeAnnotation, node.init);
}
function inferrableParameterVisitor(node) {
if (ignoreParameters) {
return;
}
node.params.forEach(param => {
if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) {
param = param.parameter;
}
if (param.type === utils_1.AST_NODE_TYPES.AssignmentPattern) {
reportInferrableType(param, param.left.typeAnnotation, param.right);
}
});
}
function inferrablePropertyVisitor(node) {
// We ignore `readonly` because of Microsoft/TypeScript#14416
// Essentially a readonly property without a type
// will result in its value being the type, leading to
// compile errors if the type is stripped.
if (ignoreProperties || node.readonly || node.optional) {
return;
}
reportInferrableType(node, node.typeAnnotation, node.value);
}
return {
AccessorProperty: inferrablePropertyVisitor,
ArrowFunctionExpression: inferrableParameterVisitor,
FunctionDeclaration: inferrableParameterVisitor,
FunctionExpression: inferrableParameterVisitor,
PropertyDefinition: inferrablePropertyVisitor,
VariableDeclarator: inferrableVariableVisitor,
};
},
});
@@ -0,0 +1,8 @@
import { default as Level } from './Level';
import { TLevel } from './typings';
/**
* Normalize log level (标准化日志级别)
* @param level Log level (日志级别)
* @returns Normalized log level (标准化后的日志级别)
*/
export default function normalizeLevel(level: Level | TLevel): Level | undefined;
@@ -0,0 +1,59 @@
/**
* @license React
* use-sync-external-store-shim.native.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var React = require("react");
function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
var objectIs = "function" === typeof Object.is ? Object.is : is,
useState = React.useState,
useEffect = React.useEffect,
useLayoutEffect = React.useLayoutEffect,
useDebugValue = React.useDebugValue;
function useSyncExternalStore$1(subscribe, getSnapshot) {
var value = getSnapshot(),
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
inst = _useState[0].inst,
forceUpdate = _useState[1];
useLayoutEffect(
function () {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
},
[subscribe, value, getSnapshot]
);
useEffect(
function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
return subscribe(function () {
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
});
},
[subscribe]
);
useDebugValue(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
return !0;
}
}
exports.useSyncExternalStore =
void 0 !== React.useSyncExternalStore
? React.useSyncExternalStore
: useSyncExternalStore$1;
@@ -0,0 +1,41 @@
// packages/react/use-size/src/use-size.tsx
import * as React from "react";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
function useSize(element) {
const [size, setSize] = React.useState(void 0);
useLayoutEffect(() => {
if (element) {
setSize({ width: element.offsetWidth, height: element.offsetHeight });
const resizeObserver = new ResizeObserver((entries) => {
if (!Array.isArray(entries)) {
return;
}
if (!entries.length) {
return;
}
const entry = entries[0];
let width;
let height;
if ("borderBoxSize" in entry) {
const borderSizeEntry = entry["borderBoxSize"];
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
width = borderSize["inlineSize"];
height = borderSize["blockSize"];
} else {
width = element.offsetWidth;
height = element.offsetHeight;
}
setSize({ width, height });
});
resizeObserver.observe(element, { box: "border-box" });
return () => resizeObserver.unobserve(element);
} else {
setSize(void 0);
}
}, [element]);
return size;
}
export {
useSize
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,145 @@
'use strict'
const test = require('tape')
const fastURI = require('..')
const fn = fastURI.equal
const runTest = (t, suite) => {
suite.forEach(s => {
const operator = s.result ? '==' : '!='
t.equal(fn(s.pair[0], s.pair[1]), s.result, `${s.pair[0]} ${operator} ${s.pair[1]}`)
t.equal(fn(s.pair[1], s.pair[0]), s.result, `${s.pair[1]} ${operator} ${s.pair[0]}`)
})
}
test('URI Equals', (t) => {
const suite = [
{ pair: ['example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'], result: true }, // test from RFC 3986
{ pair: ['http://example.org/~user', 'http://example.org/%7euser'], result: true } // test from RFC 3987
]
runTest(t, suite)
t.end()
})
test('URI Equals rejects malformed object input even when identical', (t) => {
const malformed = { scheme: 'http', host: 'example.com', port: 99999, path: '/x' }
t.equal(fn(malformed, malformed), false)
t.end()
})
test('URI Equals preserves case-sensitive components', (t) => {
const suite = [
{ pair: ['http://example.com/Admin', 'http://example.com/admin'], result: false },
{ pair: ['http://example.com/?token=SECRET', 'http://example.com/?token=secret'], result: false },
{ pair: ['http://example.com/#Section', 'http://example.com/#section'], result: false },
{ pair: ['http://User@example.com/', 'http://user@example.com/'], result: false },
{ pair: ['urn:foo:CaseSensitive', 'urn:foo:casesensitive'], result: false },
{ pair: ['ws://example.com/Chat', 'ws://example.com/chat'], result: false },
{ pair: ['ws://example.com/?token=SECRET', 'ws://example.com/?token=secret'], result: false },
{ pair: [{ scheme: 'http', host: 'example.com', path: '/Admin' }, { scheme: 'http', host: 'example.com', path: '/admin' }], result: false }
]
runTest(t, suite)
t.end()
})
test('URI Equals folds normalized scheme and host case', (t) => {
const suite = [
{ pair: ['HTTP://EXAMPLE.COM/resource', 'http://example.com/resource'], result: true },
{ pair: [{ scheme: 'HTTP', host: 'EXAMPLE.COM', path: '/resource' }, { scheme: 'http', host: 'example.com', path: '/resource' }], result: true }
]
runTest(t, suite)
t.end()
})
// test('IRI Equals', (t) => {
// // example from RFC 3987
// t.equal(URI.equal('example://a/b/c/%7Bfoo%7D/ros\xE9', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9', IRI_OPTION), true)
// t.end()
// })
test('HTTP Equals', (t) => {
const suite = [
// test from RFC 2616
{ pair: ['http://abc.com:80/~smith/home.html', 'http://abc.com/~smith/home.html'], result: true },
{ pair: [{ scheme: 'http', host: 'abc.com', port: 80, path: '/~smith/home.html' }, 'http://abc.com/~smith/home.html'], result: true },
{ pair: ['http://ABC.com/%7Esmith/home.html', 'http://abc.com/~smith/home.html'], result: true },
{ pair: ['http://ABC.com:/%7esmith/home.html', 'http://abc.com/~smith/home.html'], result: true },
{ pair: ['HTTP://ABC.COM', 'http://abc.com/'], result: true },
// test from RFC 3986
{ pair: ['http://example.com:/', 'http://example.com:80/'], result: true }
]
runTest(t, suite)
t.end()
})
test('HTTPS Equals', (t) => {
const suite = [
{ pair: ['https://example.com', 'https://example.com:443/'], result: true },
{ pair: ['https://example.com:/', 'https://example.com:443/'], result: true }
]
runTest(t, suite)
t.end()
})
test('URN Equals', (t) => {
const suite = [
// test from RFC 2141
{ pair: ['urn:foo:a123,456', 'urn:foo:a123,456'], result: true },
{ pair: ['urn:foo:a123,456', 'URN:foo:a123,456'], result: true },
{ pair: ['urn:foo:a123,456', 'urn:FOO:a123,456'], result: true }
]
// Disabling for now as the whole equal logic might need
// to be refactored
// t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:A123,456'), false)
// t.equal(URI.equal('urn:foo:a123%2C456', 'URN:FOO:a123%2c456'), true)
runTest(t, suite)
t.equal(fn('urn:', 'urn:FOO:a123,456'), false, 'malformed URN fails equality safely')
t.end()
})
test('UUID Equals', (t) => {
const suite = [
{ pair: ['URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6', 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'], result: true }
]
runTest(t, suite)
t.end()
})
// test('Mailto Equals', (t) => {
// // tests from RFC 6068
// t.equal(URI.equal('mailto:addr1@an.example,addr2@an.example', 'mailto:?to=addr1@an.example,addr2@an.example'), true)
// t.equal(URI.equal('mailto:?to=addr1@an.example,addr2@an.example', 'mailto:addr1@an.example?to=addr2@an.example'), true)
// t.end()
// })
test('WS Equal', (t) => {
const suite = [
{ pair: ['WS://ABC.COM:80/chat#one', 'ws://abc.com/chat'], result: true }
]
runTest(t, suite)
t.end()
})
test('WSS Equal', (t) => {
const suite = [
{ pair: ['WSS://ABC.COM:443/chat#one', 'wss://abc.com/chat'], result: true }
]
runTest(t, suite)
t.end()
})
test('URI Equals tolerates malformed fragments', (t) => {
t.equal(
fastURI.equal('http://example.com/#%E0%A4A', 'http://example.com/#%E0%A4A'),
true,
'malformed fragment does not throw during equality checks'
)
t.end()
})
@@ -0,0 +1,192 @@
/**
* 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 {Program} from 'hermes-estree';
import type {HermesNode} from './HermesAST';
import type {ParserOptions} from './ParserOptions';
import {
HERMES_AST_VISITOR_KEYS,
NODE_CHILD,
NODE_LIST_CHILD,
} from './generated/ParserVisitorKeys';
/**
* The base class for transforming the Hermes AST to the desired output format.
* Extended by concrete adapters which output an ESTree or Babel AST.
*/
export default class HermesASTAdapter {
sourceFilename: ParserOptions['sourceFilename'];
sourceType: ParserOptions['sourceType'];
constructor(options: ParserOptions) {
this.sourceFilename = options.sourceFilename;
this.sourceType = options.sourceType;
}
/**
* Transform the input Hermes AST to the desired output format.
* This modifies the input AST in place instead of constructing a new AST.
*/
transform(program: HermesNode): Program {
// Comments are not traversed via visitor keys
const comments = program.comments;
for (let i = 0; i < comments.length; i++) {
const comment = comments[i];
this.fixSourceLocation(comment);
comments[i] = this.mapComment(comment);
}
// The first comment may be an interpreter directive and is stored directly on the program node
program.interpreter =
comments.length > 0 && comments[0].type === 'InterpreterDirective'
? comments.shift()
: null;
// Tokens are not traversed via visitor keys
const tokens = program.tokens;
if (tokens) {
for (let i = 0; i < tokens.length; i++) {
this.fixSourceLocation(tokens[i]);
}
}
const resultNode = this.mapNode(program);
if (resultNode.type !== 'Program') {
throw new Error(
`HermesToESTreeAdapter: Must return a Program node, instead of "${resultNode.type}". `,
);
}
// $FlowExpectedError[incompatible-return] We know this is a program at this point.
return resultNode;
}
/**
* Transform a Hermes AST node to the output AST format.
*
* This may modify the input node in-place and return that same node, or a completely
* new node may be constructed and returned. Overriden in child classes.
*/
mapNode(_node: HermesNode): HermesNode {
throw new Error('Implemented in subclasses');
}
mapNodeDefault(node: HermesNode): HermesNode {
const visitorKeys = HERMES_AST_VISITOR_KEYS[node.type];
for (const key in visitorKeys) {
const childType = visitorKeys[key];
if (childType === NODE_CHILD) {
const child = node[key];
if (child != null) {
node[key] = this.mapNode(child);
}
} else if (childType === NODE_LIST_CHILD) {
const children = node[key];
for (let i = 0; i < children.length; i++) {
const child = children[i];
if (child != null) {
children[i] = this.mapNode(child);
}
}
}
}
return node;
}
/**
* Update the source location for this node depending on the output AST format.
* This can modify the input node in-place. Overriden in child classes.
*/
fixSourceLocation(_node: HermesNode): void {
throw new Error('Implemented in subclasses');
}
getSourceType(): ParserOptions['sourceType'] {
return this.sourceType ?? 'script';
}
setModuleSourceType(): void {
if (this.sourceType == null) {
this.sourceType = 'module';
}
}
mapComment(node: HermesNode): HermesNode {
return node;
}
mapEmpty(_node: HermesNode): HermesNode {
// $FlowExpectedError
return null;
}
mapImportDeclaration(node: HermesNode): HermesNode {
if (node.importKind === 'value') {
this.setModuleSourceType();
}
return this.mapNodeDefault(node);
}
mapImportSpecifier(node: HermesNode): HermesNode {
if (node.importKind === 'value') {
node.importKind = null;
}
return this.mapNodeDefault(node);
}
mapExportDefaultDeclaration(node: HermesNode): HermesNode {
this.setModuleSourceType();
return this.mapNodeDefault(node);
}
mapExportNamedDeclaration(node: HermesNode): HermesNode {
if (node.exportKind === 'value') {
this.setModuleSourceType();
}
return this.mapNodeDefault(node);
}
mapExportAllDeclaration(node: HermesNode): HermesNode {
if (node.exportKind === 'value') {
this.setModuleSourceType();
}
return this.mapNodeDefault(node);
}
formatError(node: HermesNode, message: string): string {
return `${message} (${node.loc.start.line}:${node.loc.start.column})`;
}
getBigIntLiteralValue(bigintString: string): {
bigint: string,
value: $FlowFixMe /* bigint */,
} {
// TODO - once we update flow we can remove this
declare var BigInt: ?(value: $FlowFixMe) => mixed;
const bigint = bigintString
// estree spec is to not have a trailing `n` on this property
// https://github.com/estree/estree/blob/db962bb417a97effcfe9892f87fbb93c81a68584/es2020.md#bigintliteral
.replace(/n$/, '')
// `BigInt` doesn't accept numeric separator and `bigint` property should not include numeric separator
.replace(/_/, '');
return {
bigint,
// coerce the string to a bigint value if supported by the environment
value: typeof BigInt === 'function' ? BigInt(bigint) : null,
};
}
}
@@ -0,0 +1,641 @@
/**
* Simple interactive task server demonstrating elicitation and sampling.
*
* This server demonstrates the task message queue pattern from the MCP Tasks spec:
* - confirm_delete: Uses elicitation to ask the user for confirmation
* - write_haiku: Uses sampling to request an LLM to generate content
*
* Both tools use the "call-now, fetch-later" pattern where the initial call
* creates a task, and the result is fetched via tasks/result endpoint.
*/
import { randomUUID } from 'node:crypto';
import { Server } from '../../server/index.js';
import { createMcpExpressApp } from '../../server/express.js';
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
import { RELATED_TASK_META_KEY, ListToolsRequestSchema, CallToolRequestSchema, GetTaskRequestSchema, GetTaskPayloadRequestSchema } from '../../types.js';
import { isTerminal } from '../../experimental/tasks/interfaces.js';
import { InMemoryTaskStore } from '../../experimental/tasks/stores/in-memory.js';
// ============================================================================
// Resolver - Promise-like for passing results between async operations
// ============================================================================
class Resolver {
constructor() {
this._done = false;
this._promise = new Promise((resolve, reject) => {
this._resolve = resolve;
this._reject = reject;
});
}
setResult(value) {
if (this._done)
return;
this._done = true;
this._resolve(value);
}
setException(error) {
if (this._done)
return;
this._done = true;
this._reject(error);
}
wait() {
return this._promise;
}
done() {
return this._done;
}
}
class TaskMessageQueueWithResolvers {
constructor() {
this.queues = new Map();
this.waitResolvers = new Map();
}
getQueue(taskId) {
let queue = this.queues.get(taskId);
if (!queue) {
queue = [];
this.queues.set(taskId, queue);
}
return queue;
}
async enqueue(taskId, message, _sessionId, maxSize) {
const queue = this.getQueue(taskId);
if (maxSize !== undefined && queue.length >= maxSize) {
throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`);
}
queue.push(message);
// Notify any waiters
this.notifyWaiters(taskId);
}
async enqueueWithResolver(taskId, message, resolver, originalRequestId) {
const queue = this.getQueue(taskId);
const queuedMessage = {
type: 'request',
message,
timestamp: Date.now(),
resolver,
originalRequestId
};
queue.push(queuedMessage);
this.notifyWaiters(taskId);
}
async dequeue(taskId, _sessionId) {
const queue = this.getQueue(taskId);
return queue.shift();
}
async dequeueAll(taskId, _sessionId) {
const queue = this.queues.get(taskId) ?? [];
this.queues.delete(taskId);
return queue;
}
async waitForMessage(taskId) {
// Check if there are already messages
const queue = this.getQueue(taskId);
if (queue.length > 0)
return;
// Wait for a message to be added
return new Promise(resolve => {
let waiters = this.waitResolvers.get(taskId);
if (!waiters) {
waiters = [];
this.waitResolvers.set(taskId, waiters);
}
waiters.push(resolve);
});
}
notifyWaiters(taskId) {
const waiters = this.waitResolvers.get(taskId);
if (waiters) {
this.waitResolvers.delete(taskId);
for (const resolve of waiters) {
resolve();
}
}
}
cleanup() {
this.queues.clear();
this.waitResolvers.clear();
}
}
// ============================================================================
// Extended task store with wait functionality
// ============================================================================
class TaskStoreWithNotifications extends InMemoryTaskStore {
constructor() {
super(...arguments);
this.updateResolvers = new Map();
}
async updateTaskStatus(taskId, status, statusMessage, sessionId) {
await super.updateTaskStatus(taskId, status, statusMessage, sessionId);
this.notifyUpdate(taskId);
}
async storeTaskResult(taskId, status, result, sessionId) {
await super.storeTaskResult(taskId, status, result, sessionId);
this.notifyUpdate(taskId);
}
async waitForUpdate(taskId) {
return new Promise(resolve => {
let waiters = this.updateResolvers.get(taskId);
if (!waiters) {
waiters = [];
this.updateResolvers.set(taskId, waiters);
}
waiters.push(resolve);
});
}
notifyUpdate(taskId) {
const waiters = this.updateResolvers.get(taskId);
if (waiters) {
this.updateResolvers.delete(taskId);
for (const resolve of waiters) {
resolve();
}
}
}
}
// ============================================================================
// Task Result Handler - delivers queued messages and routes responses
// ============================================================================
class TaskResultHandler {
constructor(store, queue) {
this.store = store;
this.queue = queue;
this.pendingRequests = new Map();
}
async handle(taskId, server, _sessionId) {
while (true) {
// Get fresh task state
const task = await this.store.getTask(taskId);
if (!task) {
throw new Error(`Task not found: ${taskId}`);
}
// Dequeue and send all pending messages
await this.deliverQueuedMessages(taskId, server, _sessionId);
// If task is terminal, return result
if (isTerminal(task.status)) {
const result = await this.store.getTaskResult(taskId);
// Add related-task metadata per spec
return {
...result,
_meta: {
...(result._meta || {}),
[RELATED_TASK_META_KEY]: { taskId }
}
};
}
// Wait for task update or new message
await this.waitForUpdate(taskId);
}
}
async deliverQueuedMessages(taskId, server, _sessionId) {
while (true) {
const message = await this.queue.dequeue(taskId);
if (!message)
break;
console.log(`[Server] Delivering queued ${message.type} message for task ${taskId}`);
if (message.type === 'request') {
const reqMessage = message;
// Send the request via the server
// Store the resolver so we can route the response back
if (reqMessage.resolver && reqMessage.originalRequestId) {
this.pendingRequests.set(reqMessage.originalRequestId, reqMessage.resolver);
}
// Send the message - for elicitation/sampling, we use the server's methods
// But since we're in tasks/result context, we need to send via transport
// This is simplified - in production you'd use proper message routing
try {
const request = reqMessage.message;
let response;
if (request.method === 'elicitation/create') {
// Send elicitation request to client
const params = request.params;
response = await server.elicitInput(params);
}
else if (request.method === 'sampling/createMessage') {
// Send sampling request to client
const params = request.params;
response = await server.createMessage(params);
}
else {
throw new Error(`Unknown request method: ${request.method}`);
}
// Route response back to resolver
if (reqMessage.resolver) {
reqMessage.resolver.setResult(response);
}
}
catch (error) {
if (reqMessage.resolver) {
reqMessage.resolver.setException(error instanceof Error ? error : new Error(String(error)));
}
}
}
// For notifications, we'd send them too but this example focuses on requests
}
}
async waitForUpdate(taskId) {
// Race between store update and queue message
await Promise.race([this.store.waitForUpdate(taskId), this.queue.waitForMessage(taskId)]);
}
routeResponse(requestId, response) {
const resolver = this.pendingRequests.get(requestId);
if (resolver && !resolver.done()) {
this.pendingRequests.delete(requestId);
resolver.setResult(response);
return true;
}
return false;
}
routeError(requestId, error) {
const resolver = this.pendingRequests.get(requestId);
if (resolver && !resolver.done()) {
this.pendingRequests.delete(requestId);
resolver.setException(error);
return true;
}
return false;
}
}
// ============================================================================
// Task Session - wraps server to enqueue requests during task execution
// ============================================================================
class TaskSession {
constructor(server, taskId, store, queue) {
this.server = server;
this.taskId = taskId;
this.store = store;
this.queue = queue;
this.requestCounter = 0;
}
nextRequestId() {
return `task-${this.taskId}-${++this.requestCounter}`;
}
async elicit(message, requestedSchema) {
// Update task status to input_required
await this.store.updateTaskStatus(this.taskId, 'input_required');
const requestId = this.nextRequestId();
// Build the elicitation request with related-task metadata
const params = {
message,
requestedSchema,
mode: 'form',
_meta: {
[RELATED_TASK_META_KEY]: { taskId: this.taskId }
}
};
const jsonrpcRequest = {
jsonrpc: '2.0',
id: requestId,
method: 'elicitation/create',
params
};
// Create resolver to wait for response
const resolver = new Resolver();
// Enqueue the request
await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId);
try {
// Wait for response
const response = await resolver.wait();
// Update status back to working
await this.store.updateTaskStatus(this.taskId, 'working');
return response;
}
catch (error) {
await this.store.updateTaskStatus(this.taskId, 'working');
throw error;
}
}
async createMessage(messages, maxTokens) {
// Update task status to input_required
await this.store.updateTaskStatus(this.taskId, 'input_required');
const requestId = this.nextRequestId();
// Build the sampling request with related-task metadata
const params = {
messages,
maxTokens,
_meta: {
[RELATED_TASK_META_KEY]: { taskId: this.taskId }
}
};
const jsonrpcRequest = {
jsonrpc: '2.0',
id: requestId,
method: 'sampling/createMessage',
params
};
// Create resolver to wait for response
const resolver = new Resolver();
// Enqueue the request
await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId);
try {
// Wait for response
const response = await resolver.wait();
// Update status back to working
await this.store.updateTaskStatus(this.taskId, 'working');
return response;
}
catch (error) {
await this.store.updateTaskStatus(this.taskId, 'working');
throw error;
}
}
}
// ============================================================================
// Server Setup
// ============================================================================
const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 8000;
// Create shared stores
const taskStore = new TaskStoreWithNotifications();
const messageQueue = new TaskMessageQueueWithResolvers();
const taskResultHandler = new TaskResultHandler(taskStore, messageQueue);
// Track active task executions
const activeTaskExecutions = new Map();
// Create the server
const createServer = () => {
const server = new Server({ name: 'simple-task-interactive', version: '1.0.0' }, {
capabilities: {
tools: {},
tasks: {
requests: {
tools: { call: {} }
}
}
}
});
// Register tools
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [
{
name: 'confirm_delete',
description: 'Asks for confirmation before deleting (demonstrates elicitation)',
inputSchema: {
type: 'object',
properties: {
filename: { type: 'string' }
}
},
execution: { taskSupport: 'required' }
},
{
name: 'write_haiku',
description: 'Asks LLM to write a haiku (demonstrates sampling)',
inputSchema: {
type: 'object',
properties: {
topic: { type: 'string' }
}
},
execution: { taskSupport: 'required' }
}
]
};
});
// Handle tool calls
server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
const { name, arguments: args } = request.params;
const taskParams = (request.params._meta?.task || request.params.task);
// Validate task mode - these tools require tasks
if (!taskParams) {
throw new Error(`Tool ${name} requires task mode`);
}
// Create task
const taskOptions = {
ttl: taskParams.ttl,
pollInterval: taskParams.pollInterval ?? 1000
};
const task = await taskStore.createTask(taskOptions, extra.requestId, request, extra.sessionId);
console.log(`\n[Server] ${name} called, task created: ${task.taskId}`);
// Start background task execution
const taskExecution = (async () => {
try {
const taskSession = new TaskSession(server, task.taskId, taskStore, messageQueue);
if (name === 'confirm_delete') {
const filename = args?.filename ?? 'unknown.txt';
console.log(`[Server] confirm_delete: asking about '${filename}'`);
console.log('[Server] Sending elicitation request to client...');
const result = await taskSession.elicit(`Are you sure you want to delete '${filename}'?`, {
type: 'object',
properties: {
confirm: { type: 'boolean' }
},
required: ['confirm']
});
console.log(`[Server] Received elicitation response: action=${result.action}, content=${JSON.stringify(result.content)}`);
let text;
if (result.action === 'accept' && result.content) {
const confirmed = result.content.confirm;
text = confirmed ? `Deleted '${filename}'` : 'Deletion cancelled';
}
else {
text = 'Deletion cancelled';
}
console.log(`[Server] Completing task with result: ${text}`);
await taskStore.storeTaskResult(task.taskId, 'completed', {
content: [{ type: 'text', text }]
});
}
else if (name === 'write_haiku') {
const topic = args?.topic ?? 'nature';
console.log(`[Server] write_haiku: topic '${topic}'`);
console.log('[Server] Sending sampling request to client...');
const result = await taskSession.createMessage([
{
role: 'user',
content: { type: 'text', text: `Write a haiku about ${topic}` }
}
], 50);
let haiku = 'No response';
if (result.content && 'text' in result.content) {
haiku = result.content.text;
}
console.log(`[Server] Received sampling response: ${haiku.substring(0, 50)}...`);
console.log('[Server] Completing task with haiku');
await taskStore.storeTaskResult(task.taskId, 'completed', {
content: [{ type: 'text', text: `Haiku:\n${haiku}` }]
});
}
}
catch (error) {
console.error(`[Server] Task ${task.taskId} failed:`, error);
await taskStore.storeTaskResult(task.taskId, 'failed', {
content: [{ type: 'text', text: `Error: ${error}` }],
isError: true
});
}
finally {
activeTaskExecutions.delete(task.taskId);
}
})();
activeTaskExecutions.set(task.taskId, {
promise: taskExecution,
server,
sessionId: extra.sessionId ?? ''
});
return { task };
});
// Handle tasks/get
server.setRequestHandler(GetTaskRequestSchema, async (request) => {
const { taskId } = request.params;
const task = await taskStore.getTask(taskId);
if (!task) {
throw new Error(`Task ${taskId} not found`);
}
return task;
});
// Handle tasks/result
server.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
const { taskId } = request.params;
console.log(`[Server] tasks/result called for task ${taskId}`);
return taskResultHandler.handle(taskId, server, extra.sessionId ?? '');
});
return server;
};
// ============================================================================
// Express App Setup
// ============================================================================
const app = createMcpExpressApp();
// Close sessions that have been idle for IDLE_MS, and keep at most MAX_SESSIONS open
const IDLE_MS = 30 * 60000;
const MAX_SESSIONS = 1000;
const sessions = new Map();
// Count open responses so a long-running request or a listening SSE stream is not treated as idle
const trackResponse = (session, res) => {
if (!res.socket || res.destroyed)
return;
session.open++;
res.on('close', () => {
session.open--;
session.lastActive = Date.now();
});
};
// Close sessions with nothing open and no activity for IDLE_MS
setInterval(() => {
const cutoff = Date.now() - IDLE_MS;
for (const { transport, open, lastActive } of sessions.values()) {
if (open === 0 && lastActive < cutoff)
transport.close().catch(console.error);
}
}, 60000).unref();
// Helper to check if request is initialize
const isInitializeRequest = (body) => {
return typeof body === 'object' && body !== null && 'method' in body && body.method === 'initialize';
};
// MCP POST endpoint
app.post('/mcp', async (req, res) => {
const sessionId = req.headers['mcp-session-id'];
try {
const session = sessionId ? sessions.get(sessionId) : undefined;
let transport;
if (session) {
transport = session.transport;
trackResponse(session, res);
}
else if (!sessionId && isInitializeRequest(req.body)) {
if (sessions.size >= MAX_SESSIONS) {
res.status(503).json({ jsonrpc: '2.0', error: { code: -32000, message: 'Too many open sessions' }, id: null });
return;
}
transport = new StreamableHTTPServerTransport({
sessionIdGenerator: () => randomUUID(),
onsessioninitialized: sid => {
console.log(`Session initialized: ${sid}`);
sessions.set(sid, { transport, open: 0, lastActive: Date.now() });
}
});
transport.onclose = () => {
const sid = transport.sessionId;
if (sid && sessions.has(sid)) {
console.log(`Transport closed for session ${sid}`);
sessions.delete(sid);
}
};
const server = createServer();
await server.connect(transport);
await transport.handleRequest(req, res, req.body);
return;
}
else if (sessionId) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
else {
res.status(400).json({
jsonrpc: '2.0',
error: { code: -32000, message: 'Bad Request: No valid session ID' },
id: null
});
return;
}
await transport.handleRequest(req, res, req.body);
}
catch (error) {
console.error('Error handling MCP request:', error);
if (!res.headersSent) {
res.status(500).json({
jsonrpc: '2.0',
error: { code: -32603, message: 'Internal server error' },
id: null
});
}
}
});
// Handle GET requests for SSE streams
app.get('/mcp', async (req, res) => {
const sessionId = req.headers['mcp-session-id'];
if (!sessionId) {
res.status(400).send('Missing session ID');
return;
}
const session = sessions.get(sessionId);
if (!session) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
trackResponse(session, res);
await session.transport.handleRequest(req, res);
});
// Handle DELETE requests for session termination
app.delete('/mcp', async (req, res) => {
const sessionId = req.headers['mcp-session-id'];
if (!sessionId) {
res.status(400).send('Missing session ID');
return;
}
const session = sessions.get(sessionId);
if (!session) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
console.log(`Session termination request: ${sessionId}`);
trackResponse(session, res);
await session.transport.handleRequest(req, res);
});
// Start server
app.listen(PORT, () => {
console.log(`Starting server on http://localhost:${PORT}/mcp`);
console.log('\nAvailable tools:');
console.log(' - confirm_delete: Demonstrates elicitation (asks user y/n)');
console.log(' - write_haiku: Demonstrates sampling (requests LLM completion)');
});
// Handle shutdown
process.on('SIGINT', async () => {
console.log('\nShutting down server...');
for (const [sessionId, { transport }] of sessions) {
try {
await transport.close();
sessions.delete(sessionId);
}
catch (error) {
console.error(`Error closing session ${sessionId}:`, error);
}
}
taskStore.cleanup();
messageQueue.cleanup();
console.log('Server shutdown complete');
process.exit(0);
});
//# sourceMappingURL=simpleTaskInteractive.js.map
@@ -0,0 +1 @@
module.exports={C:{"52":0.00261,"99":0.00261,"115":0.02609,"120":0.00522,"121":0.01305,"127":0.00261,"133":0.00261,"136":0.00522,"140":0.00783,"146":0.00522,"150":0.00522,"151":0.00522,"152":0.00783,"153":0.00522,"154":0.03392,"155":0.10697,"156":0.0861,"157":0.00522,"158":0.00261,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 128 129 130 131 132 134 135 137 138 139 141 142 143 144 145 147 148 149 159 160 3.5 3.6"},D:{"37":0.00261,"41":0.02087,"50":0.00261,"56":0.00261,"57":0.0287,"68":0.00522,"70":0.01305,"73":0.00261,"74":0.01044,"75":0.00261,"76":0.00261,"78":0.00783,"79":0.00261,"80":0.00261,"83":0.01305,"86":0.01044,"87":0.01044,"91":0.01305,"92":0.00261,"94":0.00261,"95":0.00783,"98":0.00261,"99":0.00261,"101":0.03131,"102":0.00261,"103":0.00522,"104":0.00522,"105":0.02087,"106":0.02348,"107":0.00261,"108":0.00783,"109":0.25046,"110":0.00261,"111":0.00783,"112":0.00261,"114":0.00522,"115":0.00522,"116":0.00522,"117":0.00522,"118":0.03131,"119":0.02348,"120":0.01826,"122":0.00261,"123":0.01305,"124":0.00522,"125":0.00261,"126":0.00522,"127":0.01565,"128":0.01305,"129":0.00261,"130":0.00783,"131":0.01826,"132":0.08871,"133":0.03653,"134":0.06783,"135":0.04957,"136":0.03131,"137":0.03914,"138":0.18263,"139":0.04435,"140":0.06523,"141":0.0574,"142":0.10958,"143":0.02609,"144":0.01044,"145":0.00522,"146":0.04696,"147":0.04696,"148":0.04435,"149":0.13567,"150":0.21655,"151":0.80618,"152":2.30636,"153":1.33581,"154":0.23481,"155":0.00522,_:"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 38 39 40 42 43 44 45 46 47 48 49 51 52 53 54 55 58 59 60 61 62 63 64 65 66 67 69 71 72 77 81 84 85 88 89 90 93 96 97 100 113 121 156 157"},F:{"79":0.00261,"89":0.00261,"90":0.02087,"95":0.01305,"99":0.00261,"100":0.01826,"101":0.0574,"102":0.01044,"133":0.01826,"134":0.00783,"135":0.05218,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 91 92 93 94 96 97 98 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00261,"92":0.00783,"100":0.00261,"109":0.00261,"114":0.00783,"119":0.00783,"120":0.00783,"122":0.00261,"124":0.00261,"128":0.00261,"140":0.00522,"142":0.00261,"143":0.00261,"144":0.00261,"147":0.00261,"148":0.00261,"149":0.00783,"150":0.01305,"151":0.03392,"152":0.17741,"153":0.1748,"154":0.0574,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 123 125 126 127 129 130 131 132 133 134 135 136 137 138 139 141 145 146"},E:{_:"4 5 6 7 8 9 10 11 12 13 14 15 27 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.5 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.2 17.3 17.5 17.6 18.0 18.1 18.2 18.3 18.4 18.5-18.7 26.0 26.1 26.3 26.4 27.1 27.2 TP","15.4":0.00261,"15.6":0.00522,"17.1":0.00261,"17.4":0.00261,"26.2":0.00522,"26.5":0.00261,"26.6":0.01826},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00018,"5.0-5.1":0.00018,"6.0-6.1":0,"7.0-7.1":0.00035,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00175,"11.0-11.2":0.00018,"11.3-11.4":0.00035,"12.0-12.1":0,"12.2-12.5":0.00455,"13.0-13.1":0,"13.2":0.00088,"13.3":0,"13.4-13.7":0.00018,"14.0-14.4":0.0007,"14.5-14.8":0.00105,"15.0-15.1":0.00105,"15.2-15.3":0.0007,"15.4":0.00088,"15.5":0.00105,"15.6-15.8":0.02277,"16.0":0.00175,"16.1":0.00315,"16.2":0.00175,"16.3":0.00385,"16.4":0.00088,"16.5":0.0014,"16.6-16.7":0.03171,"17.0":0.00123,"17.1":0.00175,"17.2":0.00175,"17.3":0.00263,"17.4":0.00368,"17.5":0.00718,"17.6-17.7":0.01857,"18.0":0.00385,"18.1":0.00771,"18.2":0.01051,"18.3":0.01822,"18.4":0.01139,"18.5-18.7":0.23525,"26.0":0.01139,"26.1":0.01156,"26.2":0.03013,"26.3":0.03258,"26.4":0.02382,"26.5":0.15958,"26.6":0.98461,"27.0":0.0755,"27.1":0,"27.2":0.00193},P:{"21":0.04824,"22":0.0193,"23":0.0193,"24":0.0193,"25":0.0193,"26":0.00965,"27":0.02895,"28":0.08684,"29":0.15438,"30":1.18677,_:"4 20 8.2 10.1 12.0 15.0 19.0","5.0-5.4":0.00965,"6.2-6.4":0.00965,"7.2-7.4":0.19297,"9.2":0.07719,"11.1-11.2":0.10613,"13.0":0.14473,"14.0":0.06754,"16.0":0.07719,"17.0":0.0193,"18.0":0.00965},I:{"0":0.08124,"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.00003},K:{"0":1.68515,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00261,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":79.13955},R:{_:"0"},M:{"0":0.19956},Q:{_:"14.9"},O:{"0":6.11236},H:{all:0}};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_4D","2":"_KB"},C:{"1":"_H _lB","2":"_qL"},D:{"1":"_IS","2":"_xR"},E:{"1":"_PC","2":"_3C"},F:{"1":"_AN _vB","2":"_j _WF _O"},G:{"1":"_NC","2":"_0C"},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":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"Beacon API",D:true};
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './captions.js';
//# sourceMappingURL=subtitles.js.map
@@ -0,0 +1,270 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStaticMemberAccessOfValue = exports.MemberNameType = void 0;
exports.isDefinitionFile = isDefinitionFile;
exports.upperCaseFirst = upperCaseFirst;
exports.arrayGroupByToMap = arrayGroupByToMap;
exports.arraysAreEqual = arraysAreEqual;
exports.findFirstResult = findFirstResult;
exports.getNameFromIndexSignature = getNameFromIndexSignature;
exports.getNameFromMember = getNameFromMember;
exports.getEnumNames = getEnumNames;
exports.formatWordList = formatWordList;
exports.findLastIndex = findLastIndex;
exports.typeNodeRequiresParentheses = typeNodeRequiresParentheses;
exports.isRestParameterDeclaration = isRestParameterDeclaration;
exports.isParenlessArrowFunction = isParenlessArrowFunction;
exports.getStaticMemberAccessValue = getStaticMemberAccessValue;
const type_utils_1 = require("@typescript-eslint/type-utils");
const utils_1 = require("@typescript-eslint/utils");
const ts = __importStar(require("typescript"));
const astUtils_1 = require("./astUtils");
const DEFINITION_EXTENSIONS = [
ts.Extension.Dts,
ts.Extension.Dcts,
ts.Extension.Dmts,
];
/**
* Check if the context file name is *.d.ts or *.d.tsx
*/
function isDefinitionFile(fileName) {
const lowerFileName = fileName.toLowerCase();
for (const definitionExt of DEFINITION_EXTENSIONS) {
if (lowerFileName.endsWith(definitionExt)) {
return true;
}
}
return /\.d\.(ts|cts|mts|.*\.ts)$/.test(lowerFileName);
}
/**
* Upper cases the first character or the string
*/
function upperCaseFirst(str) {
return str[0].toUpperCase() + str.slice(1);
}
function arrayGroupByToMap(array, getKey) {
const groups = new Map();
for (const item of array) {
const key = getKey(item);
const existing = groups.get(key);
if (existing) {
existing.push(item);
}
else {
groups.set(key, [item]);
}
}
return groups;
}
function arraysAreEqual(a, b, eq) {
return (a === b ||
(a != null && a.length === b?.length && a.every((x, idx) => eq(x, b[idx]))));
}
/** Returns the first non-`undefined` result. */
function findFirstResult(inputs, getResult) {
for (const element of inputs) {
const result = getResult(element);
// eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
if (result !== undefined) {
return result;
}
}
return undefined;
}
/**
* Gets a string representation of the name of the index signature.
*/
function getNameFromIndexSignature(node) {
const propName = node.parameters.find((parameter) => parameter.type === utils_1.AST_NODE_TYPES.Identifier);
return propName ? propName.name : '(index signature)';
}
var MemberNameType;
(function (MemberNameType) {
MemberNameType[MemberNameType["Private"] = 1] = "Private";
MemberNameType[MemberNameType["Quoted"] = 2] = "Quoted";
MemberNameType[MemberNameType["Normal"] = 3] = "Normal";
MemberNameType[MemberNameType["Expression"] = 4] = "Expression";
})(MemberNameType || (exports.MemberNameType = MemberNameType = {}));
/**
* Gets a string name representation of the name of the given MethodDefinition
* or PropertyDefinition node, with handling for computed property names.
*/
function getNameFromMember(member, sourceCode) {
if (member.key.type === utils_1.AST_NODE_TYPES.Identifier) {
return {
name: member.key.name,
type: MemberNameType.Normal,
};
}
if (member.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
return {
name: `#${member.key.name}`,
type: MemberNameType.Private,
};
}
if (member.key.type === utils_1.AST_NODE_TYPES.Literal) {
const name = `${member.key.value}`;
if ((0, type_utils_1.requiresQuoting)(name)) {
return {
name: `"${name}"`,
type: MemberNameType.Quoted,
};
}
return {
name,
type: MemberNameType.Normal,
};
}
return {
name: sourceCode.text.slice(...member.key.range),
type: MemberNameType.Expression,
};
}
function getEnumNames(myEnum) {
return Object.keys(myEnum).filter(x => isNaN(Number(x)));
}
/**
* Given an array of words, returns an English-friendly concatenation, separated with commas, with
* the `and` clause inserted before the last item.
*
* Example: ['foo', 'bar', 'baz' ] returns the string "foo, bar, and baz".
*/
function formatWordList(words) {
if (!words.length) {
return '';
}
if (words.length === 1) {
return words[0];
}
return [words.slice(0, -1).join(', '), words.slice(-1)[0]].join(' and ');
}
/**
* Iterates the array in reverse and returns the index of the first element it
* finds which passes the predicate function.
*
* @returns Returns the index of the element if it finds it or -1 otherwise.
*/
function findLastIndex(members, predicate) {
let idx = members.length - 1;
while (idx >= 0) {
const valid = predicate(members[idx]);
if (valid) {
return idx;
}
idx--;
}
return -1;
}
function typeNodeRequiresParentheses(node, text) {
return (node.type === utils_1.AST_NODE_TYPES.TSFunctionType ||
node.type === utils_1.AST_NODE_TYPES.TSConstructorType ||
node.type === utils_1.AST_NODE_TYPES.TSConditionalType ||
(node.type === utils_1.AST_NODE_TYPES.TSUnionType && text.startsWith('|')) ||
(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && text.startsWith('&')));
}
function isRestParameterDeclaration(decl) {
return ts.isParameter(decl) && decl.dotDotDotToken != null;
}
function isParenlessArrowFunction(node, sourceCode) {
return (node.params.length === 1 && !(0, astUtils_1.isParenthesized)(node.params[0], sourceCode));
}
/**
* Gets a member being accessed or declared if its value can be determined statically, and
* resolves it to the string or symbol value that will be used as the actual member
* access key at runtime. Otherwise, returns `undefined`.
*
* ```ts
* x.member // returns 'member'
* ^^^^^^^^
*
* x?.member // returns 'member' (optional chaining is treated the same)
* ^^^^^^^^^
*
* x['value'] // returns 'value'
* ^^^^^^^^^^
*
* x[Math.random()] // returns undefined (not a static value)
* ^^^^^^^^^^^^^^^^
*
* arr[0] // returns '0' (NOT 0)
* ^^^^^^
*
* arr[0n] // returns '0' (NOT 0n)
* ^^^^^^^
*
* const s = Symbol.for('symbolName')
* x[s] // returns `Symbol.for('symbolName')` (since it's a static/global symbol)
* ^^^^
*
* const us = Symbol('symbolName')
* x[us] // returns undefined (since it's a unique symbol, so not statically analyzable)
* ^^^^^
*
* var object = {
* 1234: '4567', // returns '1234' (NOT 1234)
* ^^^^^^^^^^^^
* method() { } // returns 'method'
* ^^^^^^^^^^^^
* }
*
* class WithMembers {
* foo: string // returns 'foo'
* ^^^^^^^^^^^
* }
* ```
*/
function getStaticMemberAccessValue(node, { sourceCode }) {
const key = node.type === utils_1.AST_NODE_TYPES.MemberExpression ? node.property : node.key;
const { type } = key;
if (!node.computed &&
(type === utils_1.AST_NODE_TYPES.Identifier ||
type === utils_1.AST_NODE_TYPES.PrivateIdentifier)) {
return key.name;
}
const result = (0, astUtils_1.getStaticValue)(key, sourceCode.getScope(node));
if (!result) {
return undefined;
}
const { value } = result;
return typeof value === 'symbol' ? value : String(value);
}
/**
* Answers whether the member expression looks like
* `x.value`, `x['value']`,
* or even `const v = 'value'; x[v]` (or optional variants thereof).
*/
const isStaticMemberAccessOfValue = (memberExpression, context, ...values) => values.includes(getStaticMemberAccessValue(memberExpression, context));
exports.isStaticMemberAccessOfValue = isStaticMemberAccessOfValue;
@@ -0,0 +1,35 @@
const unicode = require('../lib/unicode')
module.exports = {
isSpaceSeparator (c) {
return typeof c === 'string' && unicode.Space_Separator.test(c)
},
isIdStartChar (c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c === '$') || (c === '_') ||
unicode.ID_Start.test(c)
)
},
isIdContinueChar (c) {
return typeof c === 'string' && (
(c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
(c >= '0' && c <= '9') ||
(c === '$') || (c === '_') ||
(c === '\u200C') || (c === '\u200D') ||
unicode.ID_Continue.test(c)
)
},
isDigit (c) {
return typeof c === 'string' && /[0-9]/.test(c)
},
isHexDigit (c) {
return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)
},
}
@@ -0,0 +1,63 @@
import type { Linter } from './Linter';
export declare namespace Processor {
interface ProcessorMeta {
/**
* The unique name of the processor.
*/
name: string;
/**
* The a string identifying the version of the processor.
*/
version?: string;
}
type PreProcess = (text: string, filename: string) => (string | {
filename: string;
text: string;
})[];
type PostProcess = (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
interface ProcessorModule {
/**
* Information about the processor to uniquely identify it when serializing.
*/
meta?: ProcessorMeta;
/**
* The function to merge messages.
*/
postprocess?: PostProcess;
/**
* The function to extract code blocks.
*/
preprocess?: PreProcess;
/**
* If `true` then it means the processor supports autofix.
*/
supportsAutofix?: boolean;
}
/**
* A loose definition of the ParserModule type for use with configs
* This type intended to relax validation of configs so that parsers that have
* different AST types or scope managers can still be passed to configs
*
* @see {@link LooseRuleDefinition}, {@link LooseParserModule}
*/
interface LooseProcessorModule {
/**
* Information about the processor to uniquely identify it when serializing.
*/
meta?: {
[K in keyof ProcessorMeta]?: ProcessorMeta[K] | undefined;
};
/**
* The function to merge messages.
*/
postprocess?: (messagesList: any, filename: string) => any;
/**
* The function to extract code blocks.
*/
preprocess?: (text: string, filename: string) => any;
/**
* If `true` then it means the processor supports autofix.
*/
supportsAutofix?: boolean | undefined;
}
}
@@ -0,0 +1,82 @@
import { ChildProcess, SpawnOptions, SpawnSyncOptions } from "node:child_process";
import { Readable } from "node:stream";
//#region src/non-zero-exit-error.d.ts
declare class NonZeroExitError extends Error {
readonly result: CommonOutputApi;
readonly output?: Output | undefined;
get exitCode(): number | undefined;
constructor(result: CommonOutputApi, output?: Output | undefined);
}
//#endregion
//#region src/main.d.ts
interface Output {
stderr: string;
stdout: string;
exitCode: number | undefined;
}
interface PipeOptions extends Options {}
type KillSignal = Parameters<ChildProcess['kill']>[0];
interface CommonOutputApi {
get pid(): number | undefined;
get killed(): boolean;
get exitCode(): number | undefined;
}
interface OutputApi extends AsyncIterable<string>, CommonOutputApi {
process: ChildProcess | undefined;
get aborted(): boolean;
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
kill(signal?: KillSignal): boolean;
}
interface OutputApiSync extends Iterable<string>, CommonOutputApi {}
type Result = PromiseLike<Output> & OutputApi;
type SyncResult = Output & OutputApiSync;
interface CommonOptions {
timeout: number;
throwOnError: boolean;
}
interface Options extends CommonOptions {
signal: AbortSignal;
nodeOptions: SpawnOptions;
persist: boolean;
stdin: Result | ExecProcess | string;
}
interface SyncOptions extends CommonOptions {
nodeOptions: SpawnSyncOptions;
}
interface TinyExec {
(command: string, args?: string[], options?: Partial<Options>): Result;
}
declare class ExecProcess implements Result {
protected _process?: ChildProcess;
protected _aborted: boolean;
protected _options: Partial<Options>;
protected _command: string;
protected _args: string[];
protected _resolveClose?: () => void;
protected _processClosed: Promise<void>;
protected _thrownError?: Error;
get process(): ChildProcess | undefined;
get pid(): number | undefined;
get exitCode(): number | undefined;
constructor(command: string, args?: string[], options?: Partial<Options>);
kill(signal?: KillSignal): boolean;
get aborted(): boolean;
get killed(): boolean;
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
[Symbol.asyncIterator](): AsyncIterator<string>;
protected _waitForOutput(): Promise<Output>;
then<TResult1 = Output, TResult2 = never>(onfulfilled?: ((value: Output) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
protected _streamOut?: Readable;
protected _streamErr?: Readable;
spawn(): void;
protected _resetState(): void;
protected _onError: (err: Error) => void;
protected _onClose: () => void;
}
declare function xSync(command: string, args?: string[], options?: Partial<SyncOptions>): SyncResult;
declare const x: TinyExec;
declare const exec: TinyExec;
declare const execSync: typeof xSync;
//#endregion
export { CommonOptions, CommonOutputApi, ExecProcess, KillSignal, NonZeroExitError, Options, Output, OutputApi, OutputApiSync, PipeOptions, Result, SyncOptions, SyncResult, TinyExec, exec, execSync, x, xSync };
@@ -0,0 +1,61 @@
type Pathname = string
interface TestResult {
ignored: boolean
unignored: boolean
}
export interface Ignore {
/**
* Adds one or several rules to the current manager.
* @param {string[]} patterns
* @returns IgnoreBase
*/
add(patterns: string | Ignore | readonly (string | Ignore)[]): this
/**
* Filters the given array of pathnames, and returns the filtered array.
* NOTICE that each path here should be a relative path to the root of your repository.
* @param paths the array of paths to be filtered.
* @returns The filtered array of paths
*/
filter(pathnames: readonly Pathname[]): Pathname[]
/**
* Creates a filter function which could filter
* an array of paths with Array.prototype.filter.
*/
createFilter(): (pathname: Pathname) => boolean
/**
* Returns Boolean whether pathname should be ignored.
* @param {string} pathname a path to check
* @returns boolean
*/
ignores(pathname: Pathname): boolean
/**
* Returns whether pathname should be ignored or unignored
* @param {string} pathname a path to check
* @returns TestResult
*/
test(pathname: Pathname): TestResult
}
export interface Options {
ignorecase?: boolean
// For compatibility
ignoreCase?: boolean
allowRelativePaths?: boolean
}
/**
* Creates new ignore manager.
*/
declare function ignore(options?: Options): Ignore
declare namespace ignore {
export function isPathValid (pathname: string): boolean
}
export default ignore
@@ -0,0 +1,59 @@
{
"name": "@epic-web/invariant",
"version": "1.0.0",
"description": "Type safe utilities for throwing errors (and responses) if things aren't quite right. Inspired by npm.im/invariant",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/epicweb-dev/invariant"
},
"bugs": {
"url": "https://github.com/epicweb-dev/invariant/issues"
},
"homepage": "https://github.com/epicweb-dev/invariant#readme",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"format": "prettier --write .",
"test": "tsx --test --test-reporter spec --experimental-test-coverage test/*.test.ts",
"test:watch": "tsx --test --test-reporter spec --watch test/*.test.ts"
},
"devDependencies": {
"@types/node": "^20.10.4",
"prettier": "^3.1.1",
"tsx": "^4.6.2",
"typescript": "^5.3.3"
},
"prettier": {
"semi": false,
"useTabs": true,
"singleQuote": true,
"proseWrap": "always",
"overrides": [
{
"files": [
"**/*.json"
],
"options": {
"useTabs": false
}
}
]
},
"keywords": [],
"author": "Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com/)",
"license": "MIT"
}
@@ -0,0 +1,52 @@
{
"name": "esrecurse",
"description": "ECMAScript AST recursive visitor",
"homepage": "https://github.com/estools/esrecurse",
"main": "esrecurse.js",
"version": "4.3.0",
"engines": {
"node": ">=4.0"
},
"maintainers": [
{
"name": "Yusuke Suzuki",
"email": "utatane.tea@gmail.com",
"web": "https://github.com/Constellation"
}
],
"repository": {
"type": "git",
"url": "https://github.com/estools/esrecurse.git"
},
"dependencies": {
"estraverse": "^5.2.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.24.1",
"chai": "^4.0.2",
"esprima": "^4.0.0",
"gulp": "^3.9.0",
"gulp-bump": "^2.7.0",
"gulp-eslint": "^4.0.0",
"gulp-filter": "^5.0.0",
"gulp-git": "^2.4.1",
"gulp-mocha": "^4.3.1",
"gulp-tag-version": "^1.2.1",
"jsdoc": "^3.3.0-alpha10",
"minimist": "^1.1.0"
},
"license": "BSD-2-Clause",
"scripts": {
"test": "gulp travis",
"unit-test": "gulp test",
"lint": "gulp lint"
},
"babel": {
"presets": [
"es2015"
]
}
}
@@ -0,0 +1,166 @@
"use client";
import { optimizedAppearDataAttribute } from 'motion-dom';
import { useContext, useRef, useInsertionEffect, useEffect } from 'react';
import { LazyContext } from '../../context/LazyContext.mjs';
import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
import { MotionContext } from '../../context/MotionContext/index.mjs';
import { PresenceContext } from '../../context/PresenceContext.mjs';
import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';
import { isRefObject } from '../../utils/is-ref-object.mjs';
import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {
const { visualElement: parent } = useContext(MotionContext);
const lazyContext = useContext(LazyContext);
const presenceContext = useContext(PresenceContext);
const motionConfig = useContext(MotionConfigContext);
const reducedMotionConfig = motionConfig.reducedMotion;
const skipAnimations = motionConfig.skipAnimations;
const visualElementRef = useRef(null);
/**
* Track whether the component has been through React's commit phase.
* Used to detect when LazyMotion features load after the component has mounted.
*/
const hasMountedOnce = useRef(false);
/**
* If we haven't preloaded a renderer, check to see if we have one lazy-loaded
*/
createVisualElement =
createVisualElement ||
lazyContext.renderer;
if (!visualElementRef.current && createVisualElement) {
visualElementRef.current = createVisualElement(Component, {
visualState,
parent,
props,
presenceContext,
blockInitialAnimation: presenceContext
? presenceContext.initial === false
: false,
reducedMotionConfig,
skipAnimations,
isSVG,
});
/**
* If the component has already mounted before features loaded (e.g. via
* LazyMotion with async feature loading), we need to force the initial
* animation to run. Otherwise state changes that occurred before features
* loaded will be lost and the element will snap to its final state.
*/
if (hasMountedOnce.current && visualElementRef.current) {
visualElementRef.current.manuallyAnimateOnMount = true;
}
}
const visualElement = visualElementRef.current;
/**
* Load Motion gesture and animation features. These are rendered as renderless
* components so each feature can optionally make use of React lifecycle methods.
*/
const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);
if (visualElement &&
!visualElement.projection &&
ProjectionNodeConstructor &&
(visualElement.type === "html" || visualElement.type === "svg")) {
createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
}
const isMounted = useRef(false);
useInsertionEffect(() => {
/**
* Check the component has already mounted before calling
* `update` unnecessarily. This ensures we skip the initial update.
*/
if (visualElement && isMounted.current) {
visualElement.update(props, presenceContext);
}
});
/**
* Cache this value as we want to know whether HandoffAppearAnimations
* was present on initial render - it will be deleted after this.
*/
const optimisedAppearId = props[optimizedAppearDataAttribute];
const wantsHandoff = useRef(Boolean(optimisedAppearId) &&
typeof window !== "undefined" &&
!window.MotionHandoffIsComplete?.(optimisedAppearId) &&
window.MotionHasOptimisedAnimation?.(optimisedAppearId));
useIsomorphicLayoutEffect(() => {
/**
* Track that this component has mounted. This is used to detect when
* LazyMotion features load after the component has already committed.
*/
hasMountedOnce.current = true;
if (!visualElement)
return;
isMounted.current = true;
window.MotionIsMounted = true;
visualElement.updateFeatures();
visualElement.scheduleRenderMicrotask();
/**
* Ideally this function would always run in a useEffect.
*
* However, if we have optimised appear animations to handoff from,
* it needs to happen synchronously to ensure there's no flash of
* incorrect styles in the event of a hydration error.
*
* So if we detect a situtation where optimised appear animations
* are running, we use useLayoutEffect to trigger animations.
*/
if (wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
});
useEffect(() => {
if (!visualElement)
return;
if (!wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
if (wantsHandoff.current) {
// This ensures all future calls to animateChanges() in this component will run in useEffect
queueMicrotask(() => {
window.MotionHandoffMarkAsComplete?.(optimisedAppearId);
});
wantsHandoff.current = false;
}
/**
* Now we've finished triggering animations for this element we
* can wipe the enteringChildren set for the next render.
*/
visualElement.enteringChildren = undefined;
});
return visualElement;
}
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
? undefined
: getClosestProjectingNode(visualElement.parent));
visualElement.projection.setOptions({
layoutId,
layout,
alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),
visualElement,
/**
* TODO: Update options in an effect. This could be tricky as it'll be too late
* to update by the time layout animations run.
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
* ensuring it gets called if there's no potential layout animations.
*
*/
animationType: typeof layout === "string" ? layout : "both",
initialPromotionConfig,
crossfade: layoutCrossfade,
layoutScroll,
layoutRoot,
layoutAnchor,
});
}
function getClosestProjectingNode(visualElement) {
if (!visualElement)
return undefined;
return visualElement.options.allowProjection !== false
? visualElement.projection
: getClosestProjectingNode(visualElement.parent);
}
export { useVisualElement };
//# sourceMappingURL=use-visual-element.mjs.map
@@ -0,0 +1,52 @@
#!/usr/bin/env node
const which = require('../lib')
const argv = process.argv.slice(2)
const usage = (err) => {
if (err) {
console.error(`which: ${err}`)
}
console.error('usage: which [-as] program ...')
process.exit(1)
}
if (!argv.length) {
return usage()
}
let dashdash = false
const [commands, flags] = argv.reduce((acc, arg) => {
if (dashdash || arg === '--') {
dashdash = true
return acc
}
if (!/^-/.test(arg)) {
acc[0].push(arg)
return acc
}
for (const flag of arg.slice(1).split('')) {
if (flag === 's') {
acc[1].silent = true
} else if (flag === 'a') {
acc[1].all = true
} else {
usage(`illegal option -- ${flag}`)
}
}
return acc
}, [[], {}])
for (const command of commands) {
try {
const res = which.sync(command, { all: flags.all })
if (!flags.silent) {
console.log([].concat(res).join('\n'))
}
} catch (err) {
process.exitCode = 1
}
}
@@ -0,0 +1 @@
{"version":3,"file":"standaloneSseWithGetStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":";;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAyE;AACzE,wDAA8D;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QACzB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,OAAO;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE;QAClD,MAAM,GAAG,GAAG,mCAAmC,kBAAk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MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAuB,CAAC;IACtE,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC3C,OAAO;IACX,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,wEAAwE;QACxE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAALine truncated
@@ -0,0 +1,27 @@
import { UnionToIntersection } from "../utils/types.js";
import { FormValue, ParsedFormValue, ValidationTargets } from "../types.js";
//#region src/validator/utils.d.ts
/**
* Checks if T is a literal union type (e.g., 'asc' | 'desc')
* that should be preserved in input types.
* Returns true for union literals, false for single literals or wide types.
*/
export type IsLiteralUnion<T, Base> = [Exclude<T, undefined>] extends [Base] ? [Exclude<T, undefined>] extends [UnionToIntersection<Exclude<T, undefined>>] ? false : true : false;
type IsOptionalUnion<T> = [unknown] extends [T] ? false : undefined extends T ? true : false;
type SimplifyDeep<T> = { [K in keyof T]: T[K]; } & {};
type InferInputInner<Output, Target extends keyof ValidationTargets, T extends FormValue> = SimplifyDeep<{ [K in keyof Output]: IsLiteralUnion<Output[K], string> extends true ? Output[K] : IsOptionalUnion<Output[K]> extends true ? Output[K] : Target extends 'form' ? T | T[] : Target extends 'query' ? string | string[] : Target extends 'param' ? string : Target extends 'header' ? string : Target extends 'cookie' ? string : unknown; }>;
/**
* Utility type to infer input types for validation targets.
* Preserves literal union types (e.g., 'asc' | 'desc') while using
* the default ValidationTargets type for other values.
*
* @example
* ```ts
* // In @hono/zod-validator or similar:
* type Input = InferInput<z.input<Schema>, 'query'>
* // { orderBy: 'asc' | 'desc', page: string | string[] }
* ```
*/
export type InferInput<Output, Target extends keyof ValidationTargets, T extends FormValue = ParsedFormValue> = [Exclude<Output, undefined>] extends [never] ? {} : [Exclude<Output, undefined>] extends [object] ? undefined extends Output ? SimplifyDeep<InferInputInner<Exclude<Output, undefined>, Target, T>> | undefined : SimplifyDeep<InferInputInner<Output, Target, T>> : {};
//#endregion
export {};
@@ -0,0 +1,42 @@
import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';
import { createSelectorEffect } from '../utils/create-dom-effect.mjs';
import { createEffect } from '../utils/create-effect.mjs';
function canSetAsProperty(element, name) {
if (!(name in element))
return false;
const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||
Object.getOwnPropertyDescriptor(element, name);
// Check if it has a setter
return descriptor && typeof descriptor.set === "function";
}
const addAttrValue = (element, state, key, value) => {
const isProp = canSetAsProperty(element, key);
const name = isProp
? key
: key.startsWith("data") || key.startsWith("aria")
? camelToDash(key)
: key;
/**
* Set attribute directly via property if available
*/
const render = isProp
? () => {
element[name] = state.latest[key];
}
: () => {
const v = state.latest[key];
if (v === null || v === undefined) {
element.removeAttribute(name);
}
else {
element.setAttribute(name, String(v));
}
};
return state.set(key, value, render);
};
const attrEffect = /*@__PURE__*/ createSelectorEffect(
/*@__PURE__*/ createEffect(addAttrValue));
export { addAttrValue, attrEffect };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Trash2 = createLucideIcon("Trash2", [
["path", { d: "M3 6h18", key: "d0wm0j" }],
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
]);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":0.00176,"128":0.00176,"139":0.00176,"140":0.01058,"143":0.00176,"144":0.00176,"145":0.00176,"146":0.00176,"147":0.00176,"148":0.00176,"149":0.00176,"150":0.00882,"151":0.00176,"152":0.00353,"153":0.00706,"154":0.0688,"155":0.14288,"156":0.13583,"157":0.00529,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 129 130 131 132 133 134 135 136 137 138 141 142 158 159 160 3.5 3.6"},D:{"49":0.00176,"53":0.00176,"56":0.00176,"67":0.00176,"68":0.00176,"70":0.00176,"72":0.00176,"73":0.01058,"76":0.00176,"79":0.00882,"80":0.00176,"81":0.00176,"83":0.00706,"85":0.00529,"86":0.00176,"87":0.01058,"88":0.00176,"91":0.00529,"92":0.00353,"95":0.00176,"98":0.00176,"100":0.00176,"101":0.00529,"103":0.04763,"104":0.0441,"105":0.0441,"106":0.04763,"107":0.0441,"108":0.04586,"109":0.598,"110":0.04586,"111":0.04586,"112":0.0441,"113":0.00176,"114":0.01058,"115":0.00176,"116":0.09526,"117":0.0441,"118":0.15523,"119":0.14112,"120":0.18698,"121":0.00176,"122":0.02293,"123":0.00353,"124":0.05116,"125":0.00353,"126":0.00882,"127":0.00529,"128":0.01058,"129":0.00176,"130":0.00529,"131":0.09702,"132":0.00529,"133":0.12701,"134":0.04763,"135":0.05821,"136":0.04763,"137":0.05292,"138":0.09702,"139":0.05116,"140":0.0635,"141":0.05821,"142":0.16758,"143":0.01411,"144":0.03528,"145":0.0247,"146":0.04586,"147":0.02822,"148":0.07585,"149":0.07232,"150":0.12348,"151":1.00724,"152":3.47684,"153":3.84552,"154":0.98078,"155":0.01058,"156":0.00176,_:"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 54 55 57 58 59 60 61 62 63 64 65 66 69 71 74 75 77 78 84 89 90 93 94 96 97 99 102 157"},F:{"40":0.00176,"46":0.01588,"90":0.00176,"95":0.01411,"100":0.00353,"101":0.01764,"102":0.00176,"106":0.00176,"119":0.00176,"121":0.00176,"124":0.00176,"131":0.00176,"132":0.00176,"133":0.00529,"134":0.08114,"135":0.72853,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 96 97 98 99 103 104 105 107 108 109 110 111 112 113 114 115 116 117 118 120 122 123 125 126 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00176,"92":0.00353,"109":0.01764,"119":0.06703,"120":0.07056,"122":0.00353,"130":0.00176,"131":0.00176,"134":0.00176,"137":0.00176,"139":0.00176,"140":0.00176,"141":0.00529,"142":0.00706,"143":0.00706,"144":0.00529,"145":0.00706,"146":0.00529,"147":0.00706,"148":0.00706,"149":0.00882,"150":0.0194,"151":0.03175,"152":0.34927,"153":0.49745,"154":0.16052,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 123 124 125 126 127 128 129 132 133 135 136 138"},E:{"27":0.04586,_:"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 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.4 27.1 27.2 TP","11.1":0.00176,"13.1":0.00176,"14.1":0.00353,"15.6":0.01235,"16.1":0.00176,"16.3":0.00176,"16.5":0.00176,"16.6":0.01588,"17.0":0.00176,"17.1":0.00706,"17.2":0.00176,"17.3":0.00176,"17.4":0.00353,"17.5":0.00353,"17.6":0.01058,"18.0":0.00176,"18.1":0.00176,"18.2":0.00176,"18.3":0.00353,"18.4":0.00176,"18.5-18.7":0.00706,"26.0":0.00353,"26.1":0.00353,"26.2":0.01058,"26.3":0.01411,"26.4":0.00882,"26.5":0.05645,"26.6":0.20992},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00129,"5.0-5.1":0.00129,"6.0-6.1":0,"7.0-7.1":0.00258,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.0129,"11.0-11.2":0.00129,"11.3-11.4":0.00258,"12.0-12.1":0,"12.2-12.5":0.03353,"13.0-13.1":0,"13.2":0.00645,"13.3":0,"13.4-13.7":0.00129,"14.0-14.4":0.00516,"14.5-14.8":0.00774,"15.0-15.1":0.00774,"15.2-15.3":0.00516,"15.4":0.00645,"15.5":0.00774,"15.6-15.8":0.16767,"16.0":0.0129,"16.1":0.02322,"16.2":0.0129,"16.3":0.02837,"16.4":0.00645,"16.5":0.01032,"16.6-16.7":0.23345,"17.0":0.00903,"17.1":0.0129,"17.2":0.0129,"17.3":0.01935,"17.4":0.02708,"17.5":0.05288,"17.6-17.7":0.13671,"18.0":0.02837,"18.1":0.05675,"18.2":0.07739,"18.3":0.13413,"18.4":0.08383,"18.5-18.7":1.73214,"26.0":0.08383,"26.1":0.08512,"26.2":0.22184,"26.3":0.23989,"26.4":0.17541,"26.5":1.17497,"26.6":7.24973,"27.0":0.55589,"27.1":0,"27.2":0.01419},P:{"4":0.0286,"20":0.00953,"21":0.0286,"22":0.00953,"23":0.00953,"24":0.00953,"25":0.01907,"26":0.0572,"27":0.01907,"28":0.07626,"29":0.10486,"30":1.83028,_:"5.0-5.4 6.2-6.4 8.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.01907,"9.2":0.00953,"17.0":0.00953},I:{"0":0.01646,"3":0,"4Line truncated
@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const store = require("@tanstack/store");
const useStore = require("./useStore.cjs");
function shallow(objA, objB) {
if (Object.is(objA, objB)) {
return true;
}
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
return false;
}
if (objA instanceof Map && objB instanceof Map) {
if (objA.size !== objB.size) return false;
for (const [k, v] of objA) {
if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;
}
return true;
}
if (objA instanceof Set && objB instanceof Set) {
if (objA.size !== objB.size) return false;
for (const v of objA) {
if (!objB.has(v)) return false;
}
return true;
}
if (objA instanceof Date && objB instanceof Date) {
if (objA.getTime() !== objB.getTime()) return false;
return true;
}
const keysA = getOwnKeys(objA);
if (keysA.length !== getOwnKeys(objB).length) {
return false;
}
for (let i = 0; i < keysA.length; i++) {
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
function getOwnKeys(obj) {
return Object.keys(obj).concat(
Object.getOwnPropertySymbols(obj)
);
}
exports.useStore = useStore.useStore;
exports.shallow = shallow;
Object.keys(store).forEach((k) => {
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: () => store[k]
});
});
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1,37 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface RegExpMatchArray {
indices?: RegExpIndicesArray;
}
interface RegExpExecArray {
indices?: RegExpIndicesArray;
}
interface RegExpIndicesArray extends Array<[number, number] | undefined> {
groups?: {
[key: string]: [number, number];
};
}
interface RegExp {
/**
* Returns a Boolean value indicating the state of the hasIndices flag (d) used with a regular expression.
* Default is false. Read-only.
*/
readonly hasIndices: boolean;
}
@@ -0,0 +1 @@
{"version":3,"file":"aperture.js","sources":["../../../src/icons/aperture.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Aperture\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJtMTQuMzEgOCA1Ljc0IDkuOTQiIC8+CiAgPHBhdGggZD0iTTkuNjkgOGgxMS40OCIgLz4KICA8cGF0aCBkPSJtNy4zOCAxMiA1Ljc0LTkuOTQiIC8+CiAgPHBhdGggZD0iTTkuNjkgMTYgMy45NSA2LjA2IiAvPgogIDxwYXRoIGQ9Ik0xNC4zMSAxNkgyLjgzIiAvPgogIDxwYXRoIGQ9Im0xNi42MiAxMi01Ljc0IDkuOTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/aperture\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 Aperture = createLucideIcon('Aperture', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm14.31 8 5.74 9.94', key: '1y6ab4' }],\n ['path', { d: 'M9.69 8h11.48', key: '1wxppr' }],\n ['path', { d: 'm7.38 12 5.74-9.94', key: '1grp0k' }],\n ['path', { d: 'M9.69 16 3.95 6.06', key: 'libnyf' }],\n ['path', { d: 'M14.31 16H2.83', key: 'x5fava' }],\n ['path', { d: 'm16.62 12-5.74 9.94', key: '1vwawt' }],\n]);\n\nexport default Aperture;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,U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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACtD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @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 FileAxis3d = createLucideIcon("FileAxis3d", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "m8 18 4-4", key: "12zab0" }],
["path", { d: "M8 10v8h8", key: "tlaukw" }]
]);
export { FileAxis3d as default };
//# sourceMappingURL=file-axis-3d.js.map
@@ -0,0 +1 @@
export declare function parserSeemsToBeTSESLint(parser: string | undefined): boolean;
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FoldVertical = createLucideIcon("FoldVertical", [
["path", { d: "M12 22v-6", key: "6o8u61" }],
["path", { d: "M12 8V2", key: "1wkif3" }],
["path", { d: "M4 12H2", key: "rhcxmi" }],
["path", { d: "M10 12H8", key: "s88cx1" }],
["path", { d: "M16 12h-2", key: "10asgb" }],
["path", { d: "M22 12h-2", key: "14jgyd" }],
["path", { d: "m15 19-3-3-3 3", key: "e37ymu" }],
["path", { d: "m15 5-3 3-3-3", key: "19d6lf" }]
]);
export { FoldVertical as default };
//# sourceMappingURL=fold-vertical.js.map
@@ -0,0 +1 @@
{"version":3,"file":"videotape.js","sources":["../../../src/icons/videotape.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Videotape\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHg9IjIiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0yIDhoMjAiIC8+CiAgPGNpcmNsZSBjeD0iOCIgY3k9IjE0IiByPSIyIiAvPgogIDxwYXRoIGQ9Ik04IDEyaDgiIC8+CiAgPGNpcmNsZSBjeD0iMTYiIGN5PSIxNCIgcj0iMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/videotape\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 Videotape = createLucideIcon('Videotape', [\n ['rect', { width: '20', height: '16', x: '2', y: '4', rx: '2', key: '18n3k1' }],\n ['path', { d: 'M2 8h20', key: 'd11cs7' }],\n ['circle', { cx: '8', cy: '14', r: '2', key: '1k2qr5' }],\n ['path', { d: 'M8 12h8', key: '1wcyev' }],\n ['circle', { cx: '16', cy: '14', r: '2', key: '14k7lr' }],\n]);\n\nexport default Videotape;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,C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,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,235 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = applyDecs2305;
var _checkInRHS = require("./checkInRHS.js");
var _setFunctionName = require("./setFunctionName.js");
var _toPropertyKey = require("./toPropertyKey.js");
function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand, parentClass) {
function _bindPropCall(obj, name, before) {
return function (_this, value) {
if (before) {
before(_this);
}
return obj[name].call(_this, value);
};
}
function runInitializers(initializers, value) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(value);
}
return value;
}
function assertCallable(fn, hint1, hint2, throwUndefined) {
if (typeof fn !== "function") {
if (throwUndefined || fn !== void 0) {
throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
}
}
return fn;
}
function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, metadata, initializers, ret, isStatic, isPrivate, isField, isAccessor, hasPrivateBrand) {
function assertInstanceIfPrivate(target) {
if (!hasPrivateBrand(target)) {
throw new TypeError("Attempted to access private element on non-instance");
}
}
var decs = decInfo[0],
decVal = decInfo[3],
_,
isClass = !ret;
if (!isClass) {
if (!decoratorsHaveThis && !Array.isArray(decs)) {
decs = [decs];
}
var desc = {},
init = [],
key = kind === 3 ? "get" : kind === 4 || isAccessor ? "set" : "value";
if (isPrivate) {
if (isField || isAccessor) {
desc = {
get: (0, _setFunctionName.default)(function () {
return decVal(this);
}, name, "get"),
set: function (value) {
decInfo[4](this, value);
}
};
} else {
desc[key] = decVal;
}
if (!isField) {
(0, _setFunctionName.default)(desc[key], name, kind === 2 ? "" : key);
}
} else if (!isField) {
desc = Object.getOwnPropertyDescriptor(Class, name);
}
}
var newValue = Class;
for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
var dec = decs[i],
decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
var decoratorFinishedRef = {};
var ctx = {
kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
name: name,
metadata: metadata,
addInitializer: function (decoratorFinishedRef, initializer) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call addInitializer after decoration was finished");
}
assertCallable(initializer, "An initializer", "be", true);
initializers.push(initializer);
}.bind(null, decoratorFinishedRef)
};
try {
if (isClass) {
if (_ = assertCallable(dec.call(decThis, newValue, ctx), "class decorators", "return")) {
newValue = _;
}
} else {
ctx["static"] = isStatic;
ctx["private"] = isPrivate;
var get, set;
if (!isPrivate) {
get = function (target) {
return target[name];
};
if (kind < 2 || kind === 4) {
set = function (target, v) {
target[name] = v;
};
}
} else if (kind === 2) {
get = function (_this) {
assertInstanceIfPrivate(_this);
return desc.value;
};
} else {
if (kind < 4) {
get = _bindPropCall(desc, "get", assertInstanceIfPrivate);
}
if (kind !== 3) {
set = _bindPropCall(desc, "set", assertInstanceIfPrivate);
}
}
var access = ctx.access = {
has: isPrivate ? hasPrivateBrand.bind() : function (target) {
return name in target;
}
};
if (get) access.get = get;
if (set) access.set = set;
newValue = dec.call(decThis, isAccessor ? {
get: desc.get,
set: desc.set
} : desc[key], ctx);
if (isAccessor) {
if (typeof newValue === "object" && newValue) {
if (_ = assertCallable(newValue.get, "accessor.get")) {
desc.get = _;
}
if (_ = assertCallable(newValue.set, "accessor.set")) {
desc.set = _;
}
if (_ = assertCallable(newValue.init, "accessor.init")) {
init.push(_);
}
} else if (newValue !== void 0) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
} else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
if (isField) {
init.push(newValue);
} else {
desc[key] = newValue;
}
}
}
} finally {
decoratorFinishedRef.v = true;
}
}
if (isField || isAccessor) {
ret.push(function (instance, value) {
for (var i = init.length - 1; i >= 0; i--) {
value = init[i].call(instance, value);
}
return value;
});
}
if (!isField && !isClass) {
if (isPrivate) {
if (isAccessor) {
ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set"));
} else {
ret.push(kind === 2 ? desc[key] : _bindPropCall.call.bind(desc[key]));
}
} else {
Object.defineProperty(Class, name, desc);
}
}
return newValue;
}
function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
var ret = [];
var protoInitializers;
var staticInitializers;
var staticBrand = function (_) {
return (0, _checkInRHS.default)(_) === Class;
};
var existingNonFields = new Map();
function pushInitializers(initializers) {
if (initializers) {
ret.push(runInitializers.bind(null, initializers));
}
}
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var decoratorsHaveThis = kind & 16;
var isStatic = !!(kind & 8);
kind &= 7;
var isField = kind === 0;
var key = name + "/" + isStatic;
if (!isField && !isPrivate) {
var existingKind = existingNonFields.get(key);
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
}
existingNonFields.set(key, kind > 2 ? kind : true);
}
applyDec(isStatic ? Class : Class.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kind, metadata, isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, isStatic, isPrivate, isField, kind === 1, isStatic && isPrivate ? staticBrand : instanceBrand);
}
pushInitializers(protoInitializers);
pushInitializers(staticInitializers);
return ret;
}
function defineMetadata(Class, metadata) {
return Object.defineProperty(Class, Symbol.metadata || Symbol["for"]("Symbol.metadata"), {
configurable: true,
enumerable: true,
value: metadata
});
}
if (arguments.length >= 6) {
var parentMetadata = parentClass[Symbol.metadata || Symbol["for"]("Symbol.metadata")];
}
var metadata = Object.create(parentMetadata == null ? null : parentMetadata);
var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
if (!classDecs.length) defineMetadata(targetClass, metadata);
return {
e: e,
get c() {
var initializers = [];
return classDecs.length && [defineMetadata(applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, metadata, initializers), metadata), runInitializers.bind(null, initializers, targetClass)];
}
};
}
//# sourceMappingURL=applyDecs2305.js.map
@@ -0,0 +1,136 @@
// src/use-controllable-state.tsx
import * as React from "react";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect;
function useControllableState({
prop,
defaultProp,
onChange = () => {
},
caller
}) {
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
defaultProp,
onChange
});
const isControlled = prop !== void 0;
const value = isControlled ? prop : uncontrolledProp;
if (true) {
const isControlledRef = React.useRef(prop !== void 0);
React.useEffect(() => {
const wasControlled = isControlledRef.current;
if (wasControlled !== isControlled) {
const from = wasControlled ? "controlled" : "uncontrolled";
const to = isControlled ? "controlled" : "uncontrolled";
console.warn(
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
);
}
isControlledRef.current = isControlled;
}, [isControlled, caller]);
}
const setValue = React.useCallback(
(nextValue) => {
if (isControlled) {
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
if (value2 !== prop) {
onChangeRef.current?.(value2);
}
} else {
setUncontrolledProp(nextValue);
}
},
[isControlled, prop, setUncontrolledProp, onChangeRef]
);
return [value, setValue];
}
function useUncontrolledState({
defaultProp,
onChange
}) {
const [value, setValue] = React.useState(defaultProp);
const prevValueRef = React.useRef(value);
const onChangeRef = React.useRef(onChange);
useInsertionEffect(() => {
onChangeRef.current = onChange;
}, [onChange]);
React.useEffect(() => {
if (prevValueRef.current !== value) {
onChangeRef.current?.(value);
prevValueRef.current = value;
}
}, [value, prevValueRef]);
return [value, setValue, onChangeRef];
}
function isFunction(value) {
return typeof value === "function";
}
// src/use-controllable-state-reducer.tsx
import * as React2 from "react";
import { useEffectEvent } from "@radix-ui/react-use-effect-event";
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
const isControlled = controlledState !== void 0;
const onChange = useEffectEvent(onChangeProp);
if (true) {
const isControlledRef = React2.useRef(controlledState !== void 0);
React2.useEffect(() => {
const wasControlled = isControlledRef.current;
if (wasControlled !== isControlled) {
const from = wasControlled ? "controlled" : "uncontrolled";
const to = isControlled ? "controlled" : "uncontrolled";
console.warn(
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
);
}
isControlledRef.current = isControlled;
}, [isControlled, caller]);
}
const args = [{ ...initialArg, state: defaultProp }];
if (init) {
args.push(init);
}
const [internalState, dispatch] = React2.useReducer(
(state2, action) => {
if (action.type === SYNC_STATE) {
return { ...state2, state: action.state };
}
const next = reducer(state2, action);
if (isControlled && !Object.is(next.state, state2.state)) {
onChange(next.state);
}
return next;
},
...args
);
const uncontrolledState = internalState.state;
const prevValueRef = React2.useRef(uncontrolledState);
React2.useEffect(() => {
if (prevValueRef.current !== uncontrolledState) {
prevValueRef.current = uncontrolledState;
if (!isControlled) {
onChange(uncontrolledState);
}
}
}, [onChange, uncontrolledState, prevValueRef, isControlled]);
const state = React2.useMemo(() => {
const isControlled2 = controlledState !== void 0;
if (isControlled2) {
return { ...internalState, state: controlledState };
}
return internalState;
}, [internalState, controlledState]);
React2.useEffect(() => {
if (isControlled && !Object.is(controlledState, internalState.state)) {
dispatch({ type: SYNC_STATE, state: controlledState });
}
}, [controlledState, internalState.state, isControlled]);
return [state, dispatch];
}
export {
useControllableState,
useControllableStateReducer
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"angry.js","sources":["../../../src/icons/angry.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Angry\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTYgMTZzLTEuNS0yLTQtMi00IDItNCAyIiAvPgogIDxwYXRoIGQ9Ik03LjUgOCAxMCA5IiAvPgogIDxwYXRoIGQ9Im0xNCA5IDIuNS0xIiAvPgogIDxwYXRoIGQ9Ik05IDEwaC4wMSIgLz4KICA8cGF0aCBkPSJNMTUgMTBoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/angry\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 Angry = createLucideIcon('Angry', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M16 16s-1.5-2-4-2-4 2-4 2', key: 'epbg0q' }],\n ['path', { d: 'M7.5 8 10 9', key: 'olxxln' }],\n ['path', { d: 'm14 9 2.5-1', key: '1j6cij' }],\n ['path', { d: 'M9 10h.01', key: 'qbtxuw' }],\n ['path', { d: 'M15 10h.01', key: '1qmjsl' }],\n]);\n\nexport default Angry;\n"],"names":[],"mappings":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CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const DiamondMinus = createLucideIcon("DiamondMinus", [
[
"path",
{
d: "M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",
key: "1ey20j"
}
],
["path", { d: "M8 12h8", key: "1wcyev" }]
]);
export { DiamondMinus as default };
//# sourceMappingURL=diamond-minus.js.map
@@ -0,0 +1 @@
{"version":3,"file":"split.js","sources":["../../../src/icons/split.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Split\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgM2g1djUiIC8+CiAgPHBhdGggZD0iTTggM0gzdjUiIC8+CiAgPHBhdGggZD0iTTEyIDIydi04LjNhNCA0IDAgMCAwLTEuMTcyLTIuODcyTDMgMyIgLz4KICA8cGF0aCBkPSJtMTUgOSA2LTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/split\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 Split = createLucideIcon('Split', [\n ['path', { d: 'M16 3h5v5', key: '1806ms' }],\n ['path', { d: 'M8 3H3v5', key: '15dfkv' }],\n ['path', { d: 'M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3', key: '1qrqzj' }],\n ['path', { d: 'm15 9 6-6', key: 'ko1vev' }],\n]);\n\nexport default Split;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAyC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,5 @@
export const version = {
major: 4,
minor: 6,
patch: 7 as number,
} as const;
@@ -0,0 +1,5 @@
'use strict'
module.exports.isClean = Symbol('isClean')
module.exports.my = Symbol('my')
@@ -0,0 +1,9 @@
module.exports = {
y: 1 << 0,
n: 1 << 1,
a: 1 << 2,
p: 1 << 3,
u: 1 << 4,
x: 1 << 5,
d: 1 << 6
}
@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const add = require("./add.js");
const addDays = require("./addDays.js");
const addHours = require("./addHours.js");
const addMilliseconds = require("./addMilliseconds.js");
const addMinutes = require("./addMinutes.js");
const addMonths = require("./addMonths.js");
const addSeconds = require("./addSeconds.js");
const addYears = require("./addYears.js");
const compile = require("./compile.js");
const dayOfYear = require("./dayOfYear.js");
const daysInMonth = require("./daysInMonth.js");
const diff = require("./diff.js");
const diffInDays = require("./diffInDays.js");
const diffInHours = require("./diffInHours.js");
const diffInMilliseconds = require("./diffInMilliseconds.js");
const diffInMinutes = require("./diffInMinutes.js");
const diffInMonths = require("./diffInMonths.js");
const diffInSeconds = require("./diffInSeconds.js");
const diffInYears = require("./diffInYears.js");
const endOf = require("./endOf.js");
const format = require("./format.js");
const get = require("./set-Bwi5SIy8.js");
const isAfter = require("./isAfter.js");
const isBefore = require("./isBefore.js");
const isBetween = require("./isBetween.js");
const isLeapYear = require("./isLeapYear.js");
const isSame = require("./isSame.js");
const isSameOrAfter = require("./isSameOrAfter.js");
const isSameOrBefore = require("./isSameOrBefore.js");
const isValid = require("./isValid.js");
const parse = require("./parse.js");
const startOf = require("./startOf.js");
const subDays = require("./subDays.js");
const subHours = require("./subHours.js");
const subMilliseconds = require("./subMilliseconds.js");
const subMinutes = require("./subMinutes.js");
const subMonths = require("./subMonths.js");
const subSeconds = require("./subSeconds.js");
const subYears = require("./subYears.js");
const subtract = require("./subtract.js");
const units = require("./units.js");
exports.add = add;
exports.addDays = addDays;
exports.addHours = addHours;
exports.addMilliseconds = addMilliseconds;
exports.addMinutes = addMinutes;
exports.addMonths = addMonths;
exports.addSeconds = addSeconds;
exports.addYears = addYears;
exports.compile = compile;
exports.dayOfYear = dayOfYear;
exports.daysInMonth = daysInMonth;
exports.diff = diff;
exports.diffInDays = diffInDays;
exports.diffInHours = diffInHours;
exports.diffInMilliseconds = diffInMilliseconds;
exports.diffInMinutes = diffInMinutes;
exports.diffInMonths = diffInMonths;
exports.diffInSeconds = diffInSeconds;
exports.diffInYears = diffInYears;
exports.endOf = endOf;
exports.format = format;
exports.get = get.get;
exports.set = get.set;
exports.isAfter = isAfter;
exports.isBefore = isBefore;
exports.isBetween = isBetween;
exports.isLeapYear = isLeapYear;
exports.isSame = isSame;
exports.isSameOrAfter = isSameOrAfter;
exports.isSameOrBefore = isSameOrBefore;
exports.isValid = isValid;
exports.parse = parse;
exports.startOf = startOf;
exports.subDays = subDays;
exports.subHours = subHours;
exports.subMilliseconds = subMilliseconds;
exports.subMinutes = subMinutes;
exports.subMonths = subMonths;
exports.subSeconds = subSeconds;
exports.subYears = subYears;
exports.subtract = subtract;
exports.units = units;
@@ -0,0 +1 @@
module.exports={C:{"56":0.00301,"66":0.00301,"68":0.00301,"70":0.00301,"72":0.00601,"84":0.00301,"103":0.00301,"112":0.02104,"115":0.06613,"120":0.04509,"121":0.1022,"123":0.00301,"124":0.00601,"125":0.00301,"126":0.00301,"127":0.01202,"134":0.00902,"135":0.00902,"136":0.01804,"137":0.01503,"139":0.00301,"140":0.1503,"141":0.00301,"142":0.00601,"146":0.00301,"147":0.00301,"148":0.00301,"149":0.00301,"150":0.00902,"151":0.00601,"152":0.01804,"153":0.04208,"154":0.23447,"155":0.59819,"156":0.57415,"157":0.01804,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 67 69 71 73 74 75 76 77 78 79 80 81 82 83 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 107 108 109 110 111 113 114 116 117 118 119 122 128 129 130 131 132 133 138 143 144 145 158 159 160 3.5 3.6"},D:{"49":0.00301,"50":0.00301,"55":0.00301,"57":0.00301,"58":0.00601,"63":0.00301,"64":0.00301,"65":0.00601,"66":0.00301,"67":0.00301,"68":0.00301,"69":0.01503,"70":0.00902,"71":0.00601,"72":0.00301,"73":0.00601,"74":0.01202,"75":0.00301,"76":0.00902,"77":0.00601,"79":0.01804,"80":0.01202,"81":0.01202,"83":0.00301,"84":0.00301,"85":0.00301,"86":0.00902,"87":0.01202,"88":0.00601,"89":0.00301,"90":0.00301,"91":0.00301,"93":0.01804,"94":0.00601,"95":0.01202,"96":0.00301,"97":0.00301,"98":0.00601,"101":0.02705,"103":0.05411,"104":0.01202,"105":0.18637,"106":0.01202,"107":0.01202,"108":0.01503,"109":0.42685,"110":0.01804,"111":0.06012,"112":0.00902,"113":0.01202,"114":0.16533,"116":0.0511,"117":0.01202,"118":0.29459,"119":0.11723,"120":0.12024,"121":0.00301,"122":0.01503,"123":0.00902,"124":0.02104,"125":0.00601,"126":0.01503,"127":0.01804,"128":0.04208,"129":0.00601,"130":0.02705,"131":0.06613,"132":0.02705,"133":0.09018,"134":0.07816,"135":0.06914,"136":0.07515,"137":0.07515,"138":0.15631,"139":0.06613,"140":0.08417,"141":0.08116,"142":0.23447,"143":0.03607,"144":0.0511,"145":0.03607,"146":0.10822,"147":0.05711,"148":0.0992,"149":0.17134,"150":0.53507,"151":1.43987,"152":6.06911,"153":4.19036,"154":0.8537,"155":0.01804,"156":0.00301,_:"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 51 52 53 54 56 59 60 61 62 78 92 99 100 102 115 157"},F:{"36":0.00301,"42":0.00301,"46":0.00301,"79":0.00601,"90":0.00301,"91":0.00301,"95":0.02104,"97":0.00601,"98":0.00601,"99":0.00301,"100":0.02405,"101":0.02104,"102":0.00301,"105":0.00301,"106":0.00601,"113":0.00601,"114":0.00301,"115":0.00301,"119":0.00301,"120":0.00301,"121":0.00301,"126":0.00301,"131":0.00601,"132":0.00601,"133":0.02104,"134":0.1022,"135":0.7996,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 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 86 87 88 89 92 93 94 96 103 104 107 108 109 110 111 112 116 117 118 122 123 124 125 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"15":0.00301,"16":0.00301,"17":0.00301,"18":0.1503,"84":0.00601,"89":0.00601,"90":0.02104,"92":0.06613,"100":0.01503,"104":0.00301,"109":0.00902,"111":0.00902,"112":0.00301,"114":0.04509,"117":0.00301,"119":0.04509,"120":0.05711,"122":0.05711,"123":0.00301,"131":0.00301,"132":0.00301,"134":0.00301,"137":0.00601,"138":0.00301,"139":0.00601,"140":0.02405,"141":0.00601,"142":0.00601,"143":0.00601,"144":0.01804,"145":0.03006,"146":0.01202,"147":0.01804,"148":0.02705,"149":0.02405,"150":0.09319,"151":0.27956,"152":1.20841,"153":1.22645,"154":0.22846,_:"12 13 14 79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 105 106 107 108 110 113 115 116 118 121 124 125 126 127 128 129 130 133 135 136"},E:{"11":0.00301,"13":0.00601,"14":0.00301,"27":0.07214,_:"4 5 6 7 8 9 10 12 15 3.1 3.2 5.1 6.1 7.1 9.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 17.2 17.3 27.1 27.2 TP","10.1":0.00301,"11.1":0.01202,"12.1":0.00301,"13.1":0.01202,"14.1":0.00601,"15.1":0.00601,"15.6":0.08417,"16.4":0.00301,"16.5":0.00301,"16.6":0.03307,"17.0":0.00301,"17.1":0.00601,"17.4":0.00601,"17.5":0.00301,"17.6":0.07214,"18.0":0.00301,"18.1":0.00902,"18.2":0.00902,"18.3":0.00301,"18.4":0.00301,"18.5-18.7":0.00601,"26.0":0.00601,"26.1":0.00601,"26.2":0.01804,"26.3":0.01804,"26.4":0.02104,"26.5":0.09619,"26.6":0.31864},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00165,"5.0-5.1":0.00165,"6.0-6.1":0,"7.0-7.1":0.0033,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01651,"11.0-11.2":0.00165,"11.3-11.4":0.0033,"12.0-12.1":0,"12.2-12.5":0.04293,"13.0-13.1":0,"13.2":0.00826,"13.3":0,"13.4-13.7":0.00165,"14.0-14.4":0.00661,"14.5-14.8":0.00991,"15.0-15.1":0.00991,"15.2-15.3":0.00661,"15.4":0.00826,"15.5":0.00991,"15.6-15.8":0.21467,"16.0":0.01651,"16.1":0.02972,"16.2":0.01651,"16.3":0.03633,"16.4":0.00826,"16.5":0.01321,"16.6-16.7":0.29888,"17.0":0.01156,"17.1":0.01651,"17.2":0.01651,"17.3":0.02477,"17.4":0.03468,"17.5":0.0677,"17.6-17.7":0.1Line truncated
@@ -0,0 +1,43 @@
export const encoder = new TextEncoder();
export const decoder = new TextDecoder();
const MAX_INT32 = 2 ** 32;
export function concat(...buffers) {
const size = buffers.reduce((acc, { length }) => acc + length, 0);
const buf = new Uint8Array(size);
let i = 0;
for (const buffer of buffers) {
buf.set(buffer, i);
i += buffer.length;
}
return buf;
}
function writeUInt32BE(buf, value, offset) {
if (value < 0 || value >= MAX_INT32) {
throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value}`);
}
buf.set([value >>> 24, value >>> 16, value >>> 8, value & 0xff], offset);
}
export function uint64be(value) {
const high = Math.floor(value / MAX_INT32);
const low = value % MAX_INT32;
const buf = new Uint8Array(8);
writeUInt32BE(buf, high, 0);
writeUInt32BE(buf, low, 4);
return buf;
}
export function uint32be(value) {
const buf = new Uint8Array(4);
writeUInt32BE(buf, value);
return buf;
}
export function encode(string) {
const bytes = new Uint8Array(string.length);
for (let i = 0; i < string.length; i++) {
const code = string.charCodeAt(i);
if (code > 127) {
throw new TypeError('non-ASCII string encountered in encode()');
}
bytes[i] = code;
}
return bytes;
}
@@ -0,0 +1,18 @@
/**
* @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 FileSearch2 = createLucideIcon("FileSearch2", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["circle", { cx: "11.5", cy: "14.5", r: "2.5", key: "1bq0ko" }],
["path", { d: "M13.3 16.3 15 18", key: "2quom7" }]
]);
export { FileSearch2 as default };
//# sourceMappingURL=file-search-2.js.map
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Aperture = createLucideIcon("Aperture", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "m14.31 8 5.74 9.94", key: "1y6ab4" }],
["path", { d: "M9.69 8h11.48", key: "1wxppr" }],
["path", { d: "m7.38 12 5.74-9.94", key: "1grp0k" }],
["path", { d: "M9.69 16 3.95 6.06", key: "libnyf" }],
["path", { d: "M14.31 16H2.83", key: "x5fava" }],
["path", { d: "m16.62 12-5.74 9.94", key: "1vwawt" }]
]);
export { Aperture as default };
//# sourceMappingURL=aperture.js.map
@@ -0,0 +1,49 @@
// tar -x
import * as fsm from '@isaacs/fs-minipass';
import fs from 'node:fs';
import { filesFilter } from './list.js';
import { makeCommand } from './make-command.js';
import { Unpack, UnpackSync } from './unpack.js';
const extractFileSync = (opt) => {
const u = new UnpackSync(opt);
const file = opt.file;
const stat = fs.statSync(file);
// This trades a zero-byte read() syscall for a stat
// However, it will usually result in less memory allocation
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
const stream = new fsm.ReadStreamSync(file, {
readSize: readSize,
size: stat.size,
});
stream.pipe(u);
};
const extractFile = (opt, _) => {
const u = new Unpack(opt);
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
const file = opt.file;
const p = new Promise((resolve, reject) => {
u.on('error', reject);
u.on('close', resolve);
// This trades a zero-byte read() syscall for a stat
// However, it will usually result in less memory allocation
fs.stat(file, (er, stat) => {
if (er) {
reject(er);
}
else {
const stream = new fsm.ReadStream(file, {
readSize: readSize,
size: stat.size,
});
stream.on('error', reject);
stream.pipe(u);
}
});
});
return p;
};
export const extract = makeCommand(extractFileSync, extractFile, opt => new UnpackSync(opt), opt => new Unpack(opt), (opt, files) => {
if (files?.length)
filesFilter(opt, files);
});
//# sourceMappingURL=extract.js.map
@@ -0,0 +1,82 @@
# Util
<!--introduced_in=v1.2.0-->
<!--type=module-->
<!-- source_link=lib/core/util.js -->
> Stability: 2 - Stable
A small set of utility helpers exposed for third-party implementations of the
[`Dispatcher`][] API. They cover the header-handling primitives undici uses
internally, so that custom dispatchers and handlers can normalize header names
and parse raw header lists exactly the way undici does.
```mjs
import { util } from 'undici'
const { parseHeaders, headerNameToString } = util
```
```cjs
const { util } = require('undici')
const { parseHeaders, headerNameToString } = util
```
## `parseHeaders(headers[, obj])`
<!-- YAML
added: v1.2.0
changes:
- version: v6.1.0
pr-url: https://github.com/nodejs/undici/pull/2501
description: Header names supplied as a `Buffer` are accepted and normalized.
-->
* `headers` {Array} A flat list of raw header entries where even indices are
header names and odd indices are the corresponding values. Each entry is a
{string}, {Buffer}, or an array of {string}/{Buffer}.
* `obj` {Record<string, string|string[]>} An object to assign the parsed values
to. When omitted, a new object is created. **Default:** `{}`.
* Returns: {Record<string, string|string[]>} The object the parsed headers were
assigned to. When `obj` is provided, the same reference is returned.
Receives a flat list of raw header name/value pairs and returns them as an
object keyed by lowercased header name. Header names are normalized with
[`headerNameToString()`][], and `Buffer` values are decoded as `latin1`. When a
header name appears more than once, its values are collected into an array.
```mjs
import { util } from 'undici'
const raw = ['Content-Type', 'text/plain', 'Set-Cookie', 'a=1', 'Set-Cookie', 'b=2']
console.log(util.parseHeaders(raw))
// { 'content-type': 'text/plain', 'set-cookie': [ 'a=1', 'b=2' ] }
```
## `headerNameToString(value)`
<!-- YAML
added: v6.1.0
-->
* `value` {string|Buffer} The header name to normalize.
* Returns: {string} The lowercased header name.
Returns the lowercased form of a header name. The `value` may be provided as a
{string} or as a {Buffer}, in which case it is decoded as `latin1`. Common
header names are resolved through an internal lookup table for performance.
```mjs
import { util } from 'undici'
console.log(util.headerNameToString('Content-Type'))
// 'content-type'
console.log(util.headerNameToString(Buffer.from('X-Custom-Header')))
// 'x-custom-header'
```
[`Dispatcher`]: Dispatcher.md#class-dispatcher
[`headerNameToString()`]: #headernametostringvalue
@@ -0,0 +1,168 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const index_js_1 = require("../../client/index.js");
const streamableHttp_js_1 = require("../../client/streamableHttp.js");
const sse_js_1 = require("../../client/sse.js");
const types_js_1 = require("../../types.js");
/**
* Simplified Backwards Compatible MCP Client
*
* This client demonstrates backward compatibility with both:
* 1. Modern servers using Streamable HTTP transport (protocol version 2025-03-26)
* 2. Older servers using HTTP+SSE transport (protocol version 2024-11-05)
*
* Following the MCP specification for backwards compatibility:
* - Attempts to POST an initialize request to the server URL first (modern transport)
* - If that fails with 4xx status, falls back to GET request for SSE stream (older transport)
*/
// Command line args processing
const args = process.argv.slice(2);
const serverUrl = args[0] || 'http://localhost:3000/mcp';
async function main() {
console.log('MCP Backwards Compatible Client');
console.log('===============================');
console.log(`Connecting to server at: ${serverUrl}`);
let client;
let transport;
try {
// Try connecting with automatic transport detection
const connection = await connectWithBackwardsCompatibility(serverUrl);
client = connection.client;
transport = connection.transport;
// Set up notification handler
client.setNotificationHandler(types_js_1.LoggingMessageNotificationSchema, notification => {
console.log(`Notification: ${notification.params.level} - ${notification.params.data}`);
});
// DEMO WORKFLOW:
// 1. List available tools
console.log('\n=== Listing Available Tools ===');
await listTools(client);
// 2. Call the notification tool
console.log('\n=== Starting Notification Stream ===');
await startNotificationTool(client);
// 3. Wait for all notifications (5 seconds)
console.log('\n=== Waiting for all notifications ===');
await new Promise(resolve => setTimeout(resolve, 5000));
// 4. Disconnect
console.log('\n=== Disconnecting ===');
await transport.close();
console.log('Disconnected from MCP server');
}
catch (error) {
console.error('Error running client:', error);
process.exit(1);
}
}
/**
* Connect to an MCP server with backwards compatibility
* Following the spec for client backward compatibility
*/
async function connectWithBackwardsCompatibility(url) {
console.log('1. Trying Streamable HTTP transport first...');
// Step 1: Try Streamable HTTP transport first
const client = new index_js_1.Client({
name: 'backwards-compatible-client',
version: '1.0.0'
});
client.onerror = error => {
console.error('Client error:', error);
};
const baseUrl = new URL(url);
try {
// Create modern transport
const streamableTransport = new streamableHttp_js_1.StreamableHTTPClientTransport(baseUrl);
await client.connect(streamableTransport);
console.log('Successfully connected using modern Streamable HTTP transport.');
return {
client,
transport: streamableTransport,
transportType: 'streamable-http'
};
}
catch (error) {
// Step 2: If transport fails, try the older SSE transport
console.log(`StreamableHttp transport connection failed: ${error}`);
console.log('2. Falling back to deprecated HTTP+SSE transport...');
try {
// Create SSE transport pointing to /sse endpoint
const sseTransport = new sse_js_1.SSEClientTransport(baseUrl);
const sseClient = new index_js_1.Client({
name: 'backwards-compatible-client',
version: '1.0.0'
});
await sseClient.connect(sseTransport);
console.log('Successfully connected using deprecated HTTP+SSE transport.');
return {
client: sseClient,
transport: sseTransport,
transportType: 'sse'
};
}
catch (sseError) {
console.error(`Failed to connect with either transport method:\n1. Streamable HTTP error: ${error}\n2. SSE error: ${sseError}`);
throw new Error('Could not connect to server with any available transport');
}
}
}
/**
* List available tools on the server
*/
async function listTools(client) {
try {
const toolsRequest = {
method: 'tools/list',
params: {}
};
const toolsResult = await client.request(toolsRequest, types_js_1.ListToolsResultSchema);
console.log('Available tools:');
if (toolsResult.tools.length === 0) {
console.log(' No tools available');
}
else {
for (const tool of toolsResult.tools) {
console.log(` - ${tool.name}: ${tool.description}`);
}
}
}
catch (error) {
console.log(`Tools not supported by this server: ${error}`);
}
}
/**
* Start a notification stream by calling the notification tool
*/
async function startNotificationTool(client) {
try {
// Call the notification tool using reasonable defaults
const request = {
method: 'tools/call',
params: {
name: 'start-notification-stream',
arguments: {
interval: 1000, // 1 second between notifications
count: 5 // Send 5 notifications
}
}
};
console.log('Calling notification tool...');
const result = await client.request(request, types_js_1.CallToolResultSchema);
console.log('Tool result:');
result.content.forEach(item => {
if (item.type === 'text') {
console.log(` ${item.text}`);
}
else {
console.log(` ${item.type} content:`, item);
}
});
}
catch (error) {
console.log(`Error calling notification tool: ${error}`);
}
}
// Start the client
main().catch((error) => {
console.error('Error running MCP client:', error);
process.exit(1);
});
//# sourceMappingURL=streamableHttpWithSseFallbackClient.js.map
@@ -0,0 +1 @@
{"version":3,"file":"octagon-alert.js","sources":["../../../src/icons/octagon-alert.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name OctagonAlert\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTZoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xMiA4djQiIC8+CiAgPHBhdGggZD0iTTE1LjMxMiAyYTIgMiAwIDAgMSAxLjQxNC41ODZsNC42ODggNC42ODhBMiAyIDAgMCAxIDIyIDguNjg4djYuNjI0YTIgMiAwIDAgMS0uNTg2IDEuNDE0bC00LjY4OCA0LjY4OGEyIDIgMCAwIDEtMS40MTQuNTg2SDguNjg4YTIgMiAwIDAgMS0xLjQxNC0uNTg2bC00LjY4OC00LjY4OEEyIDIgMCAwIDEgMiAxNS4zMTJWOC42ODhhMiAyIDAgMCAxIC41ODYtMS40MTRsNC42ODgtNC42ODhBMiAyIDAgMCAxIDguNjg4IDJ6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/octagon-alert\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 OctagonAlert = createLucideIcon('OctagonAlert', [\n ['path', { d: 'M12 16h.01', key: '1drbdi' }],\n ['path', { d: 'M12 8v4', key: '1got3b' }],\n [\n 'path',\n {\n d: 'M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z',\n key: '1fd625',\n },\n ],\n]);\n\nexport default OctagonAlert;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,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,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,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,41 @@
/**
* Verifying JSON Web Signature (JWS) in General JSON Serialization
*
* @module
*/
import type * as types from '../../types.d.ts';
/**
* Interface for General JWS Verification dynamic key resolution. No token components have been
* verified at the time of this function call.
*
* @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
*/
export interface GeneralVerifyGetKey extends types.GenericGetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, types.CryptoKey | types.KeyObject | types.JWK | Uint8Array> {
}
/**
* Verifies the signature and format of and afterwards decodes the General JWS.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/jws/general/verify'`.
*
* > [!NOTE]\
* > The function iterates over the `signatures` array in the General JWS and returns the verification
* > result of the first signature entry that can be successfully verified. The result only contains
* > the payload, protected header, and unprotected header of that successfully verified signature
* > entry. Other signature entries in the General JWS are not validated, and their headers are not
* > included in the returned result. Recipients of a General JWS should only rely on the returned
* > (verified) data.
*
* @param jws General JWS.
* @param key Key to verify the JWS with. See
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
* @param options JWS Verify options.
*/
export declare function generalVerify(jws: types.GeneralJWSInput, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult>;
/**
* @param jws General JWS.
* @param getKey Function resolving a key to verify the JWS with. See
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
* @param options JWS Verify options.
*/
export declare function generalVerify(jws: types.GeneralJWSInput, getKey: GeneralVerifyGetKey, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult & types.ResolvedKey>;
@@ -0,0 +1,350 @@
'use strict'
const { URL } = require('node:url')
let tls // include tls conditionally since it is not always available
const DispatcherBase = require('./dispatcher-base')
const { ConnectTimeoutError, InvalidArgumentError } = require('../core/errors')
const { Socks5Client, STATES } = require('../core/socks5-client')
const { kBusy, kConnected, kDispatch, kClose, kDestroy } = require('../core/symbols')
const Pool = require('./pool')
const buildConnector = require('../core/connect')
const { setupConnectTimeout } = require('../core/util')
const { debuglog } = require('node:util')
const debug = debuglog('undici:socks5-proxy')
const DEFAULT_SOCKS5_CONNECT_TIMEOUT = 5000
const kProxyUrl = Symbol('proxy url')
const kProxyHeaders = Symbol('proxy headers')
const kProxyAuth = Symbol('proxy auth')
const kProxyProtocol = Symbol('proxy protocol')
const kPools = Symbol('pools')
const kConnector = Symbol('connector')
const kConnectTimeout = Symbol('connect timeout')
const kRequestTls = Symbol('request tls settings')
const kRequestTlsTimeout = Symbol('request tls timeout')
function createConnectTimeoutError (hostname, port, timeout) {
return new ConnectTimeoutError(
`Connect Timeout Error (attempted address: ${hostname}:${port}, timeout: ${timeout}ms)`
)
}
// Static flag to ensure warning is only emitted once per process
let experimentalWarningEmitted = false
/**
* SOCKS5 proxy agent for dispatching requests through a SOCKS5 proxy
*/
class Socks5ProxyAgent extends DispatcherBase {
constructor (proxyUrl, options = {}) {
super(options)
// Emit experimental warning only once
if (!experimentalWarningEmitted) {
process.emitWarning(
'SOCKS5 proxy support is experimental and subject to change',
'ExperimentalWarning'
)
experimentalWarningEmitted = true
}
if (!proxyUrl) {
throw new InvalidArgumentError('Proxy URL is mandatory')
}
// Parse proxy URL
const url = typeof proxyUrl === 'string' ? new URL(proxyUrl) : proxyUrl
if (url.protocol !== 'socks5:' && url.protocol !== 'socks:') {
throw new InvalidArgumentError('Proxy URL must use socks5:// or socks:// protocol')
}
this[kProxyUrl] = url
this[kProxyHeaders] = options.headers || {}
this[kProxyProtocol] = options.proxyTls ? 'https:' : 'http:'
const connectTimeout = options.connectTimeout ?? DEFAULT_SOCKS5_CONNECT_TIMEOUT
if (!Number.isFinite(connectTimeout) || connectTimeout < 0) {
throw new InvalidArgumentError('invalid connectTimeout')
}
this[kConnectTimeout] = connectTimeout
const { timeout, ...requestTls } = options.requestTls || {}
const requestTlsTimeout = timeout ?? connectTimeout
if (!Number.isFinite(requestTlsTimeout) || requestTlsTimeout < 0) {
throw new InvalidArgumentError('invalid requestTls.timeout')
}
this[kRequestTls] = requestTls
this[kRequestTlsTimeout] = requestTlsTimeout
// Extract auth from URL or options
this[kProxyAuth] = {
username: options.username || (url.username ? decodeURIComponent(url.username) : null),
password: options.password || (url.password ? decodeURIComponent(url.password) : null)
}
// Create connector for proxy connection
const proxyTlsTimeout = options.proxyTls?.timeout ?? connectTimeout
if (!Number.isFinite(proxyTlsTimeout) || proxyTlsTimeout < 0) {
throw new InvalidArgumentError('invalid proxyTls.timeout')
}
this[kConnector] = options.connect || buildConnector({
...options.proxyTls,
timeout: proxyTlsTimeout,
servername: options.proxyTls?.servername || url.hostname
})
// Pools for the actual HTTP connections (with SOCKS5 tunnel connect function), keyed by origin
this[kPools] = new Map()
}
/**
* Create a SOCKS5 connection to the proxy
*/
async createSocks5Connection (targetHost, targetPort) {
const proxyHost = this[kProxyUrl].hostname
const proxyPort = parseInt(this[kProxyUrl].port) || 1080
debug('creating SOCKS5 connection to', proxyHost, proxyPort)
// Connect to the SOCKS5 proxy
const socketReady = Promise.withResolvers()
this[kConnector]({
hostname: proxyHost,
host: proxyHost,
port: proxyPort,
protocol: this[kProxyProtocol]
}, (err, socket) => {
if (err) {
socketReady.reject(err)
} else {
socketReady.resolve(socket)
}
})
const socket = await socketReady.promise
// Create SOCKS5 client
const socks5Client = new Socks5Client(socket, this[kProxyAuth])
// Handle SOCKS5 errors
socks5Client.on('error', (err) => {
debug('SOCKS5 error:', err)
socket.destroy()
})
// Perform SOCKS5 handshake
await socks5Client.handshake()
// Wait for authentication (if required)
const authenticationReady = Promise.withResolvers()
const authenticationTimeout = this[kConnectTimeout] === 0
? null
: setTimeout(() => {
cleanupAuthenticationListeners()
socks5Client.destroy()
authenticationReady.reject(
createConnectTimeoutError(proxyHost, proxyPort, this[kConnectTimeout])
)
}, this[kConnectTimeout])
const cleanupAuthenticationListeners = () => {
clearTimeout(authenticationTimeout)
socks5Client.removeListener('authenticated', onAuthenticated)
socks5Client.removeListener('error', onAuthenticationError)
}
const onAuthenticated = () => {
cleanupAuthenticationListeners()
authenticationReady.resolve()
}
const onAuthenticationError = (err) => {
cleanupAuthenticationListeners()
authenticationReady.reject(err)
}
// Check if already authenticated (for NO_AUTH method)
if (socks5Client.state === STATES.AUTHENTICATED) {
clearTimeout(authenticationTimeout)
authenticationReady.resolve()
} else {
socks5Client.once('authenticated', onAuthenticated)
socks5Client.once('error', onAuthenticationError)
}
await authenticationReady.promise
// Send CONNECT command
await socks5Client.connect(targetHost, targetPort)
// Wait for connection
const connectionReady = Promise.withResolvers()
const connectionTimeout = this[kConnectTimeout] === 0
? null
: setTimeout(() => {
cleanupConnectionListeners()
socks5Client.destroy()
connectionReady.reject(
createConnectTimeoutError(targetHost, targetPort, this[kConnectTimeout])
)
}, this[kConnectTimeout])
const cleanupConnectionListeners = () => {
clearTimeout(connectionTimeout)
socks5Client.removeListener('connected', onConnected)
socks5Client.removeListener('error', onConnectionError)
}
const onConnected = (info) => {
debug('SOCKS5 tunnel established to', targetHost, targetPort, 'via', info)
cleanupConnectionListeners()
connectionReady.resolve()
}
const onConnectionError = (err) => {
cleanupConnectionListeners()
connectionReady.reject(err)
}
socks5Client.once('connected', onConnected)
socks5Client.once('error', onConnectionError)
await connectionReady.promise
return socket
}
/**
* Dispatch a request through the SOCKS5 proxy
*/
[kDispatch] (opts, handler) {
const { origin } = opts
debug('dispatching request to', origin, 'via SOCKS5')
try {
const originKey = String(origin)
let pool = this[kPools].get(originKey)
// Create a Pool per origin so requests are not routed to the wrong host
if (!pool || pool.destroyed || pool.closed) {
pool = new Pool(origin, {
pipelining: opts.pipelining,
connections: opts.connections,
connect: async (connectOpts, callback) => {
try {
const url = new URL(origin)
const targetHost = url.hostname
const targetPort = parseInt(url.port) || (url.protocol === 'https:' ? 443 : 80)
debug('establishing SOCKS5 connection to', targetHost, targetPort)
// Create SOCKS5 tunnel
const socket = await this.createSocks5Connection(targetHost, targetPort)
// Handle TLS if needed
let finalSocket = socket
if (url.protocol === 'https:') {
if (!tls) {
tls = require('node:tls')
}
debug('upgrading to TLS')
finalSocket = tls.connect({
...this[kRequestTls],
socket,
servername: this[kRequestTls]?.servername || targetHost
})
const tlsReady = Promise.withResolvers()
const cleanupTlsListeners = () => {
queueMicrotask(clearTlsTimeout)
finalSocket.removeListener('secureConnect', onSecureConnect)
finalSocket.removeListener('error', onTlsError)
}
const onSecureConnect = () => {
cleanupTlsListeners()
tlsReady.resolve()
}
const onTlsError = (err) => {
cleanupTlsListeners()
tlsReady.reject(err)
}
const clearTlsTimeout = setupConnectTimeout(new WeakRef(finalSocket), {
timeout: this[kRequestTlsTimeout],
hostname: targetHost,
port: targetPort
})
finalSocket.once('secureConnect', onSecureConnect)
finalSocket.once('error', onTlsError)
await tlsReady.promise
}
callback(null, finalSocket)
} catch (err) {
debug('SOCKS5 connection error:', err)
callback(err)
}
}
})
this[kPools].set(originKey, pool)
const closePoolIfUnused = () => {
if (this[kPools].get(originKey) !== pool || pool[kConnected] > 0 || pool[kBusy]) {
return
}
this[kPools].delete(originKey)
if (!pool.destroyed) {
pool.close()
}
}
pool.on('disconnect', closePoolIfUnused)
pool.on('connectionError', closePoolIfUnused)
}
// Dispatch the request through the per-origin pool
return pool[kDispatch](opts, handler)
} catch (err) {
debug('dispatch error:', err)
if (typeof handler.onResponseError === 'function') {
handler.onResponseError(null, err)
return false
} else if (typeof handler.onError === 'function') {
handler.onError(err)
return false
} else {
throw err
}
}
}
async [kClose] () {
const closePromises = []
for (const pool of this[kPools].values()) {
closePromises.push(pool.close())
}
this[kPools].clear()
await Promise.all(closePromises)
}
async [kDestroy] (err) {
const destroyPromises = []
for (const pool of this[kPools].values()) {
destroyPromises.push(pool.destroy(err))
}
this[kPools].clear()
await Promise.all(destroyPromises)
}
}
module.exports = Socks5ProxyAgent
@@ -0,0 +1 @@
{"version":3,"file":"sseAndStreamableHttpCompatibleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAkB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;;;;;GASG;AAEH,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,SAAS,CACxB;QACI,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACnB,EACD,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CACpC,CAAC;IAEF,4DAA4D;IAC5D,MAAM,CAAC,YAAY,CACf,2BAA2B,EAC3B;QACI,WAAW,EAAE,gEAAgE;QAC7E,WAAW,EAAE;YACT,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC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ucide-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 ShoppingCart = createLucideIcon("ShoppingCart", [
["circle", { cx: "8", cy: "21", r: "1", key: "jimo8o" }],
["circle", { cx: "19", cy: "21", r: "1", key: "13723u" }],
[
"path",
{
d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",
key: "9zh506"
}
]
]);
export { ShoppingCart as default };
//# sourceMappingURL=shopping-cart.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_7D","2":"J"},E:{"1":"_nB","2":"_k"},F:{"1":"_oB","2":"F"},G:{"1":"_M"},H:{"2":"1D"},I:{"1":"_8B","132":"_n"},J:{"1":"A","132":"D"},K:{"1":"_N"},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:1,C:"Email, telephone & URL input types",D:true};
@@ -0,0 +1,194 @@
import { K as isSingleLine, O as getNextLocation, f as createRule, g as import_ast_utils, m as AST_NODE_TYPES, t as FixTracker } from "../utils.js";
var semi_default = createRule({
name: "semi",
meta: {
type: "layout",
docs: { description: "Require or disallow semicolons instead of ASI" },
fixable: "code",
schema: { anyOf: [{
type: "array",
items: [{
type: "string",
enum: ["never"]
}, {
type: "object",
properties: { beforeStatementContinuationChars: {
type: "string",
enum: [
"always",
"any",
"never"
]
} },
additionalProperties: false
}],
minItems: 0,
maxItems: 2
}, {
type: "array",
items: [{
type: "string",
enum: ["always"]
}, {
type: "object",
properties: {
omitLastInOneLineBlock: { type: "boolean" },
omitLastInOneLineClassBody: { type: "boolean" }
},
additionalProperties: false
}],
minItems: 0,
maxItems: 2
}] },
defaultOptions: ["always"],
messages: {
missingSemi: "Missing semicolon.",
extraSemi: "Extra semicolon."
}
},
create(context, [mode, options]) {
const OPT_OUT_PATTERN = /^[-[(/+`]/u;
const unsafeClassFieldNames = new Set([
"get",
"set",
"static"
]);
const unsafeClassFieldFollowers = new Set([
"*",
"in",
"instanceof"
]);
const never = mode === "never";
const exceptOneLine = Boolean(options && "omitLastInOneLineBlock" in options && options.omitLastInOneLineBlock);
const exceptOneLineClassBody = Boolean(options && "omitLastInOneLineClassBody" in options && options.omitLastInOneLineClassBody);
const beforeStatementContinuationChars = options && "beforeStatementContinuationChars" in options && options.beforeStatementContinuationChars || "any";
const sourceCode = context.sourceCode;
function report(node, missing = false) {
const lastToken = sourceCode.getLastToken(node);
let messageId = "missingSemi";
let fix, loc;
if (!missing) {
loc = {
start: lastToken.loc.end,
end: getNextLocation(sourceCode, lastToken.loc.end)
};
fix = function(fixer) {
return fixer.insertTextAfter(lastToken, ";");
};
} else {
messageId = "extraSemi";
loc = lastToken.loc;
fix = function(fixer) {
return new FixTracker(fixer, sourceCode).retainSurroundingTokens(lastToken).remove(lastToken);
};
}
context.report({
node,
loc,
messageId,
fix
});
}
function isRedundantSemi(semiToken) {
const nextToken = sourceCode.getTokenAfter(semiToken);
return !nextToken || (0, import_ast_utils.isClosingBraceToken)(nextToken) || (0, import_ast_utils.isSemicolonToken)(nextToken);
}
function isEndOfArrowBlock(lastToken) {
if (!(0, import_ast_utils.isClosingBraceToken)(lastToken)) return false;
const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]);
return node.type === "BlockStatement" && node.parent.type === "ArrowFunctionExpression";
}
function maybeClassFieldAsiHazard(node) {
if (node.type !== "PropertyDefinition") return false;
if (!node.computed && node.key.type === "Identifier" && "name" in node.key && unsafeClassFieldNames.has(node.key.name)) {
if (!(node.static && node.key.name === "static") && !node.value) return true;
}
const followingToken = sourceCode.getTokenAfter(node);
return unsafeClassFieldFollowers.has(followingToken.value);
}
function isOnSameLineWithNextToken(node) {
const prevToken = sourceCode.getLastToken(node, 1);
const nextToken = sourceCode.getTokenAfter(node);
return !!nextToken && (0, import_ast_utils.isTokenOnSameLine)(prevToken, nextToken);
}
function maybeAsiHazardAfter(node) {
const t = node.type;
if (t === "DoWhileStatement" || t === "BreakStatement" || t === "ContinueStatement" || t === "DebuggerStatement" || t === "ImportDeclaration" || t === "ExportAllDeclaration") return false;
if (t === "ReturnStatement") return Boolean(node.argument);
if (t === "ExportNamedDeclaration") return Boolean(node.declaration);
if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) return false;
return true;
}
function maybeAsiHazardBefore(token) {
return Boolean(token) && OPT_OUT_PATTERN.test(token.value) && token.value !== "++" && token.value !== "--";
}
function canRemoveSemicolon(node) {
if (isRedundantSemi(sourceCode.getLastToken(node))) return true;
if (maybeClassFieldAsiHazard(node)) return false;
if (isOnSameLineWithNextToken(node)) return false;
if (node.type !== "PropertyDefinition" && beforeStatementContinuationChars === "never" && !maybeAsiHazardAfter(node)) return true;
if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) return true;
return false;
}
function isLastInOneLinerBlock(node) {
const parent = node.parent;
const nextToken = sourceCode.getTokenAfter(node);
if (!nextToken || nextToken.value !== "}") return false;
if (parent.type === "BlockStatement") return isSingleLine(parent);
if (parent.type === "StaticBlock") return (0, import_ast_utils.isTokenOnSameLine)(parent, sourceCode.getFirstToken(parent, { skip: 1 }));
return false;
}
function isLastInOneLinerClassBody(node) {
const parent = node.parent;
const nextToken = sourceCode.getTokenAfter(node);
if (!nextToken || nextToken.value !== "}") return false;
if (parent.type === "ClassBody") return isSingleLine(parent);
return false;
}
function checkForSemicolon(node) {
const isSemi = (0, import_ast_utils.isSemicolonToken)(sourceCode.getLastToken(node));
if (never) {
const nextToken = sourceCode.getTokenAfter(node);
if (isSemi && canRemoveSemicolon(node)) report(node, true);
else if (!isSemi && beforeStatementContinuationChars === "always" && node.type !== "PropertyDefinition" && maybeAsiHazardBefore(nextToken)) report(node);
} else {
const oneLinerBlock = exceptOneLine && isLastInOneLinerBlock(node);
const oneLinerClassBody = exceptOneLineClassBody && isLastInOneLinerClassBody(node);
const oneLinerBlockOrClassBody = oneLinerBlock || oneLinerClassBody;
if (isSemi && oneLinerBlockOrClassBody) report(node, true);
else if (!isSemi && !oneLinerBlockOrClassBody) report(node);
}
}
return {
VariableDeclaration(node) {
const parent = node.parent;
if ((parent.type !== "ForStatement" || parent.init !== node) && (!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node)) checkForSemicolon(node);
},
ExpressionStatement: checkForSemicolon,
ReturnStatement: checkForSemicolon,
ThrowStatement: checkForSemicolon,
DoWhileStatement: checkForSemicolon,
DebuggerStatement: checkForSemicolon,
BreakStatement: checkForSemicolon,
ContinueStatement: checkForSemicolon,
ImportDeclaration: checkForSemicolon,
ExportAllDeclaration: checkForSemicolon,
ExportNamedDeclaration(node) {
if (!node.declaration) checkForSemicolon(node);
},
ExportDefaultDeclaration(node) {
if (node.declaration.type === AST_NODE_TYPES.TSInterfaceDeclaration) return;
if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) checkForSemicolon(node);
},
PropertyDefinition: checkForSemicolon,
AccessorProperty: checkForSemicolon,
TSAbstractPropertyDefinition: checkForSemicolon,
TSDeclareFunction: checkForSemicolon,
TSExportAssignment: checkForSemicolon,
TSImportEqualsDeclaration: checkForSemicolon,
TSTypeAliasDeclaration: checkForSemicolon,
TSEmptyBodyFunctionExpression: checkForSemicolon
};
}
});
export { semi_default as t };
@@ -0,0 +1,34 @@
/**
* Un-escape a string that has been escaped with {@link escape}.
*
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
* square-bracket escapes are removed, but not backslash escapes.
*
* For example, it will turn the string `'[*]'` into `*`, but it will not
* turn `'\\*'` into `'*'`, because `\` is a path separator in
* `windowsPathsNoEscape` mode.
*
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
* backslash escapes are removed.
*
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
* or unescaped.
*
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
* unescaped.
*/
export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
if (magicalBraces) {
return windowsPathsNoEscape ?
s.replace(/\[([^/\\])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
.replace(/\\([^/])/g, '$1');
}
return windowsPathsNoEscape ?
s.replace(/\[([^/\\{}])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
.replace(/\\([^/{}])/g, '$1');
};
//# sourceMappingURL=unescape.js.map
@@ -0,0 +1,18 @@
/**
* @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 FileBadge2 = createLucideIcon("FileBadge2", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "m14 12.5 1 5.5-3-1-3 1 1-5.5", key: "14xlky" }]
]);
export { FileBadge2 as default };
//# sourceMappingURL=file-badge-2.js.map
@@ -0,0 +1,89 @@
# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
Correctly stops looking after an `--` argument terminator.
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
---
## Install
```
$ npm install has-flag
```
## Usage
```js
// foo.js
const hasFlag = require('has-flag');
hasFlag('unicorn');
//=> true
hasFlag('--unicorn');
//=> true
hasFlag('f');
//=> true
hasFlag('-f');
//=> true
hasFlag('foo=bar');
//=> true
hasFlag('foo');
//=> false
hasFlag('rainbow');
//=> false
```
```
$ node foo.js -f --unicorn --foo=bar -- --rainbow
```
## API
### hasFlag(flag, [argv])
Returns a boolean for whether the flag exists.
#### flag
Type: `string`
CLI flag to look for. The `--` prefix is optional.
#### argv
Type: `string[]`<br>
Default: `process.argv`
CLI arguments.
## Security
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -0,0 +1 @@
{"version":3,"file":"reverse.cjs","sources":["../../../../../src/matcher/dictionary/variants/matching/reverse.ts"],"sourcesContent":[null],"names":["MatchReverse","MatchDictionary","match","matchOptions","passwordReversed","password","split","reverse","join","map","token","reversed","i","length","j"],"mappings":";;;;AAIA;;;;AAIG;AACH,MAAMA,YAAa,SAAQC,QAAe,CAAA;EACjCC,KAAKA,CAACC,YAAoC,EAAA;AAC/C,IAAA,MAAMC,gBAAgB,GAAGD,YAAY,CAACE,QAAQ,CAACC,KAAK,CAAC,EAAE,CAAC,CAACC,OAAO,EAAE,CAACC,IAAI,CAAC,EAAE,CAAC;IAC3E,OAAO,KAAK,CACTN,KAAK,CAAC;AACL,MAAA,GAAGC,YAAY;AACfE,MAAAA,QAAQ,EAAED;KACX,CAAC,CACDK,GAAG,CAAEP,KAAsB,KAAM;AAChC,MAAA,GAAGA,KAAK;AACRQ,MAAAA,KAAK,EAAER,KAAK,CAACQ,KAAK,CAACJ,KAAK,CAAC,EAAE,CAAC,CAACC,OAAO,EAAE,CAACC,IAAI,CAAC,EAAE,CAAC;AAAE;AACjDG,MAAAA,QAAQ,EAAE,IAAI;AACd;MACAC,CAAC,EAAET,YAAY,CAACE,QAAQ,CAACQ,MAAM,GAAG,CAAC,GAAGX,KAAK,CAACY,CAAC;MAC7CA,CAAC,EAAEX,YAAY,CAACE,QAAQ,CAACQ,MAAM,GAAG,CAAC,GAAGX,KAAK,CAACU;AAC7C,KAAA,CAAC,CAAC;AACP,EAAA;AACD;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"use-visual-state.mjs","sources":["../../../../src/motion/utils/use-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState<Instance, RenderState> {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState<Instance, RenderState> = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState<Instance, RenderState>\n\nexport interface UseVisualStateConfig<RenderState> {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState<I, RS>(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig<RS>,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState<I, RS> = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n <I, RS>(config: UseVisualStateConfig<RS>): UseVisualState<I, RS> =>\n (props: MotionProps, isStatic: boolean): VisualState<I, RS> => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n"],"names":[],"mappings":";;;;;;;AAqCA;AASI;;;;AAUA;AACJ;AAEA;;;AASI;;;AAIA;ALine truncated
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ChartBarBig = createLucideIcon("ChartBarBig", [
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
["rect", { x: "7", y: "13", width: "9", height: "4", rx: "1", key: "1iip1u" }],
["rect", { x: "7", y: "5", width: "12", height: "4", rx: "1", key: "1anskk" }]
]);
export { ChartBarBig as default };
//# sourceMappingURL=chart-bar-big.js.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Espen Hovlandsdal <espen@hovlandsdal.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,123 @@
declare class MockerRegistry {
private readonly registryByUrl;
private readonly registryById;
clear(): void;
keys(): IterableIterator<string>;
add(mock: MockedModule): void;
register(json: MockedModuleSerialized): MockedModule;
register(type: "redirect", raw: string, id: string, url: string, redirect: string): RedirectedModule;
register(type: "manual", raw: string, id: string, url: string, factory: () => any): ManualMockedModule;
register(type: "automock", raw: string, id: string, url: string): AutomockedModule;
register(type: "autospy", id: string, raw: string, url: string): AutospiedModule;
delete(id: string): void;
deleteById(id: string): void;
get(id: string): MockedModule | undefined;
getById(id: string): MockedModule | undefined;
has(id: string): boolean;
}
type MockedModule = AutomockedModule | AutospiedModule | ManualMockedModule | RedirectedModule;
type MockedModuleType = "automock" | "autospy" | "manual" | "redirect";
type MockedModuleSerialized = AutomockedModuleSerialized | AutospiedModuleSerialized | ManualMockedModuleSerialized | RedirectedModuleSerialized;
declare class AutomockedModule {
raw: string;
id: string;
url: string;
readonly type = "automock";
constructor(raw: string, id: string, url: string);
static fromJSON(data: AutomockedModuleSerialized): AutospiedModule;
toJSON(): AutomockedModuleSerialized;
}
interface AutomockedModuleSerialized {
type: "automock";
url: string;
raw: string;
id: string;
}
declare class AutospiedModule {
raw: string;
id: string;
url: string;
readonly type = "autospy";
constructor(raw: string, id: string, url: string);
static fromJSON(data: AutospiedModuleSerialized): AutospiedModule;
toJSON(): AutospiedModuleSerialized;
}
interface AutospiedModuleSerialized {
type: "autospy";
url: string;
raw: string;
id: string;
}
declare class RedirectedModule {
raw: string;
id: string;
url: string;
redirect: string;
readonly type = "redirect";
constructor(raw: string, id: string, url: string, redirect: string);
static fromJSON(data: RedirectedModuleSerialized): RedirectedModule;
toJSON(): RedirectedModuleSerialized;
}
interface RedirectedModuleSerialized {
type: "redirect";
url: string;
id: string;
raw: string;
redirect: string;
}
declare class ManualMockedModule<T = any> {
raw: string;
id: string;
url: string;
factory: () => T;
cache: T | undefined;
readonly type = "manual";
constructor(raw: string, id: string, url: string, factory: () => T);
resolve(): T;
static fromJSON(data: ManualMockedModuleSerialized, factory: () => any): ManualMockedModule;
toJSON(): ManualMockedModuleSerialized;
}
interface ManualMockedModuleSerialized {
type: "manual";
url: string;
id: string;
raw: string;
}
type Awaitable<T> = T | PromiseLike<T>;
type ModuleMockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M = M>() => Promise<T>) => Awaitable<Partial<M>>;
type ModuleMockFactory = () => any;
interface ModuleMockOptions {
spy?: boolean;
}
interface ServerMockResolution {
mockType: "manual" | "redirect" | "automock" | "autospy";
resolvedId: string;
resolvedUrl: string;
needsInterop?: boolean;
redirectUrl?: string | null;
}
interface ServerIdResolution {
id: string;
url: string;
optimized: boolean;
}
interface ModuleMockContext {
/**
* When mocking with a factory, this refers to the module that imported the mock.
*/
callstack: null | string[];
}
interface TestModuleMocker {
queueMock(id: string, importer: string, factoryOrOptions?: ModuleMockFactory | ModuleMockOptions): void;
queueUnmock(id: string, importer: string): void;
importActual<T>(rawId: string, importer: string, callstack?: string[] | null): Promise<T>;
importMock(rawId: string, importer: string): Promise<any>;
mockObject(object: Record<string | symbol, any>, moduleType?: "automock" | "autospy"): Record<string | symbol, any>;
mockObject(object: Record<string | symbol, any>, mockExports: Record<string | symbol, any> | undefined, moduleType?: "automock" | "autospy"): Record<string | symbol, any>;
getMockContext(): ModuleMockContext;
reset(): void;
}
export { AutomockedModule as A, MockerRegistry as M, RedirectedModule as R, AutospiedModule as h, ManualMockedModule as j };
export type { ServerMockResolution as S, TestModuleMocker as T, MockedModule as a, ModuleMockOptions as b, ModuleMockFactoryWithHelper as c, MockedModuleType as d, ModuleMockContext as e, ServerIdResolution as f, AutomockedModuleSerialized as g, AutospiedModuleSerialized as i, ManualMockedModuleSerialized as k, MockedModuleSerialized as l, ModuleMockFactory as m, RedirectedModuleSerialized as n };
@@ -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 SquarePlay = createLucideIcon("SquarePlay", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "m9 8 6 4-6 4Z", key: "f1r3lt" }]
]);
export { SquarePlay as default };
//# sourceMappingURL=square-play.js.map
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Warehouse = createLucideIcon("Warehouse", [
[
"path",
{
d: "M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z",
key: "gksnxg"
}
],
["path", { d: "M6 18h12", key: "9pbo8z" }],
["path", { d: "M6 14h12", key: "4cwo0f" }],
["rect", { width: "12", height: "12", x: "6", y: "10", key: "apd30q" }]
]);
export { Warehouse as default };
//# sourceMappingURL=warehouse.js.map
@@ -0,0 +1,7 @@
import Dispatcher from './dispatcher'
export default Dispatcher1Wrapper
declare class Dispatcher1Wrapper extends Dispatcher {
constructor (dispatcher: Dispatcher)
}
@@ -0,0 +1,55 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/middleware/context-storage/index.ts
/**
* @module
* Context Storage Middleware for Hono.
*/
const asyncLocalStorage = new (require("node:async_hooks")).AsyncLocalStorage();
/**
* Context Storage Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/context-storage}
*
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* type Env = {
* Variables: {
* message: string
* }
* }
*
* const app = new Hono<Env>()
*
* app.use(contextStorage())
*
* app.use(async (c, next) => {
* c.set('message', 'Hono is hot!!')
* await next()
* })
*
* app.get('/', async (c) => c.text(getMessage()))
*
* const getMessage = () => {
* return getContext<Env>().var.message
* }
* ```
*/
const contextStorage = () => {
return async function contextStorage(c, next) {
await asyncLocalStorage.run(c, next);
};
};
const tryGetContext = () => {
return asyncLocalStorage.getStore();
};
const getContext = () => {
const context = tryGetContext();
if (!context) throw new Error("Context is not available");
return context;
};
//#endregion
exports.contextStorage = contextStorage;
exports.getContext = getContext;
exports.tryGetContext = tryGetContext;
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Youtube = createLucideIcon("Youtube", [
[
"path",
{
d: "M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",
key: "1q2vi4"
}
],
["path", { d: "m10 15 5-3-5-3z", key: "1jp15x" }]
]);
export { Youtube as default };
//# sourceMappingURL=youtube.js.map
@@ -0,0 +1 @@
{"version":3,"file":"receipt-indian-rupee.js","sources":["../../../src/icons/receipt-indian-rupee.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ReceiptIndianRupee\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAydjIwbDItMSAyIDEgMi0xIDIgMSAyLTEgMiAxIDItMSAyIDFWMmwtMiAxLTItMS0yIDEtMi0xLTIgMS0yLTEtMiAxWiIgLz4KICA8cGF0aCBkPSJNOCA3aDgiIC8+CiAgPHBhdGggZD0iTTEyIDE3LjUgOCAxNWgxYTQgNCAwIDAgMCAwLTgiIC8+CiAgPHBhdGggZD0iTTggMTFoOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/receipt-indian-rupee\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 ReceiptIndianRupee = createLucideIcon('ReceiptIndianRupee', [\n [\n 'path',\n { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z', key: 'q3az6g' },\n ],\n ['path', { d: 'M8 7h8', key: 'i86dvs' }],\n ['path', { d: 'M12 17.5 8 15h1a4 4 0 0 0 0-8', key: 'grpkl4' }],\n ['path', { d: 'M8 11h8', key: 'vwpz6n' }],\n]);\n\nexport default ReceiptIndianRupee;\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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAChE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC9D,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;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright 2022 Andrey Sitnik <andrey@sitnik.ru> and other 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 @@
{"version":3,"names":["_importDeferProxy","init","ns","constValue","v","proxy","run","_target","p","receiver","Proxy","defineProperty","deleteProperty","get","Reflect","getOwnPropertyDescriptor","getPrototypeOf","isExtensible","has","ownKeys","preventExtensions","set","setPrototypeOf"],"sources":["../../src/helpers/importDeferProxy.ts"],"sourcesContent":["/* @minVersion 7.23.0 */\n\nexport default function _importDeferProxy<T extends object>(\n init: () => T,\n): ProxyHandler<T> {\n var ns: T | null = null;\n\n var constValue = function <V extends boolean | null>(v: V) {\n return function (): V {\n return v;\n };\n };\n\n var proxy = function (run: Function) {\n return function (_target: T, p?: string | symbol, receiver?: any) {\n if (ns === null) ns = init();\n return run(ns, p, receiver);\n };\n };\n\n return new Proxy(\n {},\n {\n defineProperty: constValue(false),\n deleteProperty: constValue(false),\n get: proxy(Reflect.get),\n getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor),\n getPrototypeOf: constValue(null),\n isExtensible: constValue(false),\n has: proxy(Reflect.has),\n ownKeys: proxy(Reflect.ownKeys),\n preventExtensions: constValue(true),\n set: constValue(false),\n setPrototypeOf: constValue(false),\n },\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,IAAa,EACI;EACjB,IAAIC,EAAY,GAAG,IAAI;EAEvB,IAAIC,UAAU,GAAG,SAAAA,CAAoCC,CAAI,EAAE;IACzD,OAAO,YAAe;MACpB,OAAOA,CAAC;IACV,CAAC;EACH,CAAC;EAED,IAAIC,KAAK,GAAG,SAAAA,CAAUC,GAAa,EAAE;IACnC,OAAO,UAAUC,OAAU,EAAEC,CAAmB,EAAEC,QAAc,EAAE;MAChE,IAAIP,EAAE,KAAK,IAAI,EAAEA,EAAE,GAAGD,IAAI,CAAC,CAAC;MAC5B,OAAOK,GAAG,CAACJ,EAAE,EAAEM,CAAC,EAAEC,QAAQ,CAAC;IAC7B,CAAC;EACH,CAAC;EAED,OAAO,IAAIC,KAAK,CACd,CAAC,CAAC,EACF;IACEC,cAAc,EAAER,UAAU,CAAC,KAAK,CAAC;IACjCS,cAAc,EAAET,UAAU,CAAC,KAAK,CAAC;IACjCU,GAAG,EAAER,KAAK,CAACS,OAAO,CAACD,GAAG,CAAC;IACvBE,wBAAwB,EAAEV,KAAK,CAACS,OAAO,CAACC,wBAAwB,CAAC;IACjEC,cAAc,EAAEb,UAAU,CAAC,IAAI,CAAC;IAChCc,YAAY,EAAEd,UAAU,CAAC,KAAK,CAAC;IAC/Be,GAAG,EAAEb,KAAK,CAACS,OAAO,CAACI,GAAG,CAAC;IACvBC,OAAO,EAAEd,KAAK,CAACS,OAAO,CAACK,OAAO,CAAC;IAC/BC,iBAAiB,EAAEjB,UAAU,CAAC,IAAI,CAAC;IACnCkB,GAAG,EAAElB,UAAU,CAAC,KAAK,CAAC;IACtBmB,cAAc,EAAEnB,UAAU,CAAC,KAAK;EAClC,CACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,4 @@
import { getConnInfo } from "./conninfo.js";
import { serveStatic as module } from "./serve-static-module.js";
import { upgradeWebSocket } from "./websocket.js";
export { getConnInfo, module as serveStatic, upgradeWebSocket };
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Package = createLucideIcon("Package", [
[
"path",
{
d: "M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",
key: "1a0edw"
}
],
["path", { d: "M12 22V12", key: "d0xqtd" }],
["path", { d: "m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7", key: "yx3hmr" }],
["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }]
]);
export { Package as default };
//# sourceMappingURL=package.js.map
@@ -0,0 +1,728 @@
export default `flf2a$ 7 5 16 -1 12
Fender by Scooter 8/94 (jkratten@law.georgetown.edu)
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
7 - height of a character
5 - height of a character, not including descenders
10 - max line length (excluding comment lines) + a fudge factor
-1 - default smushmode for this font (like "-m 15" on command line)
12 - number of comment lines
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
|| @
|| @
|| @
@
|| @
@
@@
'' '' @
@
@
@
@
@
@@
| | @
''''' @
| | @
''''' @
| | @
@
@@
| | @
.'|'|' @
| | | @
\`|'|, @
| | | @
'|'|' @
| | @@
\` || @
|| @
|| @
|| @
|| , @
@
@@
.'', @
| | @
.\`', ,@
| | | @
\`,,|' @
@
@@
'' @
@
@
@
@
@
@@
|' @
|' @
| @
|, @
|. @
@
@@
\`| @
\`| @
| @
,| @
.| @
@
@@
@
, | , @
,|, @
--|-- @
'|' @
' | ' @
@@
@
| @
-|- @
| @
@
@
@@
@
@
@
@
,, @
, @
@@
@
@
--- @
@
@
@
@@
@
@
@
@
.. @
@
@@
''@
'' @
'' @
'' @
'' @
@
@@
.''', @
| | @
| | @
| | @
\`,,,' @
@
@@
|| @
'|| @
|| @
|| @
.||. @
@
@@
''|, @
' || @
.|' @
// @
((... @
@
@@
,'''|, @
|| @
'''|| @
|| @
'...|' @
@
@@
/|| @
// || @
//..||.. @
|| @
|| @
@
@@
||'''' @
|| @
\`'''|| @
|| @
....|' @
@
@@
,,,, @
|| ' @
||''|, @
|| || @
\`|..|' @
@
@@
'''''/ @
// @
// @
// @
// @
@
@@
.|'''|, @
|| || @
))-(( @
|| || @
\`|...|' @
@
@@
.|'''|, @
|| || @
\`|...|| @
'' @
'' @
'' @
@@
@
|| @
@
|| @
@
@
@@
@
|| @
@
|| @
' @
@
@@
,, @
,, @
,, @
,, @
,, @
@
@@
@
,,, @
@
''' @
@
@
@@
,, @
,, @
,, @
,, @
,, @
@
@@
.|'''|, @
|| || @
//' @
|| @
.. @
@
@@
.''', @
| . | @
| |,' @
| @
\`... @
@
@@
/.\\ @
// \\\\ @
//...\\\\ @
// \\\\ @
.// \\\\. @
@
@@
'||'''|, @
|| || @
||;;;; @
|| || @
.||...|' @
@
@@
.|'''', @
|| @
|| @
|| @
\`|....' @
@
@@
'||'''|. @
|| || @
|| || @
|| || @
.||...|' @
@
@@
'||''''| @
|| . @
||'''| @
|| @
.||....| @
@
@@
'||''''| @
|| . @
||''| @
|| @
.||. @
@
@@
.|'''''| @
|| . @
|| |''|| @
|| || @
\`|....|' @
@
@@
'|| ||\` @
|| || @
||''|| @
|| || @
.|| ||. @
@
@@
|''||''| @
|| @
|| @
|| @
|..||..| @
@
@@
|''||''| @
|| @
|| @
|| @
'..|' @
@
@@
'|| //' @
|| // @
||<< @
|| \\\\ @
.|| \\\\. @
@
@@
'|| @
|| @
|| @
|| @
.||...| @
@
@@
'||\\ /||\` @
||\\\\.//|| @
|| || @
|| || @
.|| ||. @
@
@@
'||\\ ||\` @
||\\\\ || @
|| \\\\ || @
|| \\\\|| @
.|| \\||. @
@
@@
.|''''|, @
|| || @
|| || @
|| || @
\`|....|' @
@
@@
'||'''|, @
|| || @
||...|' @
|| @
.|| @
@
@@
.|''''|, @
|| || @
|| || @
|| \\\\|| @
\`|....|\\\\ @
@
@@
'||'''|, @
|| || @
||...|' @
|| \\\\ @
.|| \\\\. @
@
@@
.|'''| @
|| @
\`|'''|, @
. || @
|...|' @
@
@@
|''||''| @
|| @
|| @
|| @
.||. @
@
@@
'|| ||\` @
|| || @
|| || @
|| || @
\`|...|' @
@
@@
\\\\ // @
\\\\ // @
\\\\ // @
\\\\// @
\\/ @
@
@@
'|| ||\` @
|| || @
|| /\\ || @
\\\\//\\\\// @
\\/ \\/ @
@
@@
'\\\\ //\` @
\\\\// @
>< @
//\\\\ @
.// \\\\. @
@
@@
'\\\\ //\` @
\\\\// @
|| @
|| @
.||. @
@
@@
|'''''/ @
// @
// @
// @
/.....| @
@
@@
||''' @
|| @
|| @
|| @
||... @
@
@@
\\\\ @
\\\\ @
\\\\ @
\\\\ @
\\\\ @
@
@@
'''|| @
|| @
|| @
|| @
...|| @
@
@@
. @
.| |, @
| | @
@
@
@
@@
@
@
@
@
@
....@
@@
\`\` @
@
@
@
@
@
@@
@
@
'''|. @
.|''|| @
\`|..||. @
@
@@
'|| @
|| @
||''|, @
|| || @
.||..|' @
@
@@
@
@
.|'', @
|| @
\`|..' @
@
@@
||\` @
|| @
.|''|| @
|| || @
\`|..||. @
@
@@
@
@
.|''|, @
||..|| @
\`|... @
@
@@
.|'; @
|| @
'||' @
|| @
.||. @
@
@@
@
@
.|''|, @
|| || @
\`|..|| @
|| @
\`..|' @@
'|| @
|| @
||''|, @
|| || @
.|| || @
@
@@
@
'' @
|| @
|| @
.||. @
@
@@
@
'' @
|| @
|| @
|| @
|| @
\`..|' @@
'|| @
|| @
|| //\` @
||<< @
.|| \\\\. @
@
@@
'||\` @
|| @
|| @
|| @
.||. @
@
@@
@
@
'||),,(|, @
|| || || @
.|| ||. @
@
@@
@
@
\`||''|, @
|| || @
.|| ||. @
@
@@
@
@
.|''|, @
|| || @
\`|..|' @
@
@@
@
@
'||''|, @
|| || @
||..|' @
|| @
.|| @@
@
@
.|''||\` @
|| || @
\`|..|| @
|| , @
||\` @@
@
@
'||''| @
|| @
.||. @
@
@@
@
@
('''' @
\`'') @
\`...' @
@
@@
|| @
|| @
''||'' @
|| @
\`|..' @
@
@@
@
@
'|| ||\` @
|| || @
\`|..'|. @
@
@@
@
@
\\\\ // @
\\\\// @
\\/ @
@
@@
@
@
'\\\\ //\` @
\\\\/\\// @
\\/\\/ @
@
@@
@
@
\\\\ // @
>< @
// \\\\ @
@
@@
@
@
'|| ||\` @
\`|..|| @
|| @
, |' @
'' @@
@
@
'''/ @
// @
/... @
@
@@
{{ @
{{ @
{{ @
{{ @
{{ @
@
@@
||@
||@
||@
||@
||@
||@
@@
}} @
}} @
}} @
}} @
}} @
@
@@
@
% % @
% % @
@
@
@
@@
,, ,, @
/.\\ @
// \\\\ @
//...\\\\ @
.// \\\\. @
@
@@
'' '' @
.|'''|, @
|| || @
|| || @
\`|...|' @
@
@@
'' '' @
|| || @
|| || @
|| || @
\`|...|' @
@
@@
,, ,, @
@
'''|. @
.|''|| @
\`|..||. @
@
@@
,, ,, @
@
.|''|, @
|| || @
\`|..|' @
@
@@
,, ,, @
@
|| || @
|| || @
\`|..||. @
@
@@
.|'''|, @
|| || @
||;;;; @
|| || @
||...|' @
|| @
@@
`
@@ -0,0 +1 @@
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAIF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAmBjF;AAqBD,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAiH1H"}
@@ -0,0 +1,2 @@
import { LogEvent } from './typings';
export default function basicLogPrefix(event: LogEvent, dateFormat?: string): string;
@@ -0,0 +1 @@
{"version":3,"file":"square-terminal.js","sources":["../../../src/icons/square-terminal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareTerminal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyAxMSAyLTItMi0yIiAvPgogIDxwYXRoIGQ9Ik0xMSAxM2g0IiAvPgogIDxyZWN0IHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgeD0iMyIgeT0iMyIgcng9IjIiIHJ5PSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-terminal\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 SquareTerminal = createLucideIcon('SquareTerminal', [\n ['path', { d: 'm7 11 2-2-2-2', key: '1lz0vl' }],\n ['path', { d: 'M11 13h4', key: '1p7l4v' }],\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n]);\n\nexport default SquareTerminal;\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,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,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,CAC9C,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,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA;AACzF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,304 @@
'use strict'
const log = require('./log')
const semver = require('semver')
const { execFile } = require('./util')
const win = process.platform === 'win32'
function getOsUserInfo () {
try {
return require('os').userInfo().username
} catch {}
}
const systemDrive = process.env.SystemDrive || 'C:'
const username = process.env.USERNAME || process.env.USER || getOsUserInfo()
const localAppData = process.env.LOCALAPPDATA || `${systemDrive}\\${username}\\AppData\\Local`
const foundLocalAppData = process.env.LOCALAPPDATA || username
const programFiles = process.env.ProgramW6432 || process.env.ProgramFiles || `${systemDrive}\\Program Files`
const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)`
const winDefaultLocationsArray = []
for (const majorMinor of ['311', '310', '39', '38']) {
if (foundLocalAppData) {
winDefaultLocationsArray.push(
`${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`,
`${programFiles}\\Python${majorMinor}\\python.exe`,
`${localAppData}\\Programs\\Python\\Python${majorMinor}-32\\python.exe`,
`${programFiles}\\Python${majorMinor}-32\\python.exe`,
`${programFilesX86}\\Python${majorMinor}-32\\python.exe`
)
} else {
winDefaultLocationsArray.push(
`${programFiles}\\Python${majorMinor}\\python.exe`,
`${programFiles}\\Python${majorMinor}-32\\python.exe`,
`${programFilesX86}\\Python${majorMinor}-32\\python.exe`
)
}
}
class PythonFinder {
static findPython = (...args) => new PythonFinder(...args).findPython()
log = log.withPrefix('find Python')
argsExecutable = ['-c', 'import sys; sys.stdout.buffer.write(sys.executable.encode(\'utf-8\'));']
argsVersion = ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);']
semverRange = '>=3.6.0'
// These can be overridden for testing:
execFile = execFile
env = process.env
win = win
pyLauncher = 'py.exe'
winDefaultLocations = winDefaultLocationsArray
constructor (configPython) {
this.configPython = configPython
this.errorLog = []
}
// Logs a message at verbose level, but also saves it to be displayed later
// at error level if an error occurs. This should help diagnose the problem.
addLog (message) {
this.log.verbose(message)
this.errorLog.push(message)
}
// Find Python by trying a sequence of possibilities.
// Ignore errors, keep trying until Python is found.
async findPython () {
const SKIP = 0
const FAIL = 1
const toCheck = (() => {
if (this.env.NODE_GYP_FORCE_PYTHON) {
return [{
before: () => {
this.addLog(
'checking Python explicitly set from NODE_GYP_FORCE_PYTHON')
this.addLog('- process.env.NODE_GYP_FORCE_PYTHON is ' +
`"${this.env.NODE_GYP_FORCE_PYTHON}"`)
},
check: () => this.checkCommand(this.env.NODE_GYP_FORCE_PYTHON)
}]
}
const checks = [
{
before: () => {
if (!this.configPython) {
this.addLog('--python was not set on the command line')
return SKIP
}
this.addLog(`--python=${this.configPython} was set on the command line`)
},
check: () => this.checkCommand(this.configPython)
},
{
before: () => {
if (!this.env.PYTHON) {
this.addLog('Python is not set from environment variable ' +
'PYTHON')
return SKIP
}
this.addLog('checking Python explicitly set from environment ' +
'variable PYTHON')
this.addLog(`- process.env.PYTHON is "${this.env.PYTHON}"`)
},
check: () => this.checkCommand(this.env.PYTHON)
}
]
if (this.win) {
checks.push({
before: () => {
this.addLog(
'checking if the py launcher can be used to find Python 3')
},
check: () => this.checkPyLauncher()
})
}
checks.push(...[
{
before: () => { this.addLog('checking if "python3" can be used') },
check: () => this.checkCommand('python3')
},
{
before: () => { this.addLog('checking if "python" can be used') },
check: () => this.checkCommand('python')
}
])
if (this.win) {
for (let i = 0; i < this.winDefaultLocations.length; ++i) {
const location = this.winDefaultLocations[i]
checks.push({
before: () => this.addLog(`checking if Python is ${location}`),
check: () => this.checkExecPath(location)
})
}
}
return checks
})()
for (const check of toCheck) {
const before = check.before()
if (before === SKIP) {
continue
}
if (before === FAIL) {
return this.fail()
}
try {
return await check.check()
} catch (err) {
this.log.silly('runChecks: err = %j', (err && err.stack) || err)
}
}
return this.fail()
}
// Check if command is a valid Python to use.
// Will exit the Python finder on success.
// If on Windows, run in a CMD shell to support BAT/CMD launchers.
async checkCommand (command) {
let exec = command
let args = this.argsExecutable
let shell = false
if (this.win) {
// Arguments have to be manually quoted
exec = `"${exec}"`
args = args.map(a => `"${a}"`)
shell = true
}
this.log.verbose(`- executing "${command}" to get executable path`)
// Possible outcomes:
// - Error: not in PATH, not executable or execution fails
// - Gibberish: the next command to check version will fail
// - Absolute path to executable
try {
const execPath = await this.run(exec, args, shell)
this.addLog(`- executable path is "${execPath}"`)
return this.checkExecPath(execPath)
} catch (err) {
this.addLog(`- "${command}" is not in PATH or produced an error`)
throw err
}
}
// Check if the py launcher can find a valid Python to use.
// Will exit the Python finder on success.
// Distributions of Python on Windows by default install with the "py.exe"
// Python launcher which is more likely to exist than the Python executable
// being in the $PATH.
// Because the Python launcher supports Python 2 and Python 3, we should
// explicitly request a Python 3 version. This is done by supplying "-3" as
// the first command line argument. Since "py.exe -3" would be an invalid
// executable for "execFile", we have to use the launcher to figure out
// where the actual "python.exe" executable is located.
async checkPyLauncher () {
this.log.verbose(`- executing "${this.pyLauncher}" to get Python 3 executable path`)
// Possible outcomes: same as checkCommand
try {
const execPath = await this.run(this.pyLauncher, ['-3', ...this.argsExecutable], false)
this.addLog(`- executable path is "${execPath}"`)
return this.checkExecPath(execPath)
} catch (err) {
this.addLog(`- "${this.pyLauncher}" is not in PATH or produced an error`)
throw err
}
}
// Check if a Python executable is the correct version to use.
// Will exit the Python finder on success.
async checkExecPath (execPath) {
this.log.verbose(`- executing "${execPath}" to get version`)
// Possible outcomes:
// - Error: executable can not be run (likely meaning the command wasn't
// a Python executable and the previous command produced gibberish)
// - Gibberish: somehow the last command produced an executable path,
// this will fail when verifying the version
// - Version of the Python executable
try {
const version = await this.run(execPath, this.argsVersion, false)
this.addLog(`- version is "${version}"`)
const range = new semver.Range(this.semverRange)
let valid = false
try {
valid = range.test(version)
} catch (err) {
this.log.silly('range.test() threw:\n%s', err.stack)
this.addLog(`- "${execPath}" does not have a valid version`)
this.addLog('- is it a Python executable?')
throw err
}
if (!valid) {
this.addLog(`- version is ${version} - should be ${this.semverRange}`)
this.addLog('- THIS VERSION OF PYTHON IS NOT SUPPORTED')
throw new Error(`Found unsupported Python version ${version}`)
}
return this.succeed(execPath, version)
} catch (err) {
this.addLog(`- "${execPath}" could not be run`)
throw err
}
}
// Run an executable or shell command, trimming the output.
async run (exec, args, shell) {
const env = Object.assign({}, this.env)
env.TERM = 'dumb'
const opts = { env, shell }
this.log.silly('execFile: exec = %j', exec)
this.log.silly('execFile: args = %j', args)
this.log.silly('execFile: opts = %j', opts)
try {
const [err, stdout, stderr] = await this.execFile(exec, args, opts)
this.log.silly('execFile result: err = %j', (err && err.stack) || err)
this.log.silly('execFile result: stdout = %j', stdout)
this.log.silly('execFile result: stderr = %j', stderr)
return stdout.trim()
} catch (err) {
this.log.silly('execFile: threw:\n%s', err.stack)
throw err
}
}
succeed (execPath, version) {
this.log.info(`using Python version ${version} found at "${execPath}"`)
return execPath
}
fail () {
const errorLog = this.errorLog.join('\n')
const pathExample = this.win
? 'C:\\Path\\To\\python.exe'
: '/path/to/pythonexecutable'
// For Windows 80 col console, use up to the column before the one marked
// with X (total 79 chars including logger prefix, 58 chars usable here):
// X
const info = [
'**********************************************************',
'You need to install the latest version of Python.',
'Node-gyp should be able to find and use Python. If not,',
'you can try one of the following options:',
`- Use the switch --python="${pathExample}"`,
' (accepted by both node-gyp and npm)',
'- Set the environment variable PYTHON',
'For more information consult the documentation at:',
'https://github.com/nodejs/node-gyp#installation',
'**********************************************************'
].join('\n')
this.log.error(`\n${errorLog}\n\n${info}\n`)
throw new Error('Could not find any Python installation to use')
}
}
module.exports = PythonFinder
@@ -0,0 +1 @@
{"version":3,"names":["_deepArray","require","Plugin","constructor","plugin","options","key","externalDependencies","finalize","manipulateOptions","post","pre","visitor","parserOverride","generatorOverride","name","exports","default"],"sources":["../../src/config/plugin.ts"],"sourcesContent":["import { finalize } from \"./helpers/deep-array.ts\";\nimport type { ReadonlyDeepArray } from \"./helpers/deep-array.ts\";\nimport type { PluginObject } from \"./validation/plugins.ts\";\n\nexport default class Plugin {\n key: string | undefined | null;\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n post?: PluginObject[\"post\"];\n pre?: PluginObject[\"pre\"];\n visitor: PluginObject[\"visitor\"];\n\n parserOverride?: PluginObject[\"parserOverride\"];\n generatorOverride?: PluginObject[\"generatorOverride\"];\n\n options: object;\n\n externalDependencies: ReadonlyDeepArray<string>;\n\n constructor(\n plugin: PluginObject,\n options: object,\n key?: string,\n externalDependencies: ReadonlyDeepArray<string> = finalize([]),\n ) {\n this.key = plugin.name || key;\n\n this.manipulateOptions = plugin.manipulateOptions;\n this.post = plugin.post;\n this.pre = plugin.pre;\n this.visitor = plugin.visitor || {};\n this.parserOverride = plugin.parserOverride;\n this.generatorOverride = plugin.generatorOverride;\n\n this.options = options;\n this.externalDependencies = externalDependencies;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIe,MAAMC,MAAM,CAAC;EAc1BC,WAAWA,CACTC,MAAoB,EACpBC,OAAe,EACfC,GAAY,EACZC,oBAA+C,GAAG,IAAAC,mBAAQ,EAAC,EAAE,CAAC,EAC9D;IAAA,KAlBFF,GAAG;IAAA,KACHG,iBAAiB;IAAA,KACjBC,IAAI;IAAA,KACJC,GAAG;IAAA,KACHC,OAAO;IAAA,KAEPC,cAAc;IAAA,KACdC,iBAAiB;IAAA,KAEjBT,OAAO;IAAA,KAEPE,oBAAoB;IAQlB,IAAI,CAACD,GAAG,GAAGF,MAAM,CAACW,IAAI,IAAIT,GAAG;IAE7B,IAAI,CAACG,iBAAiB,GAAGL,MAAM,CAACK,iBAAiB;IACjD,IAAI,CAACC,IAAI,GAAGN,MAAM,CAACM,IAAI;IACvB,IAAI,CAACC,GAAG,GAAGP,MAAM,CAACO,GAAG;IACrB,IAAI,CAACC,OAAO,GAAGR,MAAM,CAACQ,OAAO,IAAI,CAAC,CAAC;IACnC,IAAI,CAACC,cAAc,GAAGT,MAAM,CAACS,cAAc;IAC3C,IAAI,CAACC,iBAAiB,GAAGV,MAAM,CAACU,iBAAiB;IAEjD,IAAI,CAACT,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,oBAAoB,GAAGA,oBAAoB;EAClD;AACF;AAACS,OAAA,CAAAC,OAAA,GAAAf,MAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts';
export type Source = ReverseSegment[][];
export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[];
//# sourceMappingURL=by-source.d.ts.map
@@ -0,0 +1,749 @@
<h1 align="center">Picomatch</h1>
<p align="center">
<a href="https://npmjs.org/package/picomatch">
<img src="https://img.shields.io/npm/v/picomatch.svg" alt="version">
</a>
<a href="https://github.com/micromatch/picomatch/actions?workflow=Tests">
<img src="https://github.com/micromatch/picomatch/workflows/Tests/badge.svg" alt="test status">
</a>
<a href="https://coveralls.io/github/micromatch/picomatch">
<img src="https://img.shields.io/coveralls/github/micromatch/picomatch/master.svg" alt="coverage status">
</a>
<a href="https://npmjs.org/package/picomatch">
<img src="https://img.shields.io/npm/dm/picomatch.svg" alt="downloads">
</a>
</p>
<br>
<br>
<p align="center">
<strong>Blazing fast and accurate glob matcher written in JavaScript.</strong></br>
<em>No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.</em>
</p>
<br>
<br>
## Why picomatch?
* **Lightweight** - No dependencies
* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps)
* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files)
* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes.
* **Well tested** - Thousands of unit tests
See the [library comparison](#library-comparisons) to other libraries.
<br>
<br>
## Table of Contents
<details><summary> Click to expand </summary>
- [Install](#install)
- [Usage](#usage)
- [API](#api)
* [picomatch](#picomatch)
* [.test](#test)
* [.matchBase](#matchbase)
* [.isMatch](#ismatch)
* [.parse](#parse)
* [.scan](#scan)
* [.compileRe](#compilere)
* [.makeRe](#makere)
* [.toRegex](#toregex)
- [Options](#options)
* [Picomatch options](#picomatch-options)
* [Scan Options](#scan-options)
* [Options Examples](#options-examples)
- [Globbing features](#globbing-features)
* [Basic globbing](#basic-globbing)
* [Advanced globbing](#advanced-globbing)
* [Braces](#braces)
* [Matching special characters as literals](#matching-special-characters-as-literals)
- [Library Comparisons](#library-comparisons)
- [Benchmarks](#benchmarks)
- [Philosophies](#philosophies)
- [About](#about)
* [Author](#author)
* [License](#license)
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
</details>
<br>
<br>
## Install
Install with [npm](https://www.npmjs.com/):
```sh
npm install --save picomatch
```
<br>
## Usage
The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.
```js
const pm = require('picomatch');
const isMatch = pm('*.js');
console.log(isMatch('abcd')); //=> false
console.log(isMatch('a.js')); //=> true
console.log(isMatch('a.md')); //=> false
console.log(isMatch('a/b.js')); //=> false
```
<br>
## API
### [picomatch](lib/picomatch.js#L31)
Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.
**Params**
* `globs` **{String|Array}**: One or more glob patterns.
* `options` **{Object=}**
* `returns` **{Function=}**: Returns a matcher function.
**Example**
```js
const picomatch = require('picomatch');
// picomatch(glob[, options]);
const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
**Example without node.js**
For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
```js
const picomatch = require('picomatch/posix');
// the same API, defaulting to posix paths
const isMatch = picomatch('a/*');
console.log(isMatch('a\\b')); //=> false
console.log(isMatch('a/b')); //=> true
// you can still configure the matcher function to accept windows paths
const isMatch = picomatch('a/*', { options: windows });
console.log(isMatch('a\\b')); //=> true
console.log(isMatch('a/b')); //=> true
```
### [.test](lib/picomatch.js#L116)
Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string.
**Params**
* `input` **{String}**: String to test.
* `regex` **{RegExp}**
* `returns` **{Object}**: Returns an object with matching info.
**Example**
```js
const picomatch = require('picomatch');
// picomatch.test(input, regex[, options]);
console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
```
### [.matchBase](lib/picomatch.js#L160)
Match the basename of a filepath.
**Params**
* `input` **{String}**: String to test.
* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe).
* `returns` **{Boolean}**
**Example**
```js
const picomatch = require('picomatch');
// picomatch.matchBase(input, glob[, options]);
console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
```
### [.isMatch](lib/picomatch.js#L182)
Returns true if **any** of the given glob `patterns` match the specified `string`.
**Params**
* **{String|Array}**: str The string to test.
* **{String|Array}**: patterns One or more glob patterns to use for matching.
* **{Object}**: See available [options](#options).
* `returns` **{Boolean}**: Returns true if any patterns match `str`
**Example**
```js
const picomatch = require('picomatch');
// picomatch.isMatch(string, patterns[, options]);
console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
```
### [.parse](lib/picomatch.js#L198)
Parse a glob pattern to create the source string for a regular expression.
**Params**
* `pattern` **{String}**
* `options` **{Object}**
* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string.
**Example**
```js
const picomatch = require('picomatch');
const result = picomatch.parse(pattern[, options]);
```
### [.scan](lib/picomatch.js#L230)
Scan a glob pattern to separate the pattern into segments.
**Params**
* `input` **{String}**: Glob pattern to scan.
* `options` **{Object}**
* `returns` **{Object}**: Returns an object with
**Example**
```js
const picomatch = require('picomatch');
// picomatch.scan(input[, options]);
const result = picomatch.scan('!./foo/*.js');
console.log(result);
{ prefix: '!./',
input: '!./foo/*.js',
start: 3,
base: 'foo',
glob: '*.js',
isBrace: false,
isBracket: false,
isGlob: true,
isExtglob: false,
isGlobstar: false,
negated: true }
```
### [.compileRe](lib/picomatch.js#L244)
Compile a regular expression from the `state` object returned by the
[parse()](#parse) method.
**Params**
* `state` **{Object}**
* `options` **{Object}**
* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser.
* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
* `returns` **{RegExp}**
**Example**
```js
const picomatch = require('picomatch');
const state = picomatch.parse('*.js');
// picomatch.compileRe(state[, options]);
console.log(picomatch.compileRe(state));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
```
### [.makeRe](lib/picomatch.js#L285)
Create a regular expression from a parsed glob pattern.
**Params**
* `state` **{String}**: The object returned from the `.parse` method.
* `options` **{Object}**
* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
* `returns` **{RegExp}**: Returns a regex created from the given pattern.
**Example**
```js
const picomatch = require('picomatch');
// picomatch.makeRe(state[, options]);
const result = picomatch.makeRe('*.js');
console.log(result);
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
```
### [.toRegex](lib/picomatch.js#L320)
Create a regular expression from the given regex source string.
**Params**
* `source` **{String}**: Regular expression source string.
* `options` **{Object}**
* `returns` **{RegExp}**
**Example**
```js
const picomatch = require('picomatch');
// picomatch.toRegex(source[, options]);
const { output } = picomatch.parse('*.js');
console.log(picomatch.toRegex(output));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
```
<br>
## Options
### Picomatch options
The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API.
| **Option** | **Type** | **Default value** | **Description** |
| --- | --- | --- | --- |
| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). |
| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. |
| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). |
| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. |
| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true |
| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. |
| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. |
| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. |
| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. |
| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
| `matchBase` | `boolean` | `false` | Alias for `basename` |
| `maxLength` | `number` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
| `maxExtglobRecursion` | `number\|boolean` | `0` | Limit nested quantified extglobs and other risky repeated extglob forms. When the limit is exceeded, the extglob is treated as a literal string instead of being compiled to regex. Set to `false` to disable this safeguard. |
| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. |
| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. |
| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. |
| `noext` | `boolean` | `false` | Alias for `noextglob` |
| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) |
| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) |
| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` |
| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. |
| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. |
| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). |
| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. |
| `windows` | `boolean` | `false` | Also accept backslashes as the path separator. |
### Scan Options
In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method.
| **Option** | **Type** | **Default value** | **Description** |
| --- | --- | --- | --- |
| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern |
| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true |
**Example**
```js
const picomatch = require('picomatch');
const result = picomatch.scan('!./foo/*.js', { tokens: true });
console.log(result);
// {
// prefix: '!./',
// input: '!./foo/*.js',
// start: 3,
// base: 'foo',
// glob: '*.js',
// isBrace: false,
// isBracket: false,
// isGlob: true,
// isExtglob: false,
// isGlobstar: false,
// negated: true,
// maxDepth: 2,
// tokens: [
// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true },
// { value: 'foo', depth: 1, isGlob: false },
// { value: '*.js', depth: 1, isGlob: true }
// ],
// slashes: [ 2, 6 ],
// parts: [ 'foo', '*.js' ]
// }
```
<br>
### Options Examples
#### options.expandRange
**Type**: `function`
**Default**: `undefined`
Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
**Example**
The following example shows how to create a glob that matches a folder
```js
const fill = require('fill-range');
const regex = pm.makeRe('foo/{01..25}/bar', {
expandRange(a, b) {
return `(${fill(a, b, { toRegex: true })})`;
}
});
console.log(regex);
//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/
console.log(regex.test('foo/00/bar')) // false
console.log(regex.test('foo/01/bar')) // true
console.log(regex.test('foo/10/bar')) // true
console.log(regex.test('foo/22/bar')) // true
console.log(regex.test('foo/25/bar')) // true
console.log(regex.test('foo/26/bar')) // false
```
#### options.format
**Type**: `function`
**Default**: `undefined`
Custom function for formatting strings before they're matched.
**Example**
```js
// strip leading './' from strings
const format = str => str.replace(/^\.\//, '');
const isMatch = picomatch('foo/*.js', { format });
console.log(isMatch('./foo/bar.js')); //=> true
```
#### options.onMatch
```js
const onMatch = ({ glob, regex, input, output }) => {
console.log({ glob, regex, input, output });
};
const isMatch = picomatch('*', { onMatch });
isMatch('foo');
isMatch('bar');
isMatch('baz');
```
#### options.onIgnore
```js
const onIgnore = ({ glob, regex, input, output }) => {
console.log({ glob, regex, input, output });
};
const isMatch = picomatch('*', { onIgnore, ignore: 'f*' });
isMatch('foo');
isMatch('bar');
isMatch('baz');
```
#### options.onResult
```js
const onResult = ({ glob, regex, input, output }) => {
console.log({ glob, regex, input, output });
};
const isMatch = picomatch('*', { onResult, ignore: 'f*' });
isMatch('foo');
isMatch('bar');
isMatch('baz');
```
<br>
<br>
## Globbing features
* [Basic globbing](#basic-globbing) (Wildcard matching)
* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching)
### Basic globbing
| **Character** | **Description** |
| --- | --- |
| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. |
| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` with the `windows` option) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. |
| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. |
#### Matching behavior vs. Bash
Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions:
* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`.
* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`.
<br>
### Advanced globbing
* [extglobs](#extglobs)
* [POSIX brackets](#posix-brackets)
* [Braces](#brace-expansion)
#### Extglobs
| **Pattern** | **Description** |
| --- | --- |
| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` |
| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` |
| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` |
| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` |
| `!(pattern)` | Match _anything but_ `pattern` |
**Examples**
```js
const pm = require('picomatch');
// *(pattern) matches ZERO or more of "pattern"
console.log(pm.isMatch('a', 'a*(z)')); // true
console.log(pm.isMatch('az', 'a*(z)')); // true
console.log(pm.isMatch('azzz', 'a*(z)')); // true
// +(pattern) matches ONE or more of "pattern"
console.log(pm.isMatch('a', 'a+(z)')); // false
console.log(pm.isMatch('az', 'a+(z)')); // true
console.log(pm.isMatch('azzz', 'a+(z)')); // true
// supports multiple extglobs
console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false
// supports nested extglobs
console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true
// risky quantified extglobs are treated literally by default
console.log(pm.makeRe('+(a|aa)'));
//=> /^(?:\+\(a\|aa\))$/
// increase the limit to allow a small amount of nested quantified extglobs
console.log(pm.isMatch('aaa', '+(+(a))', { maxExtglobRecursion: 1 })); // true
```
#### POSIX brackets
POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true.
**Enable POSIX bracket support**
```js
console.log(pm.makeRe('[[:word:]]+', { posix: true }));
//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/
```
**Supported POSIX classes**
The following named POSIX bracket expressions are supported:
* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]`
* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`.
* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`.
* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`.
* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`.
* `[:digit:]` - Numerical digits, equivalent to `[0-9]`.
* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`.
* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`.
* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`.
* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`.
* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`.
* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`.
* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`.
* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`.
See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information.
### Braces
Picomatch only does [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) of comma-delimited lists (e.g. `a/{b,c}/d`). For advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch), which supports advanced syntax such as ranges (e.g. `{01..03}`) and increments (e.g. `{2..10..2}`).
### Matching special characters as literals
If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes:
**Special Characters**
Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.
To match any of the following characters as literals: `$^*+?()[]
Examples:
```js
console.log(pm.makeRe('foo/bar \\(1\\)'));
console.log(pm.makeRe('foo/bar \\(1\\)'));
```
<br>
<br>
## Library Comparisons
The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets).
| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - |
| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - |
| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - |
| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - |
| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - |
| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ |
| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ |
| File system operations | - | - | - | - | - | - | - |
<br>
<br>
## Benchmarks
Performance comparison of picomatch and minimatch.
```
# .makeRe star (*)
picomatch x 3,251,247 ops/sec ±0.25% (95 runs sampled)
minimatch x 497,224 ops/sec ±0.11% (100 runs sampled)
# .makeRe star; dot=true (*)
picomatch x 2,624,035 ops/sec ±0.16% (98 runs sampled)
minimatch x 446,244 ops/sec ±0.63% (99 runs sampled)
# .makeRe globstar (**)
picomatch x 2,524,465 ops/sec ±0.13% (99 runs sampled)
minimatch x 1,396,257 ops/sec ±0.58% (96 runs sampled)
# .makeRe globstars (**/**/**)
picomatch x 2,545,674 ops/sec ±0.10% (99 runs sampled)
minimatch x 1,196,835 ops/sec ±0.63% (98 runs sampled)
# .makeRe with leading star (*.txt)
picomatch x 2,537,708 ops/sec ±0.11% (100 runs sampled)
minimatch x 345,284 ops/sec ±0.64% (96 runs sampled)
# .makeRe - basic braces ({a,b,c}*.txt)
picomatch x 505,430 ops/sec ±1.04% (94 runs sampled)
minimatch x 107,991 ops/sec ±0.54% (99 runs sampled)
# .makeRe - short ranges ({a..z}*.txt)
picomatch x 371,179 ops/sec ±2.91% (77 runs sampled)
minimatch x 14,104 ops/sec ±0.61% (99 runs sampled)
# .makeRe - medium ranges ({1..100000}*.txt)
picomatch x 384,958 ops/sec ±1.70% (82 runs sampled)
minimatch x 2.55 ops/sec ±3.22% (11 runs sampled)
# .makeRe - long ranges ({1..10000000}*.txt)
picomatch x 382,552 ops/sec ±1.52% (71 runs sampled)
minimatch x 0.83 ops/sec ±5.67% (7 runs sampled))
```
<br>
<br>
## Philosophies
The goal of this library is to be blazing fast, without compromising on accuracy.
**Accuracy**
The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`.
Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements.
**Performance**
Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer.
<br>
<br>
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Author
**Jon Schlinkert**
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
### License
Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
@@ -0,0 +1,120 @@
/**
* @fileoverview Define 2 token factories; forward and backward.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const BackwardTokenCommentCursor = require("./backward-token-comment-cursor");
const BackwardTokenCursor = require("./backward-token-cursor");
const FilterCursor = require("./filter-cursor");
const ForwardTokenCommentCursor = require("./forward-token-comment-cursor");
const ForwardTokenCursor = require("./forward-token-cursor");
const LimitCursor = require("./limit-cursor");
const SkipCursor = require("./skip-cursor");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* The cursor factory.
* @private
*/
class CursorFactory {
/**
* Initializes this cursor.
* @param {Function} TokenCursor The class of the cursor which iterates tokens only.
* @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments.
*/
constructor(TokenCursor, TokenCommentCursor) {
this.TokenCursor = TokenCursor;
this.TokenCommentCursor = TokenCommentCursor;
}
/**
* Creates a base cursor instance that can be decorated by createCursor.
* @param {Token[]} tokens The array of tokens.
* @param {Comment[]} comments The array of comments.
* @param {Object} indexMap The map from locations to indices in `tokens`.
* @param {number} startLoc The start location of the iteration range.
* @param {number} endLoc The end location of the iteration range.
* @param {boolean} includeComments The flag to iterate comments as well.
* @returns {Cursor} The created base cursor.
*/
createBaseCursor(
tokens,
comments,
indexMap,
startLoc,
endLoc,
includeComments,
) {
const Cursor = includeComments
? this.TokenCommentCursor
: this.TokenCursor;
return new Cursor(tokens, comments, indexMap, startLoc, endLoc);
}
/**
* Creates a cursor that iterates tokens with normalized options.
* @param {Token[]} tokens The array of tokens.
* @param {Comment[]} comments The array of comments.
* @param {Object} indexMap The map from locations to indices in `tokens`.
* @param {number} startLoc The start location of the iteration range.
* @param {number} endLoc The end location of the iteration range.
* @param {boolean} includeComments The flag to iterate comments as well.
* @param {Function|null} filter The predicate function to choose tokens.
* @param {number} skip The count of tokens the cursor skips.
* @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
* @returns {Cursor} The created cursor.
*/
createCursor(
tokens,
comments,
indexMap,
startLoc,
endLoc,
includeComments,
filter,
skip,
count,
) {
let cursor = this.createBaseCursor(
tokens,
comments,
indexMap,
startLoc,
endLoc,
includeComments,
);
if (filter) {
cursor = new FilterCursor(cursor, filter);
}
if (skip >= 1) {
cursor = new SkipCursor(cursor, skip);
}
if (count >= 0) {
cursor = new LimitCursor(cursor, count);
}
return cursor;
}
}
//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------
module.exports = {
forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor),
backward: new CursorFactory(
BackwardTokenCursor,
BackwardTokenCommentCursor,
),
};
@@ -0,0 +1,24 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2018 = void 0;
const es2017_1 = require("./es2017");
const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator");
const es2018_asynciterable_1 = require("./es2018.asynciterable");
const es2018_intl_1 = require("./es2018.intl");
const es2018_promise_1 = require("./es2018.promise");
const es2018_regexp_1 = require("./es2018.regexp");
exports.es2018 = {
libs: [
es2017_1.es2017,
es2018_asynciterable_1.es2018_asynciterable,
es2018_asyncgenerator_1.es2018_asyncgenerator,
es2018_promise_1.es2018_promise,
es2018_regexp_1.es2018_regexp,
es2018_intl_1.es2018_intl,
],
variables: [],
};
@@ -0,0 +1 @@
{"version":3,"file":"car-taxi-front.js","sources":["../../../src/icons/car-taxi-front.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CarTaxiFront\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMmg0IiAvPgogIDxwYXRoIGQ9Im0yMSA4LTIgMi0xLjUtMy43QTIgMiAwIDAgMCAxNS42NDYgNUg4LjRhMiAyIDAgMCAwLTEuOTAzIDEuMjU3TDUgMTAgMyA4IiAvPgogIDxwYXRoIGQ9Ik03IDE0aC4wMSIgLz4KICA8cGF0aCBkPSJNMTcgMTRoLjAxIiAvPgogIDxyZWN0IHdpZHRoPSIxOCIgaGVpZ2h0PSI4IiB4PSIzIiB5PSIxMCIgcng9IjIiIC8+CiAgPHBhdGggZD0iTTUgMTh2MiIgLz4KICA8cGF0aCBkPSJNMTkgMTh2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/car-taxi-front\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 CarTaxiFront = createLucideIcon('CarTaxiFront', [\n ['path', { d: 'M10 2h4', key: 'n1abiw' }],\n [\n 'path',\n { d: 'm21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8', key: '1imjwt' },\n ],\n ['path', { d: 'M7 14h.01', key: '1qa3f1' }],\n ['path', { d: 'M17 14h.01', key: '7oqj8z' }],\n ['rect', { width: '18', height: '8', x: '3', y: '10', rx: '2', key: 'a7itu8' }],\n ['path', { d: 'M5 18v2', key: 'ppbyun' }],\n ['path', { d: 'M19 18v2', key: 'gy7782' }],\n]);\n\nexport default CarTaxiFront;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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,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 @@
{"version":3,"file":"music.js","sources":["../../../src/icons/music.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Music\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAxOFY1bDEyLTJ2MTMiIC8+CiAgPGNpcmNsZSBjeD0iNiIgY3k9IjE4IiByPSIzIiAvPgogIDxjaXJjbGUgY3g9IjE4IiBjeT0iMTYiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/music\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 Music = createLucideIcon('Music', [\n ['path', { d: 'M9 18V5l12-2v13', key: '1jmyc2' }],\n ['circle', { cx: '6', cy: '18', r: '3', key: 'fqmcym' }],\n ['circle', { cx: '18', cy: '16', r: '3', key: '1hluhg' }],\n]);\n\nexport default Music;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,74 @@
/*
Copyright Node.js contributors. All rights reserved.
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.
*/
// Node does not include the headers for these functions when compiling for WASM, so add them here.
#ifdef __wasm32__
extern "C" {
NAPI_EXTERN napi_status NAPI_CDECL
napi_create_threadsafe_function(napi_env env,
napi_value func,
napi_value async_resource,
napi_value async_resource_name,
size_t max_queue_size,
size_t initial_thread_count,
void* thread_finalize_data,
napi_finalize thread_finalize_cb,
void* context,
napi_threadsafe_function_call_js call_js_cb,
napi_threadsafe_function* result);
NAPI_EXTERN napi_status NAPI_CDECL napi_get_threadsafe_function_context(
napi_threadsafe_function func, void** result);
NAPI_EXTERN napi_status NAPI_CDECL
napi_call_threadsafe_function(napi_threadsafe_function func,
void* data,
napi_threadsafe_function_call_mode is_blocking);
NAPI_EXTERN napi_status NAPI_CDECL
napi_acquire_threadsafe_function(napi_threadsafe_function func);
NAPI_EXTERN napi_status NAPI_CDECL napi_release_threadsafe_function(
napi_threadsafe_function func, napi_threadsafe_function_release_mode mode);
NAPI_EXTERN napi_status NAPI_CDECL
napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func);
NAPI_EXTERN napi_status NAPI_CDECL
napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func);
NAPI_EXTERN napi_status NAPI_CDECL
napi_create_async_work(napi_env env,
napi_value async_resource,
napi_value async_resource_name,
napi_async_execute_callback execute,
napi_async_complete_callback complete,
void* data,
napi_async_work* result);
NAPI_EXTERN napi_status NAPI_CDECL napi_delete_async_work(napi_env env,
napi_async_work work);
NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(napi_env env,
napi_async_work work);
NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env,
napi_async_work work);
}
#endif
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function isLength(value) {
return Number.isInteger(value) && value > -1;
}
exports.isLength = isLength;
@@ -0,0 +1,719 @@
export default `flf2a$ 7 7 26 32 3
Alligator by Simon Bradley <syb3@aber.ac.uk>
17th June, 1994
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
:::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
$ $ @
###$ @@
::: :::$@
:+: :+:$ @
$ $ @
$ $ @
$ $ @
$ $ @
$ $ @@
::: :::$ @
:+: :+:$ @
+:+:+:+:+:+:+:+$@
+#+ +:+$ @
+#+#+#+#+#+#+#+$ @
#+# #+#$ @
### ###$ @@
:::$ @
:+:+:+:+:$@
+:+ +:+$ @
+#++:++#+$ @
+#+ +#+$ @
#+#+#+#+#$ @
###$ @@
::: :::$ @
:+: :+:$ @
+:+$ @
+#+$ @
+#+$ @
#+# #+#$@
### ###$ @@
:::::::$ @
:+: :+:$ @
+:+ +:+$ @
+#++: ++#$@
+#+ +#+#+#$ @
#+# #+#+$ @
##########$ @@
:::$@
:+$ @
$$ @
$$ @
$$ @
$$ @
$$ @@
:::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###$ @@
:::$@
:+:$@
+:+$@
+#+$ @
+#+$ @
#+#$ @
###$ @@
$ $ $ $@
:+: :+:$@
+:+ +:+$ @
+#++:++#++:++$ @
+#+ +#+$ @
#+# #+#$ @
$ $ $ $ @@
$ $ @
:+:$ @
+:+$ @
+#++:++#++:++$@
+#+$ @
#+#$ @
$ $ @@
$ $@
$ $ @
$ $ @
$ $ @
$ $ @
#+#$ @
##$ @@
$ $@
$ $ @
$ $ @
+#++:++#++:++$ @
$ $ @
$ $ @
$ $ @@
$ $@
$ $ @
$ $ @
$ $ @
$ $ @
#+#$ @
###$ @@
:::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###$ @@
:::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
#######$ @@
:::$@
:+:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
#######$ @@
::::::::$@
:+: :+:$@
$ +:+$ @
$ +#+$ @
$ +#+$ @
#+#$ @
##########$ @@
::::::::$@
:+: :+:$@
$ +:+$ @
$ +#++:$ @
$ +#+$ @
#+# #+#$ @
########$ @@
:::$@
:+:$ @
+:+ +:+$@
+#+ +:+$ @
+#+#+#+#+#+$@
#+#$ @
###$ @@
::::::::::$@
:+: :+:$ @
+:+ $ @
+#++:++#+$ @
$ +#+$ @
#+# #+#$ @
########$ @@
::::::::$@
:+: :+:$@
+:+ $ @
+#++:++#+$ @
+#+ +#+$ @
#+# #+#$ @
########$ @@
:::::::::::$@
:+: :+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###$ @@
::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#$ @
+#+ +#+$ @
#+# #+#$ @
########$ @@
::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#+$ @
$ +#+$ @
#+# #+#$ @
########$ @@
$ $@
:+:$@
$ $ @
$ $ @
$ $ @
#+#$ @
$ $ @@
$ $@
:+:$@
$ $ @
$ $ @
$ $ @
#+#$ @
##$ @@
:::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###$ @@
$ $@
$ $ @
+:+:+:+:+:+:+$ @
$ $ @
+#+#+#+#+#+#+$ @
$ $ @
$ $ @@
:::$@
:+:$@
+:+$@
+#+$@
+#+$ @
#+#$ @
###$ @@
:::::::::$@
:+: :+:$@
+:+$ @
+#+$ @
+#+$ @
$ $ @
###$ @@
:::::::::::$ @
:+: :+:+:+:+:+:$@
+:+ +:+ +:+ +:+$@
+#+ +:+ +#+ +:+$ @
+#+ +#+ +#+ +#+$ @
#+# #+#+#+#+#+$ @
#####$ @@
:::$ @
:+: :+:$@
+:+ +:+$@
+#++:++#++:$@
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#+$ @
+#+ +#+$ @
#+# #+#$ @
#########$ @@
::::::::$@
:+: :+:$@
+:+ $ @
+#+ $ @
+#+ $ @
#+# #+#$ @
########$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
#########$ @@
::::::::::$@
:+:$ @
+:+$ @
+#++:++#$ @
+#+$ @
#+#$ @
##########$ @@
::::::::::$@
:+:$ @
+:+$ @
:#::+::#$ @
+#+$ @
#+#$ @
###$ @@
::::::::$@
:+: :+:$@
+:+ $ @
:#: $ @
+#+ +#+#$ @
#+# #+#$ @
########$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:++#++$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###########$ @@
:::::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+# #+#$ @
#####$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:++$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::$ @
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
##########$@@
::: :::$@
:+:+: :+:+:$@
+:+ +:+:+ +:+$@
+#+ +:+ +#+$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::: :::$@
:+:+: :+:$ @
:+:+:+ +:+$ @
+#+ +:+ +#+$ @
+#+ +#+#+#$ @
#+# #+#+#$ @
### ####$ @@
::::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
########$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#+$ @
+#+$ @
#+#$ @
###$ @@
::::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
###########$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#:$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
::::::::$@
:+: :+:$@
+:+ $ @
+#++:++#++$ @
$ +#+$ @
#+# #+#$ @
########$ @@
:::::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
########$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+#+#+#$ @
###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#+ +:+ +#+$ @
+#+ +#+#+ +#+$ @
#+#+# #+#+#$ @
### ###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:+$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:$ @
+#+$ @
#+#$ @
###$ @@
:::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
#########$ @@
::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
######$ @@
:::$@
:+:$@
+:+$@
+#+$@
+#+$@
#+#$@
###$@@
::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
######$ @@
:::$ @
:+: :+:$ @
+:+ +:+$@
$ $ @
$ $ @
$ $ @
$ $ @@
$ $@
$ $ @
$ $ @
$ $ @
$ $ @
$ $ @
##########$ @@
:::$@
:+$ @
$$ @
$$ @
$$ @
$$ @
$$ @@
:::$ @
:+: :+:$@
+:+ +:+$@
+#++:++#++:$@
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#+$ @
+#+ +#+$ @
#+# #+#$ @
#########$ @@
::::::::$@
:+: :+:$@
+:+ $ @
+#+ $ @
+#+ $ @
#+# #+#$ @
########$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
#########$ @@
::::::::::$@
:+:$ @
+:+$ @
+#++:++#$ @
+#+$ @
#+#$ @
##########$ @@
::::::::::$@
:+:$ @
+:+$ @
:#::+::#$ @
+#+$ @
#+#$ @
###$ @@
::::::::$@
:+: :+:$@
+:+ $ @
:#: $ @
+#+ +#+#$ @
#+# #+#$ @
########$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:++#++$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###########$ @@
:::::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+# #+#$ @
#####$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:++$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::$ @
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
##########$@@
::: :::$@
:+:+: :+:+:$@
+:+ +:+:+ +:+$@
+#+ +:+ +#+$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
:::: :::$@
:+:+: :+:$ @
:+:+:+ +:+$ @
+#+ +:+ +#+$ @
+#+ +#+#+#$ @
#+# #+#+#$ @
### ####$ @@
::::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
########$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#+$ @
+#+$ @
#+#$ @
###$ @@
::::::::$@
:+: :+:$@
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
###########$ @@
:::::::::$@
:+: :+:$@
+:+ +:+$ @
+#++:++#:$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
::::::::$@
:+: :+:$@
+:+ $ @
+#++:++#++$ @
$ +#+$ @
#+# #+#$ @
########$ @@
:::::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+# #+#$ @
########$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#+ +:+$ @
+#+ +#+$ @
#+#+#+#$ @
###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#+ +:+ +#+$ @
+#+ +#+#+ +#+$ @
#+#+# #+#+#$ @
### ###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:+$ @
+#+ +#+$ @
#+# #+#$ @
### ###$ @@
::: :::$@
:+: :+:$ @
+:+ +:+$ @
+#++:$ @
+#+$ @
#+#$ @
###$ @@
:::::::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
#########$ @@
::::$@
:+:$ @
+:+$ @
+#+$ @
+#+$ @
#+#$ @
####$ @@
:::$@
:+:$ @
+:+$ @
$ $ @
+#+$ @
#+#$ @
###$ @@
::::$@
:+:$@
+:+$ @
+#+$@
+#+$ @
#+#$ @
####$ @@
::::: :::$@
:+: :+:+:$ @
$ $ @
$ $ @
$ $ @
$ $ @
$ $ @@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,72 @@
# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from)
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
## Install
```
$ npm install resolve-from
```
## Usage
```js
const resolveFrom = require('resolve-from');
// There is a file at `./foo/bar.js`
resolveFrom('foo', './bar');
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
```
## API
### resolveFrom(fromDirectory, moduleId)
Like `require()`, throws when the module can't be found.
### resolveFrom.silent(fromDirectory, moduleId)
Returns `undefined` instead of throwing when the module can't be found.
#### fromDirectory
Type: `string`
Directory to resolve from.
#### moduleId
Type: `string`
What you would use in `require()`.
## Tip
Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times:
```js
const resolveFromFoo = resolveFrom.bind(null, 'foo');
resolveFromFoo('./bar');
resolveFromFoo('./baz');
```
## Related
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
Loaded 100 of 18210 files, more files were not shown because too many files have changed in this diff. Show more