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

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

No files matched your search

@@ -0,0 +1,3 @@
export * from './composable-filters.ts';
export * from './filter-vite-plugins.ts';
export * from './simple-filters.ts';
@@ -0,0 +1,476 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.2.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.7...istanbul-reports-v3.2.0) (2025-08-18)
### Features
* update HTML report filter to take a RegEx ([#796](https://github.com/istanbuljs/istanbuljs/issues/796)) ([a739999](https://github.com/istanbuljs/istanbuljs/commit/a7399991f4f5a086a75e8ac13131b79f5e4a6377))
### Bug Fixes
* html-spa table formatting ([#814](https://github.com/istanbuljs/istanbuljs/issues/814)) ([39c0fd1](https://github.com/istanbuljs/istanbuljs/commit/39c0fd1c45c8e2300bd724f91989bbffe60422a6))
## [3.1.7](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.6...istanbul-reports-v3.1.7) (2024-02-19)
### Bug Fixes
* **ux:** address bug with firefox event handling ([2207a87](https://github.com/istanbuljs/istanbuljs/commit/2207a87ec978b7637d8b55de2ff887e462bd48d3))
## [3.1.6](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.5...istanbul-reports-v3.1.6) (2023-07-25)
### Bug Fixes
* **clover:** always close last open tag ([07c6ea6](https://github.com/istanbuljs/istanbuljs/commit/07c6ea6537261a19b117702b7362dee0bdc001ac))
## [3.1.5](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.4...istanbul-reports-v3.1.5) (2022-07-13)
### Bug Fixes
* `new Date()` such that it works with MockDate library ([#688](https://github.com/istanbuljs/istanbuljs/issues/688)) ([85905f9](https://github.com/istanbuljs/istanbuljs/commit/85905f989c9480e63ad534c6ff8b1a12dae278eb))
* add placeholder to fix Implicit Else ([#679](https://github.com/istanbuljs/istanbuljs/issues/679)) ([0516f51](https://github.com/istanbuljs/istanbuljs/commit/0516f519575ee28f77ebf1e9556ac294d78904ea))
### [3.1.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.3...istanbul-reports-v3.1.4) (2022-01-17)
### Bug Fixes
* "E" is not showing in the HTML reporter for "implicit else" branches after pull 633 ([#663](https://github.com/istanbuljs/istanbuljs/issues/663)) ([7818922](https://github.com/istanbuljs/istanbuljs/commit/7818922fd7229c4eee12b1407b5a13020f5d34de))
### [3.1.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.2...istanbul-reports-v3.1.3) (2021-12-29)
### Bug Fixes
* reverse tabnabbing vulnerability in URLs ([#591](https://github.com/istanbuljs/istanbuljs/issues/591)) ([4eceb9e](https://github.com/istanbuljs/istanbuljs/commit/4eceb9eb8b3169b882d74ecc526fb5837ebc6205))
### [3.1.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.1...istanbul-reports-v3.1.2) (2021-12-23)
### Bug Fixes
* remove stray div tag from HTML report ([68d9c74](https://github.com/istanbuljs/istanbuljs/commit/68d9c7469927ddcf15346307eacea8fd7104086c))
### [3.1.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.1.0...istanbul-reports-v3.1.1) (2021-12-01)
### Bug Fixes
* rel="noopener" to the link in the generated html reports ([f234bb3](https://github.com/istanbuljs/istanbuljs/commit/f234bb321421e7312a83595934a1abf81c7af70c))
## [3.1.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.0.5...istanbul-reports-v3.1.0) (2021-11-30)
### Features
* add filter to HTML report ([#650](https://github.com/istanbuljs/istanbuljs/issues/650)) ([eab47f7](https://github.com/istanbuljs/istanbuljs/commit/eab47f76be90343f679ef0e5567a21447a4995dc))
### [3.0.5](https://www.github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.0.4...istanbul-reports-v3.0.5) (2021-10-13)
### Bug Fixes
* cobertura reports in root folder ([#571](https://www.github.com/istanbuljs/istanbuljs/issues/571)) ([596f6ff](https://www.github.com/istanbuljs/istanbuljs/commit/596f6ff1342ae4baa6688bf3ee7786c75d4df947))
### [3.0.4](https://www.github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.0.3...istanbul-reports-v3.0.4) (2021-10-12)
### Bug Fixes
* handle reports with "loc" but no "decl" ([#637](https://www.github.com/istanbuljs/istanbuljs/issues/637)) ([cdc28f3](https://www.github.com/istanbuljs/istanbuljs/commit/cdc28f3a1e80e786eaab3b7d3b8b9b558fc2d3c8)), closes [#322](https://www.github.com/istanbuljs/istanbuljs/issues/322)
### [3.0.3](https://www.github.com/istanbuljs/istanbuljs/compare/istanbul-reports-v3.0.2...istanbul-reports-v3.0.3) (2021-10-06)
### Bug Fixes
* lcov reporter crash when missing branches ([#613](https://www.github.com/istanbuljs/istanbuljs/issues/613)) ([d34981c](https://www.github.com/istanbuljs/istanbuljs/commit/d34981c8131e2ecbff6fc02ffd8702fd9808e241))
## [3.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.1...istanbul-reports@3.0.2) (2020-04-01)
### Bug Fixes
* Ignore insignificant lines when coalesce ([#525](https://github.com/istanbuljs/istanbuljs/issues/525)) ([d7d7cfa](https://github.com/istanbuljs/istanbuljs/commit/d7d7cfa1301f0dde2ff19078c31235ffd55c01ef))
## [3.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0...istanbul-reports@3.0.1) (2020-03-26)
### Bug Fixes
* cobertura should escape invalid characters ([#534](https://github.com/istanbuljs/istanbuljs/issues/534)) ([4fd5114](https://github.com/istanbuljs/istanbuljs/commit/4fd5114a0926d20e4e1e3055323c44281f0af6cd))
# [3.0.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.6...istanbul-reports@3.0.0) (2019-12-20)
### Features
* **text:** Coalesce ranges of missing lines ([#511](https://github.com/istanbuljs/istanbuljs/issues/511)) ([54636fc](https://github.com/istanbuljs/istanbuljs/commit/54636fc9acbb53e5724fe9018837d0d205413194))
# [3.0.0-alpha.6](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.5...istanbul-reports@3.0.0-alpha.6) (2019-12-07)
### Bug Fixes
* Add favicon to html report ([#493](https://github.com/istanbuljs/istanbuljs/issues/493)) ([5afe203](https://github.com/istanbuljs/istanbuljs/commit/5afe20347dd3ae954b31707a67f381f87920797f))
# [3.0.0-alpha.5](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.4...istanbul-reports@3.0.0-alpha.5) (2019-11-22)
### Features
* Add support for projectRoot option ([#492](https://github.com/istanbuljs/istanbuljs/issues/492)) ([177fd45](https://github.com/istanbuljs/istanbuljs/commit/177fd45ebd7e505e79120995d937d40f965bad79))
# [3.0.0-alpha.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.3...istanbul-reports@3.0.0-alpha.4) (2019-11-18)
### Bug Fixes
* Remove handlebars ([#503](https://github.com/istanbuljs/istanbuljs/issues/503)) ([aa8ae7f](https://github.com/istanbuljs/istanbuljs/commit/aa8ae7fe42ef9c8aeaa193309bafb22ad725bc3d)), closes [#476](https://github.com/istanbuljs/istanbuljs/issues/476)
# [3.0.0-alpha.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.2...istanbul-reports@3.0.0-alpha.3) (2019-10-19)
### Bug Fixes
* Add missing dependency on istanbul-lib-report ([#490](https://github.com/istanbuljs/istanbuljs/issues/490)) ([95a2b2f](https://github.com/istanbuljs/istanbuljs/commit/95a2b2f)), closes [istanbuljs/nyc#1204](https://github.com/istanbuljs/nyc/issues/1204)
# [3.0.0-alpha.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.1...istanbul-reports@3.0.0-alpha.2) (2019-10-06)
### Bug Fixes
* Use path.posix.relative to generate URL's for html reports ([#472](https://github.com/istanbuljs/istanbuljs/issues/472)) ([05dc22c](https://github.com/istanbuljs/istanbuljs/commit/05dc22c))
* **html-spa:** Filter only exact paths ([#431](https://github.com/istanbuljs/istanbuljs/issues/431)) ([bbc85f6](https://github.com/istanbuljs/istanbuljs/commit/bbc85f6)), closes [#426](https://github.com/istanbuljs/istanbuljs/issues/426)
# [3.0.0-alpha.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0-alpha.0...istanbul-reports@3.0.0-alpha.1) (2019-06-20)
### Bug Fixes
* Set `opts.file = '-'` on text-lcov ([#424](https://github.com/istanbuljs/istanbuljs/issues/424)) ([4be56b2](https://github.com/istanbuljs/istanbuljs/commit/4be56b2))
# [3.0.0-alpha.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.2.5...istanbul-reports@3.0.0-alpha.0) (2019-06-19)
### Features
* Refactor istanbul-lib-report so report can choose summarizer ([#408](https://github.com/istanbuljs/istanbuljs/issues/408)) ([0f328fd](https://github.com/istanbuljs/istanbuljs/commit/0f328fd))
* **text report:** Optimize output to show more missing lines ([#341](https://github.com/istanbuljs/istanbuljs/issues/341)) ([c4e8b8e](https://github.com/istanbuljs/istanbuljs/commit/c4e8b8e))
* Modern html report ([#345](https://github.com/istanbuljs/istanbuljs/issues/345)) ([95ebaf1](https://github.com/istanbuljs/istanbuljs/commit/95ebaf1))
* Update dependencies, require Node.js 8 ([#401](https://github.com/istanbuljs/istanbuljs/issues/401)) ([bf3a539](https://github.com/istanbuljs/istanbuljs/commit/bf3a539))
### BREAKING CHANGES
* Existing istanbul-lib-report API's have been changed
* Node.js 8 is now required
## [2.2.5](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.2.4...istanbul-reports@2.2.5) (2019-05-02)
### Bug Fixes
* **istanbul-reports:** Remove isRoot check causing incorrect report formatting ([#66](https://github.com/istanbuljs/istanbuljs/issues/66)). ([#382](https://github.com/istanbuljs/istanbuljs/issues/382)) ([df6e994](https://github.com/istanbuljs/istanbuljs/commit/df6e994))
## [2.2.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.2.3...istanbul-reports@2.2.4) (2019-04-24)
**Note:** Version bump only for package istanbul-reports
## [2.2.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.2.2...istanbul-reports@2.2.3) (2019-04-17)
### Bug Fixes
* Initialize cols for HTML report sorting ([#369](https://github.com/istanbuljs/istanbuljs/issues/369)) ([28f61de](https://github.com/istanbuljs/istanbuljs/commit/28f61de))
## [2.2.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.2.1...istanbul-reports@2.2.2) (2019-04-09)
**Note:** Version bump only for package istanbul-reports
## [2.2.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.2.0...istanbul-reports@2.2.1) (2019-04-03)
**Note:** Version bump only for package istanbul-reports
# [2.2.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.1.1...istanbul-reports@2.2.0) (2019-03-12)
### Features
* set medium colour to yellow ([#306](https://github.com/istanbuljs/istanbuljs/issues/306)) ([ed40be7](https://github.com/istanbuljs/istanbuljs/commit/ed40be7))
## [2.1.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.1.0...istanbul-reports@2.1.1) (2019-02-14)
### Bug Fixes
* update dependencies due to vulnerabilities ([#294](https://github.com/istanbuljs/istanbuljs/issues/294)) ([4c14fed](https://github.com/istanbuljs/istanbuljs/commit/4c14fed))
# [2.1.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.0.3...istanbul-reports@2.1.0) (2019-01-26)
### Features
* **istanbul-reports:** Enable keyboard shortcuts on HTML report file listing view ([#265](https://github.com/istanbuljs/istanbuljs/issues/265)) ([f49b355](https://github.com/istanbuljs/istanbuljs/commit/f49b355))
<a name="2.0.3"></a>
## [2.0.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.0.2...istanbul-reports@2.0.3) (2018-12-25)
### Bug Fixes
* functionMap is sometimes missing a key from functions ([#253](https://github.com/istanbuljs/istanbuljs/issues/253)) ([399f215](https://github.com/istanbuljs/istanbuljs/commit/399f215))
<a name="2.0.2"></a>
## [2.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.0.1...istanbul-reports@2.0.2) (2018-12-19)
### Bug Fixes
* clover report metrics must be an inline xml element ([#226](https://github.com/istanbuljs/istanbuljs/issues/226)) ([e290c95](https://github.com/istanbuljs/istanbuljs/commit/e290c95)), closes [#13](https://github.com/istanbuljs/istanbuljs/issues/13)
<a name="2.0.1"></a>
## [2.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@2.0.0...istanbul-reports@2.0.1) (2018-09-06)
**Note:** Version bump only for package istanbul-reports
<a name="2.0.0"></a>
# [2.0.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.5.0...istanbul-reports@2.0.0) (2018-07-07)
### Chores
* Specify node >= 6 in istanbul-reports. ([#197](https://github.com/istanbuljs/istanbuljs/issues/197)) ([5810c38](https://github.com/istanbuljs/istanbuljs/commit/5810c38))
### BREAKING CHANGES
* Requires node >= 6.
<a name="1.5.0"></a>
# [1.5.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.4.1...istanbul-reports@1.5.0) (2018-06-06)
### Features
* ability to skip rows with full coverage ([#170](https://github.com/istanbuljs/istanbuljs/issues/170)) ([bbcdc07](https://github.com/istanbuljs/istanbuljs/commit/bbcdc07))
<a name="1.4.1"></a>
## [1.4.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.4.0...istanbul-reports@1.4.1) (2018-05-31)
### Bug Fixes
* ensure using correct context ([#168](https://github.com/istanbuljs/istanbuljs/issues/168)) ([df102fd](https://github.com/istanbuljs/istanbuljs/commit/df102fd))
<a name="1.4.0"></a>
# [1.4.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.3.0...istanbul-reports@1.4.0) (2018-04-17)
### Features
* allow custom reporters to be loaded ([#155](https://github.com/istanbuljs/istanbuljs/issues/155)) ([6d89cca](https://github.com/istanbuljs/istanbuljs/commit/6d89cca))
<a name="1.3.0"></a>
# [1.3.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.2.0...istanbul-reports@1.3.0) (2018-03-09)
### Features
* added named anchors to code coverage line numbers. ([#149](https://github.com/istanbuljs/istanbuljs/issues/149)) ([98e1c50](https://github.com/istanbuljs/istanbuljs/commit/98e1c50))
<a name="1.2.0"></a>
# [1.2.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.1.4...istanbul-reports@1.2.0) (2018-03-04)
### Bug Fixes
* update fixtures to reflect new heading ([36801d3](https://github.com/istanbuljs/istanbuljs/commit/36801d3))
### Features
* add skip-empty option for html & text reports ([#140](https://github.com/istanbuljs/istanbuljs/issues/140)) ([d2a4262](https://github.com/istanbuljs/istanbuljs/commit/d2a4262))
* add uncovered block navigation ([#136](https://github.com/istanbuljs/istanbuljs/issues/136)) ([c798930](https://github.com/istanbuljs/istanbuljs/commit/c798930))
<a name="1.1.4"></a>
## [1.1.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.1.3...istanbul-reports@1.1.4) (2018-02-13)
### Bug Fixes
* changed column header from "Uncovered Lines" to "Uncovered Line #s" ([#138](https://github.com/istanbuljs/istanbuljs/issues/138)) ([7ba7760](https://github.com/istanbuljs/istanbuljs/commit/7ba7760))
<a name="1.1.3"></a>
## [1.1.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.1.2...istanbul-reports@1.1.3) (2017-10-21)
**Note:** Version bump only for package istanbul-reports
<a name="1.1.2"></a>
## [1.1.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.1.1...istanbul-reports@1.1.2) (2017-08-26)
### Bug Fixes
* prevent branch highlighting from extending pass the end of a line ([#80](https://github.com/istanbuljs/istanbuljs/issues/80)) ([f490377](https://github.com/istanbuljs/istanbuljs/commit/f490377))
<a name="1.1.1"></a>
## [1.1.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@1.1.0...istanbul-reports@1.1.1) (2017-05-27)
<a name="1.1.0"></a>
# [1.1.0](https://github.com/istanbuljs/istanbul-reports/compare/istanbul-reports@1.0.2...istanbul-reports@1.1.0) (2017-04-29)
### Features
* once 100% line coverage is achieved, missing branch coverage is now shown in text report ([#45](https://github.com/istanbuljs/istanbuljs/issues/45)) ([8a809f8](https://github.com/istanbuljs/istanbul-reports/commit/8a809f8))
<a name="1.0.2"></a>
## [1.0.2](https://github.com/istanbuljs/istanbul-reports/compare/istanbul-reports@1.0.1...istanbul-reports@1.0.2) (2017-03-27)
### Bug Fixes
* **windows:** preserve escape char of json-summary key path ([4d71d5e](https://github.com/istanbuljs/istanbul-reports/commit/4d71d5e))
<a name="1.0.1"></a>
## [1.0.1](https://github.com/istanbuljs/istanbul-reports/compare/v1.0.0...v1.0.1) (2017-01-29)
### Bug Fixes
* add files key to package.json ([#17](https://github.com/istanbuljs/istanbul-reports/issues/17)) ([141f801](https://github.com/istanbuljs/istanbul-reports/commit/141f801))
<a name="1.0.0"></a>
# [1.0.0](https://github.com/istanbuljs/istanbul-reports/compare/v1.0.0-alpha.8...v1.0.0) (2016-10-17)
### Bug Fixes
* fail gracefully if structuredText[startLine] is undefined ([#10](https://github.com/istanbuljs/istanbul-reports/issues/10)) ([bed1d13](https://github.com/istanbuljs/istanbul-reports/commit/bed1d13))
* preserve escape char of json key path on Windows ([#12](https://github.com/istanbuljs/istanbul-reports/issues/12)) ([4e5266e](https://github.com/istanbuljs/istanbul-reports/commit/4e5266e))
* skip branch if meta does not exist (fixes speedskater/babel-plugin-rewire[#165](https://github.com/istanbuljs/istanbul-reports/issues/165)) ([#11](https://github.com/istanbuljs/istanbul-reports/issues/11)) ([62bae2f](https://github.com/istanbuljs/istanbul-reports/commit/62bae2f))
* Teamcity reporter modified to send proper coverage values ([#8](https://github.com/istanbuljs/istanbul-reports/issues/8)) ([4147f50](https://github.com/istanbuljs/istanbul-reports/commit/4147f50))
@@ -0,0 +1,124 @@
"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: 'prefer-promise-reject-errors',
meta: {
type: 'suggestion',
docs: {
description: 'Require using Error objects as Promise rejection reasons',
extendsBaseRule: true,
recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
rejectAnError: 'Expected the Promise rejection reason to be an Error.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allow: {
...util_1.typeOrValueSpecifiersSchema,
description: 'Type specifiers that can be used as Promise rejection reasons.',
},
allowEmptyReject: {
type: 'boolean',
description: 'Whether to allow calls to `Promise.reject()` with no arguments.',
},
allowThrowingAny: {
type: 'boolean',
description: 'Whether to always allow throwing values typed as `any`.',
},
allowThrowingUnknown: {
type: 'boolean',
description: 'Whether to always allow throwing values typed as `unknown`.',
},
},
},
],
},
defaultOptions: [
{
allow: [],
allowEmptyReject: false,
allowThrowingAny: false,
allowThrowingUnknown: false,
},
],
create(context, [options]) {
const services = (0, util_1.getParserServices)(context);
function checkRejectCall(callExpression) {
const argument = callExpression.arguments.at(0);
if (argument) {
const type = services.getTypeAtLocation(argument);
if ((0, util_1.typeMatchesSomeSpecifier)(type, options.allow, services.program)) {
return;
}
if (options.allowThrowingAny && (0, util_1.isTypeAnyType)(type)) {
return;
}
if (options.allowThrowingUnknown && (0, util_1.isTypeUnknownType)(type)) {
return;
}
if ((0, util_1.isErrorLike)(services.program, type) ||
(0, util_1.isReadonlyErrorLike)(services.program, type)) {
return;
}
}
else if (options.allowEmptyReject) {
return;
}
context.report({
node: callExpression,
messageId: 'rejectAnError',
});
}
function typeAtLocationIsLikePromise(node) {
const type = services.getTypeAtLocation(node);
return ((0, util_1.isPromiseConstructorLike)(services.program, type) ||
(0, util_1.isPromiseLike)(services.program, type));
}
return {
CallExpression(node) {
const callee = (0, util_1.skipChainExpression)(node.callee);
if (callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) {
return;
}
if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'reject') ||
!typeAtLocationIsLikePromise(callee.object)) {
return;
}
checkRejectCall(node);
},
NewExpression(node) {
const callee = (0, util_1.skipChainExpression)(node.callee);
if (!(0, util_1.isPromiseConstructorLike)(services.program, services.getTypeAtLocation(callee))) {
return;
}
const executor = node.arguments.at(0);
if (!executor || !(0, util_1.isFunction)(executor)) {
return;
}
const rejectParamNode = executor.params.at(1);
if (!rejectParamNode || !(0, util_1.isIdentifier)(rejectParamNode)) {
return;
}
// reject param is always present in variables declared by executor
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const rejectVariable = context.sourceCode
.getDeclaredVariables(executor)
.find(variable => variable.identifiers.includes(rejectParamNode));
rejectVariable.references.forEach(ref => {
if (ref.identifier.parent.type !== utils_1.AST_NODE_TYPES.CallExpression ||
ref.identifier !== ref.identifier.parent.callee) {
return;
}
checkRejectCall(ref.identifier.parent);
});
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","_index","isMemberExpression","isOptionalMemberExpression","isYieldExpression","isStatement","PRECEDENCE","Map","isTSTypeExpression","nodeId","isClassExtendsClause","node","parent","parentId","superClass","hasPostfixPart","object","callee","tag","NullableTypeAnnotation","FunctionTypeAnnotation","tokenContext","TokenContext","arrowFlowReturnType","UpdateExpression","needsParenBeforeExpressionBrace","expressionStatement","arrowBody","ObjectExpression","DoExpression","async","BinaryLike","nodeType","parentPos","get","operator","undefined","nodePos","left","right","UnionTypeAnnotation","OptionalIndexedAccessType","objectType","TSAsExpression","TSConditionalType","types","checkType","extendsType","TSUnionType","TSIntersectionType","TSTypeOperator","TSInferType","typeParameter","constraint","TSInstantiationExpression","typeParameters","TSFunctionType","BinaryExpression","forInOrInitHeadAccumulate","LogicalExpression","SequenceExpression","property","YieldExpression","test","ClassExpression","exportDefault","UnaryLike","FunctionExpression","ConditionalExpression","OptionalMemberExpression","AssignmentExpression","type","Identifier","getRawIdentifier","_node$extra","name","extra","parenthesized","rightType","id","forOfHead","forInitHead","forInHead","isFollowedByBracket","computed","optional","await"],"sources":["../../src/node/parentheses.ts"],"sourcesContent":["import {\n isMemberExpression,\n isOptionalMemberExpression,\n isYieldExpression,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport { TokenContext } from \"./index.ts\";\n\nconst PRECEDENCE = new Map([\n [\"||\", 0],\n [\"??\", 1],\n [\"&&\", 2],\n [\"|\", 3],\n [\"^\", 4],\n [\"&\", 5],\n [\"==\", 6],\n [\"===\", 6],\n [\"!=\", 6],\n [\"!==\", 6],\n [\"<\", 7],\n [\">\", 7],\n [\"<=\", 7],\n [\">=\", 7],\n [\"in\", 7],\n [\"instanceof\", 7],\n [\">>\", 8],\n [\"<<\", 8],\n [\">>>\", 8],\n [\"+\", 9],\n [\"-\", 9],\n [\"*\", 10],\n [\"/\", 10],\n [\"%\", 10],\n [\"**\", 11],\n]);\n\nfunction isTSTypeExpression(nodeId: number) {\n return (\n nodeId === __node(\"TSAsExpression\") ||\n nodeId === __node(\"TSSatisfiesExpression\") ||\n nodeId === __node(\"TSTypeAssertion\")\n );\n}\n\nconst isClassExtendsClause = (\n node: t.Node,\n parent: any,\n parentId: number,\n): parent is t.Class => {\n return (\n (parentId === __node(\"ClassDeclaration\") ||\n parentId === __node(\"ClassExpression\")) &&\n parent.superClass === node\n );\n};\n\nconst hasPostfixPart = (node: t.Node, parent: any, parentId: number) => {\n switch (parentId) {\n case __node(\"MemberExpression\"):\n case __node(\"OptionalMemberExpression\"):\n return parent.object === node;\n case __node(\"CallExpression\"):\n case __node(\"OptionalCallExpression\"):\n case __node(\"NewExpression\"):\n return parent.callee === node;\n case __node(\"TaggedTemplateExpression\"):\n return parent.tag === node;\n case __node(\"TSNonNullExpression\"):\n return true;\n }\n\n return false;\n};\n\nexport function NullableTypeAnnotation(\n node: t.NullableTypeAnnotation,\n parent: any,\n parentId: number,\n): boolean {\n return parentId === __node(\"ArrayTypeAnnotation\");\n}\n\nexport function FunctionTypeAnnotation(\n node: t.FunctionTypeAnnotation,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n return (\n // (() => A) | (() => B)\n parentId === __node(\"UnionTypeAnnotation\") ||\n // (() => A) & (() => B)\n parentId === __node(\"IntersectionTypeAnnotation\") ||\n // (() => A)[]\n parentId === __node(\"ArrayTypeAnnotation\") ||\n (tokenContext & TokenContext.arrowFlowReturnType) > 0\n );\n}\n\nexport function UpdateExpression(\n node: t.UpdateExpression,\n parent: any,\n parentId: number,\n): boolean {\n return (\n hasPostfixPart(node, parent, parentId) ||\n isClassExtendsClause(node, parent, parentId)\n );\n}\n\nfunction needsParenBeforeExpressionBrace(tokenContext: number) {\n return (\n (tokenContext &\n (TokenContext.expressionStatement | TokenContext.arrowBody)) >\n 0\n );\n}\n\nexport function ObjectExpression(\n node: t.ObjectExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n return needsParenBeforeExpressionBrace(tokenContext);\n}\n\nexport function DoExpression(\n node: t.DoExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n // `async do` can start an expression statement\n return (tokenContext & TokenContext.expressionStatement) > 0 && !node.async;\n}\n\nconst enum BinaryLikeType {\n Binary = 0,\n Logical = 1,\n TypeScript = 2,\n}\n\nfunction BinaryLike(\n node: t.Binary | t.TSAsExpression | t.TSSatisfiesExpression,\n parent: any,\n parentId: number,\n nodeType: BinaryLikeType,\n): boolean {\n if (isClassExtendsClause(node, parent, parentId)) {\n return tLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"candy.js","sources":["../../../src/icons/candy.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Candy\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOS41IDcuNS0yIDJhNC45NSA0Ljk1IDAgMSAwIDcgN2wyLTJhNC45NSA0Ljk1IDAgMSAwLTctN1oiIC8+CiAgPHBhdGggZD0iTTE0IDYuNXYxMCIgLz4KICA8cGF0aCBkPSJNMTAgNy41djEwIiAvPgogIDxwYXRoIGQ9Im0xNiA3IDEtNSAxLjM3LjY4QTMgMyAwIDAgMCAxOS43IDNIMjF2MS4zYzAgLjQ2LjEuOTIuMzIgMS4zM0wyMiA3bC01IDEiIC8+CiAgPHBhdGggZD0ibTggMTctMSA1LTEuMzctLjY4QTMgMyAwIDAgMCA0LjMgMjFIM3YtMS4zYTMgMyAwIDAgMC0uMzItMS4zM0wyIDE3bDUtMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/candy\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 Candy = createLucideIcon('Candy', [\n ['path', { d: 'm9.5 7.5-2 2a4.95 4.95 0 1 0 7 7l2-2a4.95 4.95 0 1 0-7-7Z', key: 'ue6khb' }],\n ['path', { d: 'M14 6.5v10', key: '5xnk7c' }],\n ['path', { d: 'M10 7.5v10', key: '1uew51' }],\n [\n 'path',\n { d: 'm16 7 1-5 1.37.68A3 3 0 0 0 19.7 3H21v1.3c0 .46.1.92.32 1.33L22 7l-5 1', key: 'b9cp6k' },\n ],\n [\n 'path',\n { d: 'm8 17-1 5-1.37-.68A3 3 0 0 0 4.3 21H3v-1.3a3 3 0 0 0-.32-1.33L2 17l5-1', key: '5lney8' },\n ],\n]);\n\nexport default Candy;\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,CAA6D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1F,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,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,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,CAA0E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC/F,CAAA,CAAA,CAAA;AAAA,CACA,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,CAA0E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC/F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"names":["_arrayWithHoles","require","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_slicedToArray","arr","i","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest"],"sources":["../../src/helpers/slicedToArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithHoles from \"./arrayWithHoles.ts\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableRest is still being converted to TS.\nimport nonIterableRest from \"./nonIterableRest.ts\";\n\nexport default function _slicedToArray<T>(arr: any, i: number): T[] {\n return (\n arrayWithHoles<T>(arr) ||\n iterableToArrayLimit<T>(arr, i) ||\n unsupportedIterableToArray<T>(arr, i) ||\n nonIterableRest()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEe,SAASI,cAAcA,CAAIC,GAAQ,EAAEC,CAAS,EAAO;EAClE,OACE,IAAAC,uBAAc,EAAIF,GAAG,CAAC,IACtB,IAAAG,6BAAoB,EAAIH,GAAG,EAAEC,CAAC,CAAC,IAC/B,IAAAG,mCAA0B,EAAIJ,GAAG,EAAEC,CAAC,CAAC,IACrC,IAAAI,wBAAe,EAAC,CAAC;AAErB","ignoreList":[]}
@@ -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 ArrowDownRight = createLucideIcon("ArrowDownRight", [
["path", { d: "m7 7 10 10", key: "1fmybs" }],
["path", { d: "M17 7v10H7", key: "6fjiku" }]
]);
export { ArrowDownRight as default };
//# sourceMappingURL=arrow-down-right.js.map
@@ -0,0 +1,3 @@
export * from './types'
export * from './atom'
export * from './store'
@@ -0,0 +1 @@
{"version":3,"file":"get-context-window.mjs","sources":["../../../src/utils/get-context-window.ts"],"sourcesContent":["import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement<Element>) => {\n return current ? current.ownerDocument.defaultView : null\n}\n"],"names":[],"mappings":"AAEA;MACa,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAA0B,KAAI;AACpE,IAAA,OAAO,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI;AAC7D;;;;"}
@@ -0,0 +1,16 @@
export function parseNativeEnumDef(def) {
const object = def.values;
const actualKeys = Object.keys(def.values).filter((key) => {
return typeof object[object[key]] !== "number";
});
const actualValues = actualKeys.map((key) => object[key]);
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
return {
type: parsedTypes.length === 1
? parsedTypes[0] === "string"
? "string"
: "number"
: ["string", "number"],
enum: actualValues,
};
}
@@ -0,0 +1,9 @@
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
/**
* This is a compatibility ruleset that:
* - disables rules from eslint:recommended which are already handled by TypeScript.
* - enables rules that make sense due to TS's typechecking / transpilation.
* @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended}
*/
declare const _default: (_plugin: FlatConfig.Plugin, _parser: FlatConfig.Parser) => FlatConfig.Config;
export default _default;
@@ -0,0 +1,10 @@
'use strict';
/* eslint-env browser */
var inspect = require('../');
var d = document.createElement('div');
d.setAttribute('id', 'beep');
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]));
@@ -0,0 +1 @@
{"version":3,"file":"useCanGoBack.cjs","names":[],"sources":["../../src/useCanGoBack.ts"],"sourcesContent":["import { useStore } from '@tanstack/react-store'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function useCanGoBack() {\n const router = useRouter()\n\n if (isServer ?? router.isServer) {\n return router.stores.location.get().state.__TSR_index !== 0\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static\n return useStore(\n router.stores.location,\n (location) => location.state.__TSR_index !== 0,\n )\n}\n"],"mappings":";;;;;AAIA,SAAgB,eAAe;CAC7B,MAAM,SAAS,kBAAA,WAAW;AAE1B,KAAI,+BAAA,YAAY,OAAO,SACrB,QAAO,OAAO,OAAO,SAAS,KAAK,CAAC,MAAM,gBAAgB;AAI5D,SAAA,GAAA,sBAAA,UACE,OAAO,OAAO,WACb,aAAa,SAAS,MAAM,gBAAgB,EAC9C"}
@@ -0,0 +1,136 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_encode = require("../encode.js");
const require_utils_jwt_jwa = require("./jwa.js");
const require_utils_jwt_types = require("./types.js");
const require_utils_jwt_utf8 = require("./utf8.js");
const require_utils_jwt_jws = require("./jws.js");
//#region src/utils/jwt/jwt.ts
/**
* @module
* JSON Web Token (JWT)
* https://datatracker.ietf.org/doc/html/rfc7519
*/
const encodeJwtPart = (part) => require_utils_encode.encodeBase64Url(require_utils_jwt_utf8.utf8Encoder.encode(JSON.stringify(part)).buffer).replace(/=/g, "");
const encodeSignaturePart = (buf) => require_utils_encode.encodeBase64Url(buf).replace(/=/g, "");
const decodeJwtPart = (part) => JSON.parse(require_utils_jwt_utf8.utf8Decoder.decode(require_utils_encode.decodeBase64Url(part)));
function isTokenHeader(obj) {
if (typeof obj === "object" && obj !== null) {
const objWithAlg = obj;
return "alg" in objWithAlg && Object.values(require_utils_jwt_jwa.AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT");
}
return false;
}
const sign = async (payload, privateKey, alg = "HS256") => {
const encodedPayload = encodeJwtPart(payload);
let encodedHeader;
if (typeof privateKey === "object" && "alg" in privateKey) {
alg = privateKey.alg;
encodedHeader = encodeJwtPart({
alg,
typ: "JWT",
kid: privateKey.kid
});
} else encodedHeader = encodeJwtPart({
alg,
typ: "JWT"
});
const partialToken = `${encodedHeader}.${encodedPayload}`;
const signaturePart = await require_utils_jwt_jws.signing(privateKey, alg, require_utils_jwt_utf8.utf8Encoder.encode(partialToken));
return `${partialToken}.${encodeSignaturePart(signaturePart)}`;
};
const verify = async (token, publicKey, algOrOptions) => {
if (!algOrOptions) throw new require_utils_jwt_types.JwtAlgorithmRequired();
const { alg, iss, nbf = true, exp = true, iat = true, aud } = typeof algOrOptions === "string" ? { alg: algOrOptions } : algOrOptions;
if (!alg) throw new require_utils_jwt_types.JwtAlgorithmRequired();
const tokenParts = token.split(".");
if (tokenParts.length !== 3) throw new require_utils_jwt_types.JwtTokenInvalid(token);
const { header, payload } = decode(token);
if (!isTokenHeader(header)) throw new require_utils_jwt_types.JwtHeaderInvalid(header);
if (header.alg !== alg) throw new require_utils_jwt_types.JwtAlgorithmMismatch(alg, header.alg);
const now = Math.floor(Date.now() / 1e3);
if (nbf && payload.nbf !== void 0) {
if (typeof payload.nbf !== "number" || !Number.isFinite(payload.nbf) || payload.nbf > now) throw new require_utils_jwt_types.JwtTokenNotBefore(token);
}
if (exp && payload.exp !== void 0) {
if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp) || payload.exp <= now) throw new require_utils_jwt_types.JwtTokenExpired(token);
}
if (iat && payload.iat !== void 0) {
if (typeof payload.iat !== "number" || !Number.isFinite(payload.iat) || now < payload.iat) throw new require_utils_jwt_types.JwtTokenIssuedAt(now, payload.iat);
}
if (iss) {
if (!payload.iss) throw new require_utils_jwt_types.JwtTokenIssuer(iss, null);
if (typeof iss === "string" && payload.iss !== iss) throw new require_utils_jwt_types.JwtTokenIssuer(iss, payload.iss);
if (iss instanceof RegExp && !iss.test(payload.iss)) throw new require_utils_jwt_types.JwtTokenIssuer(iss, payload.iss);
}
if (aud) {
if (!payload.aud) throw new require_utils_jwt_types.JwtPayloadRequiresAud(payload);
if (!(Array.isArray(payload.aud) ? payload.aud : [payload.aud]).some((payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud))) throw new require_utils_jwt_types.JwtTokenAudience(aud, payload.aud);
}
const headerPayload = token.substring(0, token.lastIndexOf("."));
let signature;
try {
signature = require_utils_encode.decodeBase64Url(tokenParts[2]);
} catch {
throw new require_utils_jwt_types.JwtTokenInvalid(token);
}
if (!await require_utils_jwt_jws.verifying(publicKey, alg, signature, require_utils_jwt_utf8.utf8Encoder.encode(headerPayload))) throw new require_utils_jwt_types.JwtTokenSignatureMismatched(token);
return payload;
};
const symmetricAlgorithms = [
"HS256",
"HS384",
"HS512"
];
const verifyWithJwks = async (token, options, init) => {
const verifyOpts = options.verification || {};
const header = decodeHeader(token);
if (!isTokenHeader(header)) throw new require_utils_jwt_types.JwtHeaderInvalid(header);
if (!header.kid) throw new require_utils_jwt_types.JwtHeaderRequiresKid(header);
if (symmetricAlgorithms.includes(header.alg)) throw new require_utils_jwt_types.JwtSymmetricAlgorithmNotAllowed(header.alg);
if (!options.allowedAlgorithms.includes(header.alg)) throw new require_utils_jwt_types.JwtAlgorithmNotAllowed(header.alg, options.allowedAlgorithms);
let verifyKeys = options.keys ? [...options.keys] : void 0;
if (options.jwks_uri) {
const response = await fetch(options.jwks_uri, init);
if (!response.ok) throw new Error(`failed to fetch JWKS from ${options.jwks_uri}`);
const data = await response.json();
if (!data.keys) throw new Error("invalid JWKS response. \"keys\" field is missing");
if (!Array.isArray(data.keys)) throw new Error("invalid JWKS response. \"keys\" field is not an array");
verifyKeys ??= [];
verifyKeys.push(...data.keys);
} else if (!verifyKeys) throw new Error("verifyWithJwks requires options for either \"keys\" or \"jwks_uri\" or both");
const matchingKey = verifyKeys.find((key) => key.kid === header.kid);
if (!matchingKey) throw new require_utils_jwt_types.JwtTokenInvalid(token);
if (matchingKey.alg && matchingKey.alg !== header.alg) throw new require_utils_jwt_types.JwtAlgorithmMismatch(matchingKey.alg, header.alg);
return await verify(token, matchingKey, {
alg: header.alg,
...verifyOpts
});
};
const decode = (token) => {
const parts = token.split(".");
if (parts.length !== 3) throw new require_utils_jwt_types.JwtTokenInvalid(token);
try {
return {
header: decodeJwtPart(parts[0]),
payload: decodeJwtPart(parts[1])
};
} catch {
throw new require_utils_jwt_types.JwtTokenInvalid(token);
}
};
const decodeHeader = (token) => {
const parts = token.split(".");
if (parts.length !== 3) throw new require_utils_jwt_types.JwtTokenInvalid(token);
try {
return decodeJwtPart(parts[0]);
} catch {
throw new require_utils_jwt_types.JwtTokenInvalid(token);
}
};
//#endregion
exports.decode = decode;
exports.decodeHeader = decodeHeader;
exports.isTokenHeader = isTokenHeader;
exports.sign = sign;
exports.verify = verify;
exports.verifyWithJwks = verifyWithJwks;
@@ -0,0 +1 @@
module.exports={C:{"115":0.01228,"120":0.31933,"121":0.61001,"133":0.00409,"134":0.00409,"136":0.00409,"138":0.00409,"140":0.00409,"148":0.00409,"150":0.00409,"151":0.00819,"153":0.00409,"154":0.04913,"155":0.18014,"156":0.25792,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 127 128 129 130 131 132 135 137 139 141 142 143 144 145 146 147 149 152 157 158 159 160 3.5 3.6"},D:{"69":0.00409,"87":0.00409,"89":0.00409,"90":0.00819,"92":0.01228,"101":0.02047,"103":0.03685,"104":0.03685,"105":0.02047,"106":0.04503,"107":0.02866,"108":0.02456,"109":0.47081,"110":0.03275,"111":0.02456,"112":0.01638,"113":0.00409,"114":0.00409,"116":0.08188,"117":0.02866,"118":0.65504,"119":0.69189,"120":0.64685,"123":0.03685,"124":0.04503,"125":0.02047,"126":0.02047,"128":0.08597,"130":0.00409,"131":0.08188,"132":0.02047,"133":0.12282,"134":0.49947,"135":0.75739,"136":2.67748,"137":0.05322,"138":0.20879,"139":0.07369,"140":0.13101,"141":0.14329,"142":3.07459,"143":0.03275,"144":1.03169,"145":0.01228,"146":1.93646,"147":0.55678,"148":0.50356,"149":0.22926,"150":0.36437,"151":2.14935,"152":6.68141,"153":4.45018,"154":1.14632,"155":0.10644,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 88 91 93 94 95 96 97 98 99 100 102 115 121 122 127 129 156 157"},F:{"100":0.01228,"101":0.00819,"114":0.00409,"115":0.00819,"116":0.01228,"134":0.06141,"135":0.26202,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 102 103 104 105 106 107 108 109 110 111 112 113 117 118 119 120 121 122 123 124 125 126 127 131 132 133 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.01228,"100":0.00819,"104":0.00409,"109":0.12282,"114":0.01228,"115":0.00819,"116":0.01638,"119":0.25792,"120":0.2702,"122":0.00409,"124":0.00409,"126":0.00409,"127":0.01228,"128":0.00409,"129":0.00819,"132":0.00409,"134":0.00409,"135":0.00409,"136":0.00409,"137":0.00409,"139":0.01228,"140":0.00819,"141":0.00409,"142":0.00409,"143":0.00409,"144":0.01228,"145":0.01638,"146":0.02866,"147":0.02047,"148":0.01638,"149":0.01228,"150":0.04094,"151":0.22926,"152":1.58438,"153":1.2282,"154":0.29067,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 105 106 107 108 110 111 112 113 117 118 121 123 125 130 131 133 138"},E:{"27":0.14329,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 17.0 17.2 17.3 17.5 18.4 26.1 27.1 TP","14.1":0.00409,"15.6":0.02456,"16.5":0.00409,"16.6":0.04094,"17.1":0.00819,"17.4":0.00409,"17.6":0.04913,"18.0":0.00409,"18.1":0.00409,"18.2":0.02047,"18.3":0.02047,"18.5-18.7":0.00409,"26.0":0.00409,"26.2":0.02456,"26.3":0.01638,"26.4":0.02047,"26.5":0.16376,"26.6":0.43806,"27.2":0.00409},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0005,"5.0-5.1":0.0005,"6.0-6.1":0,"7.0-7.1":0.00101,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00503,"11.0-11.2":0.0005,"11.3-11.4":0.00101,"12.0-12.1":0,"12.2-12.5":0.01308,"13.0-13.1":0,"13.2":0.00252,"13.3":0,"13.4-13.7":0.0005,"14.0-14.4":0.00201,"14.5-14.8":0.00302,"15.0-15.1":0.00302,"15.2-15.3":0.00201,"15.4":0.00252,"15.5":0.00302,"15.6-15.8":0.06541,"16.0":0.00503,"16.1":0.00906,"16.2":0.00503,"16.3":0.01107,"16.4":0.00252,"16.5":0.00403,"16.6-16.7":0.09108,"17.0":0.00352,"17.1":0.00503,"17.2":0.00503,"17.3":0.00755,"17.4":0.01057,"17.5":0.02063,"17.6-17.7":0.05334,"18.0":0.01107,"18.1":0.02214,"18.2":0.03019,"18.3":0.05233,"18.4":0.03271,"18.5-18.7":0.67579,"26.0":0.03271,"26.1":0.03321,"26.2":0.08655,"26.3":0.09359,"26.4":0.06843,"26.5":0.45841,"26.6":2.82844,"27.0":0.21688,"27.1":0,"27.2":0.00554},P:{"25":0.00841,"26":0.00841,"27":0.00841,"28":0.04206,"29":0.01682,"30":0.46264,_:"4 20 21 22 23 24 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.00841},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.44886,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":54.63572},R:{_:"0"},M:{"0":0.63785},Q:{_:"14.9"},O:{"0":0.67328},H:{all:0}};
@@ -0,0 +1,11 @@
export type Options = [
{
allow?: string[];
allowAsImport?: boolean;
}
];
export type MessageIds = 'noRequireImports';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRequireImports", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,315 @@
/**
* RFC 7914 Scrypt KDF. Can be used to create a key from password and salt.
* @module
*/
import { pbkdf2 } from './pbkdf2.ts';
import { sha256 } from './sha2.ts';
// prettier-ignore
import {
anumber, asyncLoop,
checkOpts, clean,
rotl,
swap32IfBE,
u32,
type KDFInput,
type TArg,
type TRet
} from './utils.ts';
// The main Scrypt loop: uses Salsa extensively.
// Six versions of the function were tried, this is the fastest one.
// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block
// after xor'ing two such blocks.
// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`.
// prettier-ignore
function XorAndSalsa(
prev: TArg<Uint32Array>,
pi: number,
input: TArg<Uint32Array>,
ii: number,
out: TArg<Uint32Array>,
oi: number
) {
// Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core.
// Xor blocks
let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];
let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];
let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];
let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];
let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];
let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];
let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];
let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];
// Save state to temporary variables (salsa)
let x00 = y00, x01 = y01, x02 = y02, x03 = y03,
x04 = y04, x05 = y05, x06 = y06, x07 = y07,
x08 = y08, x09 = y09, x10 = y10, x11 = y11,
x12 = y12, x13 = y13, x14 = y14, x15 = y15;
// Main loop (salsa)
for (let i = 0; i < 8; i += 2) {
x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9);
x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18);
x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9);
x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18);
x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9);
x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18);
x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9);
x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18);
x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9);
x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18);
x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9);
x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18);
x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9);
x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18);
x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9);
x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18);
}
// Write output (salsa)
out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0;
out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0;
out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0;
out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0;
out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0;
out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0;
out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0;
out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0;
}
function BlockMix(
input: TArg<Uint32Array>,
ii: number,
out: TArg<Uint32Array>,
oi: number,
r: number
) {
// The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks.
let head = oi + 0;
let tail = oi + 16 * r;
for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]
for (let i = 0; i < r; i++, head += 16, ii += 16) {
// RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`;
// `head` and `tail` lay out those even/odd halves in place.
XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])
if (i > 0) tail += 16; // First iteration overwrites tmp value in tail
// tail[i] = Salsa(blockIn[2*i+1] ^ head[i])
XorAndSalsa(out, head, input, (ii += 16), out, tail);
}
}
/**
* Scrypt options:
* - `N` is cpu/mem work factor (power of 2 e.g. `2**18`)
* - `r` is block size (8 is common), fine-tunes sequential memory read size and performance
* - `p` is parallelization factor (1 is common)
* - `dkLen` is output key length in bytes e.g. 32, and must be `>= 1` per RFC 7914 §2.
* - `asyncTick` - (default: 10) max time in ms for which async function can block execution
* - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt
* - `onProgress` - callback function that would be executed for progress report
*/
export type ScryptOpts = {
/** CPU and memory work factor. Must be a power of two. */
N: number;
/** Block size parameter. */
r: number;
/** Parallelization factor. */
p: number;
/** Desired derived key length in bytes, must be `>= 1` per RFC 7914 §2. */
dkLen?: number;
/** Max scheduler block time in milliseconds for the async variant. */
asyncTick?: number;
/** Maximum temporary memory budget in bytes. */
maxmem?: number;
/**
* Optional progress callback invoked during long-running derivations.
* param progress - completion fraction in the `0..1` range
*/
onProgress?: (progress: number) => void;
};
// Common prologue and epilogue for sync/async functions
function scryptInit(password: TArg<KDFInput>, salt: TArg<KDFInput>, _opts?: TArg<ScryptOpts>) {
// Maxmem - 1GB+1KB by default
const opts = checkOpts(
{
dkLen: 32,
asyncTick: 10,
maxmem: 1024 ** 3 + 1024,
},
_opts
);
const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;
anumber(N, 'N');
anumber(r, 'r');
anumber(p, 'p');
anumber(dkLen, 'dkLen');
anumber(asyncTick, 'asyncTick');
anumber(maxmem, 'maxmem');
if (onProgress !== undefined && typeof onProgress !== 'function')
throw new Error('progressCb must be a function');
const blockSize = 128 * r;
const blockSize32 = blockSize / 4;
// Max N is 2^32 (Integrify is 32-bit).
// Real limit can be 2^22: some JS engines limit Uint8Array to 4GB.
// Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs,
// which used incorrect r: 1, p: 8. Also, the check seems to be a spec error:
// https://www.rfc-editor.org/errata_search.php?rfc=7914
const pow32 = Math.pow(2, 32);
if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32)
throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32');
if (p < 1 || p > ((pow32 - 1) * 32) / blockSize)
throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)');
// RFC 7914 §2 defines `dkLen` as a positive integer.
if (dkLen < 1 || dkLen > (pow32 - 1) * 32)
throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32');
// Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation.
// Node requires more headroom here, so this accounting is intentionally noble-specific.
const memUsed = blockSize * (N + p + 1);
if (memUsed > maxmem)
throw new Error(
'"maxmem" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem
);
// [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)
// Since it has only one iteration there is no reason to use async variant
const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });
const B32 = u32(B);
// Re-used between parallel iterations. Array(iterations) of B
const V = u32(new Uint8Array(blockSize * N));
const tmp = u32(new Uint8Array(blockSize));
let blockMixCb = () => {};
if (onProgress) {
const totalBlockMix = 2 * N * p;
// Invoke callback if progress changes from 10.01 to 10.02
// Allows to draw smooth progress bar on up to 8K screen
const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);
let blockMixCnt = 0;
blockMixCb = () => {
blockMixCnt++;
if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix))
onProgress(blockMixCnt / totalBlockMix);
};
}
return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };
}
function scryptOutput(
password: TArg<KDFInput>,
dkLen: number,
B: TArg<Uint8Array>,
V: TArg<Uint32Array>,
tmp: TArg<Uint32Array>
): TRet<Uint8Array> {
// Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace.
const res = pbkdf2(sha256, password, B, { c: 1, dkLen });
clean(B, V, tmp);
return res;
}
/**
* Scrypt KDF from RFC 7914. See {@link ScryptOpts}.
* @param password - password or key material to derive from;
* JS string inputs are UTF-8 encoded first
* @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first
* @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,
* must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}.
* @returns Derived key bytes.
* @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}
* @example
* Derive a key with scrypt.
* ```ts
* scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });
* ```
*/
export function scrypt(
password: TArg<KDFInput>,
salt: TArg<KDFInput>,
opts: TArg<ScryptOpts>
): TRet<Uint8Array> {
const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(
password,
salt,
opts
);
swap32IfBE(B32);
for (let pi = 0; pi < p; pi++) {
const Pi = blockSize32 * pi;
for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i]
for (let i = 0, pos = 0; i < N - 1; i++) {
BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);
blockMixCb();
}
BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element
blockMixCb();
for (let i = 0; i < N; i++) {
// First u32 of the last 64-byte block (u32 is LE)
// RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N
// only depends on the low word here because N is a power of two and
// this implementation caps N at 2^32.
// & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked
// above; >>> 0 for unsigned, input fits in u32.
const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations
// tmp = B ^ V[j]
for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];
BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])
blockMixCb();
}
}
swap32IfBE(B32);
return scryptOutput(password, dkLen, B, V, tmp);
}
/**
* Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}.
* @param password - password or key material to derive from;
* JS string inputs are UTF-8 encoded first
* @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first
* @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,
* must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local
* scheduler-yield control for this JS wrapper, not part of RFC 7914.
* See {@link ScryptOpts}.
* @returns Promise resolving to derived key bytes.
* @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}
* @example
* Derive a key with scrypt asynchronously.
* ```ts
* await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });
* ```
*/
export async function scryptAsync(
password: TArg<KDFInput>,
salt: TArg<KDFInput>,
opts: TArg<ScryptOpts>
): Promise<TRet<Uint8Array>> {
const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(
password,
salt,
opts
);
swap32IfBE(B32);
for (let pi = 0; pi < p; pi++) {
const Pi = blockSize32 * pi;
for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i]
let pos = 0;
await asyncLoop(N - 1, asyncTick, () => {
BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);
blockMixCb();
});
BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element
blockMixCb();
await asyncLoop(N, asyncTick, () => {
// First u32 of the last 64-byte block (u32 is LE)
// RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N
// only depends on the low word here because N is a power of two and
// this implementation caps N at 2^32.
// & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked
// above; >>> 0 for unsigned, input fits in u32.
const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations
// tmp = B ^ V[j]
for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];
BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])
blockMixCb();
});
}
swap32IfBE(B32);
return scryptOutput(password, dkLen, B, V, tmp);
}
@@ -0,0 +1 @@
{"version":3,"file":"pipette.js","sources":["../../../src/icons/pipette.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Pipette\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMiAyMiAxLTFoM2w5LTkiIC8+CiAgPHBhdGggZD0iTTMgMjF2LTNsOS05IiAvPgogIDxwYXRoIGQ9Im0xNSA2IDMuNC0zLjRhMi4xIDIuMSAwIDEgMSAzIDNMMTggOWwuNC40YTIuMSAyLjEgMCAxIDEtMyAzbC0zLjgtMy44YTIuMSAyLjEgMCAxIDEgMy0zbC40LjRaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/pipette\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 Pipette = createLucideIcon('Pipette', [\n ['path', { d: 'm2 22 1-1h3l9-9', key: '1sre89' }],\n ['path', { d: 'M3 21v-3l9-9', key: 'hpe2y6' }],\n [\n 'path',\n {\n d: 'm15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z',\n key: '196du1',\n },\n ],\n]);\n\nexport default Pipette;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,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,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC7C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,7 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): schemas.ZodMiniString<T>;
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): schemas.ZodMiniNumber<T>;
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): schemas.ZodMiniBoolean<T>;
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): schemas.ZodMiniBigInt<T>;
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): schemas.ZodMiniDate<T>;
@@ -0,0 +1,16 @@
import type { TSESLint } from '@typescript-eslint/utils';
type Types = Record<string, boolean | string | {
fixWith?: string;
message: string;
suggest?: readonly string[];
} | null>;
export type Options = [
{
types?: Types;
}
];
export type MessageIds = 'bannedTypeMessage' | 'bannedTypeReplacement';
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,256 @@
"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: 'consistent-indexed-object-style',
meta: {
type: 'suggestion',
docs: {
description: 'Require or disallow the `Record` type',
recommended: 'stylistic',
},
fixable: 'code',
// eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- suggestions are exposed through a helper.
hasSuggestions: true,
messages: {
preferIndexSignature: 'An index signature is preferred over a record.',
preferIndexSignatureSuggestion: 'Change into an index signature instead of a record.',
preferRecord: 'A record is preferred over an index signature.',
},
schema: [
{
type: 'string',
description: 'Which indexed object syntax to prefer.',
enum: ['record', 'index-signature'],
},
],
},
defaultOptions: ['record'],
create(context, [mode]) {
function checkMembers(members, node, parentId, prefix, postfix, safeFix = true) {
if (members.length !== 1) {
return;
}
const [member] = members;
if (member.type !== utils_1.AST_NODE_TYPES.TSIndexSignature) {
return;
}
const parameter = member.parameters.at(0);
if (parameter?.type !== utils_1.AST_NODE_TYPES.Identifier) {
return;
}
const keyType = parameter.typeAnnotation;
if (!keyType) {
return;
}
const valueType = member.typeAnnotation;
if (!valueType) {
return;
}
if (parentId) {
const scope = context.sourceCode.getScope(parentId);
const superVar = utils_1.ASTUtils.findVariable(scope, parentId.name);
if (superVar &&
isDeeplyReferencingType(node, superVar, new Set([parentId]))) {
return;
}
}
context.report({
node,
messageId: 'preferRecord',
fix: safeFix
? (fixer) => {
const key = context.sourceCode.getText(keyType.typeAnnotation);
const value = context.sourceCode.getText(valueType.typeAnnotation);
const record = member.readonly
? `Readonly<Record<${key}, ${value}>>`
: `Record<${key}, ${value}>`;
return fixer.replaceText(node, `${prefix}${record}${postfix}`);
}
: null,
});
}
return {
...(mode === 'index-signature' && {
TSTypeReference(node) {
const typeName = node.typeName;
if (typeName.type !== utils_1.AST_NODE_TYPES.Identifier) {
return;
}
if (typeName.name !== 'Record') {
return;
}
const params = node.typeArguments?.params;
if (params?.length !== 2) {
return;
}
const indexParam = params[0];
const shouldFix = indexParam.type === utils_1.AST_NODE_TYPES.TSStringKeyword ||
indexParam.type === utils_1.AST_NODE_TYPES.TSNumberKeyword ||
indexParam.type === utils_1.AST_NODE_TYPES.TSSymbolKeyword;
context.report({
node,
messageId: 'preferIndexSignature',
...(0, util_1.getFixOrSuggest)({
fixOrSuggest: shouldFix ? 'fix' : 'suggest',
suggestion: {
messageId: 'preferIndexSignatureSuggestion',
fix: fixer => {
const key = context.sourceCode.getText(params[0]);
const type = context.sourceCode.getText(params[1]);
return fixer.replaceText(node, `{ [key: ${key}]: ${type} }`);
},
},
}),
});
},
}),
...(mode === 'record' && {
TSInterfaceDeclaration(node) {
let genericTypes = '';
if (node.typeParameters?.params.length) {
genericTypes = `<${node.typeParameters.params
.map(p => context.sourceCode.getText(p))
.join(', ')}>`;
}
checkMembers(node.body.body, node, node.id, `type ${node.id.name}${genericTypes} = `, ';', !node.extends.length &&
node.parent.type !== utils_1.AST_NODE_TYPES.ExportDefaultDeclaration);
},
TSMappedType(node) {
const key = node.key;
const scope = context.sourceCode.getScope(key);
const scopeManagerKey = (0, util_1.nullThrows)(scope.variables.find(value => value.name === key.name && value.isTypeVariable), 'key type parameter must be a defined type variable in its scope');
// If the key is used to compute the value, we can't convert to a Record.
if (scopeManagerKey.references.some(reference => reference.isTypeReference)) {
return;
}
const constraint = node.constraint;
if (constraint.type === utils_1.AST_NODE_TYPES.TSTypeOperator &&
constraint.operator === 'keyof' &&
!(0, util_1.isParenthesized)(constraint, context.sourceCode)) {
// This is a weird special case, since modifiers are preserved by
// the mapped type, but not by the Record type. So this type is not,
// in general, equivalent to a Record type.
return;
}
// If the mapped type is circular, we can't convert it to a Record.
const parentId = findParentDeclaration(node)?.id;
if (parentId) {
const scope = context.sourceCode.getScope(key);
const superVar = utils_1.ASTUtils.findVariable(scope, parentId.name);
if (superVar) {
const isCircular = isDeeplyReferencingType(node.parent, superVar, new Set([parentId]));
if (isCircular) {
return;
}
}
}
// There's no builtin Mutable<T> type, so we can't autofix it really.
const canFix = node.readonly !== '-';
context.report({
node,
messageId: 'preferRecord',
...(canFix && {
fix: (fixer) => {
const keyType = context.sourceCode.getText(constraint);
const valueType = node.typeAnnotation
? context.sourceCode.getText(node.typeAnnotation)
: 'any';
let recordText = `Record<${keyType}, ${valueType}>`;
if (node.optional === '+' || node.optional === true) {
recordText = `Partial<${recordText}>`;
}
else if (node.optional === '-') {
recordText = `Required<${recordText}>`;
}
if (node.readonly === '+' || node.readonly === true) {
recordText = `Readonly<${recordText}>`;
}
return fixer.replaceText(node, recordText);
},
}),
});
},
TSTypeLiteral(node) {
const parent = findParentDeclaration(node);
checkMembers(node.members, node, parent?.id, '', '');
},
}),
};
},
});
function findParentDeclaration(node) {
if (node.parent && node.parent.type !== utils_1.AST_NODE_TYPES.TSTypeAnnotation) {
if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) {
return node.parent;
}
return findParentDeclaration(node.parent);
}
return undefined;
}
function isDeeplyReferencingType(node, superVar, visited) {
if (visited.has(node)) {
// something on the chain is circular but it's not the reference being checked
return false;
}
visited.add(node);
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSTypeLiteral:
return node.members.some(member => isDeeplyReferencingType(member, superVar, visited));
case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration:
return isDeeplyReferencingType(node.typeAnnotation, superVar, visited);
case utils_1.AST_NODE_TYPES.TSIndexedAccessType:
return [node.indexType, node.objectType].some(type => isDeeplyReferencingType(type, superVar, visited));
case utils_1.AST_NODE_TYPES.TSMappedType:
if (node.typeAnnotation) {
return isDeeplyReferencingType(node.typeAnnotation, superVar, visited);
}
break;
case utils_1.AST_NODE_TYPES.TSConditionalType:
return [
node.checkType,
node.extendsType,
node.falseType,
node.trueType,
].some(type => isDeeplyReferencingType(type, superVar, visited));
case utils_1.AST_NODE_TYPES.TSUnionType:
case utils_1.AST_NODE_TYPES.TSIntersectionType:
return node.types.some(type => isDeeplyReferencingType(type, superVar, visited));
case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration:
return node.body.body.some(type => isDeeplyReferencingType(type, superVar, visited));
case utils_1.AST_NODE_TYPES.TSTypeAnnotation:
return isDeeplyReferencingType(node.typeAnnotation, superVar, visited);
case utils_1.AST_NODE_TYPES.TSIndexSignature: {
if (node.typeAnnotation) {
return isDeeplyReferencingType(node.typeAnnotation, superVar, visited);
}
break;
}
case utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation: {
return node.params.some(param => isDeeplyReferencingType(param, superVar, visited));
}
case utils_1.AST_NODE_TYPES.TSTypeReference: {
if (isDeeplyReferencingType(node.typeName, superVar, visited)) {
return true;
}
if (node.typeArguments &&
isDeeplyReferencingType(node.typeArguments, superVar, visited)) {
return true;
}
break;
}
case utils_1.AST_NODE_TYPES.Identifier: {
// check if the identifier is a reference of the type being checked
if (superVar.references.some(ref => (0, util_1.isNodeEqual)(ref.identifier, node))) {
return true;
}
// otherwise, follow its definition(s)
const refVar = utils_1.ASTUtils.findVariable(superVar.scope, node.name);
if (refVar) {
return refVar.defs.some(def => isDeeplyReferencingType(def.node, superVar, visited));
}
}
}
return false;
}
@@ -0,0 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03
### Commits
- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff)
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719)
- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8)
## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15
### Commits
- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be)
- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e)
- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49)
- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7)
## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10
### Commits
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5)
- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14)
- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871)
## v1.0.1 - 2024-12-05
### Commits
- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d)
- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9)
- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275)
- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb)
- [actions] skip `npm ls` in node &lt; 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8)
- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97)
@@ -0,0 +1,169 @@
# http-errors
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][node-url]
[![Node.js Version][node-image]][node-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
Create HTTP errors for Express, Koa, Connect, etc. with ease.
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```console
$ npm install http-errors
```
## Example
```js
var createError = require('http-errors')
var express = require('express')
var app = express()
app.use(function (req, res, next) {
if (!req.user) return next(createError(401, 'Please login to view this page.'))
next()
})
```
## API
This is the current API, currently extracted from Koa and subject to change.
### Error Properties
- `expose` - can be used to signal if `message` should be sent to the client,
defaulting to `false` when `status` >= 500
- `headers` - can be an object of header names to values to be sent to the
client, defaulting to `undefined`. When defined, the key names should all
be lower-cased
- `message` - the traditional error message, which should be kept short and all
single line
- `status` - the status code of the error, mirroring `statusCode` for general
compatibility
- `statusCode` - the status code of the error, defaulting to `500`
### createError([status], [message], [properties])
Create a new error object with the given message `msg`.
The error object inherits from `createError.HttpError`.
```js
var err = createError(404, 'This video does not exist!')
```
- `status: 500` - the status code as a number
- `message` - the message of the error, defaulting to node's text for that status code.
- `properties` - custom properties to attach to the object
### createError([status], [error], [properties])
Extend the given `error` object with `createError.HttpError`
properties. This will not alter the inheritance of the given
`error` object, and the modified `error` object is the
return value.
<!-- eslint-disable no-redeclare -->
```js
fs.readFile('foo.txt', function (err, buf) {
if (err) {
if (err.code === 'ENOENT') {
var httpError = createError(404, err, { expose: false })
} else {
var httpError = createError(500, err)
}
}
})
```
- `status` - the status code as a number
- `error` - the error object to extend
- `properties` - custom properties to attach to the object
### createError.isHttpError(val)
Determine if the provided `val` is an `HttpError`. This will return `true`
if the error inherits from the `HttpError` constructor of this module or
matches the "duck type" for an error this module creates. All outputs from
the `createError` factory will return `true` for this function, including
if an non-`HttpError` was passed into the factory.
### new createError\[code || name\](\[msg]\))
Create a new error object with the given message `msg`.
The error object inherits from `createError.HttpError`.
```js
var err = new createError.NotFound()
```
- `code` - the status code as a number
- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
#### List of all constructors
|Status Code|Constructor Name |
|-----------|-----------------------------|
|400 |BadRequest |
|401 |Unauthorized |
|402 |PaymentRequired |
|403 |Forbidden |
|404 |NotFound |
|405 |MethodNotAllowed |
|406 |NotAcceptable |
|407 |ProxyAuthenticationRequired |
|408 |RequestTimeout |
|409 |Conflict |
|410 |Gone |
|411 |LengthRequired |
|412 |PreconditionFailed |
|413 |PayloadTooLarge |
|414 |URITooLong |
|415 |UnsupportedMediaType |
|416 |RangeNotSatisfiable |
|417 |ExpectationFailed |
|418 |ImATeapot |
|421 |MisdirectedRequest |
|422 |UnprocessableEntity |
|423 |Locked |
|424 |FailedDependency |
|425 |TooEarly |
|426 |UpgradeRequired |
|428 |PreconditionRequired |
|429 |TooManyRequests |
|431 |RequestHeaderFieldsTooLarge |
|451 |UnavailableForLegalReasons |
|500 |InternalServerError |
|501 |NotImplemented |
|502 |BadGateway |
|503 |ServiceUnavailable |
|504 |GatewayTimeout |
|505 |HTTPVersionNotSupported |
|506 |VariantAlsoNegotiates |
|507 |InsufficientStorage |
|508 |LoopDetected |
|509 |BandwidthLimitExceeded |
|510 |NotExtended |
|511 |NetworkAuthenticationRequired|
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci
[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master
[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master
[node-image]: https://badgen.net/npm/node/http-errors
[node-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/http-errors
[npm-url]: https://npmjs.org/package/http-errors
[npm-version-image]: https://badgen.net/npm/v/http-errors
[travis-image]: https://badgen.net/travis/jshttp/http-errors/master
[travis-url]: https://travis-ci.org/jshttp/http-errors
@@ -0,0 +1,236 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("./types");
const __1 = require("..");
const codegen_1 = require("../codegen");
const ref_error_1 = require("../ref_error");
const names_1 = require("../names");
const code_1 = require("../../vocabularies/code");
const ref_1 = require("../../vocabularies/jtd/ref");
const util_1 = require("../util");
const quote_1 = require("../../runtime/quote");
const genSerialize = {
elements: serializeElements,
values: serializeValues,
discriminator: serializeDiscriminator,
properties: serializeProperties,
optionalProperties: serializeProperties,
enum: serializeString,
type: serializeType,
ref: serializeRef,
};
function compileSerializer(sch, definitions) {
const _sch = __1.getCompilingSchema.call(this, sch);
if (_sch)
return _sch;
const { es5, lines } = this.opts.code;
const { ownProperties } = this.opts;
const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
const serializeName = gen.scopeName("serialize");
const cxt = {
self: this,
gen,
schema: sch.schema,
schemaEnv: sch,
definitions,
data: names_1.default.data,
};
let sourceCode;
try {
this._compilations.add(sch);
sch.serializeName = serializeName;
gen.func(serializeName, names_1.default.data, false, () => {
gen.let(names_1.default.json, (0, codegen_1.str) ``);
serializeCode(cxt);
gen.return(names_1.default.json);
});
gen.optimize(this.opts.code.optimize);
const serializeFuncCode = gen.toString();
sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`;
const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode);
const serialize = makeSerialize(this.scope.get());
this.scope.value(serializeName, { ref: serialize });
sch.serialize = serialize;
}
catch (e) {
if (sourceCode)
this.logger.error("Error compiling serializer, function code:", sourceCode);
delete sch.serialize;
delete sch.serializeName;
throw e;
}
finally {
this._compilations.delete(sch);
}
return sch;
}
exports.default = compileSerializer;
function serializeCode(cxt) {
let form;
for (const key of types_1.jtdForms) {
if (key in cxt.schema) {
form = key;
break;
}
}
serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty);
}
function serializeNullable(cxt, serializeForm) {
const { gen, schema, data } = cxt;
if (!schema.nullable)
return serializeForm(cxt);
gen.if((0, codegen_1._) `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, (0, codegen_1._) `"null"`), () => serializeForm(cxt));
}
function serializeElements(cxt) {
const { gen, schema, data } = cxt;
gen.add(names_1.default.json, (0, codegen_1.str) `[`);
const first = gen.let("first", true);
gen.forOf("el", data, (el) => {
addComma(cxt, first);
serializeCode({ ...cxt, schema: schema.elements, data: el });
});
gen.add(names_1.default.json, (0, codegen_1.str) `]`);
}
function serializeValues(cxt) {
const { gen, schema, data } = cxt;
gen.add(names_1.default.json, (0, codegen_1.str) `{`);
const first = gen.let("first", true);
gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first));
gen.add(names_1.default.json, (0, codegen_1.str) `}`);
}
function serializeKeyValue(cxt, key, schema, first) {
const { gen, data } = cxt;
addComma(cxt, first);
serializeString({ ...cxt, data: key });
gen.add(names_1.default.json, (0, codegen_1.str) `:`);
const value = gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`);
serializeCode({ ...cxt, schema, data: value });
}
function serializeDiscriminator(cxt) {
const { gen, schema, data } = cxt;
const { discriminator } = schema;
gen.add(names_1.default.json, (0, codegen_1.str) `{${JSON.stringify(discriminator)}:`);
const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(discriminator)}`);
serializeString({ ...cxt, data: tag });
gen.if(false);
for (const tagValue in schema.mapping) {
gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
const sch = schema.mapping[tagValue];
serializeSchemaProperties({ ...cxt, schema: sch }, discriminator);
}
gen.endIf();
gen.add(names_1.default.json, (0, codegen_1.str) `}`);
}
function serializeProperties(cxt) {
const { gen } = cxt;
gen.add(names_1.default.json, (0, codegen_1.str) `{`);
serializeSchemaProperties(cxt);
gen.add(names_1.default.json, (0, codegen_1.str) `}`);
}
function serializeSchemaProperties(cxt, discriminator) {
const { gen, schema, data } = cxt;
const { properties, optionalProperties } = schema;
const props = keys(properties);
const optProps = keys(optionalProperties);
const allProps = allProperties(props.concat(optProps));
let first = !discriminator;
let firstProp;
for (const key of props) {
if (first)
first = false;
else
gen.add(names_1.default.json, (0, codegen_1.str) `,`);
serializeProperty(key, properties[key], keyValue(key));
}
if (first)
firstProp = gen.let("first", true);
for (const key of optProps) {
const value = keyValue(key);
gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => {
addComma(cxt, firstProp);
serializeProperty(key, optionalProperties[key], value);
});
}
if (schema.additionalProperties) {
gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)));
}
function keys(ps) {
return ps ? Object.keys(ps) : [];
}
function allProperties(ps) {
if (discriminator)
ps.push(discriminator);
if (new Set(ps).size !== ps.length) {
throw new Error("JTD: properties/optionalProperties/disciminator overlap");
}
return ps;
}
function keyValue(key) {
return gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`);
}
function serializeProperty(key, propSchema, value) {
gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`);
serializeCode({ ...cxt, schema: propSchema, data: value });
}
function isAdditional(key, ps) {
return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)) : true;
}
}
function serializeType(cxt) {
const { gen, schema, data } = cxt;
switch (schema.type) {
case "boolean":
gen.add(names_1.default.json, (0, codegen_1._) `${data} ? "true" : "false"`);
break;
case "string":
serializeString(cxt);
break;
case "timestamp":
gen.if((0, codegen_1._) `${data} instanceof Date`, () => gen.add(names_1.default.json, (0, codegen_1._) `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt));
break;
default:
serializeNumber(cxt);
}
}
function serializeString({ gen, data }) {
gen.add(names_1.default.json, (0, codegen_1._) `${(0, util_1.useFunc)(gen, quote_1.default)}(${data})`);
}
function serializeNumber({ gen, data, self }) {
const condition = (0, codegen_1._) `${data} === Infinity || ${data} === -Infinity || ${data} !== ${data}`;
if (self.opts.specialNumbers === undefined || self.opts.specialNumbers === "fast") {
gen.add(names_1.default.json, (0, codegen_1._) `"" + ${data}`);
}
else {
// specialNumbers === "null"
gen.if(condition, () => gen.add(names_1.default.json, (0, codegen_1._) `null`), () => gen.add(names_1.default.json, (0, codegen_1._) `"" + ${data}`));
}
}
function serializeRef(cxt) {
const { gen, self, data, definitions, schema, schemaEnv } = cxt;
const { ref } = schema;
const refSchema = definitions[ref];
if (!refSchema)
throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`);
if (!(0, ref_1.hasRef)(refSchema))
return serializeCode({ ...cxt, schema: refSchema });
const { root } = schemaEnv;
const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions);
gen.add(names_1.default.json, (0, codegen_1._) `${getSerialize(gen, sch)}(${data})`);
}
function getSerialize(gen, sch) {
return sch.serialize
? gen.scopeValue("serialize", { ref: sch.serialize })
: (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.serialize`;
}
function serializeEmpty({ gen, data }) {
gen.add(names_1.default.json, (0, codegen_1._) `JSON.stringify(${data})`);
}
function addComma({ gen }, first) {
if (first) {
gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`));
}
else {
gen.add(names_1.default.json, (0, codegen_1.str) `,`);
}
}
//# sourceMappingURL=serialize.js.map
@@ -0,0 +1,16 @@
'use strict'
module.exports = {
// Export promiseified graceful-fs:
...require('./fs'),
// Export extra methods:
...require('./copy'),
...require('./empty'),
...require('./ensure'),
...require('./json'),
...require('./mkdirs'),
...require('./move'),
...require('./output-file'),
...require('./path-exists'),
...require('./remove')
}
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","isNode","node","VISITOR_KEYS","type"],"sources":["../../src/validators/isNode.ts"],"sourcesContent":["import { VISITOR_KEYS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function isNode(node: any): node is t.Node {\n return !!(node && VISITOR_KEYS[node.type]);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGe,SAASC,MAAMA,CAACC,IAAS,EAAkB;EACxD,OAAO,CAAC,EAAEA,IAAI,IAAIC,mBAAY,CAACD,IAAI,CAACE,IAAI,CAAC,CAAC;AAC5C","ignoreList":[]}
@@ -0,0 +1,42 @@
/*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
*/
const debug = require('debug')('body-parser:raw')
const read = require('../read')
const { normalizeOptions, passthrough } = require('../utils')
/**
* Module exports.
*/
module.exports = raw
/**
* Create a middleware to parse raw bodies.
*
* @param {Object} [options]
* @returns {Function}
* @public
*/
function raw (options) {
const normalizedOptions = normalizeOptions(options, 'application/octet-stream')
const readOptions = {
...normalizedOptions,
// Skip charset validation and parse the body as is
skipCharset: true
}
return function rawParser (req, res, next) {
read(req, res, next, passthrough, debug, readOptions)
}
}
@@ -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 Fan = createLucideIcon("Fan", [
[
"path",
{
d: "M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",
key: "484a7f"
}
],
["path", { d: "M12 12v.01", key: "u5ubse" }]
]);
export { Fan as default };
//# sourceMappingURL=fan.js.map
@@ -0,0 +1,197 @@
/**
* The `node:trace_events` module provides a mechanism to centralize tracing information
* generated by V8, Node.js core, and userspace code.
*
* Tracing can be enabled with the `--trace-event-categories` command-line flag
* or by using the `trace_events` module. The `--trace-event-categories` flag
* accepts a list of comma-separated category names.
*
* The available categories are:
*
* * `node`: An empty placeholder.
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) trace data.
* The [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
* * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
* * `node.console`: Enables capture of `console.time()` and `console.count()` output.
* * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
* * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
* * `node.dns.native`: Enables capture of trace data for DNS queries.
* * `node.net.native`: Enables capture of trace data for network.
* * `node.environment`: Enables capture of Node.js Environment milestones.
* * `node.fs.sync`: Enables capture of trace data for file system sync methods.
* * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
* * `node.fs.async`: Enables capture of trace data for file system async methods.
* * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v24.x/api/perf_hooks.html) measurements.
* * `node.perf.usertiming`: Enables capture of only Performance API User Timing
* measures and marks.
* * `node.perf.timerify`: Enables capture of only Performance API timerify
* measurements.
* * `node.promises.rejections`: Enables capture of trace data tracking the number
* of unhandled Promise rejections and handled-after-rejections.
* * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
* * `v8`: The [V8](https://nodejs.org/docs/latest-v24.x/api/v8.html) events are GC, compiling, and execution related.
* * `node.http`: Enables capture of trace data for http request / response.
*
* By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
*
* ```bash
* node --trace-event-categories v8,node,node.async_hooks server.js
* ```
*
* Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be
* used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default.
*
* ```bash
* node --trace-events-enabled
*
* # is equivalent to
*
* node --trace-event-categories v8,node,node.async_hooks
* ```
*
* Alternatively, trace events may be enabled using the `node:trace_events` module:
*
* ```js
* import trace_events from 'node:trace_events';
* const tracing = trace_events.createTracing({ categories: ['node.perf'] });
* tracing.enable(); // Enable trace event capture for the 'node.perf' category
*
* // do work
*
* tracing.disable(); // Disable trace event capture for the 'node.perf' category
* ```
*
* Running Node.js with tracing enabled will produce log files that can be opened
* in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
*
* The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can
* be specified with `--trace-event-file-pattern` that accepts a template
* string that supports `${rotation}` and `${pid}`:
*
* ```bash
* node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
* ```
*
* To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
* in your code, such as:
*
* ```js
* process.on('SIGINT', function onSigint() {
* console.info('Received SIGINT.');
* process.exit(130); // Or applicable exit code depending on OS and signal
* });
* ```
*
* The tracing system uses the same time source
* as the one used by `process.hrtime()`.
* However the trace-event timestamps are expressed in microseconds,
* unlike `process.hrtime()` which returns nanoseconds.
*
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#class-worker) threads.
* @experimental
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/trace_events.js)
*/
declare module "trace_events" {
/**
* The `Tracing` object is used to enable or disable tracing for sets of
* categories. Instances are created using the
* `trace_events.createTracing()` method.
*
* When created, the `Tracing` object is disabled. Calling the
* `tracing.enable()` method adds the categories to the set of enabled trace
* event categories. Calling `tracing.disable()` will remove the categories
* from the set of enabled trace event categories.
*/
interface Tracing {
/**
* A comma-separated list of the trace event categories covered by this
* `Tracing` object.
* @since v10.0.0
*/
readonly categories: string;
/**
* Disables this `Tracing` object.
*
* Only trace event categories _not_ covered by other enabled `Tracing`
* objects and _not_ specified by the `--trace-event-categories` flag
* will be disabled.
*
* ```js
* import trace_events from 'node:trace_events';
* const t1 = trace_events.createTracing({ categories: ['node', 'v8'] });
* const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] });
* t1.enable();
* t2.enable();
*
* // Prints 'node,node.perf,v8'
* console.log(trace_events.getEnabledCategories());
*
* t2.disable(); // Will only disable emission of the 'node.perf' category
*
* // Prints 'node,v8'
* console.log(trace_events.getEnabledCategories());
* ```
* @since v10.0.0
*/
disable(): void;
/**
* Enables this `Tracing` object for the set of categories covered by
* the `Tracing` object.
* @since v10.0.0
*/
enable(): void;
/**
* `true` only if the `Tracing` object has been enabled.
* @since v10.0.0
*/
readonly enabled: boolean;
}
interface CreateTracingOptions {
/**
* An array of trace category names. Values included in the array are
* coerced to a string when possible. An error will be thrown if the
* value cannot be coerced.
*/
categories: string[];
}
/**
* Creates and returns a `Tracing` object for the given set of `categories`.
*
* ```js
* import trace_events from 'node:trace_events';
* const categories = ['node.perf', 'node.async_hooks'];
* const tracing = trace_events.createTracing({ categories });
* tracing.enable();
* // do stuff
* tracing.disable();
* ```
* @since v10.0.0
*/
function createTracing(options: CreateTracingOptions): Tracing;
/**
* Returns a comma-separated list of all currently-enabled trace event
* categories. The current set of enabled trace event categories is determined
* by the _union_ of all currently-enabled `Tracing` objects and any categories
* enabled using the `--trace-event-categories` flag.
*
* Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console.
*
* ```js
* import trace_events from 'node:trace_events';
* const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
* const t2 = trace_events.createTracing({ categories: ['node.perf'] });
* const t3 = trace_events.createTracing({ categories: ['v8'] });
*
* t1.enable();
* t2.enable();
*
* console.log(trace_events.getEnabledCategories());
* ```
* @since v10.0.0
*/
function getEnabledCategories(): string | undefined;
}
declare module "node:trace_events" {
export * from "trace_events";
}
@@ -0,0 +1 @@
{"version":3,"file":"simpleClientCredentials.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/simpleClientCredentials.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;GAiBG"}
@@ -0,0 +1,7 @@
"use strict";
const constants = require("./constants-DR3SPJ7u.js");
const addMilliseconds = require("./addMilliseconds.js");
function addHours(date, hours) {
return addMilliseconds(date, hours * constants.MS_IN_HOUR);
}
module.exports = addHours;
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefinitionBase = void 0;
const ID_1 = require("../ID");
const generator = (0, ID_1.createIdGenerator)();
class DefinitionBase {
/**
* A unique ID for this instance - primarily used to help debugging and testing
*/
$id = generator();
type;
/**
* The `Identifier` node of this definition
* @public
*/
name;
/**
* The enclosing node of the name.
* @public
*/
node;
/**
* the enclosing statement node of the identifier.
* @public
*/
parent;
constructor(type, name, node, parent) {
this.type = type;
this.name = name;
this.node = node;
this.parent = parent;
}
}
exports.DefinitionBase = DefinitionBase;
@@ -0,0 +1,118 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import EE from 'events';
import { Minipass } from 'minipass';
declare const _autoClose: unique symbol;
declare const _close: unique symbol;
declare const _ended: unique symbol;
declare const _fd: unique symbol;
declare const _finished: unique symbol;
declare const _flags: unique symbol;
declare const _flush: unique symbol;
declare const _handleChunk: unique symbol;
declare const _makeBuf: unique symbol;
declare const _mode: unique symbol;
declare const _needDrain: unique symbol;
declare const _onerror: unique symbol;
declare const _onopen: unique symbol;
declare const _onread: unique symbol;
declare const _onwrite: unique symbol;
declare const _open: unique symbol;
declare const _path: unique symbol;
declare const _pos: unique symbol;
declare const _queue: unique symbol;
declare const _read: unique symbol;
declare const _readSize: unique symbol;
declare const _reading: unique symbol;
declare const _remain: unique symbol;
declare const _size: unique symbol;
declare const _write: unique symbol;
declare const _writing: unique symbol;
declare const _defaultFlag: unique symbol;
declare const _errored: unique symbol;
export type ReadStreamOptions = Minipass.Options<Minipass.ContiguousData> & {
fd?: number;
readSize?: number;
size?: number;
autoClose?: boolean;
};
export type ReadStreamEvents = Minipass.Events<Minipass.ContiguousData> & {
open: [fd: number];
};
export declare class ReadStream extends Minipass<Minipass.ContiguousData, Buffer, ReadStreamEvents> {
[_errored]: boolean;
[_fd]?: number;
[_path]: string;
[_readSize]: number;
[_reading]: boolean;
[_size]: number;
[_remain]: number;
[_autoClose]: boolean;
constructor(path: string, opt: ReadStreamOptions);
get fd(): number | undefined;
get path(): string;
write(): void;
end(): void;
[_open](): void;
[_onopen](er?: NodeJS.ErrnoException | null, fd?: number): void;
[_makeBuf](): Buffer;
[_read](): void;
[_onread](er?: NodeJS.ErrnoException | null, br?: number, buf?: Buffer): void;
[_close](): void;
[_onerror](er: NodeJS.ErrnoException): void;
[_handleChunk](br: number, buf: Buffer): boolean;
emit<Event extends keyof ReadStreamEvents>(ev: Event, ...args: ReadStreamEvents[Event]): boolean;
}
export declare class ReadStreamSync extends ReadStream {
[_open](): void;
[_read](): void;
[_close](): void;
}
export type WriteStreamOptions = {
fd?: number;
autoClose?: boolean;
mode?: number;
captureRejections?: boolean;
start?: number;
flags?: string;
};
export declare class WriteStream extends EE {
readable: false;
writable: boolean;
[_errored]: boolean;
[_writing]: boolean;
[_ended]: boolean;
[_queue]: Buffer[];
[_needDrain]: boolean;
[_path]: string;
[_mode]: number;
[_autoClose]: boolean;
[_fd]?: number;
[_defaultFlag]: boolean;
[_flags]: string;
[_finished]: boolean;
[_pos]?: number;
constructor(path: string, opt: WriteStreamOptions);
emit(ev: string, ...args: any[]): boolean;
get fd(): number | undefined;
get path(): string;
[_onerror](er: NodeJS.ErrnoException): void;
[_open](): void;
[_onopen](er?: null | NodeJS.ErrnoException, fd?: number): void;
end(buf: string, enc?: BufferEncoding): this;
end(buf?: Buffer, enc?: undefined): this;
write(buf: string, enc?: BufferEncoding): boolean;
write(buf: Buffer, enc?: undefined): boolean;
[_write](buf: Buffer): void;
[_onwrite](er?: null | NodeJS.ErrnoException, bw?: number): void;
[_flush](): void;
[_close](): void;
}
export declare class WriteStreamSync extends WriteStream {
[_open](): void;
[_close](): void;
[_write](buf: Buffer): void;
}
export {};
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,90 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { ZodError } from "../ZodError.js";
import { util } from "../helpers/util.js";
const testTuple = z.tuple([z.string(), z.object({ name: z.literal("Rudy") }), z.array(z.literal("blue"))]);
const testData = ["asdf", { name: "Rudy" }, ["blue"]];
const badData = [123, { name: "Rudy2" }, ["blue", "red"]];
test("tuple inference", () => {
const args1 = z.tuple([z.string()]);
const returns1 = z.number();
const func1 = z.function(args1, returns1);
type func1 = z.TypeOf<typeof func1>;
util.assertEqual<func1, (k: string) => number>(true);
});
test("successful validation", () => {
const val = testTuple.parse(testData);
expect(val).toEqual(["asdf", { name: "Rudy" }, ["blue"]]);
});
test("successful async validation", async () => {
const val = await testTuple.parseAsync(testData);
return expect(val).toEqual(testData);
});
test("failed validation", () => {
const checker = () => {
testTuple.parse([123, { name: "Rudy2" }, ["blue", "red"]] as any);
};
try {
checker();
} catch (err) {
if (err instanceof ZodError) {
expect(err.issues.length).toEqual(3);
}
}
});
test("failed async validation", async () => {
const res = await testTuple.safeParse(badData);
expect(res.success).toEqual(false);
if (!res.success) {
expect(res.error.issues.length).toEqual(3);
}
// try {
// checker();
// } catch (err) {
// if (err instanceof ZodError) {
// expect(err.issues.length).toEqual(3);
// }
// }
});
test("tuple with transformers", () => {
const stringToNumber = z.string().transform((val) => val.length);
const val = z.tuple([stringToNumber]);
type t1 = z.input<typeof val>;
util.assertEqual<t1, [string]>(true);
type t2 = z.output<typeof val>;
util.assertEqual<t2, [number]>(true);
expect(val.parse(["1234"])).toEqual([4]);
});
test("tuple with rest schema", () => {
const myTuple = z.tuple([z.string(), z.number()]).rest(z.boolean());
expect(myTuple.parse(["asdf", 1234, true, false, true])).toEqual(["asdf", 1234, true, false, true]);
expect(myTuple.parse(["asdf", 1234])).toEqual(["asdf", 1234]);
expect(() => myTuple.parse(["asdf", 1234, "asdf"])).toThrow();
type t1 = z.output<typeof myTuple>;
util.assertEqual<t1, [string, number, ...boolean[]]>(true);
});
test("parse should fail given sparse array as tuple", () => {
expect(() => testTuple.parse(new Array(3))).toThrow();
});
// test('tuple with optional elements', () => {
// const result = z
// .tuple([z.string(), z.number().optional()])
// .safeParse(['asdf']);
// expect(result).toEqual(['asdf']);
// });
@@ -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 FileVideo2 = createLucideIcon("FileVideo2", [
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "1pf5j1" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["rect", { width: "8", height: "6", x: "2", y: "12", rx: "1", key: "1a6c1e" }],
["path", { d: "m10 15.5 4 2.5v-6l-4 2.5", key: "t7cp39" }]
]);
export { FileVideo2 as default };
//# sourceMappingURL=file-video-2.js.map
@@ -0,0 +1,11 @@
import { RouterProvider } from "../RouterProvider.js";
import "react";
import { jsx } from "react/jsx-runtime";
//#region src/ssr/RouterServer.tsx
function RouterServer(props) {
return /* @__PURE__ */ jsx(RouterProvider, { router: props.router });
}
//#endregion
export { RouterServer };
//# sourceMappingURL=RouterServer.js.map
@@ -0,0 +1,71 @@
/* eslint-disable @definitelytyped/no-self-import -- self-imports in module augmentations aren't self-imports */
/* eslint-disable @definitelytyped/no-declare-current-package -- The module augmentations are optional */
/**
* These are types for things that are present in the upcoming React 18 release.
*
* Once React 18 is released they can just be moved to the main index file.
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react-dom/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react-dom/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react-dom/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
*/
// See https://github.com/facebook/react/blob/main/packages/react-dom/index.js to see how the exports are declared,
// but confirm with published source code (e.g. https://unpkg.com/react-dom@canary) that these exports end up in the published code
import React = require("react");
import ReactDOM = require(".");
export {};
declare module "react" {
// @enableViewTransition
interface ViewTransitionPseudoElement extends Animatable {
getComputedStyle: () => CSSStyleDeclaration;
}
interface ViewTransitionInstance {
group: ViewTransitionPseudoElement;
imagePair: ViewTransitionPseudoElement;
old: ViewTransitionPseudoElement;
new: ViewTransitionPseudoElement;
}
// @enableFragmentRefs
interface FragmentInstance {
blur: () => void;
focus: (focusOptions?: FocusOptions | undefined) => void;
focusLast: (focusOptions?: FocusOptions | undefined) => void;
observeUsing(observer: IntersectionObserver | ResizeObserver): void;
unobserveUsing(observer: IntersectionObserver | ResizeObserver): void;
getClientRects(): Array<DOMRect>;
getRootNode(getRootNodeOptions?: GetRootNodeOptions | undefined): Document | ShadowRoot | FragmentInstance;
addEventListener(
type: string,
listener: EventListener,
optionsOrUseCapture?: Parameters<Element["addEventListener"]>[2],
): void;
removeEventListener(
type: string,
listener: EventListener,
optionsOrUseCapture?: Parameters<Element["removeEventListener"]>[2],
): void;
dispatchEvent(event: Event): boolean;
scrollIntoView(alignToTop?: boolean): void;
}
}
@@ -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 Pocket = createLucideIcon("Pocket", [
[
"path",
{
d: "M4 3h16a2 2 0 0 1 2 2v6a10 10 0 0 1-10 10A10 10 0 0 1 2 11V5a2 2 0 0 1 2-2z",
key: "1mz881"
}
],
["polyline", { points: "8 10 12 14 16 10", key: "w4mbv5" }]
]);
export { Pocket as default };
//# sourceMappingURL=pocket.js.map
@@ -0,0 +1 @@
{"version":3,"file":"map-pin-x-inside.js","sources":["../../../src/icons/map-pin-x-inside.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinXInside\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTBjMCA0Ljk5My01LjUzOSAxMC4xOTMtNy4zOTkgMTEuNzk5YTEgMSAwIDAgMS0xLjIwMiAwQzkuNTM5IDIwLjE5MyA0IDE0Ljk5MyA0IDEwYTggOCAwIDAgMSAxNiAwIiAvPgogIDxwYXRoIGQ9Im0xNC41IDcuNS01IDUiIC8+CiAgPHBhdGggZD0ibTkuNSA3LjUgNSA1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/map-pin-x-inside\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 MapPinXInside = createLucideIcon('MapPinXInside', [\n [\n 'path',\n {\n d: 'M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0',\n key: '1r0f0z',\n },\n ],\n ['path', { d: 'm14.5 7.5-5 5', key: '3lb6iw' }],\n ['path', { d: 'm9.5 7.5 5 5', key: 'ko136h' }],\n]);\n\nexport default MapPinXInside;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CACtD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,48 @@
import * as immutable from "immutable"
import "./sass.dart.js";
const _cliPkgLibrary = globalThis._cliPkgExports.pop();
if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
const _cliPkgExports = {};
_cliPkgLibrary.load({immutable}, _cliPkgExports);
export const compile = _cliPkgExports.compile;
export const compileAsync = _cliPkgExports.compileAsync;
export const compileString = _cliPkgExports.compileString;
export const compileStringAsync = _cliPkgExports.compileStringAsync;
export const initCompiler = _cliPkgExports.initCompiler;
export const initAsyncCompiler = _cliPkgExports.initAsyncCompiler;
export const Compiler = _cliPkgExports.Compiler;
export const AsyncCompiler = _cliPkgExports.AsyncCompiler;
export const Logger = _cliPkgExports.Logger;
export const SassArgumentList = _cliPkgExports.SassArgumentList;
export const SassBoolean = _cliPkgExports.SassBoolean;
export const SassCalculation = _cliPkgExports.SassCalculation;
export const CalculationOperation = _cliPkgExports.CalculationOperation;
export const CalculationInterpolation = _cliPkgExports.CalculationInterpolation;
export const SassColor = _cliPkgExports.SassColor;
export const SassFunction = _cliPkgExports.SassFunction;
export const SassList = _cliPkgExports.SassList;
export const SassMap = _cliPkgExports.SassMap;
export const SassMixin = _cliPkgExports.SassMixin;
export const SassNumber = _cliPkgExports.SassNumber;
export const SassString = _cliPkgExports.SassString;
export const Value = _cliPkgExports.Value;
export const CustomFunction = _cliPkgExports.CustomFunction;
export const ListSeparator = _cliPkgExports.ListSeparator;
export const sassFalse = _cliPkgExports.sassFalse;
export const sassNull = _cliPkgExports.sassNull;
export const sassTrue = _cliPkgExports.sassTrue;
export const Exception = _cliPkgExports.Exception;
export const PromiseOr = _cliPkgExports.PromiseOr;
export const info = _cliPkgExports.info;
export const render = _cliPkgExports.render;
export const renderSync = _cliPkgExports.renderSync;
export const TRUE = _cliPkgExports.TRUE;
export const FALSE = _cliPkgExports.FALSE;
export const NULL = _cliPkgExports.NULL;
export const types = _cliPkgExports.types;
export const NodePackageImporter = _cliPkgExports.NodePackageImporter;
export const deprecations = _cliPkgExports.deprecations;
export const Version = _cliPkgExports.Version;
export const parser_ = _cliPkgExports.parser_;
@@ -0,0 +1 @@
var l={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},mauve:{50:"oklch(98.5% 0 0)",100:"oklch(96% 0.003 325.6)",200:"oklch(92.2% 0.005 325.62)",300:"oklch(86.5% 0.012 325.68)",400:"oklch(71.1% 0.019 323.02)",500:"oklch(54.2% 0.034 322.5)",600:"oklch(43.5% 0.029 321.78)",700:"oklch(36.4% 0.029 323.89)",800:"oklch(26.3% 0.024 320.12)",900:"oklch(21.2% 0.019 322.12)",950:"oklch(14.5% 0.008 326)"},olive:{50:"oklch(98.8% 0.003 106.5)",100:"oklch(96.6% 0.005 106.5)",200:"oklch(93% 0.007 106.5)",300:"oklch(88% 0.011 106.6)",400:"oklch(73.7% 0.021 106.9)",500:"oklch(58% 0.031 107.3)",600:"oklch(46.6% 0.025 107.3)",700:"oklch(39.4% 0.023 107.4)",800:"oklch(28.6% 0.016 107.4)",900:"oklch(22.8% 0.013 107.4)",950:"oklch(15.3% 0.006 107.1)"},mist:{50:"oklch(98.7% 0.002 197.1)",100:"oklch(96.3% 0.002 197.1)",200:"oklch(92.5% 0.005 214.3)",300:"oklch(87.2% 0.007 219.6)",400:"oklch(72.3% 0.014 214.4)",500:"oklch(56% 0.021 213.5)",600:"oklch(45% 0.017 213.2)",700:"oklch(37.8% 0.015 216)",800:"oklch(27.5% 0.011 216.9)",900:"oklch(21.8% 0.008 223.9)",950:"oklch(14.8% 0.004 228.8)"},taupe:{50:"oklch(98.6% 0.002 67.8)",100:"oklch(96% 0.002 17.2)",200:"oklch(92.2% 0.005 34.3)",300:"oklch(86.8% 0.007 39.5)",400:"oklch(71.4% 0.014 41.2)",500:"oklch(54.7% 0.021 43.1)",600:"oklch(43.8% 0.017 39.3)",700:"oklch(36.7% 0.016 35.7)",800:"oklch(26.8% 0.011 36.5)",900:"oklch(21.4% 0.009 43.1)",950:"oklch(14.7% 0.004 49.3)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklLine truncated
@@ -0,0 +1,2 @@
import type { TSESTree } from '@typescript-eslint/utils';
export declare function isUndefinedIdentifier(i: TSESTree.Node): boolean;
@@ -0,0 +1 @@
{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,84 @@
{
"name": "@babel/core",
"version": "7.29.7",
"description": "Babel compiler core.",
"main": "./lib/index.js",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-core"
},
"homepage": "https://babel.dev/docs/en/next/babel-core",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen",
"keywords": [
"6to5",
"babel",
"classes",
"const",
"es6",
"harmony",
"let",
"modules",
"transpile",
"transpiler",
"var",
"babel-core",
"compiler"
],
"engines": {
"node": ">=6.9.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/babel"
},
"browser": {
"./lib/config/files/index.js": "./lib/config/files/index-browser.js",
"./lib/config/resolve-targets.js": "./lib/config/resolve-targets-browser.js",
"./lib/transform-file.js": "./lib/transform-file-browser.js",
"./lib/transformation/read-input-source-map-file.js": "./lib/transformation/read-input-source-map-file-browser.js",
"./src/config/files/index.ts": "./src/config/files/index-browser.ts",
"./src/config/resolve-targets.ts": "./src/config/resolve-targets-browser.ts",
"./src/transform-file.ts": "./src/transform-file-browser.ts",
"./src/transformation/read-input-source-map-file.ts": "./src/transformation/read-input-source-map-file-browser.ts"
},
"dependencies": {
"@babel/code-frame": "^7.29.7",
"@babel/generator": "^7.29.7",
"@babel/helper-compilation-targets": "^7.29.7",
"@babel/helper-module-transforms": "^7.29.7",
"@babel/helpers": "^7.29.7",
"@babel/parser": "^7.29.7",
"@babel/template": "^7.29.7",
"@babel/traverse": "^7.29.7",
"@babel/types": "^7.29.7",
"@jridgewell/remapping": "^2.3.5",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
"json5": "^2.2.3",
"semver": "^6.3.1"
},
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^7.29.7",
"@babel/plugin-syntax-flow": "^7.29.7",
"@babel/plugin-transform-flow-strip-types": "^7.29.7",
"@babel/plugin-transform-modules-commonjs": "^7.29.7",
"@babel/preset-env": "^7.29.7",
"@babel/preset-typescript": "^7.29.7",
"@jridgewell/trace-mapping": "^0.3.28",
"@types/convert-source-map": "^2.0.0",
"@types/debug": "^4.1.0",
"@types/resolve": "^1.3.2",
"@types/semver": "^5.4.0",
"rimraf": "^3.0.0",
"ts-node": "^11.0.0-beta.1",
"tsx": "^4.20.3"
},
"type": "commonjs"
}
@@ -0,0 +1,36 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
/**
* Generates report loc suitable for reporting on how a class member is
* declared, rather than how it's implemented.
*
* ```ts
* class A {
* abstract method(): void;
* ~~~~~~~~~~~~~~~
*
* concreteMethod(): void {
* ~~~~~~~~~~~~~~
* // code
* }
*
* abstract private property?: string;
* ~~~~~~~~~~~~~~~~~~~~~~~~~
*
* @decorator override concreteProperty = 'value';
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* }
* ```
*/
export declare function getMemberHeadLoc(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.AccessorProperty | TSESTree.MethodDefinition | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition): TSESTree.SourceLocation;
/**
* Generates report loc suitable for reporting on how a parameter property is
* declared.
*
* ```ts
* class A {
* constructor(private property: string = 'value') {
* ~~~~~~~~~~~~~~~~
* }
* ```
*/
export declare function getParameterPropertyHeadLoc(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.TSParameterProperty, nodeName: string): TSESTree.SourceLocation;
@@ -0,0 +1,42 @@
import * as scopeManager from '@typescript-eslint/scope-manager';
export declare namespace Scope {
type ScopeManager = scopeManager.ScopeManager;
type Reference = scopeManager.Reference;
type Variable = scopeManager.ScopeVariable;
type Scope = scopeManager.Scope;
const ScopeType: typeof scopeManager.ScopeType;
type DefinitionType = scopeManager.Definition;
type Definition = scopeManager.Definition;
const DefinitionType: typeof scopeManager.DefinitionType;
namespace Definitions {
type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
type ClassNameDefinition = scopeManager.ClassNameDefinition;
type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
type ParameterDefinition = scopeManager.ParameterDefinition;
type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
type TSEnumNameDefinition = scopeManager.TSEnumNameDefinition;
type TSModuleNameDefinition = scopeManager.TSModuleNameDefinition;
type TypeDefinition = scopeManager.TypeDefinition;
type VariableDefinition = scopeManager.VariableDefinition;
}
namespace Scopes {
type BlockScope = scopeManager.BlockScope;
type CatchScope = scopeManager.CatchScope;
type ClassScope = scopeManager.ClassScope;
type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
type ForScope = scopeManager.ForScope;
type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
type FunctionScope = scopeManager.FunctionScope;
type FunctionTypeScope = scopeManager.FunctionTypeScope;
type GlobalScope = scopeManager.GlobalScope;
type MappedTypeScope = scopeManager.MappedTypeScope;
type ModuleScope = scopeManager.ModuleScope;
type SwitchScope = scopeManager.SwitchScope;
type TSEnumScope = scopeManager.TSEnumScope;
type TSModuleScope = scopeManager.TSModuleScope;
type TypeScope = scopeManager.TypeScope;
type WithScope = scopeManager.WithScope;
}
}
@@ -0,0 +1,629 @@
import { watchFile, unwatchFile, watch as fs_watch } from 'fs';
import { open, stat, lstat, realpath as fsrealpath } from 'fs/promises';
import * as sysPath from 'path';
import { type as osType } from 'os';
export const STR_DATA = 'data';
export const STR_END = 'end';
export const STR_CLOSE = 'close';
export const EMPTY_FN = () => { };
export const IDENTITY_FN = (val) => val;
const pl = process.platform;
export const isWindows = pl === 'win32';
export const isMacos = pl === 'darwin';
export const isLinux = pl === 'linux';
export const isFreeBSD = pl === 'freebsd';
export const isIBMi = osType() === 'OS400';
export const EVENTS = {
ALL: 'all',
READY: 'ready',
ADD: 'add',
CHANGE: 'change',
ADD_DIR: 'addDir',
UNLINK: 'unlink',
UNLINK_DIR: 'unlinkDir',
RAW: 'raw',
ERROR: 'error',
};
const EV = EVENTS;
const THROTTLE_MODE_WATCH = 'watch';
const statMethods = { lstat, stat };
const KEY_LISTENERS = 'listeners';
const KEY_ERR = 'errHandlers';
const KEY_RAW = 'rawEmitters';
const HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
// prettier-ignore
const binaryExtensions = new Set([
'3dm', '3ds', '3g2', '3gp', '7z', 'a', 'aac', 'adp', 'afdesign', 'afphoto', 'afpub', 'ai',
'aif', 'aiff', 'alz', 'ape', 'apk', 'appimage', 'ar', 'arj', 'asf', 'au', 'avi',
'bak', 'baml', 'bh', 'bin', 'bk', 'bmp', 'btif', 'bz2', 'bzip2',
'cab', 'caf', 'cgm', 'class', 'cmx', 'cpio', 'cr2', 'cur', 'dat', 'dcm', 'deb', 'dex', 'djvu',
'dll', 'dmg', 'dng', 'doc', 'docm', 'docx', 'dot', 'dotm', 'dra', 'DS_Store', 'dsk', 'dts',
'dtshd', 'dvb', 'dwg', 'dxf',
'ecelp4800', 'ecelp7470', 'ecelp9600', 'egg', 'eol', 'eot', 'epub', 'exe',
'f4v', 'fbs', 'fh', 'fla', 'flac', 'flatpak', 'fli', 'flv', 'fpx', 'fst', 'fvt',
'g3', 'gh', 'gif', 'graffle', 'gz', 'gzip',
'h261', 'h263', 'h264', 'icns', 'ico', 'ief', 'img', 'ipa', 'iso',
'jar', 'jpeg', 'jpg', 'jpgv', 'jpm', 'jxr', 'key', 'ktx',
'lha', 'lib', 'lvp', 'lz', 'lzh', 'lzma', 'lzo',
'm3u', 'm4a', 'm4v', 'mar', 'mdi', 'mht', 'mid', 'midi', 'mj2', 'mka', 'mkv', 'mmr', 'mng',
'mobi', 'mov', 'movie', 'mp3',
'mp4', 'mp4a', 'mpeg', 'mpg', 'mpga', 'mxu',
'nef', 'npx', 'numbers', 'nupkg',
'o', 'odp', 'ods', 'odt', 'oga', 'ogg', 'ogv', 'otf', 'ott',
'pages', 'pbm', 'pcx', 'pdb', 'pdf', 'pea', 'pgm', 'pic', 'png', 'pnm', 'pot', 'potm',
'potx', 'ppa', 'ppam',
'ppm', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx', 'psd', 'pya', 'pyc', 'pyo', 'pyv',
'qt',
'rar', 'ras', 'raw', 'resources', 'rgb', 'rip', 'rlc', 'rmf', 'rmvb', 'rpm', 'rtf', 'rz',
's3m', 's7z', 'scpt', 'sgi', 'shar', 'snap', 'sil', 'sketch', 'slk', 'smv', 'snk', 'so',
'stl', 'suo', 'sub', 'swf',
'tar', 'tbz', 'tbz2', 'tga', 'tgz', 'thmx', 'tif', 'tiff', 'tlz', 'ttc', 'ttf', 'txz',
'udf', 'uvh', 'uvi', 'uvm', 'uvp', 'uvs', 'uvu',
'viv', 'vob',
'war', 'wav', 'wax', 'wbmp', 'wdp', 'weba', 'webm', 'webp', 'whl', 'wim', 'wm', 'wma',
'wmv', 'wmx', 'woff', 'woff2', 'wrm', 'wvx',
'xbm', 'xif', 'xla', 'xlam', 'xls', 'xlsb', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'xm',
'xmind', 'xpi', 'xpm', 'xwd', 'xz',
'z', 'zip', 'zipx',
]);
const isBinaryPath = (filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase());
// TODO: emit errors properly. Example: EMFILE on Macos.
const foreach = (val, fn) => {
if (val instanceof Set) {
val.forEach(fn);
}
else {
fn(val);
}
};
const addAndConvert = (main, prop, item) => {
let container = main[prop];
if (!(container instanceof Set)) {
main[prop] = container = new Set([container]);
}
container.add(item);
};
const clearItem = (cont) => (key) => {
const set = cont[key];
if (set instanceof Set) {
set.clear();
}
else {
delete cont[key];
}
};
const delFromSet = (main, prop, item) => {
const container = main[prop];
if (container instanceof Set) {
container.delete(item);
}
else if (container === item) {
delete main[prop];
}
};
const isEmptySet = (val) => (val instanceof Set ? val.size === 0 : !val);
const FsWatchInstances = new Map();
/**
* Instantiates the fs_watch interface
* @param path to be watched
* @param options to be passed to fs_watch
* @param listener main event handler
* @param errHandler emits info about errors
* @param emitRaw emits raw event data
* @returns {NativeFsWatcher}
*/
function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
const handleEvent = (rawEvent, evPath) => {
listener(path);
emitRaw(rawEvent, evPath, { watchedPath: path });
// emit based on events occurring for files from a directory's watcher in
// case the file's watcher misses it (and rely on throttling to de-dupe)
if (evPath && path !== evPath) {
fsWatchBroadcast(sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath));
}
};
try {
return fs_watch(path, {
persistent: options.persistent,
}, handleEvent);
}
catch (error) {
errHandler(error);
return undefined;
}
}
/**
* Helper for passing fs_watch event data to a collection of listeners
* @param fullPath absolute path bound to fs_watch instance
*/
const fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
const cont = FsWatchInstances.get(fullPath);
if (!cont)
return;
foreach(cont[listenerType], (listener) => {
listener(val1, val2, val3);
});
};
/**
* Instantiates the fs_watch interface or binds listeners
* to an existing one covering the same file system entry
* @param path
* @param fullPath absolute path
* @param options to be passed to fs_watch
* @param handlers container for event listener functions
*/
const setFsWatchListener = (path, fullPath, options, handlers) => {
const { listener, errHandler, rawEmitter } = handlers;
let cont = FsWatchInstances.get(fullPath);
let watcher;
if (!options.persistent) {
watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter);
if (!watcher)
return;
return watcher.close.bind(watcher);
}
if (cont) {
addAndConvert(cont, KEY_LISTENERS, listener);
addAndConvert(cont, KEY_ERR, errHandler);
addAndConvert(cont, KEY_RAW, rawEmitter);
}
else {
watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, // no need to use broadcast here
fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
if (!watcher)
return;
watcher.on(EV.ERROR, async (error) => {
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
if (cont)
cont.watcherUnusable = true; // documented since Node 10.4.1
// Workaround for https://github.com/joyent/node/issues/4337
if (isWindows && error.code === 'EPERM') {
try {
const fd = await open(path, 'r');
await fd.close();
broadcastErr(error);
}
catch (err) {
// do nothing
}
}
else {
broadcastErr(error);
}
});
cont = {
listeners: listener,
errHandlers: errHandler,
rawEmitters: rawEmitter,
watcher,
};
FsWatchInstances.set(fullPath, cont);
}
// const index = cont.listeners.indexOf(listener);
// removes this instance's listeners and closes the underlying fs_watch
// instance if there are no more listeners left
return () => {
delFromSet(cont, KEY_LISTENERS, listener);
delFromSet(cont, KEY_ERR, errHandler);
delFromSet(cont, KEY_RAW, rawEmitter);
if (isEmptySet(cont.listeners)) {
// Check to protect against issue gh-730.
// if (cont.watcherUnusable) {
cont.watcher.close();
// }
FsWatchInstances.delete(fullPath);
HANDLER_KEYS.forEach(clearItem(cont));
// @ts-ignore
cont.watcher = undefined;
Object.freeze(cont);
}
};
};
// fs_watchFile helpers
// object to hold per-process fs_watchFile instances
// (may be shared across chokidar FSWatcher instances)
const FsWatchFileInstances = new Map();
/**
* Instantiates the fs_watchFile interface or binds listeners
* to an existing one covering the same file system entry
* @param path to be watched
* @param fullPath absolute path
* @param options options to be passed to fs_watchFile
* @param handlers container for event listener functions
* @returns closer
*/
const setFsWatchFileListener = (path, fullPath, options, handlers) => {
const { listener, rawEmitter } = handlers;
let cont = FsWatchFileInstances.get(fullPath);
// let listeners = new Set();
// let rawEmitters = new Set();
const copts = cont && cont.options;
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
// "Upgrade" the watcher to persistence or a quicker interval.
// This creates some unlikely edge case issues if the user mixes
// settings in a very weird way, but solving for those cases
// doesn't seem worthwhile for the added complexity.
// listeners = cont.listeners;
// rawEmitters = cont.rawEmitters;
unwatchFile(fullPath);
cont = undefined;
}
if (cont) {
addAndConvert(cont, KEY_LISTENERS, listener);
addAndConvert(cont, KEY_RAW, rawEmitter);
}
else {
// TODO
// listeners.add(listener);
// rawEmitters.add(rawEmitter);
cont = {
listeners: listener,
rawEmitters: rawEmitter,
options,
watcher: watchFile(fullPath, options, (curr, prev) => {
foreach(cont.rawEmitters, (rawEmitter) => {
rawEmitter(EV.CHANGE, fullPath, { curr, prev });
});
const currmtime = curr.mtimeMs;
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
foreach(cont.listeners, (listener) => listener(path, curr));
}
}),
};
FsWatchFileInstances.set(fullPath, cont);
}
// const index = cont.listeners.indexOf(listener);
// Removes this instance's listeners and closes the underlying fs_watchFile
// instance if there are no more listeners left.
return () => {
delFromSet(cont, KEY_LISTENERS, listener);
delFromSet(cont, KEY_RAW, rawEmitter);
if (isEmptySet(cont.listeners)) {
FsWatchFileInstances.delete(fullPath);
unwatchFile(fullPath);
cont.options = cont.watcher = undefined;
Object.freeze(cont);
}
};
};
/**
* @mixin
*/
export class NodeFsHandler {
constructor(fsW) {
this.fsw = fsW;
this._boundHandleError = (error) => fsW._handleError(error);
}
/**
* Watch file for changes with fs_watchFile or fs_watch.
* @param path to file or dir
* @param listener on fs change
* @returns closer for the watcher instance
*/
_watchWithNodeFs(path, listener) {
const opts = this.fsw.options;
const directory = sysPath.dirname(path);
const basename = sysPath.basename(path);
const parent = this.fsw._getWatchedDir(directory);
parent.add(basename);
const absolutePath = sysPath.resolve(path);
const options = {
persistent: opts.persistent,
};
if (!listener)
listener = EMPTY_FN;
let closer;
if (opts.usePolling) {
const enableBin = opts.interval !== opts.binaryInterval;
options.interval = enableBin && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
closer = setFsWatchFileListener(path, absolutePath, options, {
listener,
rawEmitter: this.fsw._emitRaw,
});
}
else {
closer = setFsWatchListener(path, absolutePath, options, {
listener,
errHandler: this._boundHandleError,
rawEmitter: this.fsw._emitRaw,
});
}
return closer;
}
/**
* Watch a file and emit add event if warranted.
* @returns closer for the watcher instance
*/
_handleFile(file, stats, initialAdd) {
if (this.fsw.closed) {
return;
}
const dirname = sysPath.dirname(file);
const basename = sysPath.basename(file);
const parent = this.fsw._getWatchedDir(dirname);
// stats is always present
let prevStats = stats;
// if the file is already being watched, do nothing
if (parent.has(basename))
return;
const listener = async (path, newStats) => {
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
return;
if (!newStats || newStats.mtimeMs === 0) {
try {
const newStats = await stat(file);
if (this.fsw.closed)
return;
// Check that change event was not fired because of changed only accessTime.
const at = newStats.atimeMs;
const mt = newStats.mtimeMs;
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
this.fsw._emit(EV.CHANGE, file, newStats);
}
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats.ino) {
this.fsw._closeFile(path);
prevStats = newStats;
const closer = this._watchWithNodeFs(file, listener);
if (closer)
this.fsw._addPathCloser(path, closer);
}
else {
prevStats = newStats;
}
}
catch (error) {
// Fix issues where mtime is null but file is still present
this.fsw._remove(dirname, basename);
}
// add is about to be emitted if file not already tracked in parent
}
else if (parent.has(basename)) {
// Check that change event was not fired because of changed only accessTime.
const at = newStats.atimeMs;
const mt = newStats.mtimeMs;
if (!at || at <= mt || mt !== prevStats.mtimeMs) {
this.fsw._emit(EV.CHANGE, file, newStats);
}
prevStats = newStats;
}
};
// kick off the watcher
const closer = this._watchWithNodeFs(file, listener);
// emit an add event if we're supposed to
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
if (!this.fsw._throttle(EV.ADD, file, 0))
return;
this.fsw._emit(EV.ADD, file, stats);
}
return closer;
}
/**
* Handle symlinks encountered while reading a dir.
* @param entry returned by readdirp
* @param directory path of dir being read
* @param path of this item
* @param item basename of this item
* @returns true if no more processing is needed for this entry.
*/
async _handleSymlink(entry, directory, path, item) {
if (this.fsw.closed) {
return;
}
const full = entry.fullPath;
const dir = this.fsw._getWatchedDir(directory);
if (!this.fsw.options.followSymlinks) {
// watch symlink directly (don't follow) and detect changes
this.fsw._incrReadyCount();
let linkPath;
try {
linkPath = await fsrealpath(path);
}
catch (e) {
this.fsw._emitReady();
return true;
}
if (this.fsw.closed)
return;
if (dir.has(item)) {
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
this.fsw._symlinkPaths.set(full, linkPath);
this.fsw._emit(EV.CHANGE, path, entry.stats);
}
}
else {
dir.add(item);
this.fsw._symlinkPaths.set(full, linkPath);
this.fsw._emit(EV.ADD, path, entry.stats);
}
this.fsw._emitReady();
return true;
}
// don't follow the same symlink more than once
if (this.fsw._symlinkPaths.has(full)) {
return true;
}
this.fsw._symlinkPaths.set(full, true);
}
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
// Normalize the directory name on Windows
directory = sysPath.join(directory, '');
throttler = this.fsw._throttle('readdir', directory, 1000);
if (!throttler)
return;
const previous = this.fsw._getWatchedDir(wh.path);
const current = new Set();
let stream = this.fsw._readdirp(directory, {
fileFilter: (entry) => wh.filterPath(entry),
directoryFilter: (entry) => wh.filterDir(entry),
});
if (!stream)
return;
stream
.on(STR_DATA, async (entry) => {
if (this.fsw.closed) {
stream = undefined;
return;
}
const item = entry.path;
let path = sysPath.join(directory, item);
current.add(item);
if (entry.stats.isSymbolicLink() &&
(await this._handleSymlink(entry, directory, path, item))) {
return;
}
if (this.fsw.closed) {
stream = undefined;
return;
}
// Files that present in current directory snapshot
// but absent in previous are added to watch list and
// emit `add` event.
if (item === target || (!target && !previous.has(item))) {
this.fsw._incrReadyCount();
// ensure relativeness of path is preserved in case of watcher reuse
path = sysPath.join(dir, sysPath.relative(dir, path));
this._addToNodeFs(path, initialAdd, wh, depth + 1);
}
})
.on(EV.ERROR, this._boundHandleError);
return new Promise((resolve, reject) => {
if (!stream)
return reject();
stream.once(STR_END, () => {
if (this.fsw.closed) {
stream = undefined;
return;
}
const wasThrottled = throttler ? throttler.clear() : false;
resolve(undefined);
// Files that absent in current directory snapshot
// but present in previous emit `remove` event
// and are removed from @watched[directory].
previous
.getChildren()
.filter((item) => {
return item !== directory && !current.has(item);
})
.forEach((item) => {
this.fsw._remove(directory, item);
});
stream = undefined;
// one more time for any missed in case changes came in extremely quickly
if (wasThrottled)
this._handleRead(directory, false, wh, target, dir, depth, throttler);
});
});
}
/**
* Read directory to add / remove files from `@watched` list and re-read it on change.
* @param dir fs path
* @param stats
* @param initialAdd
* @param depth relative to user-supplied path
* @param target child path targeted for watch
* @param wh Common watch helpers for this path
* @param realpath
* @returns closer for the watcher instance.
*/
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
const tracked = parentDir.has(sysPath.basename(dir));
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
this.fsw._emit(EV.ADD_DIR, dir, stats);
}
// ensure dir is tracked (harmless if redundant)
parentDir.add(sysPath.basename(dir));
this.fsw._getWatchedDir(dir);
let throttler;
let closer;
const oDepth = this.fsw.options.depth;
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
if (!target) {
await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
if (this.fsw.closed)
return;
}
closer = this._watchWithNodeFs(dir, (dirPath, stats) => {
// if current directory is removed, do nothing
if (stats && stats.mtimeMs === 0)
return;
this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
});
}
return closer;
}
/**
* Handle added file, directory, or glob pattern.
* Delegates call to _handleFile / _handleDir after checks.
* @param path to file or ir
* @param initialAdd was the file added at watch instantiation?
* @param priorWh depth relative to user-supplied path
* @param depth Child path actually targeted for watch
* @param target Child path actually targeted for watch
*/
async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
const ready = this.fsw._emitReady;
if (this.fsw._isIgnored(path) || this.fsw.closed) {
ready();
return false;
}
const wh = this.fsw._getWatchHelpers(path);
if (priorWh) {
wh.filterPath = (entry) => priorWh.filterPath(entry);
wh.filterDir = (entry) => priorWh.filterDir(entry);
}
// evaluate what is at the path we're being asked to watch
try {
const stats = await statMethods[wh.statMethod](wh.watchPath);
if (this.fsw.closed)
return;
if (this.fsw._isIgnored(wh.watchPath, stats)) {
ready();
return false;
}
const follow = this.fsw.options.followSymlinks;
let closer;
if (stats.isDirectory()) {
const absPath = sysPath.resolve(path);
const targetPath = follow ? await fsrealpath(path) : path;
if (this.fsw.closed)
return;
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
if (this.fsw.closed)
return;
// preserve this symlink's target path
if (absPath !== targetPath && targetPath !== undefined) {
this.fsw._symlinkPaths.set(absPath, targetPath);
}
}
else if (stats.isSymbolicLink()) {
const targetPath = follow ? await fsrealpath(path) : path;
if (this.fsw.closed)
return;
const parent = sysPath.dirname(wh.watchPath);
this.fsw._getWatchedDir(parent).add(wh.watchPath);
this.fsw._emit(EV.ADD, wh.watchPath, stats);
closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
if (this.fsw.closed)
return;
// preserve this symlink's target path
if (targetPath !== undefined) {
this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
}
}
else {
closer = this._handleFile(wh.watchPath, stats, initialAdd);
}
ready();
if (closer)
this.fsw._addPathCloser(path, closer);
return false;
}
catch (error) {
if (this.fsw._handleError(error)) {
ready();
return path;
}
}
}
}
@@ -0,0 +1,10 @@
import * as React from 'react';
import { Primitive } from '@radix-ui/react-primitive';
type PrimitiveSvgProps = React.ComponentPropsWithoutRef<typeof Primitive.svg>;
interface ArrowProps extends PrimitiveSvgProps {
}
declare const Arrow: React.ForwardRefExoticComponent<ArrowProps & React.RefAttributes<SVGSVGElement>>;
declare const Root: React.ForwardRefExoticComponent<ArrowProps & React.RefAttributes<SVGSVGElement>>;
export { Arrow, type ArrowProps, Root };
@@ -0,0 +1,762 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Matcher = void 0;
const parse_class_js_1 = require("./parse-class.js");
// the end of the pattern, or of a negated sub-pattern
const MATCH = { t: 'match', id: 0 };
const extTypes = '!?+*@';
const lit = (ch) => ({ t: 'lit', ch });
const reEscape = (s) => s.replace(/[\\^$.*+?()[\]{}|/]/g, '\\$&');
// a RegExp that only matches `s`, with unicode case folding
const newFoldRe = (s) => new RegExp(`^${reEscape(s)}$`, 'iu');
// foldRe for one literal char. The same chars are in most patterns,
// so keep them. A RegExp without the `g` or `y` flag has no state to
// share.
const foldCache = new Map();
const foldRe = (ch) => {
let re = foldCache.get(ch);
if (!re) {
re = newFoldRe(ch);
if (foldCache.size >= 1000)
foldCache.clear();
foldCache.set(ch, re);
}
return re;
};
const litMatch = (l, c) => {
if (c === l.ch)
return true;
if (!l.re)
return false;
const code = c.charCodeAt(0);
if (code >= 128)
return l.re.test(c);
const ascii = (l.ascii ??= new Uint8Array(128));
ascii[code] ||= l.re.test(c) ? 1 : 2;
return ascii[code] === 1;
};
const tokenize = (p, nocase, noext, form) => {
const toks = [];
for (let i = 0; i < p.length;) {
const c = String.fromCodePoint(p.codePointAt(i));
if (c === '\\') {
// a trailing \ is a literal \
const e = p.codePointAt(i + 1);
const ch = e === undefined ? c : String.fromCodePoint(e);
toks.push(lit(ch));
i += 1 + ch.length;
continue;
}
if (c === '[') {
const [re, consumed] = (0, parse_class_js_1.parseClass)(p, i, nocase, form);
if (consumed) {
toks.push({ t: 'class', re });
i += consumed;
continue;
}
}
if (!noext && extTypes.includes(c) && p[i + 1] === '(') {
toks.push({ t: 'open', type: c });
i += 2;
continue;
}
toks.push(!noext && c === '|' ? { t: 'bar' }
: !noext && c === ')' ? { t: 'close' }
: c === '*' ? { t: 'star' }
: c === '?' ? { t: 'any' }
: lit(c));
i += c.length;
}
return toks;
};
// map each open token index to the index of its close token
const pair = (toks) => {
const pairs = new Map();
const stack = [];
toks.forEach((tok, i) => {
if (tok.t === 'open')
stack.push(i);
else if (tok.t === 'close' && stack.length)
pairs.set(stack.pop(), i);
});
return pairs;
};
// build the alternatives between start and end. An open token that
// is not closed is never inside a closed extglob, so bar and close
// tokens are only literal at the top level.
const build = (toks, pairs, start, end, top) => {
let seq = [];
const alts = [seq];
for (let i = start; i < end; i++) {
const tok = toks[i];
const close = pairs.get(i);
if (tok.t === 'open' && close !== undefined) {
const sub = build(toks, pairs, i + 1, close, false);
seq.push({ t: 'ext', type: tok.type, alts: sub });
i = close;
}
else if (tok.t === 'bar' && !top) {
alts.push((seq = []));
}
else if (tok.t === 'open') {
seq.push(lit(tok.type), lit('('));
}
else if (tok.t === 'bar') {
seq.push(lit('|'));
}
else if (tok.t === 'close') {
seq.push(lit(')'));
}
else {
seq.push(tok);
}
}
return alts;
};
// normalize each run of literal chars as one string, so that a char
// and the combining marks after it compose (or decompose) together.
// Syntax is already parsed, so a char that normalizes to a syntax
// char (such as full-width `*` in NFKC) stays a literal.
const normalize = (items, form) => {
const out = [];
let run = '';
const flush = () => {
for (const ch of run.normalize(form))
out.push(lit(ch));
run = '';
};
for (const it of items) {
if (it.t === 'lit') {
run += it.ch;
continue;
}
flush();
out.push(it.t === 'ext' ?
{ ...it, alts: it.alts.map(a => normalize(a, form)) }
: it);
}
flush();
return out;
};
// the start node, and the number of node ids. Ids are dense, from 0
// for the match node.
const compile = (items, nocase) => {
let id = 1;
const split = (out) => ({ t: 'split', id: id++, out });
const seq = (items, next) => items.reduceRight((next, it) => item(it, next), next);
const item = (it, next) => {
switch (it.t) {
case 'lit':
const re = nocase ? foldRe(it.ch) : undefined;
return { t: 'lit', id: id++, ch: it.ch, re, next };
case 'any':
case 'star':
return { t: it.t, id: id++, next };
case 'class':
return { t: 'class', id: id++, re: it.re, next };
}
const alts = (next) => it.alts.map(a => seq(a, next));
switch (it.type) {
case '@':
return split(alts(next));
case '?':
return split([next, ...alts(next)]);
case '!':
return { t: 'neg', id: id++, sub: split(alts(MATCH)), next };
}
// * and +, loop back after each match
const after = split([]);
const entry = split(alts(after));
after.out.push(next, entry);
return it.type === '*' ? after : entry;
};
const start = seq(items, MATCH);
return [start, id];
};
// one line per node, in the order that a walk from the start
// reaches them. Edges point to node ids. The nodes of a negated
// sub-pattern are indented under their negation.
const show = (start) => {
const lines = [];
const seen = new Set();
const ref = (n) => (n.t === 'match' ? 'match' : String(n.id));
const walk = (n, indent) => {
if (n.t === 'match' || seen.has(n))
return;
seen.add(n);
const line = (desc) => lines.push(`${indent}${n.id}: ${desc}`);
switch (n.t) {
case 'split':
line(`split -> ${n.out.map(ref).join(', ')}`);
for (const o of n.out)
walk(o, indent);
return;
case 'neg':
line(`!(${ref(n.sub)}) -> ${ref(n.next)}`);
walk(n.sub, indent + ' ');
return walk(n.next, indent);
case 'lit':
line(`${JSON.stringify(n.ch)} -> ${ref(n.next)}`);
break;
case 'class':
line(`${n.re} -> ${ref(n.next)}`);
break;
default:
line(`${n.t === 'any' ? '?' : '*'} -> ${ref(n.next)}`);
}
walk(n.next, indent);
};
walk(start, '');
return [`start -> ${ref(start)}`, ...lines].join('\n');
};
// The threads at one position in the string. Each node thread is
// only kept once, and runs with the same state are only kept once,
// so that identical threads merge. The match node is not in
// `threads`, because it can not step. It sets `match` instead.
class State {
// set by the Sim, to mark the nodes that this state has
gen;
threads = [];
match = false;
runs = [];
// the sorted ids of the threads, with 0 for a match, once the
// state is done
ids = [];
constructor(gen) {
this.gen = gen;
}
// no threads, so nothing more can match
get dead() {
return !this.threads.length && !this.match && !this.runs.length;
}
}
// true if the two states hold the same threads
const sameState = (a, b) => {
if (a.ids.length !== b.ids.length)
return false;
if (a.runs.length !== b.runs.length)
return false;
if (a.ids.some((id, i) => id !== b.ids[i]))
return false;
return a.runs.every(r => b.runs.some(o => o.neg === r.neg && sameState(o.state, r.state)));
};
const marks = (size) => ({
has: new Float64Array(size),
seen: new Float64Array(size),
gen: 0,
});
class Sim {
// `.` and `..` only match literal dots, even with `dot:true`
dots;
// the string starts with `.`, and `dot:true` is not set
dotStart;
#marks;
constructor(dots, dotStart, marks) {
this.dots = dots;
this.dotStart = dotStart;
this.#marks = marks;
}
state() {
return new State(++this.#marks.gen);
}
// sort the ids of a state, once it has all of its threads
done(state) {
state.ids = state.threads.map(n => n.id).sort((a, b) => a - b);
if (state.match)
state.ids.unshift(MATCH.id);
return state;
}
// true the first time that the state walks through the node, so
// that loops in the graph stop
#visit(state, node) {
const { seen } = this.#marks;
if (seen[node.id] === state.gen)
return false;
seen[node.id] = state.gen;
return true;
}
#addThread(state, node) {
const { has } = this.#marks;
if (has[node.id] === state.gen)
return false;
has[node.id] = state.gen;
state.threads.push(node);
return true;
}
// wildcards only match a leading dot if `dot:true`. In a negated
// sub-pattern, this does not apply, because the negation itself
// can not match a leading dot.
restricted(i, top) {
return top && (this.dots || (this.dotStart && i === 0));
}
add(state, node, i, top) {
switch (node.t) {
case 'split':
if (!this.#visit(state, node))
return;
for (const o of node.out)
this.add(state, o, i, top);
return;
case 'neg':
if (!this.#visit(state, node))
return;
const sub = this.state();
this.add(sub, node.sub, i, false);
this.done(sub);
return this.addRun(state, { t: 'run', neg: node, state: sub }, i, top);
case 'star':
// a * can not start a dotfile, even if it matches nothing
if (this.restricted(i, top))
return;
if (this.#addThread(state, node))
this.add(state, node.next, i, top);
return;
case 'match':
state.match = true;
return;
default:
this.#addThread(state, node);
}
}
addRun(state, run, i, top) {
for (const r of state.runs) {
if (r.neg === run.neg && sameState(r.state, run.state))
return;
}
state.runs.push(run);
if (!run.state.match) {
this.add(state, run.neg.next, i, top);
}
}
// the threads after char `c`, at index `i`
step(state, c, i, top) {
const next = this.state();
for (const th of state.threads) {
switch (th.t) {
case 'lit':
if (litMatch(th, c)) {
this.add(next, th.next, i + 1, top);
}
break;
case 'any':
if (!this.restricted(i, top))
this.add(next, th.next, i + 1, top);
break;
case 'class':
if (!this.restricted(i, top) && th.re.test(c)) {
this.add(next, th.next, i + 1, top);
}
break;
case 'star':
if (!this.restricted(i, top))
this.add(next, th, i + 1, top);
}
}
if (!this.restricted(i, top)) {
for (const run of state.runs) {
// a sub-pattern with no threads can not match again, so the
// run stays the same
if (run.state.dead) {
this.addRun(next, run, i + 1, top);
continue;
}
const sub = this.step(run.state, c, i, false);
this.addRun(next, { t: 'run', neg: run.neg, state: sub }, i + 1, top);
}
}
return this.done(next);
}
}
// A canonical key for the threads in a state. States with the same
// key hold the same threads, so they match the same strings.
const stateKey = (state) => {
const ids = state.ids.join();
if (!state.runs.length)
return ids;
const runs = state.runs.map(r => `${r.neg.id}(${stateKey(r.state)})`);
return `${ids}|${runs.sort().join('|')}`;
};
// The cache can hold about this many chars of state keys and
// transitions. When it is full, it is cleared, so that a pattern
// can not use an unbounded amount of memory.
const DFA_BUDGET = 1 << 18;
// A cache of the states that the simulation reaches, built as the
// matcher is used. Each char of a string is then one Map lookup,
// once the states that it leads to are known.
//
// The dot rules only restrict the first char of a dotfile (strings
// that are only `.` or `..` do not use the cache). So a dotfile
// starts at its own state, which takes its first step with the
// restriction, and every other state takes steps without it.
class Dfa {
#start;
#states = new Map();
#size = 0;
#plain;
#dotStart;
#sim;
#dotSim;
constructor(start, marks) {
this.#start = start;
this.#sim = new Sim(false, false, marks);
this.#dotSim = new Sim(false, true, marks);
}
#make(state) {
return {
state,
match: state.match,
dead: state.dead,
next: new Map(),
};
}
#intern(state) {
const key = stateKey(state);
const found = this.#states.get(key);
if (found)
return found;
if (this.#size > DFA_BUDGET)
this.#clear();
const d = this.#make(state);
this.#states.set(key, d);
this.#size += key.length + 1;
return d;
}
#clear() {
this.#states.clear();
this.#size = 0;
this.#plain = undefined;
this.#dotStart = undefined;
}
start(dotStart) {
if (dotStart) {
if (this.#dotStart)
return this.#dotStart;
const state = this.#dotSim.state();
this.#dotSim.add(state, this.#start, 0, true);
return (this.#dotStart = this.#make(this.#dotSim.done(state)));
}
if (this.#plain)
return this.#plain;
const state = this.#sim.state();
this.#sim.add(state, this.#start, 0, true);
return (this.#plain = this.#intern(this.#sim.done(state)));
}
// the next state, after a miss in `d.ascii`
next(d, c) {
const code = c.charCodeAt(0);
const found = code < 128 ? undefined : d.next.get(c);
if (found)
return found;
// the dotfile start is not in the cache, so it is never shared
const n = d === this.#dotStart ?
this.#intern(this.#dotSim.step(d.state, c, 0, true))
: this.#intern(this.#sim.step(d.state, c, 1, true));
if (code < 128) {
if (!d.ascii) {
d.ascii = new Array(128);
this.#size += 128;
}
d.ascii[code] = n;
}
else {
d.next.set(c, n);
}
this.#size++;
return n;
}
}
// the nodes in order, if the graph is a single chain
const linear = (start) => {
const nodes = [];
for (let n = start; n.t !== 'match'; n = n.next) {
if (n.t === 'split' || n.t === 'neg')
return undefined;
nodes.push(n);
}
return nodes;
};
// Match a chain of nodes. Each node other than `*` matches exactly
// one char, so on a failure it is enough to go back to the last `*`
// and let it match one more char. This takes at most
// nodes.length * chars.length steps.
const testLinear = (nodes, chars, start, end) => {
let ni = 0;
let ci = start;
let starNi = -1;
let starCi = 0;
while (ci < end) {
const n = nodes[ni];
if (n?.t === 'star') {
starNi = ni++;
starCi = ci;
continue;
}
const c = chars[ci];
if (n &&
(n.t === 'any' ||
(n.t === 'lit' && litMatch(n, c)) ||
(n.t === 'class' && n.re.test(c)))) {
ni++;
ci++;
continue;
}
if (starNi === -1)
return false;
ni = starNi + 1;
ci = ++starCi;
}
while (nodes[ni]?.t === 'star')
ni++;
return ni === nodes.length;
};
// The least and most chars that the items can match. These are only
// bounds: a negation can match a string of any length, so it counts
// as 0 to Infinity.
const lengths = (items) => {
let min = 0;
let max = 0;
for (const it of items) {
const [lo, hi] = itemLengths(it);
min += lo;
max += hi;
}
return [min, max];
};
const itemLengths = (it) => {
if (it.t === 'star')
return [0, Infinity];
if (it.t !== 'ext')
return [1, 1];
if (it.type === '!')
return [0, Infinity];
const alts = it.alts.map(lengths);
const min = Math.min(...alts.map(a => a[0]));
const max = Math.max(...alts.map(a => a[1]));
// a loop of alternatives that only match the empty string is empty
const loop = max === 0 ? 0 : Infinity;
return (it.type === '@' ? [min, max]
: it.type === '?' ? [0, max]
: it.type === '*' ? [0, loop]
: [min, loop]);
};
// true if the chars from `start` match the literals
const hasAffix = (lits, chars, start) => {
for (let j = 0; j < lits.length; j++) {
if (!litMatch(lits[j], chars[start + j]))
return false;
}
return true;
};
// a `/`, or half of a surrogate pair
const slashOrSurrogate = /[/\ud800-\udfff]/;
const surrogate = /[\ud800-\udfff]/;
// a string can be indexed by code point, unless it has surrogate
// pairs
const codePoints = (s) => surrogate.test(s) ? [...s] : s;
const noSlash = (s) => {
if (s.includes('/')) {
throw new Error('can only match a single path portion, got: ' + s);
}
};
class Matcher {
pattern;
options;
#start;
// the number of node ids
#size;
#marks;
// the Sim for strings that are only `.` or `..`
#dotsSim;
// the string to compare, if the pattern has no magic. With
// `nocase:true`, the RegExp that folds case is made when it is
// first used.
#literal;
#literalFold = false;
#literalRe;
// the nodes between the prefix and suffix, if the graph is a
// single chain
#linear;
// the linear nodes are only `*` and `?`, so the length bounds and
// the prefix and suffix decide the match
#wild = false;
// the least and most chars that a match can have
#min = 0;
#max = Infinity;
// the literals that a match must start and end with. Each one
// matches exactly one char, and they are distinct items in the
// pattern, so a string that does not have them can not match.
#prefix = [];
#suffix = [];
// the prefix and suffix as strings, if they do not fold case
#prefixStr;
#suffixStr;
// there is a prefix or suffix to check
#affix = false;
#dfa;
#form;
constructor(pattern, options = {}) {
if (pattern.includes('/')) {
throw new Error('can only match a single path portion, got pattern: ' + pattern);
}
this.pattern = pattern;
this.options = options;
const { nocase = false, noext = false, normalize: n } = options;
this.#form = n === true ? 'NFC' : n || undefined;
// a pattern that is only an empty extglob is a literal string,
// except for `!()`, which matches any non-empty string
const literal = /^[?*+@]\(\)$/.test(pattern);
const toks = tokenize(pattern, nocase, noext || literal, this.#form);
let [items] = build(toks, pair(toks), 0, toks.length, true);
if (this.#form)
items = normalize(items, this.#form);
const [start, size] = compile(items, nocase);
this.#start = start;
this.#size = size;
if (items.every(it => it.t === 'lit')) {
this.#literal = items.map(it => it.ch).join('');
this.#literalFold = nocase;
}
else {
const lit = (it) => it.t !== 'lit' ? undefined
: nocase ? { ch: it.ch, re: foldRe(it.ch) }
: { ch: it.ch };
for (const it of items) {
const l = lit(it);
if (!l)
break;
this.#prefix.push(l);
}
for (let j = items.length - 1; j >= 0; j--) {
const l = lit(items[j]);
if (!l)
break;
this.#suffix.unshift(l);
}
this.#affix = !!(this.#prefix.length || this.#suffix.length);
if (!nocase) {
this.#prefixStr = this.#prefix.map(l => l.ch).join('');
this.#suffixStr = this.#suffix.map(l => l.ch).join('');
}
this.#linear = linear(this.#start)?.slice(this.#prefix.length, -this.#suffix.length || undefined);
this.#wild = !!this.#linear?.every(n => n.t === 'star' || n.t === 'any');
const [min, max] = lengths(items);
this.#min = min;
this.#max = max;
}
}
test(s) {
// The `/` check uses the string as given, so with normalization it
// is a separate step. Otherwise, one scan finds both a `/` and the
// surrogate pairs that stop the string being indexed by code point.
if (this.#form) {
noSlash(s);
return this.#test(s.normalize(this.#form));
}
if (slashOrSurrogate.test(s)) {
noSlash(s);
return this.#test(s, [...s]);
}
return this.#test(s, s);
}
/**
* The same as {@link Matcher#test}, but the string is not checked
* for `/` chars, so the result for a string that has one is not
* defined. Only use it for a string that is known to be one path
* portion, such as a part of a path that was split on `/`. It can
* be faster, because some patterns do not need to look at each char
* of the string.
*/
testUnchecked(s) {
return this.#test(this.#form ? s.normalize(this.#form) : s);
}
// Test a string that has no `/`. `chars` indexes it by code point.
// If it is not given, it is only found if a step needs it.
#test(s, chars) {
if (this.#literal !== undefined) {
return this.#literalFold ?
(this.#literalRe ??= newFoldRe(this.#literal)).test(s)
: s === this.#literal;
}
// the length check means that the prefix and suffix do not
// overlap. Without the chars, the length in code points is from
// half of the UTF-16 length (if each one is a surrogate pair) to
// all of it, which is often enough to know.
const min = this.#min;
const max = this.#max;
if (chars === undefined) {
const most = s.length;
const least = (most + 1) >> 1;
if (most < min || least > max)
return false;
if (least < min || most > max)
chars = codePoints(s);
}
if (chars !== undefined &&
(chars.length < min || chars.length > max)) {
return false;
}
const prefix = this.#prefix.length;
if (this.#affix) {
if (this.#prefixStr !== undefined && this.#suffixStr !== undefined) {
if (!s.startsWith(this.#prefixStr) ||
!s.endsWith(this.#suffixStr)) {
return false;
}
}
else {
chars ??= codePoints(s);
const end = chars.length - this.#suffix.length;
if (!hasAffix(this.#prefix, chars, 0) ||
!hasAffix(this.#suffix, chars, end)) {
return false;
}
}
}
const dotStart = !this.options.dot && s.startsWith('.');
if (this.#linear) {
// `.` and `..` only match literal dots, even with `dot:true`
if (s === '.' || s === '..')
return false;
// only a literal can match the leading dot. A `*` can not
// start a dotfile, even if it matches nothing.
if (dotStart && !prefix)
return false;
if (this.#wild)
return true;
chars ??= codePoints(s);
const end = chars.length - this.#suffix.length;
return testLinear(this.#linear, chars, prefix, end);
}
chars ??= codePoints(s);
if (s === '.' || s === '..') {
this.#marks ??= marks(this.#size);
const sim = (this.#dotsSim ??= new Sim(true, false, this.#marks));
const start = sim.state();
sim.add(start, this.#start, 0, true);
let state = sim.done(start);
for (let i = 0; i < chars.length; i++) {
state = sim.step(state, chars[i], i, true);
}
return state.match;
}
this.#marks ??= marks(this.#size);
const dfa = (this.#dfa ??= new Dfa(this.#start, this.#marks));
let d = dfa.start(dotStart);
// read char codes from the string, so that a one-char string is
// only made for a cache miss
const str = chars === s;
for (let i = 0; i < chars.length; i++) {
if (d.dead)
return false;
const code = str ? s.charCodeAt(i) : chars[i].charCodeAt(0);
d = d.ascii?.[code] ?? dfa.next(d, chars[i]);
}
return d.match;
}
/** a readable listing of the state machine */
toString() {
return show(this.#start);
}
}
exports.Matcher = Matcher;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,177 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
@@ -0,0 +1,46 @@
import { warnOnce } from 'motion-utils';
import { createMotionComponent } from '../../motion/index.mjs';
function createMotionProxy(preloadedFeatures, createVisualElement) {
if (typeof Proxy === "undefined") {
return createMotionComponent;
}
/**
* A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
* Rather than generating them anew every render.
*/
const componentCache = new Map();
const factory = (Component, options) => {
return createMotionComponent(Component, options, preloadedFeatures, createVisualElement);
};
/**
* Support for deprecated`motion(Component)` pattern
*/
const deprecatedFactoryFunction = (Component, options) => {
if (process.env.NODE_ENV !== "production") {
warnOnce(false, "motion() is deprecated. Use motion.create() instead.");
}
return factory(Component, options);
};
return new Proxy(deprecatedFactoryFunction, {
/**
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
* The prop name is passed through as `key` and we can use that to generate a `motion`
* DOM component with that name.
*/
get: (_target, key) => {
if (key === "create")
return factory;
/**
* If this element doesn't exist in the component cache, create it and cache.
*/
if (!componentCache.has(key)) {
componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement));
}
return componentCache.get(key);
},
});
}
export { createMotionProxy };
//# sourceMappingURL=create-proxy.mjs.map
@@ -0,0 +1,8 @@
function fillWildcards(keyframes) {
for (let i = 1; i < keyframes.length; i++) {
keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);
}
}
export { fillWildcards };
//# sourceMappingURL=fill-wildcards.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"train-track.js","sources":["../../../src/icons/train-track.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TrainTrack\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxNyAxNyAyIiAvPgogIDxwYXRoIGQ9Im0yIDE0IDggOCIgLz4KICA8cGF0aCBkPSJtNSAxMSA4IDgiIC8+CiAgPHBhdGggZD0ibTggOCA4IDgiIC8+CiAgPHBhdGggZD0ibTExIDUgOCA4IiAvPgogIDxwYXRoIGQ9Im0xNCAyIDggOCIgLz4KICA8cGF0aCBkPSJNNyAyMiAyMiA3IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/train-track\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 TrainTrack = createLucideIcon('TrainTrack', [\n ['path', { d: 'M2 17 17 2', key: '18b09t' }],\n ['path', { d: 'm2 14 8 8', key: '1gv9hu' }],\n ['path', { d: 'm5 11 8 8', key: '189pqp' }],\n ['path', { d: 'm8 8 8 8', key: '1imecy' }],\n ['path', { d: 'm11 5 8 8', key: 'ummqn6' }],\n ['path', { d: 'm14 2 8 8', key: '1vk7dn' }],\n ['path', { d: 'M7 22 22 7', key: '15mb1i' }],\n]);\n\nexport default TrainTrack;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,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,10 @@
/*
* Copyright 2009-2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.SourceMapGenerator =
require("./lib/source-map-generator").SourceMapGenerator;
exports.SourceMapConsumer =
require("./lib/source-map-consumer").SourceMapConsumer;
exports.SourceNode = require("./lib/source-node").SourceNode;
@@ -0,0 +1 @@
{"version":3,"file":"tablet.js","sources":["../../../src/icons/tablet.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Tablet\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHg9IjQiIHk9IjIiIHJ4PSIyIiByeT0iMiIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMi4wMSIgeTE9IjE4IiB5Mj0iMTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/tablet\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 Tablet = createLucideIcon('Tablet', [\n ['rect', { width: '16', height: '20', x: '4', y: '2', rx: '2', ry: '2', key: '76otgf' }],\n ['line', { x1: '12', x2: '12.01', y1: '18', y2: '18', key: '1dp563' }],\n]);\n\nexport default Tablet;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,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,CAAA;AAAA,CACvF,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACvE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,165 @@
{
"name": "@modelcontextprotocol/sdk",
"version": "1.32.1",
"description": "Model Context Protocol implementation for TypeScript",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
"homepage": "https://modelcontextprotocol.io",
"bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/modelcontextprotocol/typescript-sdk.git"
},
"engines": {
"node": ">=18"
},
"keywords": [
"modelcontextprotocol",
"mcp"
],
"exports": {
".": {
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./client": {
"types": "./dist/esm/client/index.d.ts",
"import": "./dist/esm/client/index.js",
"require": "./dist/cjs/client/index.js"
},
"./server": {
"types": "./dist/esm/server/index.d.ts",
"import": "./dist/esm/server/index.js",
"require": "./dist/cjs/server/index.js"
},
"./validation": {
"types": "./dist/esm/validation/index.d.ts",
"import": "./dist/esm/validation/index.js",
"require": "./dist/cjs/validation/index.js"
},
"./validation/ajv": {
"types": "./dist/esm/validation/ajv-provider.d.ts",
"import": "./dist/esm/validation/ajv-provider.js",
"require": "./dist/cjs/validation/ajv-provider.js"
},
"./validation/cfworker": {
"types": "./dist/esm/validation/cfworker-provider.d.ts",
"import": "./dist/esm/validation/cfworker-provider.js",
"require": "./dist/cjs/validation/cfworker-provider.js"
},
"./experimental": {
"types": "./dist/esm/experimental/index.d.ts",
"import": "./dist/esm/experimental/index.js",
"require": "./dist/cjs/experimental/index.js"
},
"./experimental/tasks": {
"types": "./dist/esm/experimental/tasks/index.d.ts",
"import": "./dist/esm/experimental/tasks/index.js",
"require": "./dist/cjs/experimental/tasks/index.js"
},
"./*": {
"types": "./dist/esm/*.d.ts",
"import": "./dist/esm/*",
"require": "./dist/cjs/*"
}
},
"typesVersions": {
"*": {
"*": [
"./dist/esm/*"
]
}
},
"files": [
"dist"
],
"scripts": {
"fetch:spec-types": "tsx scripts/fetch-spec-types.ts",
"typecheck": "tsgo --noEmit",
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "mkdir -p dist/esm && echo '{\"type\": \"module\"}' > dist/esm/package.json && tsc -p tsconfig.prod.json",
"build:esm:w": "npm run build:esm -- -w",
"build:cjs": "mkdir -p dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json && tsc -p tsconfig.cjs.json",
"build:cjs:w": "npm run build:cjs -- -w",
"examples:simple-server:w": "tsx --watch src/examples/server/simpleStreamableHttp.ts --oauth",
"prepack": "npm run build:esm && npm run build:cjs",
"lint": "eslint src/ && prettier --check .",
"lint:fix": "eslint src/ --fix && prettier --write .",
"check": "npm run typecheck && npm run lint",
"test": "vitest run --exclude \"test/e2e/**\"",
"test:e2e": "vitest run test/e2e",
"test:watch": "vitest",
"start": "npm run server",
"server": "tsx watch --clear-screen=false scripts/cli.ts server",
"client": "tsx scripts/cli.ts client",
"test:conformance:server": "test/conformance/scripts/run-server-conformance.sh --expected-failures test/conformance/conformance-baseline.yml",
"test:conformance:server:all": "test/conformance/scripts/run-server-conformance.sh --suite all --expected-failures test/conformance/conformance-baseline.yml",
"test:conformance:server:run": "npx tsx test/conformance/src/everythingServer.ts",
"test:conformance:client": "npx @modelcontextprotocol/conformance client --command 'npx tsx test/conformance/src/everythingClient.ts' --expected-failures test/conformance/conformance-baseline.yml",
"test:conformance:client:all": "npx @modelcontextprotocol/conformance client --command 'npx tsx test/conformance/src/everythingClient.ts' --suite all --expected-failures test/conformance/conformance-baseline.yml"
},
"dependencies": {
"@hono/node-server": "^1.19.9 || ^2.0.5",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"content-type": "^1.0.5",
"cors": "^2.8.5",
"cross-spawn": "^7.0.5",
"eventsource": "^3.0.2",
"eventsource-parser": "^3.0.0",
"express": "^5.2.1",
"express-rate-limit": "^8.2.1",
"hono": "^4.11.4",
"jose": "^6.1.3",
"json-schema-typed": "^8.0.2",
"pkce-challenge": "^5.0.0",
"raw-body": "^3.0.0",
"zod": "^3.25 || ^4.0",
"zod-to-json-schema": "^3.25.1"
},
"peerDependencies": {
"@cfworker/json-schema": "^4.1.1",
"zod": "^3.25 || ^4.0"
},
"peerDependenciesMeta": {
"@cfworker/json-schema": {
"optional": true
},
"zod": {
"optional": false
}
},
"devDependencies": {
"@cfworker/json-schema": "^4.1.1",
"@eslint/js": "^9.39.1",
"@modelcontextprotocol/conformance": "^0.1.14",
"@types/content-type": "^1.1.8",
"@types/cors": "^2.8.17",
"@types/cross-spawn": "^6.0.6",
"@types/eventsource": "^1.1.15",
"@types/express": "^5.0.0",
"@types/express-serve-static-core": "^5.1.0",
"@types/node": "^22.12.0",
"@types/supertest": "^6.0.2",
"@types/ws": "^8.5.12",
"@typescript/native-preview": "^7.0.0-dev.20251103.1",
"eslint": "^9.8.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-n": "^17.23.1",
"prettier": "3.6.2",
"supertest": "^7.0.0",
"tsx": "^4.16.5",
"typescript": "^5.5.4",
"typescript-eslint": "^8.48.1",
"vitest": "^4.0.8",
"ws": "^8.18.0"
},
"resolutions": {
"strip-ansi": "6.0.1"
},
"overrides": {
"qs": "6.14.1"
}
}
@@ -0,0 +1,17 @@
import * as ts from 'typescript';
/**
* Gets all of the type flags in a type, iterating through unions automatically.
*/
export declare function getTypeFlags(type: ts.Type): ts.TypeFlags;
/**
* @param flagsToCheck The composition of one or more `ts.TypeFlags`.
* @param isReceiver Whether the type is a receiving type (e.g. the type of a
* called function's parameter).
* @remarks
* Note that if the type is a union, this function will decompose it into the
* parts and get the flags of every union constituent. If this is not desired,
* use the `isTypeFlag` function from tsutils.
*/
export declare function isTypeFlagSet(type: ts.Type, flagsToCheck: ts.TypeFlags,
/** @deprecated This params is not used and will be removed in the future.*/
isReceiver?: boolean): boolean;
@@ -0,0 +1 @@
{"version":3,"names":["_utils","require","defineType","defineAliasedType","visitor","aliases","fields","name","validate","assertNodeType","value","optional","builder","Object","assign","openingElement","closingElement","children","validateArrayOfType","selfClosing","assertValueType","expression","object","property","namespace","default","attributes","typeArguments","typeParameters","argument","openingFragment","closingFragment"],"sources":["../../src/definitions/jsx.ts"],"sourcesContent":["import {\n defineAliasedType,\n assertNodeType,\n assertValueType,\n validateArrayOfType,\n} from \"./utils.ts\";\n\nconst defineType = defineAliasedType(\"JSX\");\n\ndefineType(\"JSXAttribute\", {\n visitor: [\"name\", \"value\"],\n aliases: [\"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\"JSXIdentifier\", \"JSXNamespacedName\"),\n },\n value: {\n optional: true,\n validate: assertNodeType(\n \"JSXElement\",\n \"JSXFragment\",\n \"StringLiteral\",\n \"JSXExpressionContainer\",\n ),\n },\n },\n});\n\ndefineType(\"JSXClosingElement\", {\n visitor: [\"name\"],\n aliases: [\"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n },\n});\n\ndefineType(\"JSXElement\", {\n builder: process.env.BABEL_8_BREAKING\n ? [\"openingElement\", \"closingElement\", \"children\"]\n : [\"openingElement\", \"closingElement\", \"children\", \"selfClosing\"],\n visitor: [\"openingElement\", \"children\", \"closingElement\"],\n aliases: [\"Immutable\", \"Expression\"],\n fields: {\n openingElement: {\n validate: assertNodeType(\"JSXOpeningElement\"),\n },\n closingElement: {\n optional: true,\n validate: assertNodeType(\"JSXClosingElement\"),\n },\n children: validateArrayOfType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ...(process.env.BABEL_8_BREAKING\n ? {}\n : {\n selfClosing: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n }),\n },\n});\n\ndefineType(\"JSXEmptyExpression\", {});\n\ndefineType(\"JSXExpressionContainer\", {\n visitor: [\"expression\"],\n aliases: [\"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\", \"JSXEmptyExpression\"),\n },\n },\n});\n\ndefineType(\"JSXSpreadChild\", {\n visitor: [\"expression\"],\n aliases: [\"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXMemberExpression\", {\n visitor: [\"object\", \"property\"],\n fields: {\n object: {\n validate: assertNodeType(\"JSXMemberExpression\", \"JSXIdentifier\"),\n },\n property: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXNamespacedName\", {\n visitor: [\"namespace\", \"name\"],\n fields: {\n namespace: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n name: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXOpeningElement\", {\n builder: [\"name\", \"attributes\", \"selfClosing\"],\n visitor: process.env.BABEL_8_BREAKING\n ? [\"name\", \"typeArguments\", \"attributes\"]\n : [\"name\", \"typeParameters\", \"typeArguments\", \"attributes\"],\n aliases: [\"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n selfClosing: {\n default: false,\n },\n attributes: validateArrayOfType(\"JSXAttribute\", \"JSXSpreadAttribute\"),\n typeArguments: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n )\n : assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n ...(process.env.BABEL_8_BREAKING\n ? {}\n : {\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n }),\n },\n});\n\ndefineType(\"JSXSpreadAttribute\", {\n visitor: [\"argument\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXText\", {\n aliases: [\"Immutable\"],\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXFragment\", {\n builder: [\"openingFragment\", \"closingFragment\", \"children\"],\n visitor: [Line truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"132":"_E"},B:{"1":"_EG","132":"_I","388":"_rN _PJ"},C:{"1":"_wO","132":"_xD _0G"},D:{"1":"_EG _wC","132":"_9E","388":"_xP _mL _PJ"},E:{"1":"_1C","132":"_pD"},F:{"1":"_h","132":"_YI","388":"_5M _eG _HG _BD"},G:{"1":"_kB","132":"_yC"},H:{"132":"1D"},I:{"1":"I","132":"_G"},J:{"132":"_B"},K:{"132":"_D","388":"H"},L:{"1":"I"},M:{"1":"YC"},N:{"132":"_A"},O:{"388":"bC"},P:{"132":"J","388":"_U"},Q:{"388":"JE"},R:{"388":"KE"},S:{"132":"_C"}},B:4,C:"CSS text-indent",D:true};
@@ -0,0 +1,155 @@
import {TokenType as tt} from "../parser/tokenizer/types";
import Transformer from "./Transformer";
/**
* Transformer supporting the optional chaining and nullish coalescing operators.
*
* Tech plan here:
* https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan
*
* The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles
* the operators themselves.
*/
export default class OptionalChainingNullishTransformer extends Transformer {
constructor( tokens, nameManager) {
super();this.tokens = tokens;this.nameManager = nameManager;;
}
process() {
if (this.tokens.matches1(tt.nullishCoalescing)) {
const token = this.tokens.currentToken();
if (this.tokens.tokens[token.nullishStartIndex].isAsyncOperation) {
this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => (");
} else {
this.tokens.replaceTokenTrimmingLeftWhitespace(", () => (");
}
return true;
}
if (this.tokens.matches1(tt._delete)) {
const nextToken = this.tokens.tokenAtRelativeIndex(1);
if (nextToken.isOptionalChainStart) {
this.tokens.removeInitialToken();
return true;
}
}
const token = this.tokens.currentToken();
const chainStart = token.subscriptStartIndex;
if (
chainStart != null &&
this.tokens.tokens[chainStart].isOptionalChainStart &&
// Super subscripts can't be optional (since super is never null/undefined), and the syntax
// relies on the subscript being intact, so leave this token alone.
this.tokens.tokenAtRelativeIndex(-1).type !== tt._super
) {
const param = this.nameManager.claimFreeName("_");
let arrowStartSnippet;
if (
chainStart > 0 &&
this.tokens.matches1AtIndex(chainStart - 1, tt._delete) &&
this.isLastSubscriptInChain()
) {
// Delete operations are special: we already removed the delete keyword, and to still
// perform a delete, we need to insert a delete in the very last part of the chain, which
// in correct code will always be a property access.
arrowStartSnippet = `${param} => delete ${param}`;
} else {
arrowStartSnippet = `${param} => ${param}`;
}
if (this.tokens.tokens[chainStart].isAsyncOperation) {
arrowStartSnippet = `async ${arrowStartSnippet}`;
}
if (
this.tokens.matches2(tt.questionDot, tt.parenL) ||
this.tokens.matches2(tt.questionDot, tt.lessThan)
) {
if (this.justSkippedSuper()) {
this.tokens.appendCode(".bind(this)");
}
this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${arrowStartSnippet}`);
} else if (this.tokens.matches2(tt.questionDot, tt.bracketL)) {
this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}`);
} else if (this.tokens.matches1(tt.questionDot)) {
this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}.`);
} else if (this.tokens.matches1(tt.dot)) {
this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}.`);
} else if (this.tokens.matches1(tt.bracketL)) {
this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}[`);
} else if (this.tokens.matches1(tt.parenL)) {
if (this.justSkippedSuper()) {
this.tokens.appendCode(".bind(this)");
}
this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${arrowStartSnippet}(`);
} else {
throw new Error("Unexpected subscript operator in optional chain.");
}
return true;
}
return false;
}
/**
* Determine if the current token is the last of its chain, so that we know whether it's eligible
* to have a delete op inserted.
*
* We can do this by walking forward until we determine one way or another. Each
* isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in
* a nesting way, so we can track depth and walk to the end of the chain (the point where the
* depth goes negative) and see if any other subscript token is after us in the chain.
*/
isLastSubscriptInChain() {
let depth = 0;
for (let i = this.tokens.currentIndex() + 1; ; i++) {
if (i >= this.tokens.tokens.length) {
throw new Error("Reached the end of the code while finding the end of the access chain.");
}
if (this.tokens.tokens[i].isOptionalChainStart) {
depth++;
} else if (this.tokens.tokens[i].isOptionalChainEnd) {
depth--;
}
if (depth < 0) {
return true;
}
// This subscript token is a later one in the same chain.
if (depth === 0 && this.tokens.tokens[i].subscriptStartIndex != null) {
return false;
}
}
}
/**
* Determine if we are the open-paren in an expression like super.a()?.b.
*
* We can do this by walking backward to find the previous subscript. If that subscript was
* preceded by a super, then we must be the subscript after it, so if this is a call expression,
* we'll need to attach the right context.
*/
justSkippedSuper() {
let depth = 0;
let index = this.tokens.currentIndex() - 1;
while (true) {
if (index < 0) {
throw new Error(
"Reached the start of the code while finding the start of the access chain.",
);
}
if (this.tokens.tokens[index].isOptionalChainStart) {
depth--;
} else if (this.tokens.tokens[index].isOptionalChainEnd) {
depth++;
}
if (depth < 0) {
return false;
}
// This subscript token is a later one in the same chain.
if (depth === 0 && this.tokens.tokens[index].subscriptStartIndex != null) {
return this.tokens.tokens[index - 1].type === tt._super;
}
index--;
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"import.js","sources":["../../../src/icons/import.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Import\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM3YxMiIgLz4KICA8cGF0aCBkPSJtOCAxMSA0IDQgNC00IiAvPgogIDxwYXRoIGQ9Ik04IDVINGEyIDIgMCAwIDAtMiAydjEwYTIgMiAwIDAgMCAyIDJoMTZhMiAyIDAgMCAwIDItMlY3YTIgMiAwIDAgMC0yLTJoLTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/import\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 Import = createLucideIcon('Import', [\n ['path', { d: 'M12 3v12', key: '1x0j5s' }],\n ['path', { d: 'm8 11 4 4 4-4', key: '1dohi6' }],\n [\n 'path',\n {\n d: 'M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4',\n key: '1ywtjm',\n },\n ],\n]);\n\nexport default Import;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,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,CAAA;AAAA,CAAA,CACzC,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,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,726 @@
export default `flf2a$ 7 6 17 0 11 0 8256 0
Author : Bateau (lbm)
Date : 2005/2/4 10:36:48
Version: 1.01
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ #
$ #
$ #
$ #
$ #
$ #
$ ##
#
___ #
| | #
|___| #
|___| #
#
##
____ #
\\_\\_| #
#
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
_ #
|_| #
#
#
#
#
##
__ #
| _| #
| | #
| | #
| |_ #
|__| #
##
__ #
|_ | #
| | #
| | #
_| | #
|__| #
##
*#
#
#
#
#
#
##
#
_ #
| | #
| | #
|_| #
#
##
#
#
#
__ #
/_/ #
#
##
#
#
___ #
|___| #
#
#
##
#
#
#
_ #
|_| #
#
##
_ #
/ | #
/ / #
|_/ #
#
#
##
#
_____ #
/ | #
| / | #
|_____/ #
#
##
#
_____ #
|_ | #
| | #
|____| #
#
##
#
______ #
|____ | #
| --| #
|______| #
#
##
#
______ #
|___ | #
|___ | #
|______| #
#
##
#
__ _ #
| | | | #
| |_| | #
'----__| #
#
##
#
______ #
| ____| #
|___ \\ #
|______/ #
#
##
#
____ #
/ /_ #
| _ | #
|______| #
#
##
#
______ #
|___ | #
/ / #
|___| #
#
##
#
_____ #
< - > #
/ _ \\ #
\\_____/ #
#
##
#
______ #
| _ | #
|____ | #
|__| #
#
##
#
_ #
|_| #
_ #
|_| #
#
##
#
_ #
|_| #
__ #
/_/ #
#
##
#
__ #
/ / #
\\ \\ #
\\_\\ #
#
##
#
___ #
|___| #
___ #
|___| #
#
##
#
__ #
\\ \\ #
\\ \\ #
/_/ #
#
##
?#
#
#
#
#
#
##
@#
#
#
#
#
#
##
_____ #
__|_ |__ #
| \\ | #
| \\ | #
|__|\\__\\ __| #
|_____| #
##
_____ #
__|___ |__ #
| > | #
| < | #
|______> __| #
|_____| #
##
_____ #
__|___ |__ #
| ___| | #
| |__ | #
|______| __| #
|_____| #
##
_____ #
__|__ |__ #
| \\ | #
| \\ | #
|______/ __| #
|_____| #
##
_____ #
__|___ |__ #
| ___| | #
| ___| | #
|______| __| #
|_____| #
##
_____ #
__|___ |__ #
| ___| | #
| ___| | #
|___| __| #
|_____| #
##
_____ #
__|___ |__ #
| ___| | #
| | | | #
|______| __| #
|_____| #
##
_____ #
__| _ |__ #
| |_| | | #
| _ | | #
|__| |_| __| #
|_____| #
##
_____ #
__|_ |__ #
| | | #
| | | #
|____| __| #
|_____| #
##
_____ #
__|_ |__ #
| | |#
_| | |#
|______| __|#
|_____| #
##
_____ #
__| __ |__ #
| |/ / | #
| \\ | #
|__|\\__\\ __| #
|_____| #
##
_____ #
__|_ |__ #
| | | #
| |_ | #
|______| __| #
|_____| #
##
_____ #
___| _|__ #
| \\ / | | #
| \\/ | | #
|__/\\__/|__|_| #
|_____| #
##
_____ #
___| _ |__ #
| \\ | | | #
| \\| | | #
|__/\\____| __| #
|_____| #
##
_____ #
__|__ |__ #
/ \\ | #
| | | #
\\_____/ __| #
|_____| #
##
_____ #
__|__ |__ #
| | | #
| _| | #
|___| __| #
|_____| #
##
_____ #
__|__ |__ #
/ \\ | #
| | | #
\\___/\\_\\ __| #
|_____| #
##
_____ #
__|__ |__ #
| | | #
| \\ | #
|__|\\__\\ __| #
|_____| #
##
_____ #
__|___ |__ #
| ___| | #
\`-.\`-. | #
|______| __| #
|_____| #
##
_____ #
___|__ |__ #
|_ _| | #
| | | #
|____| __| #
|_____| #
##
_____ #
__| _ |__ #
| | | | | #
| |_| | | #
|______| __| #
|_____| #
##
_____ #
__| _ |__ #
\\ \\ // | #
|\\ \\// | #
|_\\__/ __| #
|_____| #
##
_____ #
___|__ _|__ #
| \\/ \\| | | #
| /\\ | | #
|____/ \\__|_| #
|_____| #
##
_____ #
__|__ |__ #
\\ \` / | #
/ \\ | #
/__/\\_\\ __| #
|_____| #
##
_____ #
___| _ |__ #
\\ \\ // | #
|\\ \\// | #
|/__/ __| #
|_____| #
##
_____ #
__|___ |__ #
|___ | | #
.-\`.-\` | #
|______| __| #
|_____| #
##
__ #
| _| #
| | #
| | #
| | #
|__| #
##
_ #
| \\ #
\\ \\ #
\\_\\ #
#
#
##
__ #
|_ | #
| | #
| | #
| | #
|__| #
##
^#
#
#
#
#
#
##
#
#
#
#
___ #
|___| #
##
__ #
\\_| #
#
#
#
#
##
#
____ #
| \\ #
| \\ #
|__|\\__\\ #
#
##
#
______ #
| > #
| < #
|______> #
#
##
#
______ #
| ___| #
| |__ #
|______| #
#
##
#
_____ #
| \\ #
| \\ #
|______/ #
#
##
#
______ #
| ___| #
| ___| #
|______| #
#
##
#
______ #
| ___| #
| ___| #
|___| #
#
##
#
______ #
| ___| #
| | | #
|______| #
#
##
#
__ _ #
| |_| | #
| _ | #
|__| |_| #
#
##
#
____ #
| | #
| | #
|____| #
#
##
#
____ #
| | #
_| | #
|______| #
#
##
#
__ __ #
| |/ / #
| \\ #
|__|\\__\\ #
#
##
#
____ #
| | #
| |_ #
|______| #
#
##
#
____ __ #
| \\ / | #
| \\/ | #
|__/\\__/|__| #
#
##
#
____ _ #
| \\ | | #
| \\| | #
|__/\\____| #
#
##
#
_____ #
/ \\ #
| | #
\\_____/ #
#
##
#
_____ #
| | #
| _| #
|___| #
#
##
#
_____ #
/ \\ #
| | #
\\___/\\_\\ #
#
##
#
_____ #
| | #
| \\ #
|__|\\__\\ #
#
##
#
______ #
| ___| #
\`-.\`-. #
|______| #
#
##
#
__ #
_| |_ #
|_ _| #
|__| #
#
##
#
__ _ #
| | | | #
| |_| | #
|______| #
#
##
#
__ _ #
\\ \\ // #
\\ \\// #
\\__/ #
#
##
#
__ __ __ #
| \\/ \\| | #
| /\\ | #
|____/ \\__| #
#
##
#
__ __ #
\\ \` / #
/ \\ #
/__/\\_\\ #
#
##
#
__ _ #
\\ \\ // #
\\ \\// #
/__/ #
#
##
#
______ #
|___ | #
.-\`.-\` #
|______| #
#
##
__ #
| _| #
| | #
< < #
| | #
|__| #
##
_ #
| | #
| | #
| | #
| | #
|_| #
##
__ #
|_ | #
| | #
> > #
| | #
|__| #
##
~#
#
#
#
#
#
##
_____ #
__|_ |__ #
| \\ | #
| \\ | #
|__|\\__\\ __| #
|_____| #
##
_____ #
__|__ |__ #
/ \\ | #
| | | #
\\_____/ __| #
|_____| #
##
_____ #
__| _ |__ #
| | | | | #
| |_| | | #
|______| __| #
|_____| #
##
#
____ #
| \\ #
| \\ #
|__|\\__\\ #
#
##
#
_____ #
/ \\ #
| | #
\\_____/ #
#
##
#
__ _ #
| | | | #
| |_| | #
|______| #
#
##
�#
#
#
#
#
#
##`
@@ -0,0 +1,2 @@
export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/motion/elements.mjs';
//# sourceMappingURL=client.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"inspect.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,21 @@
#!/usr/bin/env node
/**
* Example demonstrating client_credentials grant for machine-to-machine authentication.
*
* Supports two authentication methods based on environment variables:
*
* 1. client_secret_basic (default):
* MCP_CLIENT_ID - OAuth client ID (required)
* MCP_CLIENT_SECRET - OAuth client secret (required)
*
* 2. private_key_jwt (when MCP_CLIENT_PRIVATE_KEY_PEM is set):
* MCP_CLIENT_ID - OAuth client ID (required)
* MCP_CLIENT_PRIVATE_KEY_PEM - PEM-encoded private key for JWT signing (required)
* MCP_CLIENT_ALGORITHM - Signing algorithm (default: RS256)
*
* Common:
* MCP_SERVER_URL - Server URL (default: http://localhost:3000/mcp)
* MCP_EXPECTED_ISSUER - Issuer URL of the authorization server the credentials were registered with (required)
*/
export {};
//# sourceMappingURL=simpleClientCredentials.d.ts.map
@@ -0,0 +1,151 @@
export { ObjectSchema } from "@eslint/object-schema";
export type PropertyDefinition = $eslintobjectschema.PropertyDefinition;
export type ObjectDefinition = $eslintobjectschema.ObjectDefinition;
export type ConfigObject = $typests.ConfigObject;
export type FileMatcher = $typests.FileMatcher;
export type FilesMatcher = $typests.FilesMatcher;
export type ExtraConfigType = $typests.ExtraConfigType;
export type MinimatchOptions = $minimatch.MinimatchOptions;
export type ObjectSchemaInstance = ObjectSchema;
/**
* Represents an array of config objects and provides method for working with
* those config objects.
*/
export class ConfigArray extends Array<any> {
/**
* Creates a new instance of ConfigArray.
* @param {Iterable|Function|Object} configs An iterable yielding config
* objects, or a config function, or a config object.
* @param {Object} options The options for the ConfigArray.
* @param {string} [options.basePath="/"] The absolute path of the config file directory.
* Defaults to `"/"`.
* @param {boolean} [options.normalized=false] Flag indicating if the
* configs have already been normalized.
* @param {ObjectDefinition} [options.schema] The additional schema
* definitions to use for the ConfigArray schema.
* @param {ReadonlyArray<ExtraConfigType>} [options.extraConfigTypes] List of config types supported.
* @throws {TypeError} When the `basePath` is not a non-empty string,
*/
constructor(configs: Iterable<any> | Function | any, { basePath, normalized, schema: customSchema, extraConfigTypes, }?: {
basePath?: string;
normalized?: boolean;
schema?: ObjectDefinition;
extraConfigTypes?: ReadonlyArray<ExtraConfigType>;
});
/**
* The path of the config file that this array was loaded from.
* This is used to calculate filename matches.
* @property basePath
* @type {string}
*/
basePath: string;
/**
* The supported config types.
* @type {ReadonlyArray<ExtraConfigType>}
*/
extraConfigTypes: ReadonlyArray<ExtraConfigType>;
/**
* Returns the `files` globs from every config object in the array.
* This can be used to determine which files will be matched by a
* config array or to use as a glob pattern when no patterns are provided
* for a command line interface.
* @returns {Array<FilesMatcher>} An array of matchers.
*/
get files(): Array<FilesMatcher>;
/**
* Returns ignore matchers that should always be ignored regardless of
* the matching `files` fields in any configs. This is necessary to mimic
* the behavior of things like .gitignore and .eslintignore, allowing a
* globbing operation to be faster.
* @returns {Array<{ basePath?: string, name?: string, ignores: FileMatcher[] }>} An array of config objects representing global ignores.
*/
get ignores(): Array<{
basePath?: string;
name?: string;
ignores: FileMatcher[];
}>;
/**
* Indicates if the config array has been normalized.
* @returns {boolean} True if the config array is normalized, false if not.
*/
isNormalized(): boolean;
/**
* Normalizes a config array by flattening embedded arrays and executing
* config functions.
* @param {Object} [context] The context object for config functions.
* @returns {Promise<ConfigArray>} The current ConfigArray instance.
*/
normalize(context?: any): Promise<ConfigArray>;
/**
* Normalizes a config array by flattening embedded arrays and executing
* config functions.
* @param {Object} [context] The context object for config functions.
* @returns {ConfigArray} The current ConfigArray instance.
*/
normalizeSync(context?: any): ConfigArray;
/**
* Returns the config object for a given file path and a status that can be used to determine why a file has no config.
* @param {string} filePath The path of a file to get a config for.
* @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
* An object with an optional property `config` and property `status`.
* `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
* `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
*/
getConfigWithStatus(filePath: string): {
config?: any;
status: "ignored" | "external" | "unconfigured" | "matched";
};
/**
* Returns the config object for a given file path.
* @param {string} filePath The path of a file to get a config for.
* @returns {Object|undefined} The config object for this file or `undefined`.
*/
getConfig(filePath: string): any | undefined;
/**
* Determines whether a file has a config or why it doesn't.
* @param {string} filePath The path of the file to check.
* @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
* * `"ignored"`: the file is ignored
* * `"external"`: the file is outside the base path
* * `"unconfigured"`: the file is not matched by any config
* * `"matched"`: the file has a matching config
*/
getConfigStatus(filePath: string): "ignored" | "external" | "unconfigured" | "matched";
/**
* Determines if the given filepath is ignored based on the configs.
* @param {string} filePath The path of a file to check.
* @returns {boolean} True if the path is ignored, false if not.
* @deprecated Use `isFileIgnored` instead.
*/
isIgnored(filePath: string): boolean;
/**
* Determines if the given filepath is ignored based on the configs.
* @param {string} filePath The path of a file to check.
* @returns {boolean} True if the path is ignored, false if not.
*/
isFileIgnored(filePath: string): boolean;
/**
* Determines if the given directory is ignored based on the configs.
* This checks only default `ignores` that don't have `files` in the
* same config. A pattern such as `/foo` be considered to ignore the directory
* while a pattern such as `/foo/**` is not considered to ignore the
* directory because it is matching files.
* @param {string} directoryPath The path of a directory to check.
* @returns {boolean} True if the directory is ignored, false if not. Will
* return true for any directory that is not inside of `basePath`.
* @throws {Error} When the `ConfigArray` is not normalized.
*/
isDirectoryIgnored(directoryPath: string): boolean;
#private;
}
export namespace ConfigArraySymbol {
let isNormalized: symbol;
let configCache: symbol;
let schema: symbol;
let finalizeConfig: symbol;
let preprocessConfig: symbol;
}
import type * as $eslintobjectschema from "@eslint/object-schema";
import type * as $typests from "./types.ts";
import type * as $minimatch from "minimatch";
import { ObjectSchema } from '@eslint/object-schema';
@@ -0,0 +1,33 @@
import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.mts';
export type MemoState = {
lastKey: number;
lastNeedle: number;
lastIndex: number;
};
export declare let found: boolean;
/**
* A binary search implementation that returns the index if a match is found.
* If no match is found, then the left-index (the index associated with the item that comes just
* before the desired index) is returned. To maintain proper sort order, a splice would happen at
* the next index:
*
* ```js
* const array = [1, 3];
* const needle = 2;
* const index = binarySearch(array, needle, (item, needle) => item - needle);
*
* assert.equal(index, 0);
* array.splice(index + 1, 0, needle);
* assert.deepEqual(array, [1, 2, 3]);
* ```
*/
export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number;
export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number;
export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number;
export declare function memoizedState(): MemoState;
/**
* This overly complicated beast is just to record the last tested line/column and the resulting
* index, allowing us to skip a few tests if mappings are monotonically increasing.
*/
export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number;
//# sourceMappingURL=binary-search.d.ts.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 Shrink = createLucideIcon("Shrink", [
["path", { d: "m15 15 6 6m-6-6v4.8m0-4.8h4.8", key: "17vawe" }],
["path", { d: "M9 19.8V15m0 0H4.2M9 15l-6 6", key: "chjx8e" }],
["path", { d: "M15 4.2V9m0 0h4.8M15 9l6-6", key: "lav6yq" }],
["path", { d: "M9 4.2V9m0 0H4.2M9 9 3 3", key: "1pxi2q" }]
]);
export { Shrink as default };
//# sourceMappingURL=shrink.js.map
@@ -0,0 +1,77 @@
import { g as normalizeWindowsPath, j as join } from './shared/pathe.M-eThtNZ.mjs';
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
const SLASH_RE = /[/\\]/;
function normalizeAliases(_aliases) {
if (_aliases[normalizedAliasSymbol]) {
return _aliases;
}
const aliases = Object.fromEntries(
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
);
for (const key in aliases) {
for (const alias in aliases) {
if (alias === key || key.startsWith(alias)) {
continue;
}
if (aliases[key]?.startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
}
}
}
Object.defineProperty(aliases, normalizedAliasSymbol, {
value: true,
enumerable: false
});
return aliases;
}
function resolveAlias(path, aliases) {
const _path = normalizeWindowsPath(path);
aliases = normalizeAliases(aliases);
for (const [alias, to] of Object.entries(aliases)) {
if (!_path.startsWith(alias)) {
continue;
}
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
if (hasTrailingSlash(_path[_alias.length])) {
return join(to, _path.slice(alias.length));
}
}
return _path;
}
function reverseResolveAlias(path, aliases) {
const _path = normalizeWindowsPath(path);
aliases = normalizeAliases(aliases);
const matches = [];
for (const [to, alias] of Object.entries(aliases)) {
if (!_path.startsWith(alias)) {
continue;
}
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
if (hasTrailingSlash(_path[_alias.length])) {
matches.push(join(to, _path.slice(alias.length)));
}
}
return matches.sort((a, b) => b.length - a.length);
}
function filename(path) {
const base = path.split(SLASH_RE).pop();
if (!base) {
return void 0;
}
const separatorIndex = base.lastIndexOf(".");
if (separatorIndex <= 0) {
return base;
}
return base.slice(0, separatorIndex);
}
function _compareAliases(a, b) {
return b.split("/").length - a.split("/").length;
}
function hasTrailingSlash(path = "/") {
const lastChar = path[path.length - 1];
return lastChar === "/" || lastChar === "\\";
}
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
@@ -0,0 +1 @@
{"version":3,"file":"merge.js","sources":["../../../src/icons/merge.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Merge\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOCA2IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTEyIDJ2MTAuM2E0IDQgMCAwIDEtMS4xNzIgMi44NzJMNCAyMiIgLz4KICA8cGF0aCBkPSJtMjAgMjItNS01IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/merge\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 Merge = createLucideIcon('Merge', [\n ['path', { d: 'm8 6 4-4 4 4', key: 'ybng9g' }],\n ['path', { d: 'M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22', key: '1hyw0i' }],\n ['path', { d: 'm20 22-5-5', key: '1m27yz' }],\n]);\n\nexport default Merge;\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,CAAgB,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,CAC7C,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,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,9 @@
import type { Format } from "ajv";
export type FormatMode = "fast" | "full";
export type FormatName = "date" | "time" | "date-time" | "iso-time" | "iso-date-time" | "duration" | "uri" | "uri-reference" | "uri-template" | "url" | "email" | "hostname" | "ipv4" | "ipv6" | "regex" | "uuid" | "json-pointer" | "json-pointer-uri-fragment" | "relative-json-pointer" | "byte" | "int32" | "int64" | "float" | "double" | "password" | "binary";
export type DefinedFormats = {
[key in FormatName]: Format;
};
export declare const fullFormats: DefinedFormats;
export declare const fastFormats: DefinedFormats;
export declare const formatNames: FormatName[];
@@ -0,0 +1,24 @@
//#region src/adapter/cloudflare-pages/conninfo.ts
/**
* Get connection information from Cloudflare Pages
* @param c - Context
* @returns Connection information including remote address
* @example
* ```ts
* import { Hono } from 'hono'
* import { handle, getConnInfo } from 'hono/cloudflare-pages'
*
* const app = new Hono()
*
* app.get('/', (c) => {
* const info = getConnInfo(c)
* return c.text(`Your IP: ${info.remote.address}`)
* })
*
* export const onRequest = handle(app)
* ```
* @deprecated `hono/cloudflare-pages` will be removed in v5. Cloudflare recommends Workers with static assets; use `hono` on Workers instead.
*/
const getConnInfo = (c) => ({ remote: { address: c.req.header("cf-connecting-ip") } });
//#endregion
export { getConnInfo };
@@ -0,0 +1,6 @@
//#region src/link.ts
const preloadWarning = "Error preloading route! ☝️";
//#endregion
exports.preloadWarning = preloadWarning;
//# sourceMappingURL=link.cjs.map
@@ -0,0 +1,103 @@
'use strict';
module.exports = function generate_if(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $errs = 'errs__' + $lvl;
var $it = it.util.copy(it);
$it.level++;
var $nextValid = 'valid' + $it.level;
var $thenSch = it.schema['then'],
$elseSch = it.schema['else'],
$thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),
$elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),
$currentBaseId = $it.baseId;
if ($thenPresent || $elsePresent) {
var $ifClause;
$it.createErrors = false;
$it.schema = $schema;
$it.schemaPath = $schemaPath;
$it.errSchemaPath = $errSchemaPath;
out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; ';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
$it.createErrors = true;
out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
it.compositeRule = $it.compositeRule = $wasComposite;
if ($thenPresent) {
out += ' if (' + ($nextValid) + ') { ';
$it.schema = it.schema['then'];
$it.schemaPath = it.schemaPath + '.then';
$it.errSchemaPath = it.errSchemaPath + '/then';
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
if ($thenPresent && $elsePresent) {
$ifClause = 'ifClause' + $lvl;
out += ' var ' + ($ifClause) + ' = \'then\'; ';
} else {
$ifClause = '\'then\'';
}
out += ' } ';
if ($elsePresent) {
out += ' else { ';
}
} else {
out += ' if (!' + ($nextValid) + ') { ';
}
if ($elsePresent) {
$it.schema = it.schema['else'];
$it.schemaPath = it.schemaPath + '.else';
$it.errSchemaPath = it.errSchemaPath + '/else';
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
if ($thenPresent && $elsePresent) {
$ifClause = 'ifClause' + $lvl;
out += ' var ' + ($ifClause) + ' = \'else\'; ';
} else {
$ifClause = '\'else\'';
}
out += ' } ';
}
out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError(vErrors); ';
} else {
out += ' validate.errors = vErrors; return false; ';
}
}
out += ' } ';
if ($breakOnError) {
out += ' else { ';
}
} else {
if ($breakOnError) {
out += ' if (true) { ';
}
}
return out;
}
@@ -0,0 +1 @@
{"version":3,"file":"bell-plus.js","sources":["../../../src/icons/bell-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BellPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAuMjY4IDIxYTIgMiAwIDAgMCAzLjQ2NCAwIiAvPgogIDxwYXRoIGQ9Ik0xNSA4aDYiIC8+CiAgPHBhdGggZD0iTTE4IDV2NiIgLz4KICA8cGF0aCBkPSJNMjAuMDAyIDE0LjQ2NGE5IDkgMCAwIDAgLjczOC44NjNBMSAxIDAgMCAxIDIwIDE3SDRhMSAxIDAgMCAxLS43NC0xLjY3M0M0LjU5IDEzLjk1NiA2IDEyLjQ5OSA2IDhhNiA2IDAgMCAxIDguNzUtNS4zMzIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/bell-plus\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 BellPlus = createLucideIcon('BellPlus', [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0', key: 'vwvbt9' }],\n ['path', { d: 'M15 8h6', key: '8ybuxh' }],\n ['path', { d: 'M18 5v6', key: 'g5ayrv' }],\n [\n 'path',\n {\n d: 'M20.002 14.464a9 9 0 0 0 .738.863A1 1 0 0 1 20 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 8.75-5.332',\n key: '1abcvy',\n },\n ],\n]);\n\nexport default BellPlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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;;"}